iland

package module
v0.0.0-...-327506a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 30, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

README

iland-sdk

iland cloud golang SDK

Introduction

This library provides a pure Golang interface for the iland cloud API https://api.ilandcloud.com/

Getting the code

The code is hosted at https://github.com/ilanddev/go-sdk

Check out the latest development version anonymously with:

$ git clone https://github.com/ilanddev/go-sdk.git
$ cd go-sdk

Installation

$ go get github.com/ilanddev/go-sdk

Documentation

Index

Constants

View Source
const (
	IPTranslation  = "ipTranslation"
	PortForwarding = "portForwarding"

	Success       = "success"
	Running       = "running"
	Error         = "error"
	Queued        = "queued"
	Cancelled     = "cancelled"
	WaitingOnUser = "waiting-on-user-input"
	Unknown       = "unknown"
)

Variables

View Source
var LocationIDs = []string{
	"ams01.ilandcloud.com",
	"ams04.ilandcloud.com",
	"dal02.ilandcloud.com",
	"dal06.ilandcloud.com",
	"dal22.ilandcloud.com",
	"dal23.ilandcloud.com",
	"dal25.ilandcloud.com",
	"lax01.ilandcloud.com",
	"lon02.ilandcloud.com",
	"man01.ilandcloud.com",
	"mel02.ilandcloud.com",
	"res01.ilandcloud.com",
	"sin01.ilandcloud.com",
	"str02.ilandcloud.com",
	"str03.ilandcloud.com",
	"str05.ilandcloud.com",
	"syd02.ilandcloud.com",
}

Functions

This section is empty.

Types

type APIError

type APIError struct {
	Error         string `json:"error"`
	Message       string `json:"message"`
	DetailMessage string `json:"detail_message"`
}

type AddTemplateVirtualMachineParams

type AddTemplateVirtualMachineParams struct {
	Name                     string `json:"name"`
	Description              string `json:"description"`
	NetworkID                string `json:"network_uuid,omitempty"`
	VAppTemplateID           string `json:"vapp_template_uuid"`
	TemplateVirtualMachineID string `json:"vm_template_uuid"`
	IPAddress                string `json:"ip_address,omitempty"`
	StorageProfileID         string `json:"storage_profile_uuid,omitempty"`
	IPAddressingMode         string `json:"ip_address_mode,omitempty"`
}

type Billing

type Billing struct {
	EntityID          string              `json:"entity_uuid"`
	EntityName        string              `json:"entity_name"`
	EntityType        string              `json:"entity_type"`
	CurrencyCode      string              `json:"currency_code"`
	TotalCost         float64             `json:"total_cost"`
	TotalCostEstimate float64             `json:"total_cost_estimage"`
	Year              int                 `json:"year"`
	Month             int                 `json:"month"`
	TestDrive         bool                `json:"test_drive"`
	LineItems         []BillingLineItem   `json:"line_items"`
	CPU               BillingResource     `json:"cpu"`
	Memory            BillingResource     `json:"memory"`
	Bandwidth         BillingResource     `json:"bandwidth"`
	Disk              BillingDiskResource `json:"disk"`
}

type BillingDiskResource

type BillingDiskResource struct {
	Total   BillingResource `json:"total"`
	HDD     BillingResource `json:"hdd"`
	SSD     BillingResource `json:"ssd"`
	Archive BillingResource `json:"archive"`
}

type BillingLineItem

type BillingLineItem struct {
	Name      string  `json:"name"`
	Price     float64 `json:"price"`
	Quantity  float64 `json:"quantity"`
	ProductID string  `json:"product_id"`
}

type BillingResource

type BillingResource struct {
	Total    BillingResourceUsage `json:"total"`
	Reserved BillingResourceUsage `json:"reserved"`
	Burst    BillingResourceUsage `json:"burst"`
}

type BillingResourceUsage

type BillingResourceUsage struct {
	Cost  float64 `json:"cost"`
	Usage float64 `json:"usage"`
}

type BootOptions

type BootOptions struct {
	BootDelay int  `json:"boot_delay"`
	EnterBios bool `json:"is_enter_bios"`
}

type BuildNicParams

type BuildNicParams struct {
	IPAssignment string `json:"ip_assignment,omitempty"`
	IPAddress    string `json:"ip_address,omitempty"`
	Primary      bool   `json:"primary_vnic"`
	Type         string `json:"network_adapter_type,omitempty"`
	NetworkID    string `json:"network_uuid,omitempty"`
}

type BuildVAppParams

type BuildVAppParams struct {
	Name            string                      `json:"name"`
	Description     string                      `json:"description"`
	VirtualMachines []BuildVirtualMachineParams `json:"vms"`
}

type BuildVirtualMachineParams

type BuildVirtualMachineParams struct {
	Name                     string           `json:"name"`
	Description              string           `json:"description"`
	ComputerName             string           `json:"computer_name"`
	VAppTemplateID           string           `json:"vapp_template_uuid"`
	VirtualMachineTemplateID string           `json:"vm_template_uuid"`
	StorageProfileID         string           `json:"storage_profile_uuid"`
	CPUCount                 int              `json:"number_of_cpus,omitempty"`
	CPUCoresPerSocket        int              `json:"cpu_cores_per_socket,omitempty"`
	EnableCPUVirtualization  bool             `json:"expose_cpu_virtualization"`
	MemoryMB                 int              `json:"ram,omitempty"`
	HardwareVersion          int              `json:"hardware_version,omitempty"`
	BootDelay                int              `json:"boot_delay,omitempty"`
	Disks                    []Disk           `json:"disks"`
	Nics                     []BuildNicParams `json:"nics"`
}

type Catalog

type Catalog struct {
	ID          string `json:"uuid"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Version     int    `json:"version"`
	IsPublic    bool   `json:"catalog_public"`
	Shared      bool   `json:"shared"`
	Subscribed  bool   `json:"subscribed"`
	OrgID       string `json:"org_uuid"`
	CompanyID   string `json:"company_id"`
	LocationID  string `json:"location_id"`
	CreatedDate int    `json:"created_date"`
	UpdatedDate int    `json:"updated_date"`
}

type CatalogService

type CatalogService interface {
	Get(catalogID string) (Catalog, error)
	Update(catalogID string, params UpdateCatalogParams) (Task, error)
	GetVAppTemplates(catalogID string) ([]VAppTemplate, error)
	GetMedia(catalogID string) ([]Media, error)
	CreateVAppTemplate(catalogID string, params CreateVAppTemplateParams) (Task, error)
	SyncSubscription(catalogID string) (Task, error)
}

type Company

type Company struct {
	ID      string `json:"company_id"`
	Name    string `json:"name"`
	HasIAAS bool   `json:"has_iaas"`
	HasVCC  bool   `json:"has_vcc"`
	Domain  Domain `json:"domain"`
}

type CompanyService

type CompanyService interface {
	Get(companyID string) (Company, error)
	GetUsers(companyID string) ([]User, error)
	CreateUser(companyID string, params CreateUserParams) (User, error)
	GetRoles(companyID string) ([]Role, error)
	GetRole(companyID, roleID string) (Role, error)
	GetOrgs(companyID string) ([]Org, error)
	GetLocationOrgs(companyID, locationID string) ([]Org, error)
	GetVCCBackupTenants(companyID string) ([]VCCBackupTenant, error)
}

type ConsoleService

type ConsoleService interface {
	Get(endpoint string) (io.ReadCloser, error)
	Post(endpoint string, body []byte) (io.ReadCloser, error)
	Put(endpoint string, body []byte) (io.ReadCloser, error)
	Delete(endpoint string) (io.ReadCloser, error)

	GetOperatingSystems() ([]OperatingSystem, error)
	GetLocations() []Location
	GetCompanies() ([]Company, error)
	GetOrgs() ([]Org, error)
	StreamEvents(companyID string) (chan Event, error)

	Location() LocationService
	Company() CompanyService
	User() UserService
	Org() OrgService
	Catalog() CatalogService
	VAppTemplate() VAppTemplateService
	Vdc() VdcService
	Edge() EdgeService
	OrgVdcNetwork() OrgVdcNetworkService
	VApp() VAppService
	VAppNetwork() VAppNetworkService
	VirtualMachine() VirtualMachineService
	VCCBackupTenant() VCCBackupTenantService
	Vpg() VpgService
	Task() TaskService
}

func NewClient

func NewClient(Username, Password, clientID, clientSecret string) (ConsoleService, error)

type ConsoleSession

type ConsoleSession struct {
	VMX    string `json:"vmx"`
	Ticket string `json:"ticket"`
	Host   string `json:"host"`
	Port   string `json:"port"`
}

type CopyVAppParams

type CopyVAppParams struct {
	Name  string `json:"name"`
	VdcID string `json:"vdc_uuid"`
}

type CopyVirtualMachineParams

type CopyVirtualMachineParams struct {
	Name   string `json:"name"`
	VAppID string `json:"vapp_uuid"`
}

type CreateUserParams

type CreateUserParams struct {
	Username string `json:"username"`
	FullName string `json:"full_name"`
	Email    string `json:"email"`
	DomainID string `json:"domain"`
	Password string `json:"password"`
}

type CreateVAppNetworkParams

type CreateVAppNetworkParams struct {
	Name            string    `json:"name"`
	Description     string    `json:"description,omitempty"`
	ParentNetworkID string    `json:"parent_network_uuid,omitempty"`
	Gateway         string    `json:"gateway_address"`
	Netmask         string    `json:"network_mask"`
	IPRanges        []IPRange `json:"ip_ranges"`
	PrimaryDNS      string    `json:"primary_dns,omitempty"`
	SecondaryDNS    string    `json:"secondary_dns,omitempty"`
	DNSSuffix       string    `json:"dns_suffix,omitempty"`
}

type CreateVAppTemplateParams

type CreateVAppTemplateParams struct {
	VAppID      string `json:"vapp_uuid"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

type DHCP

type DHCP struct {
	Enabled          bool    `json:"enabled"`
	IPRange          IPRange `json:"ip_range"`
	DefaultLeaseTime int     `json:"default_lease_time"`
	MaxLeaseTime     int     `json:"max_lease_time"`
}

type DeployVAppTemplateParams

type DeployVAppTemplateParams struct {
	Name             string                                   `json:"name"`
	Description      string                                   `json:"description"`
	VAppTemplateID   string                                   `json:"vapp_template_uuid"`
	PreserveNetworks bool                                     `json:"preserve_networks"`
	VirtualMachines  []DeployVAppTemplateVirtualMachineParams `json:"vms"`
}

type DeployVAppTemplateVirtualMachineParams

type DeployVAppTemplateVirtualMachineParams struct {
	Name                     string                  `json:"name"`
	Description              string                  `json:"description,omitempty"`
	VirtualMachineTemplateID string                  `json:"vm_template_uuid"`
	StorageProfileID         string                  `json:"storage_profile_uuid,omitempty"`
	Nics                     []VAppTemplateNicParams `json:"vnics"`
}

type Disk

type Disk struct {
	Name             string `json:"name,omitempty"`
	SizeMB           int    `json:"size"`
	Type             string `json:"type,omitempty"`
	StorageProfileID string `json:"storage_profile_uuid,omitempty"`
}

type DiskParams

type DiskParams struct {
	Name             string `json:"name,omitempty"`
	Type             string `json:"type"`
	SizeMB           int    `json:"size"`
	StorageProfileID string `json:"storage_profile_uuid"`
}

type DiskTemplateConfig

type DiskTemplateConfig struct {
	Name      string `json:"name"`
	SizeBytes int    `json:"size_in_bytes"`
	Type      string `json:"disk_type"`
}

type Domain

type Domain struct {
	ID   string `json:"domain_id"`
	Name string `json:"domain_name"`
	Type string `json:"domain_type"`
}

type Edge

type Edge struct {
	ID                        string          `json:"uuid"`
	Name                      string          `json:"name"`
	Description               string          `json:"description"`
	Status                    int             `json:"status"`
	Interfaces                []EdgeInterface `json:"interfaces"`
	Size                      string          `json:"gateway_backing_config"`
	HighAvailabilityEnabled   bool            `json:"high_availability_enabled"`
	DefaultDNSRelay           bool            `json:"default_dns_relay_route"`
	BackwardCompatibilityMode bool            `json:"backward_compatibility_mode"`
	VdcID                     string          `json:"vdc_uuid"`
	OrgID                     string          `json:"org_uuid"`
	CompanyID                 string          `json:"company_id"`
	LocationID                string          `json:"location_id"`
	UpdatedDate               int             `json:"updated_date"`
}

type EdgeFirewall

type EdgeFirewall struct {
	Log           bool               `json:"log"`
	Enabled       bool               `json:"enabled"`
	DefaultAction string             `json:"default_action"`
	Rules         []EdgeFirewallRule `json:"rules"`
}

type EdgeFirewallRule

type EdgeFirewallRule struct {
	ID                   string   `json:"id"`
	Order                int      `json:"idx"`
	Description          string   `json:"description"`
	Enabled              bool     `json:"enabled"`
	Policy               string   `json:"policy"`
	SourceIP             string   `json:"source_ip,omitempty"`
	SourcePort           int      `json:"source_port,omitempty"`
	SourcePortRange      string   `json:"source_port_range,omitempty"`
	DestinationIP        string   `json:"destination_ip,omitempty"`
	DestinationPort      int      `json:"port,omitempty"`
	DestinationPortRange string   `json:"destination_port_range,omitempty"`
	Direction            string   `json:"direction,omitempty"`
	Protocols            []string `json:"protocols"`
	MatchOnTranslate     bool     `json:"match_on_translate,omitempty"`
}

type EdgeInterface

type EdgeInterface struct {
	Name           string                `json:"name"`
	Type           string                `json:"type"`
	NetworkID      string                `json:"network_uuid"`
	NetworkName    string                `json:"network"`
	DefaultRoute   bool                  `json:"default_route"`
	ApplyRateLimit bool                  `json:"apply_rate_limit"`
	InRateLimit    int                   `json:"in_rate_limit"`
	OutRateLimit   int                   `json:"out_rate_limit"`
	Subnets        []SubnetParticipation `json:"subnet_participation"`
}

type EdgeNAT

type EdgeNAT struct {
	Enabled bool          `json:"enabled"`
	Rules   []EdgeNATRule `json:"rules"`
}

type EdgeNATRule

type EdgeNATRule struct {
	ID             int    `json:"id"`
	Order          int    `json:"idx"`
	Description    string `json:"description"`
	Enabled        bool   `json:"enabled"`
	Type           string `json:"rule_type"`
	Interface      string `json:"interface"`
	OriginalIP     string `json:"original_ip"`
	OriginalPort   string `json:"original_port"`
	TranslatedIP   string `json:"translated_ip"`
	TranslatedPort string `json:"translated_port"`
	Protocol       string `json:"protocol"`
}

type EdgeService

type EdgeService interface {
	Get(edgeID string) (Edge, error)
	GetFirewall(edgeID string) (EdgeFirewall, error)
	UpdateFirewallRules(edgeID string, rules []EdgeFirewallRule) (Task, error)
	GetNAT(edgeID string) (EdgeNAT, error)
	UpdateNATRules(edgeID string, rules []EdgeNATRule) (Task, error)
	EnableNAT(edgeID string) (Task, error)
	DisableNAT(edgeID string) (Task, error)
}

type Event

type Event struct {
	ID              string `json:"uuid"`
	Details         string `json:"details"`
	Type            string `json:"type"`
	EntityID        string `json:"entity_uuid"`
	EntityName      string `json:"entity_name"`
	EntityType      string `json:"entity_type"`
	OwnerType       string `json:"owner_type"`
	OwnerID         string `json:"owner_id"`
	TaskID          string `json:"task_uuid"`
	InitiatedByUser string `json:"initiated_by_username"`
	InitiatedByName string `json:"initiated_by_full_name"`
	Timestamp       int    `json:"timestamp"`
}

type GuestCustomization

type GuestCustomization struct {
	Enabled               bool   `json:"enabled"`
	Required              bool   `json:"required"`
	ComputerName          string `json:"computer_name"`
	VirtualMachineLocalID string `json:"virtual_machine_id"`
	ChangeSid             bool   `json:"change_sid"`
	AdminPasswordEnabled  bool   `json:"admin_password_enabled"`
	GenerateAdminPassword bool   `json:"admin_password_auto"`
	AdminPassword         string `json:"admin_password"`
	AdminAutoLoginEnabled bool   `json:"admin_auto_logon_enabled"`
	AdminAutoLogonCount   int    `json:"admin_auto_logon_count"`
	ResetPasswordRequired bool   `json:"reset_password_required"`
	UseOrgSettings        bool   `json:"use_org_settings"`
	JoinDomain            bool   `json:"join_domain"`
	DomainName            string `json:"domain_name"`
	DomainUserName        string `json:"domain_user_name"`
	DomanUserPassword     string `json:"domain_user_password"`
	MachineObjectOU       string `json:"machine_object_ou"`
}

type HotAdd

type HotAdd struct {
	CPUEnabled    bool `json:"cpu_hot_add_enabled"`
	MemoryEnabled bool `json:"memory_hot_add_enabled"`
}

type IPRange

type IPRange struct {
	Start string `json:"start"`
	End   string `json:"end"`
}

type IPScope

type IPScope struct {
	Inherited    bool      `json:"inherited"`
	Enabled      bool      `json:"enabled"`
	Gateway      string    `json:"gateway"`
	Netmask      string    `json:"netmask"`
	PrimaryDNS   string    `json:"primary_dns"`
	SecondaryDNS string    `json:"secondary_dns"`
	DNSSuffix    string    `json:"dns_suffix"`
	IPRanges     []IPRange `json:"ip_ranges"`
}

type IPTranslationRule

type IPTranslationRule struct {
	MappingMode string `json:"mapping_mode"`
	ExternalIP  string `json:"external_ip"`
	VMInterface string `json:"vm_interface"`
	VMLocalID   string `json:"vm_local_id"`
}

type Location

type Location struct {
	ID string `json:"location_id"`
}

type LocationService

type LocationService interface {
	GetPublicCatalogs(locationID string) ([]Catalog, error)
	GetPublicVAppTemplates(locationID string) ([]VAppTemplate, error)
	GetPublicMedia(locationID string) ([]Media, error)
}

type Media

type Media struct {
	ID               string  `json:"uuid"`
	Name             string  `json:"name"`
	Description      string  `json:"description"`
	Status           int     `json:"status"`
	SizeGB           float64 `json:"size"`
	IsPublic         bool    `json:"is_public"`
	CatalogID        string  `json:"catalog_uuid"`
	StorageProfileID string  `json:"storage_profile_uuid"`
	VdcID            string  `json:"vdc_uuid"`
	OrgID            string  `json:"org_uuid"`
	CompanyID        string  `json:"company_id"`
	LocationID       string  `json:"location_id"`
	UpdatedDate      int     `json:"updated_date"`
}

type Metadata

type Metadata struct {
	Key    string      `json:"key"`
	Value  interface{} `json:"value"`
	Type   string      `json:"type"`
	Access string      `json:"access"`
}

type MoveVAppParams

type MoveVAppParams struct {
	Name  string `json:"name"`
	VdcID string `json:"vdc_uuid"`
}

type MoveVirtualMachineParams

type MoveVirtualMachineParams struct {
	Name   string `json:"name"`
	VAppID string `json:"vapp_uuid"`
}

type NetworkTemplateConfig

type NetworkTemplateConfig struct {
	Name              string  `json:"name"`
	Description       string  `json:"description"`
	FenceMode         string  `json:"fence_mode"`
	IPScope           IPScope `json:"ip_scope"`
	ParentNetworkName string  `json:"parent_network_name"`
}

type Nic

type Nic struct {
	ID               int    `json:"vnic_id"`
	IPAddress        string `json:"ip_address"`
	IPAddressingMode string `json:"ip_addressing_mode"`
	MacAddress       string `json:"mac_address,omitempty"`
	AdapterType      string `json:"adapter_type"`
	NetworkName      string `json:"network_name"`
	IsConnected      bool   `json:"is_connected"`
	IsPrimary        bool   `json:"is_primary"`
}

type NicTemplateConfig

type NicTemplateConfig struct {
	NetworkName        string `json:"network_name"`
	IPAddress          string `json:"ip_address"`
	IPAddressingMode   string `json:"ip_assignment_mode"`
	AdapterType        string `json:"network_adapter_type"`
	IsPrimary          bool   `json:"primary_vnic"`
	IsConnected        bool   `json:"connected"`
	NeedsCustomization bool   `json:"needs_customization"`
}

type OperatingSystem

type OperatingSystem struct {
	ID                        string   `json:"id"`
	Name                      string   `json:"internal_name"`
	Family                    string   `json:"family"`
	Description               string   `json:"name"`
	DefaultDiskAdapterType    string   `json:"default_disk_adapter_type"`
	MinimumDiskSizeGigabytes  int      `json:"minimum_disk_size_gigabytes"`
	MinimumMemoryMebibytes    int      `json:"minimum_memory_mebibytes"`
	X64                       bool     `json:"x64"`
	MaximumCPUCountField      int      `json:"maximum_cpu_count_field"`
	MinimumHardwareVersion    int      `json:"minimum_hardware_version"`
	PersonalizationEnabled    bool     `json:"personalization_enabled"`
	PersonalizationAuto       bool     `json:"personalization_auto"`
	SysPrepPackagingSupported bool     `json:"sys_prep_packaging_supported"`
	SupportsMemoryHotAdd      bool     `json:"supports_memory_hot_add"`
	SupportedForCreate        bool     `json:"supported_for_create"`
	SupportedVNICTypes        []string `json:"supported_vnic_types"`
}

type Org

type Org struct {
	ID                                string `json:"uuid"`
	Name                              string `json:"name"`
	FullName                          string `json:"fullname"`
	Description                       string `json:"description"`
	Enabled                           bool   `json:"enabled"`
	VAppMaxRuntimeLease               int    `json:"vapp_max_runtime_lease"`
	VAppMaxStorageLease               int    `json:"vapp_max_storage_lease"`
	VAppDeleteOnStorageExpire         bool   `json:"vapp_delete_on_storage_expire"`
	VAppTemplateDeleteOnStorageExpire bool   `json:"vapp_template_delete_on_storage_expire"`
	ZertoTarget                       bool   `json:"zerto_target"`
	LocationID                        string `json:"location_id"`
	CompanyID                         string `json:"company_id"`
	UpdatedDate                       int    `json:"updated_date"`
}

type OrgService

type OrgService interface {
	Get(orgID string) (Org, error)
	GetVdcs(orgID string) ([]Vdc, error)
	GetEdges(orgID string) ([]Edge, error)
	GetCatalogs(orgID string) ([]Catalog, error)
	GetVAppTemplates(orgID string) ([]VAppTemplate, error)
	GetMedia(orgID string) ([]Media, error)
	GetNetworks(orgID string) ([]OrgVdcNetwork, error)
	GetVApps(orgID string) ([]VApp, error)
	GetVirtualMachines(orgID string) ([]VirtualMachine, error)
	GetVpgs(orgID string) ([]Vpg, error)
	GetPublicIPs(orgID string) ([]string, error)
	GetPublicIPAssignments(orgID string) ([]PublicIPAssignment, error)
	GetCurrentBill(orgID string) (Billing, error)
	GetBill(orgID string, month, year int) (Billing, error)
}

type OrgVdcNetwork

type OrgVdcNetwork struct {
	ID              string    `json:"uuid"`
	Name            string    `json:"name"`
	Description     string    `json:"description"`
	Gateway         string    `json:"gateway"`
	Netmask         string    `json:"netmask"`
	IPRanges        []IPRange `json:"ip_ranges"`
	FenceMode       string    `json:"fence_mode"`
	PrimaryDNS      string    `json:"primary_dns"`
	SecondaryDNS    string    `json:"secondary_dns"`
	DNSSuffix       string    `json:"dns_suffix"`
	Inherited       bool      `json:"inherited"`
	Shared          bool      `json:"shared"`
	ParentNetworkID string    `json:"parent_network_id"`
	EdgeID          string    `json:"edge_uuid"`
	VdcID           string    `json:"vdc_uuid"`
	OrgID           string    `json:"org_uuid"`
	CompanyID       string    `json:"company_id"`
	LocationID      string    `json:"location_id"`
	UpdatedDate     int       `json:"updated_date"`
}

type OrgVdcNetworkService

type OrgVdcNetworkService interface {
	Get(networkID string) (OrgVdcNetwork, error)
	Update(networkID string, params UpdateOrgVdcNetworkParams) (Task, error)
}

type Performance

type Performance struct {
	ID       string              `json:"uuid"`
	Name     string              `json:"name"`
	Type     string              `json:"type"`
	Group    string              `json:"group"`
	Summary  string              `json:"summary"`
	Interval int                 `json:"interval"`
	Unit     string              `json:"unit"`
	Samples  []PerformanceSample `json:"samples"`
}

func (*Performance) GetAvgValue

func (p *Performance) GetAvgValue() int

func (*Performance) GetMaxValue

func (p *Performance) GetMaxValue() int

type PerformanceCounter

type PerformanceCounter struct {
	Name  string `json:"name"`
	Type  string `json:"type"`
	Group string `json:"group"`
}

type PerformanceSample

type PerformanceSample struct {
	Value     int `json:"value"`
	Timestamp int `json:"time"`
}

type Policy

type Policy struct {
	EntityID    string   `json:"entity_uuid"`
	Type        string   `json:"type"`
	DomainType  string   `json:"domain_type"`
	Permissions []string `json:"permissions"`
}

type PortForwardingRule

type PortForwardingRule struct {
	ExternalPort  string `json:"external_port"`
	ForwardToPort string `json:"forward_to_port"`
	Protocol      string `json:"protocol"`
	VMInterface   string `json:"vm_interface"`
	VMLocalID     string `json:"vm_local_id"`
}

type PublicIPAssignment

type PublicIPAssignment struct {
	IP                  string `json:"ip"`
	Type                string `json:"type"`
	EntityID            string `json:"entity_uuid"`
	EntityName          string `json:"entity_name"`
	ExternalNetworkID   string `json:"external_network_uuid"`
	ExternalNetworkName string `json:"external_network_name"`
}

type ReconfigureParams

type ReconfigureParams struct {
	Name               string             `json:"name"`
	Description        string             `json:"description"`
	GuestCustomization GuestCustomization `json:"guest_customization_section"`
	Cpu                UpdateCPUParams    `json:"cpu_spec"`
	Disks              []DiskParams       `json:"disk_spec"`
	Memory             UpdateMemoryParams `json:"memory_spec"`
}

type RefreshTokenRequest

type RefreshTokenRequest struct {
	ClientID     string `json:"client_id"`
	ClientSecret string `json:"client_secret"`
	RefreshToken string `json:"refresh_token"`
	GrantType    string `json:"grant_type"`
}

type Role

type Role struct {
	ID          string   `json:"uuid"`
	Name        string   `json:"name"`
	Type        string   `json:"type"`
	Description string   `json:"description"`
	CompanyID   string   `json:"company_id"`
	Policies    []Policy `json:"policies"`
}

type Snapshot

type Snapshot struct {
	Size         int64 `json:"size"`
	IsPoweredOn  bool  `json:"is_powered_on"`
	CreationDate int64 `json:"creation_date"`
}

type SocketData

type SocketData struct {
	Type string          `json:"type"`
	Data json.RawMessage `json:"data"`
}

type StorageProfile

type StorageProfile struct {
	ID      string `json:"uuid"`
	Name    string `json:"name"`
	Enabled bool   `json:"enabled"`
	Default bool   `json:"default_profile"`
	LimitMB int    `json:"limit"`
	UsedMB  int    `json:"storage_used_in_mb"`
	VdcID   string `json:"vdc_uuid"`
}

type SubnetParticipation

type SubnetParticipation struct {
	Gateway   string    `json:"gateway"`
	Netmask   string    `json:"netmask"`
	IPAddress string    `json:"ip_address"`
	IPRanges  []IPRange `json:"ip_ranges"`
}

type Summary

type Summary struct {
	ReservedCpu     float64 `json:"reserved_cpu"`
	ConsumedCpu     float64 `json:"consumed_cpu"`
	ReservedMemory  float64 `json:"reserved_mem"`
	ConsumedMemory  float64 `json:"consumed_mem"`
	ConfiguredDisk  float64 `json:"configured_disk"`
	ProvisionedDisk float64 `json:"provisioned_disk"`
}

type Task

type Task struct {
	ID           string `json:"uuid"`
	Operation    string `json:"operation"`
	Description  string `json:"operation_description"`
	Type         string `json:"task_type"`
	Status       string `json:"status"`
	Progress     int    `json:"progress"`
	Active       bool   `json:"active"`
	Synced       bool   `json:"synced"`
	Message      string `json:"message"`
	UserName     string `json:"username"`
	UserFullName string `json:"user_full_name"`
	EntityID     string `json:"entity_uuid"`
	EntityName   string `json:"entity_name"`
	OrgID        string `json:"org_uuid"`
	CompanyID    string `json:"company_id"`
	LocationID   string `json:"location_id"`
	StartTime    int    `json:"start_time"`
	EndTime      int    `json:"end_time"`
}

type TaskService

type TaskService interface {
	Get(taskID string) (Task, error)
	Track(taskID string) (Task, error)
}

type Token

type Token struct {
	AccessToken  string `json:"access_token"`
	ExpiresIn    int64  `json:"expires_in"`
	RefreshToken string `json:"refresh_token"`
}

type TokenRequest

type TokenRequest struct {
	ClientID     string `json:"client_id"`
	ClientSecret string `json:"client_secret"`
	Username     string `json:"username"`
	Password     string `json:"password"`
	GrantType    string `json:"grant_type"`
}

type UpdateCPUParams

type UpdateCPUParams struct {
	CPUCount       int `json:"cpus_number"`
	CoresPerSocket int `json:"cores_per_socket"`
}

type UpdateCatalogParams

type UpdateCatalogParams struct {
	Name        string `json:"name"`
	Description string `json:"description"`
}

type UpdateMemoryParams

type UpdateMemoryParams struct {
	MemoryMB int `json:"memory_size"`
}

type UpdateOrgVdcNetworkParams

type UpdateOrgVdcNetworkParams struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Shared      bool   `json:"shared"`
}

type UpdateUserParams

type UpdateUserParams struct {
	FullName string `json:"fullname"`
	Phone    string `json:"phone"`
	Country  string `json:"country"`
	City     string `json:"city"`
	State    string `json:"state"`
	Zip      string `json:"zip"`
	Address  string `json:"address"`
}

type UpdateVAppNetworkParams

type UpdateVAppNetworkParams struct {
	Name            string    `json:"name"`
	Description     string    `json:"description"`
	FenceMode       string    `json:"fence_mode"`
	PrimaryDNS      string    `json:"primary_dns"`
	SecondaryDNS    string    `json:"secondary_dns"`
	ParentNetworkID string    `json:"parent_network_id"`
	IPRanges        []IPRange `json:"ip_ranges"`
}

type UpdateVAppTemplateParams

type UpdateVAppTemplateParams struct {
	Name        string `json:"name"`
	Description string `json:"description"`
}

type User

type User struct {
	Name        string `json:"name"`
	FullName    string `json:"fullname"`
	Email       string `json:"email"`
	Phone       string `json:"phone"`
	Type        string `json:"user_type"`
	Locked      bool   `json:"locked"`
	Country     string `json:"country"`
	City        string `json:"city"`
	State       string `json:"state"`
	Zip         string `json:"zip"`
	Address     string `json:"address"`
	Domain      Domain `json:"domain"`
	CreatedDate int    `json:"created_date"`
}

type UserService

type UserService interface {
	Get(username string) (User, error)
	Update(username string, params UpdateUserParams) (User, error)
	GetCompanies(username string) ([]Company, error)
	GetOrgs(username string) ([]Org, error)
	AssignRole(username, companyID, roleID string) error
	GetRole(username, companyID string) (Role, error)
	DeleteRole(username, companyID string) error
}

type VApp

type VApp struct {
	ID                string   `json:"uuid"`
	Name              string   `json:"name"`
	Description       string   `json:"description"`
	Status            string   `json:"status"`
	Deployed          bool     `json:"deployed"`
	IsExpired         bool     `json:"is_expired"`
	AllocationModel   string   `json:"allocation_model"`
	StorageProfileIDs []string `json:"storage_profiles"`
	VdcID             string   `json:"vdc_uuid"`
	OrgID             string   `json:"org_uuid"`
	CompanyID         string   `json:"company_id"`
	LocationID        string   `json:"location_id"`
	CreatedDate       int      `json:"created_date"`
	UpdatedDate       int      `json:"updated_date"`
}

type VAppNetwork

type VAppNetwork struct {
	ID               string    `json:"uuid"`
	Name             string    `json:"name"`
	Description      string    `json:"description"`
	Gateway          string    `json:"gateway"`
	Netmask          string    `json:"netmask"`
	IPRanges         []IPRange `json:"ip_ranges"`
	FenceMode        string    `json:"fence_mode"`
	PrimaryDNS       string    `json:"primary_dns"`
	SecondaryDNS     string    `json:"secondary_dns"`
	DNSSuffix        string    `json:"dns_suffix"`
	Inherited        bool      `json:"inherited"`
	Shared           bool      `json:"shared"`
	RouterExternalIP string    `json:"router_external_ip"`
	ParentNetworkID  string    `json:"parent_network_id"`
	VAppID           string    `json:"vapp_uuid"`
	VdcID            string    `json:"vdc_uuid"`
	OrgID            string    `json:"org_uuid"`
	CompanyID        string    `json:"company_id"`
	LocationID       string    `json:"location_id"`
	UpdatedDate      int       `json:"updated_date"`
}

type VAppNetworkFirewall

type VAppNetworkFirewall struct {
	VAppID         string                    `json:"vapp_uuid"`
	NetworkName    string                    `json:"network_name"`
	Enabled        bool                      `json:"enabled"`
	LoggingEnabled bool                      `json:"logging_enabled"`
	DefaultAction  string                    `json:"default_action"`
	Rules          []VAppNetworkFirewallRule `json:"rules"`
}

type VAppNetworkFirewallRule

type VAppNetworkFirewallRule struct {
	ID                   string   `json:"id"`
	Index                int      `json:"rule_index"`
	Description          string   `json:"description"`
	Enabled              bool     `json:"enabled"`
	LoggingEnabled       bool     `json:"logging_enabled"`
	MatchOnTranslate     bool     `json:"match_on_translate"`
	Policy               string   `json:"policy"`
	Direction            string   `json:"direction"`
	Protocols            []string `json:"protocols"`
	SourceIP             string   `json:"source_ip"`
	SourcePort           int      `json:"source_port"`
	SourcePortRange      string   `json:"source_port_range"`
	DestinationIP        string   `json:"destination_ip"`
	DestinationPort      int      `json:"port"`
	DestinationPortRange string   `json:"destination_port_range"`
}

type VAppNetworkNAT

type VAppNetworkNAT struct {
	VAppID              string               `json:"vapp_uuid"`
	NetworkName         string               `json:"network_name"`
	Enabled             bool                 `json:"enabled"`
	Type                string               `json:"type"`
	IPMasquerade        bool                 `json:"enable_ip_masquerade"`
	IPTranslationRules  []IPTranslationRule  `json:"ip_translation_rules"`
	PortForwardingRules []PortForwardingRule `json:"port_forwarding_rules"`
}

type VAppNetworkService

type VAppNetworkService interface {
	Get(vappNetworkID string) (VAppNetwork, error)
	Update(vappNetworkID string, params UpdateVAppNetworkParams) (Task, error)
	Delete(vappNetworkID string) (Task, error)
	UpdateDHCP(vappNetworkID string, params DHCP) (Task, error)
	GetFirewall(vappNetworkID string) (VAppNetworkFirewall, error)
	UpdateFirewallRules(vappNetworkID string, rules []VAppNetworkFirewallRule) (Task, error)
	EnableFirewall(vappNetworkID string) (Task, error)
	DisableFirewall(vappNetworkID string) (Task, error)
	GetNAT(vappNetworkID string) (VAppNetworkNAT, error)
	UpdateNATIPTranslationRules(vappNetworkID string, rules []IPTranslationRule) (Task, error)
	UpdateNATPortForwardingRules(vappNetworkID string, rules []PortForwardingRule) (Task, error)
	EnableNAT(vappNetworkID string) (Task, error)
	DisableNAT(vappNetworkID string) (Task, error)
	GetInterfaces(vappNetwork string) ([]VirtualMachineInterface, error)
}

type VAppService

type VAppService interface {
	Get(vappID string) (VApp, error)
	Delete(vappID string) (Task, error)
	GetVirtualMachines(vappID string) ([]VirtualMachine, error)
	GetNetworks(vappID string) ([]VAppNetwork, error)
	AddOrgNetwork(vappID, orgVdcNetworkID string) (Task, error)
	UpdateName(vappID, name string) (Task, error)
	UpdateDescription(vappID, description string) (Task, error)
	Copy(vappID string, params CopyVAppParams) (Task, error)
	Move(vappID string, params MoveVAppParams) (Task, error)
	BuildVirtualMachines(vappID string, params []BuildVirtualMachineParams) (Task, error)
	AddTemplateVirtualMachines(vappID string, params []AddTemplateVirtualMachineParams) (Task, error)
	CreateNetwork(vappID string, params CreateVAppNetworkParams) (Task, error)
	PowerOn(vappID string) (Task, error)
	PowerOff(vappID string) (Task, error)
	Shutdown(vappID string) (Task, error)
	Reboot(vappID string) (Task, error)
	Reset(vappID string) (Task, error)
	Suspend(vappID string) (Task, error)
	GetCurrentBill(vappID string) (Billing, error)
	GetBill(vappID string, month, year int) (Billing, error)
	GetAvailableStorageProfiles(vappID string) ([]StorageProfile, error)
	GetMetadata(vappID string) ([]Metadata, error)
	UpdateMetadata(vappID string, metadata []Metadata) (Task, error)
	DeleteMetadata(vappID, metadataKey string) (Task, error)
	HasSnapshot(vappID string) (bool, error)
	GetSnapshot(vappID string) (Snapshot, error)
	CreateSnapshot(vappID string) (Task, error)
	RestoreSnapshot(vappID string) (Task, error)
	RemoveSnapshot(vappID string) (Task, error)
	GetStartupSettings(vappID string) ([]VAppStartupSetting, error)
	UpdateStartupSettings(vappID string, params []VAppStartupSetting) (Task, error)
	GetPerformanceCounters(vappID string) ([]PerformanceCounter, error)
	GetPerformance(vappID string, counter PerformanceCounter, start, end time.Time) (Performance, error)
	GetSummary(vappID string) (VAppSummary, error)
}

type VAppStartupSetting

type VAppStartupSetting struct {
	VirtualMachineName string `json:"vm_name"`
	Order              int    `json:"ord"`
	StartAction        string `json:"startup_action"`
	StopAction         string `json:"stop_action"`
	StartDelay         int    `json:"start_delay"`
	StopDelay          int    `json:"stop_delay"`
}

type VAppSummary

type VAppSummary struct {
	NumberOfVms     int     `json:"number_of_vms"`
	ReservedCPU     float64 `json:"reserved_cpu"`
	ConsumedCPU     float64 `json:"consumed_cpu"`
	ReservedMemory  float64 `json:"reserved_mem"`
	ConsumedMemory  float64 `json:"consumed_mem"`
	ProvisionedDisk float64 `json:"provisioned_disk"`
	ConsumedDisk    float64 `json:"consumed_disk"`
}

type VAppTemplate

type VAppTemplate struct {
	ID                    string                   `json:"uuid"`
	Name                  string                   `json:"name"`
	Description           string                   `json:"description"`
	Status                int                      `json:"status"`
	SizeGB                float64                  `json:"size"`
	GoldMaster            bool                     `json:"gold_master"`
	IsPublic              bool                     `json:"is_public"`
	Expired               bool                     `json:"expired"`
	Customizable          bool                     `json:"customizable"`
	CustomizationRequired bool                     `json:"customization_required"`
	VirtualMachines       []VirtualMachineTemplate `json:"vm_templates"`
	CatalogID             string                   `json:"catalog_uuid"`
	StorageProfileID      string                   `json:"storage_profile_uuid"`
	VdcID                 string                   `json:"vdc_uuid"`
	OrgID                 string                   `json:"org_uuid"`
	CompanyID             string                   `json:"company_id"`
	LocationID            string                   `json:"location_id"`
	CreatedDate           int                      `json:"created_date"`
	UpdatedDate           int                      `json:"updated_date"`
}

type VAppTemplateConfig

type VAppTemplateConfig struct {
	ID              string                         `json:"uuid"`
	Name            string                         `json:"name"`
	Description     string                         `json:"description"`
	VirtualMachines []VirtualMachineTemplateConfig `json:"vms"`
	Networks        []NetworkTemplateConfig        `json:"networks"`
}

type VAppTemplateNicParams

type VAppTemplateNicParams struct {
	NetworkID          string `json:"network_uuid,omitempty"`
	IPAssignment       string `json:"ip_assignment"`
	IPAddress          string `json:"ip_address,omitempty"`
	PrimaryVNic        bool   `json:"primary_vnic"`
	NetworkAdapterType string `json:"network_adapter_type"`
}

type VAppTemplateService

type VAppTemplateService interface {
	Get(vappTemplateID string) (VAppTemplate, error)
	Update(vappTemplateID string, params UpdateVAppTemplateParams) (Task, error)
	Delete(vappTemplateID string) (Task, error)
	GetVirtualMachines(vappTemplateID string) ([]VirtualMachineTemplate, error)
	GetConfig(vappTemplateID string) (VAppTemplateConfig, error)
	SyncSubscription(vappTemplateID string) (Task, error)
}

type VCCBackupResource

type VCCBackupResource struct {
	Repository VCCRepository `json:"repository"`
}

type VCCBackupResources

type VCCBackupResources struct {
	Resources []VCCBackupResource `json:"resources"`
}

type VCCBackupTenant

type VCCBackupTenant struct {
	ID                   string             `json:"uuid"`
	UID                  string             `json:"uid"`
	Name                 string             `json:"name"`
	Enabled              bool               `json:"enabled"`
	LastResult           string             `json:"last_result"`
	LastActive           int                `json:"last_active"`
	BackupCount          int                `json:"backup_count"`
	ThrottlingEnabled    bool               `json:"throttling_enabled"`
	ThrottlingSpeedLimit int                `json:"throttling_speed_limit"`
	ThrottlingSpeedUnit  string             `json:"throttling_speed_unit"`
	Resources            VCCBackupResources `json:"resources"`
	PublicIPCount        int                `json:"public_ip_count"`
	ContractID           string             `json:"contract_uuid"`
	CompanyName          string             `json:"owner_name"`
	CompanyID            string             `json:"company_id"`
	LocationID           string             `json:"location_id"`
	UpdatedDate          int                `json:"updated_date"`
}

type VCCBackupTenantService

type VCCBackupTenantService interface {
	Get(vccBackupTenantID string) (VCCBackupTenant, error)
}

type VCCRepository

type VCCRepository struct {
	Name           string `json:"display_name"`
	StorageQuotaMB int    `json:"quota"`
	StorageUsedMB  int    `json:"used_quota"`
}

type VMwareTools

type VMwareTools struct {
	Status        string `json:"status"`
	RunningStatus string `json:"running_status"`
	Version       string `json:"version"`
}

type Vdc

type Vdc struct {
	ID                 string `json:"uuid"`
	Name               string `json:"name"`
	Description        string `json:"description"`
	Enabled            bool   `json:"enabled"`
	AllocationModel    string `json:"allocation_model"`
	ReservedCPU        int    `json:"reserved_cpu"`
	AllocatedCPU       int    `json:"alloc_cpu"`
	ReservedMemory     int    `json:"reserved_mem"`
	AllocatedMemory    int    `json:"allocated_memory"`
	NetworkQuota       int    `json:"network_quota"`
	UsedNetworkCount   int    `json:"used_network_count"`
	MaxHardwareVersion string `json:"max_hardware_version"`
	DiskLimit          int    `json:"disk_limit"`
	AdvancedDiskLimit  int    `json:"contracted_advanced_disk_limit"`
	SSDDiskLimit       int    `json:"contracted_ssd_disk_limit"`
	ArchiveDiskLimit   int    `json:"contracted_archive_disk_limit"`
	CompanyID          string `json:"company_id"`
	OrgID              string `json:"org_uuid"`
	VCenterName        string `json:"vcenter_name"`
	VCloudHref         string `json:"vcloud_href"`
	LocationID         string `json:"location_id"`
	UpdatedDate        int    `json:"updated_date"`
}

type VdcService

type VdcService interface {
	Get(vdcID string) (Vdc, error)
	GetStorageProfiles(vdcID string) ([]StorageProfile, error)
	GetSummary(vdcID string) (VdcSummary, error)
	GetVApps(vdcID string) ([]VApp, error)
	GetVirtualMachines(vdcID string) ([]VirtualMachine, error)
	GetEdges(vdcID string) ([]Edge, error)
	GetNetworks(vdcID string) ([]OrgVdcNetwork, error)
	GetCurrentBill(vdcID string) (Billing, error)
	GetBill(vdcID string, month, year int) (Billing, error)
	GetCurrentVAppBill(vdcID string) ([]Billing, error)
	GetVAppBill(vdcID string, month, year int) ([]Billing, error)
	GetPerformanceCounters(vdcID string) ([]PerformanceCounter, error)
	GetPerformance(vdcID string, counter PerformanceCounter, start, end time.Time) (Performance, error)
	BuildVApp(vdcID string, params BuildVAppParams) (Task, error)
	DeployVAppTemplate(vdcID string, params DeployVAppTemplateParams) (Task, error)
}

type VdcSummary

type VdcSummary struct {
	NumberOfVApps    int     `json:"number_of_vapps"`
	NumberOfVms      int     `json:"number_of_vms"`
	ReservedCPU      float64 `json:"reserved_cpu"`
	AllocatedCPU     float64 `json:"allocated_cpu"`
	ConfiguredCPU    float64 `json:"configured_cpu"`
	ConsumedCPU      float64 `json:"consumed_cpu"`
	ReservedMemory   float64 `json:"reserved_mem"`
	AllocatedMemory  float64 `json:"allocated_mem"`
	ConfiguredMemory float64 `json:"configured_mem"`
	ConsumedMemory   float64 `json:"consumed_mem"`
	ProvisionedDisk  float64 `json:"provisioned_disk"`
	ConfiguredDisk   float64 `json:"configured_disk"`
	ConsumedDisk     float64 `json:"consumed_disk"`
}

type VirtualMachine

type VirtualMachine struct {
	ID                         string   `json:"uuid"`
	Name                       string   `json:"name"`
	Description                string   `json:"description"`
	Status                     string   `json:"status"`
	Deployed                   bool     `json:"deployed"`
	LocalID                    string   `json:"vm_local_id"`
	OperatingSystemName        string   `json:"os"`
	OperatingSystemDescription string   `json:"os_description"`
	CPUCount                   int      `json:"cpus_number"`
	CoresPerSocket             int      `json:"cores_per_socket"`
	MemoryMB                   int      `json:"memory_size"`
	StorageProfileIDs          []string `json:"storage_profiles"`
	HardwareVersion            string   `json:"hardware_version"`
	MediaInserted              bool     `json:"media_inserted"`
	MediaName                  string   `json:"inserted_media_name"`
	NestedHypervisorEnabled    bool     `json:"nested_hypervisor_enabled"`
	AllocationModel            string   `json:"allocation_model"`
	VCloudHref                 string   `json:"vcloud_href"`
	VCenterMoref               string   `json:"vcenter_moref"`
	VCenterName                string   `json:"vcenter_name"`
	VCenterInstanceUUID        string   `json:"vcenter_instance_uuid"`
	VAppID                     string   `json:"vapp_uuid"`
	VdcID                      string   `json:"vdc_uuid"`
	OrgID                      string   `json:"org_uuid"`
	CompanyID                  string   `json:"company_id"`
	LocationID                 string   `json:"location_id"`
	CreatedDate                int      `json:"created_date"`
	UpdatedDate                int      `json:"updated_date"`
}

type VirtualMachineBackup

type VirtualMachineBackup struct {
	Name      string `json:"name"`
	Timestamp int    `json:"timestamp"`
}

type VirtualMachineInterface

type VirtualMachineInterface struct {
	VirtualMachineID      string `json:"vm_uuid"`
	VirtualMachineName    string `json:"vm_name"`
	VirtualMachineLocalID string `json:"vm_local_id"`
	VAppID                string `json:"vapp_uuid"`
	VAppNetworkID         string `json:"vapp_network_uuid"`
	NicID                 int    `json:"nic_id"`
	IPAddress             string `json:"ip_address"`
	IPTranslationMapped   bool   `json:"ip_translation_mapped"`
}

type VirtualMachineService

type VirtualMachineService interface {
	Get(virtualMachineID string) (VirtualMachine, error)
	Delete(virtualMachineID string) (Task, error)
	UpdateName(virtualMachineID, name string) (Task, error)
	UpdateDescription(virtualMachineID, description string) (Task, error)
	PowerOn(virtualMachineID string) (Task, error)
	PowerOnForceCustomization(virtualMachineID string) (Task, error)
	PowerOff(virtualMachineID string) (Task, error)
	Reboot(virtualMachineID string) (Task, error)
	Reset(virtualMachineID string) (Task, error)
	Shutdown(virtualMachineID string) (Task, error)
	Suspend(virtualMachineID string) (Task, error)
	Copy(virtualMachineID string, params CopyVirtualMachineParams) (Task, error)
	Move(virtualMachineID string, params MoveVirtualMachineParams) (Task, error)

	GetSummary(virtualMachineID string) (Summary, error)
	GetAvailableStorageProfiles(virtualMachineID string) ([]StorageProfile, error)
	ChangeStorageProfile(virtualMachineID, storageProfileID string) (Task, error)
	EnableNestedHypervisor(virtualMachineID string) (Task, error)
	DisableNestedHypervisor(virtualMachineID string) (Task, error)
	InsertMedia(virtualMachineID, mediaID string) (Task, error)
	EjectMedia(virtualMachineID string) (Task, error)
	GetGuestCustomization(virtualMachineID string) (GuestCustomization, error)
	UpdateGuestCustomization(virtualMachineID string, params GuestCustomization) (Task, error)
	GetHotAdd(virtualMachineID string) (HotAdd, error)
	UpdateHotAdd(virtualMachineID string, params HotAdd) (Task, error)
	GetBootOptions(virtualMachineID string) (BootOptions, error)
	UpdateBootOptions(virtualMachineID string, params BootOptions) (Task, error)
	UpdateHardwareVersion(virtualMachineID string) (Task, error)
	GetVMwareTools(virtualMachineID string) (VMwareTools, error)
	UpgradeVMwareTools(virtualMachineID string) (Task, error)
	InstallVMwareTools(virtualMachineID string) (Task, error)
	Reconfigure(virtualMachineID string, params ReconfigureParams) (Task, error)
	GetDisks(virtualMachineID string) ([]Disk, error)
	AddDisk(virtualMachineID string, params DiskParams) (Task, error)
	UpdateDisk(virtualMachineID string, params DiskParams) (Task, error)
	UpdateDisks(virtualMachineID string, params []DiskParams) (Task, error)
	DeleteDisk(virtualMachineID string, diskName string) (Task, error)
	GetRecommendedBusType(virtualMachineID string) (string, error)
	GetNics(virtualMachineID string) ([]Nic, error)
	DeleteNic(virtualMachineID string, nicID int) (Task, error)
	UpdateNics(virtualMachineID string, params []Nic) (Task, error)
	UpdateCPU(virtualMachineID string, params UpdateCPUParams) (Task, error)
	UpdateCPUCount(virtualMachineID string, cpuCount int) (Task, error)
	UpdateMemory(virtualMachineID string, memorySize int) (Task, error)
	GetBackups(virtualMachineID string) ([]VirtualMachineBackup, error)
	RestoreBackup(virtualMachineID string, backupTimestamp int) (Task, error)
	RestoreBackupToVApp(virtualMachineID, vappID string, backupTimestamp int) (Task, error)
	HasSnapshot(virtualMachineID string) (bool, error)
	GetSnapshot(virtualMachineID string) (Snapshot, error)
	CreateSnapshot(virtualMachineID string) (Task, error)
	RestoreSnapshot(virtualMachineID string) (Task, error)
	RemoveSnapshot(virtualMachineID string) (Task, error)

	GetNetworks(virtualMachineID string) ([]VAppNetwork, error)
	GetCurrentBill(virtualMachineID string) (Billing, error)
	GetBill(virtualMachineID string, month, year int) (Billing, error)
	GetMetadata(virtualMachineID string) ([]Metadata, error)
	UpdateMetadata(virtualMachineID string, metadata []Metadata) (Task, error)
	DeleteMetadata(virtualMachineID string, metadataKey string) (Task, error)
	GetPerformanceCounters(virtualMachineID string) ([]PerformanceCounter, error)
	GetPerformance(virtualMachineID string, counter PerformanceCounter, start, end time.Time) (Performance, error)
	GetConsoleSession(virtualMachineID string) (ConsoleSession, error)
	GetScreenThumbnail(virtualMachineID string) ([]byte, error)
}

type VirtualMachineTemplate

type VirtualMachineTemplate struct {
	ID          string  `json:"uuid"`
	Name        string  `json:"name"`
	Description string  `json:"description"`
	Status      int     `json:"status"`
	SizeGB      float64 `json:"size"`
}

type VirtualMachineTemplateConfig

type VirtualMachineTemplateConfig struct {
	ID                      string               `json:"uuid"`
	Name                    string               `json:"name"`
	ComputerName            string               `json:"computer_name"`
	Description             string               `json:"description"`
	CPUCount                int                  `json:"number_of_cpus"`
	CoresPerSocket          int                  `json:"number_of_cores_per_socket"`
	MemoryBytes             int                  `json:"memory_in_bytes"`
	OperatingSystem         string               `json:"operating_system_version"`
	HardwareVersion         string               `json:"hardware_version"`
	NestedHypervisorEnabled bool                 `json:"expose_cpu_virtualization"`
	StorageProfileID        string               `json:"storage_profile_uuid"`
	Disks                   []DiskTemplateConfig `json:"disks"`
	Nics                    []NicTemplateConfig  `json:"vnics"`
}

type Vpg

type Vpg struct {
	ID                   string              `json:"uuid"`
	ZertoID              string              `json:"vpg_identifier"`
	Name                 string              `json:"name"`
	Status               string              `json:"status"`
	SubStatus            string              `json:"sub_status"`
	Priority             string              `json:"priority"`
	VirtualMachineCount  int                 `json:"vms_count"`
	SourceSite           string              `json:"source_site"`
	TargetSite           string              `json:"target_site"`
	ActualRPO            int                 `json:"actual_rpo"`
	IOPS                 int                 `json:"iops"`
	ProvisionedStorageMB int                 `json:"provisioned_storage_in_mb"`
	UsedStorageMB        int                 `json:"used_storage_in_mb"`
	ThroughputMB         float64             `json:"throughput_in_mb"`
	JournalStorageUsedMB int                 `json:"recovery_journal_used_storage_in_mb"`
	BackupEnabled        bool                `json:"backup_enabled"`
	VirtualMachines      []VpgVirtualMachine `json:"vms"`
	Entities             VpgEntities         `json:"entities"`
	ServiceProfileID     string              `json:"service_profile_uuid"`
	OrgID                string              `json:"org_uuid"`
	CompanyID            string              `json:"company_id"`
	LocationID           string              `json:"location_id"`
	UpdatedDate          int                 `json:"updated_date"`
}

type VpgCheckpoint

type VpgCheckpoint struct {
	ID        string `json:"checkpoint_identifier"`
	Tag       string `json:"tag"`
	Timestamp int    `json:"time_stamp"`
}

type VpgEntities

type VpgEntities struct {
	Source string `json:"source"`
	Target string `json:"target"`
}

type VpgService

type VpgService interface {
	Get(vpgID string) (Vpg, error)
	GetCheckpoints(vpgID string) ([]VpgCheckpoint, error)
}

type VpgServiceProfile

type VpgServiceProfile struct {
	ID                    string `json:"uuid"`
	ZertoID               string `json:"service_profile_identifier"`
	Name                  string `json:"service_profile_name"`
	Description           string `json:"description"`
	History               int    `json:"history"`
	MaxJournalSizePercent int    `json:"max_journal_size_in_percent"`
	Rpo                   int    `json:"rpo"`
	TestInterval          int    `json:"test_interval"`
	LocationID            string `json:"location"`
}

type VpgVirtualMachine

type VpgVirtualMachine struct {
	ID                   string      `json:"uuid"`
	ZertoID              string      `json:"vm_identifier"`
	Name                 string      `json:"vm_name"`
	Status               string      `json:"status"`
	SubStatus            string      `json:"sub_status"`
	Priority             string      `json:"priority"`
	ProvisionedStorageMB int         `json:"provisioned_storage_in_mb"`
	UsedStorageMB        int         `json:"used_storage_in_mb"`
	IOPS                 int         `json:"iops"`
	ThroughputMB         float64     `json:"throughput_in_mb"`
	TargetSite           string      `json:"target_site"`
	SourceSite           string      `json:"source_site"`
	ActualRpo            int         `json:"actual_rpo"`
	LastTest             int         `json:"last_test"`
	Entities             VpgEntities `json:"entities"`
	VpgID                string      `json:"vpg_uuid"`
	VpgName              string      `json:"vpg_name"`
	OrgID                string      `json:"org_uuid"`
	LocationID           string      `json:"location"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL