github.com/vmware/go-vcloud-director/v2@v2.24.0/types/v56/types.go (about) 1 /* 2 * Copyright 2023 VMware, Inc. All rights reserved. Licensed under the Apache v2 License. 3 */ 4 5 // Package types/v56 provider all types which are used by govcd package in order to perform API 6 // requests and parse responses 7 package types 8 9 import ( 10 "encoding/xml" 11 "fmt" 12 "sort" 13 ) 14 15 // Maps status Attribute Values for VAppTemplate, VApp, VM, and Media Objects 16 var VAppStatuses = map[int]string{ 17 -1: "FAILED_CREATION", 18 0: "UNRESOLVED", 19 1: "RESOLVED", 20 2: "DEPLOYED", 21 3: "SUSPENDED", 22 4: "POWERED_ON", 23 5: "WAITING_FOR_INPUT", 24 6: "UNKNOWN", 25 7: "UNRECOGNIZED", 26 8: "POWERED_OFF", 27 9: "INCONSISTENT_STATE", 28 10: "MIXED", 29 11: "DESCRIPTOR_PENDING", 30 12: "COPYING_CONTENTS", 31 13: "DISK_CONTENTS_PENDING", 32 14: "QUARANTINED", 33 15: "QUARANTINE_EXPIRED", 34 16: "REJECTED", 35 17: "TRANSFER_TIMEOUT", 36 18: "VAPP_UNDEPLOYED", 37 19: "VAPP_PARTIALLY_DEPLOYED", 38 20: "PARTIALLY_POWERED_OFF", // VCD 10.3+ 39 21: "PARTIALLY_SUSPENDED", 40 } 41 42 // Maps status Attribute Values for VDC Objects 43 var VDCStatuses = map[int]string{ 44 -1: "FAILED_CREATION", 45 0: "NOT_READY", 46 1: "READY", 47 2: "UNKNOWN", 48 3: "UNRECOGNIZED", 49 } 50 51 // VCD API 52 53 // DefaultStorageProfileSection is the name of the storage profile that will be specified for this virtual machine. The named storage profile must exist in the organization vDC that contains the virtual machine. If not specified, the default storage profile for the vDC is used. 54 // Type: DefaultStorageProfileSection_Type 55 // Namespace: http://www.vmware.com/vcloud/v1.5 56 // Description: Name of the storage profile that will be specified for this virtual machine. The named storage profile must exist in the organization vDC that contains the virtual machine. If not specified, the default storage profile for the vDC is used. 57 // Since: 5.1 58 type DefaultStorageProfileSection struct { 59 StorageProfile string `xml:"StorageProfile,omitempty"` 60 } 61 62 // CustomizationSection represents a vApp template customization settings. 63 // Type: CustomizationSectionType 64 // Namespace: http://www.vmware.com/vcloud/v1.5 65 // Description: Represents a vApp template customization settings. 66 // Since: 1.0 67 type CustomizationSection struct { 68 // FIXME: OVF Section needs to be laid down correctly 69 Info string `xml:"ovf:Info"` 70 // 71 GoldMaster bool `xml:"goldMaster,attr,omitempty"` 72 HREF string `xml:"href,attr,omitempty"` 73 Type string `xml:"type,attr,omitempty"` 74 CustomizeOnInstantiate bool `xml:"CustomizeOnInstantiate"` 75 Link LinkList `xml:"Link,omitempty"` 76 } 77 78 // LeaseSettingsSection represents vApp lease settings. 79 // Type: LeaseSettingsSectionType 80 // Namespace: http://www.vmware.com/vcloud/v1.5 81 // Description: Represents vApp lease settings. 82 // Since: 0.9 83 type LeaseSettingsSection struct { 84 HREF string `xml:"href,attr,omitempty"` 85 Type string `xml:"type,attr,omitempty"` 86 DeploymentLeaseExpiration string `xml:"DeploymentLeaseExpiration,omitempty"` 87 DeploymentLeaseInSeconds int `xml:"DeploymentLeaseInSeconds,omitempty"` 88 Link *Link `xml:"Link,omitempty"` 89 StorageLeaseExpiration string `xml:"StorageLeaseExpiration,omitempty"` 90 StorageLeaseInSeconds int `xml:"StorageLeaseInSeconds,omitempty"` 91 } 92 93 // UpdateLeaseSettingsSection is an extended version of LeaseSettingsSection 94 // with additional fields for update 95 type UpdateLeaseSettingsSection struct { 96 XMLName xml.Name `xml:"LeaseSettingsSection"` 97 XmlnsOvf string `xml:"xmlns:ovf,attr,omitempty"` 98 Xmlns string `xml:"xmlns,attr,omitempty"` 99 OVFInfo string `xml:"ovf:Info"` 100 HREF string `xml:"href,attr,omitempty"` 101 Type string `xml:"type,attr,omitempty"` 102 DeploymentLeaseExpiration string `xml:"DeploymentLeaseExpiration,omitempty"` 103 DeploymentLeaseInSeconds *int `xml:"DeploymentLeaseInSeconds,omitempty"` 104 Link *Link `xml:"Link,omitempty"` 105 StorageLeaseExpiration string `xml:"StorageLeaseExpiration,omitempty"` 106 StorageLeaseInSeconds *int `xml:"StorageLeaseInSeconds,omitempty"` 107 } 108 109 // IPRange represents a range of IP addresses, start and end inclusive. 110 // Type: IpRangeType 111 // Namespace: http://www.vmware.com/vcloud/v1.5 112 // Description: Represents a range of IP addresses, start and end inclusive. 113 // Since: 0.9 114 type IPRange struct { 115 StartAddress string `xml:"StartAddress"` // Start address of the IP range. 116 EndAddress string `xml:"EndAddress"` // End address of the IP range. 117 } 118 119 // DhcpService represents a DHCP network service. 120 // Type: DhcpServiceType 121 // Namespace: http://www.vmware.com/vcloud/v1.5 122 // Description: Represents a DHCP network service. 123 // Since: 124 type DhcpService struct { 125 IsEnabled bool `xml:"IsEnabled"` // Enable or disable the service using this flag 126 DefaultLeaseTime int `xml:"DefaultLeaseTime,omitempty"` // Default lease in seconds for DHCP addresses. 127 MaxLeaseTime int `xml:"MaxLeaseTime"` // Max lease in seconds for DHCP addresses. 128 IPRange *IPRange `xml:"IpRange"` // IP range for DHCP addresses. 129 RouterIP string `xml:"RouterIp,omitempty"` // Router IP. 130 SubMask string `xml:"SubMask,omitempty"` // The subnet mask. 131 PrimaryNameServer string `xml:"PrimaryNameServer,omitempty"` // The primary name server. 132 SecondaryNameServer string `xml:"SecondaryNameServer,omitempty"` // The secondary name server. 133 DomainName string `xml:"DomainName,omitempty"` // The domain name. 134 } 135 136 // NetworkFeatures represents features of a network. 137 // Type: NetworkFeaturesType 138 // Namespace: http://www.vmware.com/vcloud/v1.5 139 // Description: Represents features of a network. 140 // Since: 141 type NetworkFeatures struct { 142 DhcpService *DhcpService `xml:"DhcpService,omitempty"` // Substitute for NetworkService. DHCP service settings 143 FirewallService *FirewallService `xml:"FirewallService,omitempty"` // Substitute for NetworkService. Firewall service settings 144 NatService *NatService `xml:"NatService,omitempty"` // Substitute for NetworkService. NAT service settings 145 StaticRoutingService *StaticRoutingService `xml:"StaticRoutingService,omitempty"` // Substitute for NetworkService. Static Routing service settings 146 // TODO: Not Implemented 147 // IpsecVpnService IpsecVpnService `xml:"IpsecVpnService,omitempty"` // Substitute for NetworkService. Ipsec Vpn service settings 148 } 149 150 // IPAddresses a list of IP addresses 151 // Type: IpAddressesType 152 // Namespace: http://www.vmware.com/vcloud/v1.5 153 // Description: A list of IP addresses. 154 // Since: 0.9 155 type IPAddresses struct { 156 IPAddress []string `xml:"IpAddress,omitempty"` // A list of IP addresses. 157 } 158 159 // IPRanges represents a list of IP ranges. 160 // Type: IpRangesType 161 // Namespace: http://www.vmware.com/vcloud/v1.5 162 // Description: Represents a list of IP ranges. 163 // Since: 0.9 164 type IPRanges struct { 165 IPRange []*IPRange `xml:"IpRange,omitempty"` // IP range. 166 } 167 168 // IPScope specifies network settings like gateway, network mask, DNS servers IP ranges etc 169 // Type: IpScopeType 170 // Namespace: http://www.vmware.com/vcloud/v1.5 171 // Description: Specify network settings like gateway, network mask, DNS servers, IP ranges, etc. 172 // Since: 0.9 173 type IPScope struct { 174 IsInherited bool `xml:"IsInherited"` // True if the IP scope is inherit from parent network. 175 Gateway string `xml:"Gateway,omitempty"` // Gateway of the network. 176 Netmask string `xml:"Netmask,omitempty"` // Network mask. 177 SubnetPrefixLength string `xml:"SubnetPrefixLength,omitempty"` // Prefix length. 178 DNS1 string `xml:"Dns1,omitempty"` // Primary DNS server. 179 DNS2 string `xml:"Dns2,omitempty"` // Secondary DNS server. 180 DNSSuffix string `xml:"DnsSuffix,omitempty"` // DNS suffix. 181 IsEnabled bool `xml:"IsEnabled,omitempty"` // Indicates if subnet is enabled or not. Default value is True. 182 IPRanges *IPRanges `xml:"IpRanges,omitempty"` // IP ranges used for static pool allocation in the network. 183 AllocatedIPAddresses *IPAddresses `xml:"AllocatedIpAddresses,omitempty"` // Read-only list of allocated IP addresses in the network. 184 SubAllocations *SubAllocations `xml:"SubAllocations,omitempty"` // Read-only list of IP addresses that are sub allocated to edge gateways. 185 } 186 187 // SubAllocations a list of IP addresses that are sub allocated to edge gateways. 188 // Type: SubAllocationsType 189 // Namespace: http://www.vmware.com/vcloud/v1.5 190 // Description: A list of IP addresses that are sub allocated to edge gateways. 191 // Since: 5.1 192 type SubAllocations struct { 193 // Attributes 194 HREF string `xml:"href,attr,omitempty"` // The URI of the entity. 195 Type string `xml:"type,attr,omitempty"` // The MIME type of the entity. 196 // Elements 197 Link LinkList `xml:"Link,omitempty"` // A reference to an entity or operation associated with this object. 198 SubAllocation *SubAllocation `xml:"SubAllocation,omitempty"` // IP Range sub allocated to a edge gateway. 199 } 200 201 // SubAllocation IP range sub allocated to an edge gateway. 202 // Type: SubAllocationType 203 // Namespace: http://www.vmware.com/vcloud/v1.5 204 // Description: IP range sub allocated to an edge gateway. 205 // Since: 5.1 206 type SubAllocation struct { 207 EdgeGateway *Reference `xml:"EdgeGateway,omitempty"` // Edge gateway that uses this sub allocation. 208 IPRanges *IPRanges `xml:"IpRanges,omitempty"` // IP range sub allocated to the edge gateway. 209 } 210 211 // IPScopes represents a list of IP scopes. 212 // Type: IpScopesType 213 // Namespace: http://www.vmware.com/vcloud/v1.5 214 // Description: Represents a list of IP scopes. 215 // Since: 5.1 216 type IPScopes struct { 217 IPScope []*IPScope `xml:"IpScope"` // IP scope. 218 } 219 220 // NetworkConfiguration is the configuration applied to a network. This is an abstract base type. 221 // The concrete types include those for vApp and Organization wide networks. 222 // Type: NetworkConfigurationType 223 // Namespace: http://www.vmware.com/vcloud/v1.5 224 // Description: The configurations applied to a network. This is an abstract base type. The concrete types include those for vApp and Organization wide networks. 225 // Since: 0.9 226 type NetworkConfiguration struct { 227 Xmlns string `xml:"xmlns,attr,omitempty"` 228 BackwardCompatibilityMode bool `xml:"BackwardCompatibilityMode"` 229 IPScopes *IPScopes `xml:"IpScopes,omitempty"` 230 ParentNetwork *Reference `xml:"ParentNetwork,omitempty"` 231 FenceMode string `xml:"FenceMode"` 232 RetainNetInfoAcrossDeployments *bool `xml:"RetainNetInfoAcrossDeployments,omitempty"` 233 Features *NetworkFeatures `xml:"Features,omitempty"` 234 235 // SubInterface and DistributedInterface are mutually exclusive 236 // When they are both nil, it means the "internal" interface (the default) will be used. 237 // When one of them is set, the corresponding interface will be used. 238 // They cannot be both set (we'll get an API error if we do). 239 SubInterface *bool `xml:"SubInterface,omitempty"` 240 DistributedInterface *bool `xml:"DistributedInterface,omitempty"` 241 GuestVlanAllowed *bool `xml:"GuestVlanAllowed,omitempty"` 242 // TODO: Not Implemented 243 // RouterInfo RouterInfo `xml:"RouterInfo,omitempty"` 244 // SyslogServerSettings SyslogServerSettings `xml:"SyslogServerSettings,omitempty"` 245 } 246 247 // VAppNetworkConfiguration represents a vApp network configuration 248 // Used in vApp network configuration actions as part of vApp type, 249 // VApp.NetworkConfigSection.NetworkConfig or directly as NetworkConfigSection.NetworkConfig for various API calls. 250 // Type: VAppNetworkConfigurationType 251 // Namespace: http://www.vmware.com/vcloud/v1.5 252 // Description: Represents a vApp network configuration. 253 // Since: 0.9 254 type VAppNetworkConfiguration struct { 255 HREF string `xml:"href,attr,omitempty"` 256 Type string `xml:"type,attr,omitempty"` 257 ID string `xml:"id,attr,omitempty"` 258 NetworkName string `xml:"networkName,attr"` 259 260 Link *Link `xml:"Link,omitempty"` 261 Description string `xml:"Description,omitempty"` 262 Configuration *NetworkConfiguration `xml:"Configuration"` 263 IsDeployed bool `xml:"IsDeployed"` 264 } 265 266 // VAppNetwork represents a vApp network configuration 267 // Used as input PUT /network/{id} 268 // Type: VAppNetworkType 269 // Namespace: http://www.vmware.com/vcloud/v1.5 270 // Description: Represents a vApp network configuration. 271 // Since: 0.9 272 type VAppNetwork struct { 273 Xmlns string `xml:"xmlns,attr,omitempty"` 274 HREF string `xml:"href,attr,omitempty"` 275 Type string `xml:"type,attr,omitempty"` 276 ID string `xml:"id,attr,omitempty"` 277 Name string `xml:"name,attr"` 278 Deployed *bool `xml:"deployed,attr"` // True if the network is deployed. 279 280 Link *Link `xml:"Link,omitempty"` 281 Description string `xml:"Description,omitempty"` 282 Tasks *TasksInProgress `xml:"Tasks,omitempty"` 283 Configuration *NetworkConfiguration `xml:"Configuration"` 284 } 285 286 // NetworkConfigSection is container for vApp networks. 287 // Type: NetworkConfigSectionType 288 // Namespace: http://www.vmware.com/vcloud/v1.5 289 // Description: Container for vApp networks. 290 // Since: 0.9 291 type NetworkConfigSection struct { 292 // Extends OVF Section_Type 293 // FIXME: Fix the OVF section 294 XMLName xml.Name `xml:"NetworkConfigSection"` 295 Xmlns string `xml:"xmlns,attr,omitempty"` 296 Ovf string `xml:"xmlns:ovf,attr,omitempty"` 297 298 Info string `xml:"ovf:Info"` 299 // 300 HREF string `xml:"href,attr,omitempty"` 301 Type string `xml:"type,attr,omitempty"` 302 Link *Link `xml:"Link,omitempty"` 303 NetworkConfig []VAppNetworkConfiguration `xml:"NetworkConfig,omitempty"` 304 } 305 306 // NetworkNames allows to extract network names 307 func (n NetworkConfigSection) NetworkNames() []string { 308 var list []string 309 for _, netConfig := range n.NetworkConfig { 310 list = append(list, netConfig.NetworkName) 311 } 312 return list 313 } 314 315 // NetworkConnection represents a network connection in the virtual machine. 316 // Type: NetworkConnectionType 317 // Namespace: http://www.vmware.com/vcloud/v1.5 318 // Description: Represents a network connection in the virtual machine. 319 // Since: 0.9 320 type NetworkConnection struct { 321 Network string `xml:"network,attr"` // Name of the network to which this NIC is connected. 322 NeedsCustomization bool `xml:"needsCustomization,attr,omitempty"` // True if this NIC needs customization. 323 NetworkConnectionIndex int `xml:"NetworkConnectionIndex"` // Virtual slot number associated with this NIC. First slot number is 0. 324 IPAddress string `xml:"IpAddress,omitempty"` // IP address assigned to this NIC. 325 ExternalIPAddress string `xml:"ExternalIpAddress,omitempty"` // If the network to which this NIC connects provides NAT services, the external address assigned to this NIC appears here. 326 IsConnected bool `xml:"IsConnected"` // If the virtual machine is undeployed, this value specifies whether the NIC should be connected upon deployment. If the virtual machine is deployed, this value reports the current status of this NIC's connection, and can be updated to change that connection status. 327 MACAddress string `xml:"MACAddress,omitempty"` // MAC address associated with the NIC. 328 IPAddressAllocationMode string `xml:"IpAddressAllocationMode"` // IP address allocation mode for this connection. One of: POOL (A static IP address is allocated automatically from a pool of addresses.) DHCP (The IP address is obtained from a DHCP service.) MANUAL (The IP address is assigned manually in the IpAddress element.) NONE (No IP addressing mode specified.) 329 NetworkAdapterType string `xml:"NetworkAdapterType,omitempty"` 330 } 331 332 // NetworkConnectionSection the container for the network connections of this virtual machine. 333 // Type: NetworkConnectionSectionType 334 // Namespace: http://www.vmware.com/vcloud/v1.5 335 // Description: Container for the network connections of this virtual machine. 336 // Since: 0.9 337 type NetworkConnectionSection struct { 338 // Extends OVF Section_Type 339 // FIXME: Fix the OVF section 340 XMLName xml.Name `xml:"NetworkConnectionSection"` 341 Xmlns string `xml:"xmlns,attr,omitempty"` 342 Ovf string `xml:"xmlns:ovf,attr,omitempty"` 343 344 Info string `xml:"ovf:Info"` 345 // 346 HREF string `xml:"href,attr,omitempty"` 347 Type string `xml:"type,attr,omitempty"` 348 PrimaryNetworkConnectionIndex int `xml:"PrimaryNetworkConnectionIndex"` 349 NetworkConnection []*NetworkConnection `xml:"NetworkConnection,omitempty"` 350 Link *Link `xml:"Link,omitempty"` 351 } 352 353 // InstantiationParams is a container for ovf:Section_Type elements that specify vApp configuration on instantiate, compose, or recompose. 354 // Type: InstantiationParamsType 355 // Namespace: http://www.vmware.com/vcloud/v1.5 356 // Description: Container for ovf:Section_Type elements that specify vApp configuration on instantiate, compose, or recompose. 357 // Since: 0.9 358 type InstantiationParams struct { 359 CustomizationSection *CustomizationSection `xml:"CustomizationSection,omitempty"` 360 DefaultStorageProfileSection *DefaultStorageProfileSection `xml:"DefaultStorageProfileSection,omitempty"` 361 GuestCustomizationSection *GuestCustomizationSection `xml:"GuestCustomizationSection,omitempty"` 362 LeaseSettingsSection *LeaseSettingsSection `xml:"LeaseSettingsSection,omitempty"` 363 NetworkConfigSection *NetworkConfigSection `xml:"NetworkConfigSection,omitempty"` 364 NetworkConnectionSection *NetworkConnectionSection `xml:"NetworkConnectionSection,omitempty"` 365 ProductSection *ProductSection `xml:"ProductSection,omitempty"` 366 // TODO: Not Implemented 367 // SnapshotSection SnapshotSection `xml:"SnapshotSection,omitempty"` 368 } 369 370 // OrgVDCNetwork represents an Org VDC network in the vCloud model. 371 // Type: OrgVdcNetworkType 372 // Namespace: http://www.vmware.com/vcloud/v1.5 373 // Description: Represents an Org VDC network in the vCloud model. 374 // Since: 5.1 375 type OrgVDCNetwork struct { 376 XMLName xml.Name `xml:"OrgVdcNetwork"` 377 Xmlns string `xml:"xmlns,attr,omitempty"` 378 HREF string `xml:"href,attr,omitempty"` 379 Type string `xml:"type,attr,omitempty"` 380 ID string `xml:"id,attr,omitempty"` 381 OperationKey string `xml:"operationKey,attr,omitempty"` 382 Name string `xml:"name,attr"` 383 Status string `xml:"status,attr,omitempty"` 384 Link []Link `xml:"Link,omitempty"` 385 Description string `xml:"Description,omitempty"` 386 Configuration *NetworkConfiguration `xml:"Configuration,omitempty"` 387 EdgeGateway *Reference `xml:"EdgeGateway,omitempty"` 388 ServiceConfig *GatewayFeatures `xml:"ServiceConfig,omitempty"` // Specifies the service configuration for an isolated Org VDC networks 389 IsShared bool `xml:"IsShared"` 390 VimPortGroupRef []*VimObjectRef `xml:"VimPortGroupRef,omitempty"` // Needed to set up DHCP inside ServiceConfig 391 Tasks *TasksInProgress `xml:"Tasks,omitempty"` 392 } 393 394 // SupportedHardwareVersions contains a list of VMware virtual hardware versions supported in this vDC. 395 // Type: SupportedHardwareVersionsType 396 // Namespace: http://www.vmware.com/vcloud/v1.5 397 // Description: Contains a list of VMware virtual hardware versions supported in this vDC. 398 // Since: 1.5 399 type SupportedHardwareVersions struct { 400 SupportedHardwareVersion []Reference `xml:"SupportedHardwareVersion,omitempty"` // A virtual hardware version supported in this vDC. 401 } 402 403 // Capabilities collection of supported hardware capabilities. 404 // Type: CapabilitiesType 405 // Namespace: http://www.vmware.com/vcloud/v1.5 406 // Description: Collection of supported hardware capabilities. 407 // Since: 1.5 408 type Capabilities struct { 409 SupportedHardwareVersions *SupportedHardwareVersions `xml:"SupportedHardwareVersions,omitempty" json:"supportedHardwareVersions,omitempty"` // Read-only list of virtual hardware versions supported by this vDC. 410 } 411 412 // Vdc represents the user view of an organization VDC. 413 // Type: VdcType 414 // Namespace: http://www.vmware.com/vcloud/v1.5 415 // Description: Represents the user view of an organization VDC. 416 // Since: 0.9 417 type Vdc struct { 418 HREF string `xml:"href,attr,omitempty"` 419 Type string `xml:"type,attr,omitempty"` 420 ID string `xml:"id,attr,omitempty"` 421 OperationKey string `xml:"operationKey,attr,omitempty"` 422 Name string `xml:"name,attr"` 423 Status int `xml:"status,attr,omitempty"` 424 425 Link LinkList `xml:"Link,omitempty"` 426 Description string `xml:"Description,omitempty"` 427 Tasks *TasksInProgress `xml:"Tasks,omitempty"` 428 AllocationModel string `xml:"AllocationModel"` 429 ComputeCapacity []*ComputeCapacity `xml:"ComputeCapacity"` 430 ResourceEntities []*ResourceEntities `xml:"ResourceEntities,omitempty"` 431 AvailableNetworks []*AvailableNetworks `xml:"AvailableNetworks,omitempty"` 432 Capabilities []*Capabilities `xml:"Capabilities,omitempty"` 433 NicQuota int `xml:"NicQuota"` 434 NetworkQuota int `xml:"NetworkQuota"` 435 UsedNetworkCount int `xml:"UsedNetworkCount,omitempty"` 436 VMQuota int `xml:"VmQuota"` 437 IsEnabled bool `xml:"IsEnabled"` 438 VdcStorageProfiles *VdcStorageProfiles `xml:"VdcStorageProfiles"` 439 DefaultComputePolicy *Reference `xml:"DefaultComputePolicy"` 440 } 441 442 // AdminVdc represents the admin view of an organization VDC. 443 // Type: AdminVdcType 444 // Namespace: http://www.vmware.com/vcloud/v1.5 445 // Description: Represents the admin view of an organization VDC. 446 // Since: 0.9 447 type AdminVdc struct { 448 Xmlns string `xml:"xmlns,attr"` 449 Vdc 450 451 VCpuInMhz2 *int64 `xml:"VCpuInMhz2,omitempty"` 452 ResourceGuaranteedMemory *float64 `xml:"ResourceGuaranteedMemory,omitempty"` 453 ResourceGuaranteedCpu *float64 `xml:"ResourceGuaranteedCpu,omitempty"` 454 VCpuInMhz *int64 `xml:"VCpuInMhz,omitempty"` 455 IsThinProvision *bool `xml:"IsThinProvision,omitempty"` 456 NetworkPoolReference *Reference `xml:"NetworkPoolReference,omitempty"` 457 ProviderVdcReference *Reference `xml:"ProviderVdcReference"` 458 459 // ResourcePoolRefs is a read-only field and should be avoided in XML structure for write 460 // operations because it breaks on Go marshalling bug https://github.com/golang/go/issues/9519 461 ResourcePoolRefs *VimObjectRefs `xml:"ResourcePoolRefs,omitempty"` 462 UsesFastProvisioning *bool `xml:"UsesFastProvisioning,omitempty"` 463 OverCommitAllowed bool `xml:"OverCommitAllowed,omitempty"` 464 VmDiscoveryEnabled bool `xml:"VmDiscoveryEnabled,omitempty"` 465 IsElastic *bool `xml:"IsElastic,omitempty"` // Supported from 32.0 for the Flex model 466 IncludeMemoryOverhead *bool `xml:"IncludeMemoryOverhead,omitempty"` // Supported from 32.0 for the Flex model 467 UniversalNetworkPoolReference *Reference `xml:"UniversalNetworkPoolReference,omitempty"` // Reference to a universal network pool 468 } 469 470 // ProviderVdc represents a Provider VDC. 471 // Type: ProviderVdcType 472 // Namespace: http://www.vmware.com/vcloud/v1.5 473 // Description: Represents a Provider VDC. 474 // Since: 0.9 475 type ProviderVdc struct { 476 HREF string `xml:"href,attr,omitempty" json:"href,omitempty"` 477 Type string `xml:"type,attr,omitempty" json:"type,omitempty"` 478 ID string `xml:"id,attr,omitempty" json:"id,omitempty"` 479 OperationKey string `xml:"operationKey,attr,omitempty" json:"operationKey,omitempty"` 480 Name string `xml:"name,attr" json:"name"` 481 Status int `xml:"status,attr,omitempty" json:"status,omitempty"` // -1 (creation failed), 0 (not ready), 1 (ready), 2 (unknown), 3 (unrecognized) 482 483 AvailableNetworks *AvailableNetworks `xml:"AvailableNetworks,omitempty" json:"availableNetworks,omitempty"` // Read-only list of available networks. 484 Capabilities *Capabilities `xml:"Capabilities,omitempty" json:"capabilities,omitempty"` // Read-only list of virtual hardware versions supported by this Provider VDC. 485 ComputeCapacity *RootComputeCapacity `xml:"ComputeCapacity,omitempty" json:"computeCapacity,omitempty"` // Read-only indicator of CPU and memory capacity. 486 Description string `xml:"Description,omitempty" json:"description,omitempty"` // Optional description. 487 IsEnabled *bool `xml:"IsEnabled,omitempty" json:"isEnabled,omitempty"` // True if this Provider VDC is enabled and can provide resources to organization VDCs. A Provider VDC is always enabled on creation. 488 Link *LinkList `xml:"Link,omitempty" json:"link,omitempty"` // A reference to an entity or operation associated with this object. 489 NetworkPoolReferences *NetworkPoolReferences `xml:"NetworkPoolReferences,omitempty" json:"networkPoolReferences,omitempty"` // Read-only list of network pools used by this Provider VDC. 490 StorageProfiles *ProviderStorageProfiles `xml:"StorageProfiles,omitempty" json:"storageProfiles,omitempty"` // Container for references to vSphere storage profiles available to this Provider VDC. 491 Tasks *TasksInProgress `xml:"Tasks,omitempty" json:"tasks,omitempty"` // A list of queued, running, or recently completed tasks associated with this entity. 492 } 493 494 // VMWProviderVdc represents an extension of ProviderVdc. 495 // Type: VMWProviderVdcType 496 // Namespace: http://www.vmware.com/vcloud/v1.5 497 // Description: Represents an extension of ProviderVdc. 498 // Since: 1.0 499 type VMWProviderVdc struct { 500 ProviderVdc 501 502 AvailableUniversalNetworkPool *Reference `xml:"AvailableUniversalNetworkPool,omitempty" json:"availableUniversalNetworkPool,omitempty"` // Selectable universal network reference. 503 ComputeProviderScope string `xml:"ComputeProviderScope,omitempty" json:"computeProviderScope,omitempty"` // The compute provider scope represents the compute fault domain for this provider VDC. This value is a tenant-facing tag that is shown to tenants when viewing fault domains of the child Organization VDCs (for ex. a VDC Group). 504 DataStoreRefs VimObjectRefs `xml:"DataStoreRefs" json:"dataStoreRefs"` // vSphere datastores backing this provider VDC. 505 HighestSupportedHardwareVersion string `xml:"HighestSupportedHardwareVersion,omitempty" json:"highestSupportedHardwareVersion,omitempty"` // The highest virtual hardware version supported by this Provider VDC. If empty or omitted on creation, the system sets it to the highest virtual hardware version supported by all hosts in the primary resource pool. You can modify it when you add more resource pools. 506 HostReferences *VMWHostReferences `xml:"HostReferences,omitempty" json:"hostReferences,omitempty"` // Shows all hosts which are connected to VC server. 507 NsxTManagerReference *Reference `xml:"NsxTManagerReference,omitempty" json:"nsxTManagerReference,omitempty"` // An optional reference to a registered NSX-T Manager to back networking operations for this provider VDC. 508 ResourcePoolRefs *VimObjectRefs `xml:"ResourcePoolRefs,omitempty" json:"resourcePoolRefs,omitempty"` // Resource pools backing this provider VDC. On create, you must specify a resource pool that is not used by (and is not the child of a resource pool used by) any other provider VDC. On modify, this element is required for schema validation, but its contents cannot be changed. 509 VimServer []*Reference `xml:"VimServer,omitempty" json:"vimServer,omitempty"` // The vCenter server that provides the resource pools and datastores. A valid reference is required on create. On modify, this element is required for schema validation, but its contents cannot be changed. 510 } 511 512 // VMWHostReferences represents a list of available hosts. 513 // Type: VMWHostReferencesType 514 // Namespace: http://www.vmware.com/vcloud/v1.5 515 // Description: Represents a list of available hosts. 516 // Since: 1.0 517 type VMWHostReferences struct { 518 HostReference []*Reference `xml:"HostReference,omitempty" json:"hostReference,omitempty"` 519 Link *Link `xml:"Link,omitempty" json:"link,omitempty"` 520 } 521 522 // RootComputeCapacity represents compute capacity with units. 523 // Type: RootComputeCapacityType 524 // Namespace: http://www.vmware.com/vcloud/v1.5 525 // Description: Represents compute capacity with units. 526 // Since: 0.9 527 type RootComputeCapacity struct { 528 Cpu *ProviderVdcCapacity `xml:"Cpu" json:"cpu"` 529 IsElastic bool `xml:"IsElastic,omitempty" json:"isElastic,omitempty"` 530 IsHA bool `xml:"IsHA,omitempty" json:"isHA,omitempty"` 531 Memory *ProviderVdcCapacity `xml:"Memory" json:"memory"` 532 } 533 534 // NetworkPoolReferences is a container for references to network pools in this vDC. 535 // Type: NetworkPoolReferencesType 536 // Namespace: http://www.vmware.com/vcloud/v1.5 537 // Description: Container for references to network pools in this vDC. 538 // Since: 0.9 539 type NetworkPoolReferences struct { 540 NetworkPoolReference []*Reference `xml:"NetworkPoolReference" json:"networkPoolReference"` 541 } 542 543 // ProviderStorageProfiles is a container for references to storage profiles associated with a Provider vDC. 544 // Type: ProviderVdcStorageProfilesType 545 // Namespace: http://www.vmware.com/vcloud/v1.5 546 // Description: Container for references to storage profiles associated with a Provider vDC. 547 // Since: 0.9 548 type ProviderStorageProfiles struct { 549 ProviderVdcStorageProfile []*Reference `xml:"ProviderVdcStorageProfile" json:"providerVdcStorageProfile,omitempty"` 550 } 551 552 // ProviderVdcCapacity represents resource capacity in a Provider vDC. 553 // Type: ProviderVdcCapacityType 554 // Namespace: http://www.vmware.com/vcloud/v1.5 555 // Description: Represents resource capacity in a Provider vDC. 556 // Since: 0.9 557 type ProviderVdcCapacity struct { 558 Allocation int64 `xml:"Allocation,omitempty"` 559 Overhead int64 `xml:"Overhead,omitempty"` 560 Reserved int64 `xml:"Reserved,omitempty"` 561 Total int64 `xml:"Total,omitempty"` 562 Units string `xml:"Units"` 563 Used int64 `xml:"Used,omitempty"` 564 } 565 566 // VdcStorageProfileConfiguration represents the parameters to assign a storage profile in creation of organization vDC. 567 // Type: VdcStorageProfileParamsType 568 // Namespace: http://www.vmware.com/vcloud/v1.5 569 // Description: Represents the parameters to create a storage profile in an organization vDC. 570 // Since: 5.1 571 // https://code.vmware.com/apis/220/vcloud#/doc/doc/types/VdcStorageProfileParamsType.html 572 type VdcStorageProfileConfiguration struct { 573 Enabled *bool `xml:"Enabled,omitempty"` 574 Units string `xml:"Units"` 575 Limit int64 `xml:"Limit"` 576 Default bool `xml:"Default"` 577 ProviderVdcStorageProfile *Reference `xml:"ProviderVdcStorageProfile"` 578 } 579 580 // VdcStorageProfile represents the parameters for fetched storage profile 581 // Type: VdcStorageProfileParamsType 582 // Namespace: http://www.vmware.com/vcloud/v1.5 583 // https://vdc-repo.vmware.com/vmwb-repository/dcr-public/7a028e78-bd37-4a6a-8298-9c26c7eeb9aa/09142237-dd46-4dee-8326-e07212fb63a8/doc/doc/types/VdcStorageProfileType.html 584 // https://vdc-repo.vmware.com/vmwb-repository/dcr-public/71e12563-bc11-4d64-821d-92d30f8fcfa1/7424bf8e-aec2-44ad-be7d-b98feda7bae0/doc/doc/types/AdminVdcStorageProfileType.html 585 type VdcStorageProfile struct { 586 ID string `xml:"id,attr"` 587 Xmlns string `xml:"xmlns,attr"` 588 Name string `xml:"name,attr"` 589 Enabled *bool `xml:"Enabled,omitempty"` 590 Units string `xml:"Units"` 591 Limit int64 `xml:"Limit"` 592 Default bool `xml:"Default"` 593 IopsSettings *VdcStorageProfileIopsSettings `xml:"IopsSettings"` 594 StorageUsedMB int64 `xml:"StorageUsedMB"` 595 IopsAllocated int64 `xml:"IopsAllocated"` 596 ProviderVdcStorageProfile *Reference `xml:"ProviderVdcStorageProfile"` 597 } 598 599 // AdminVdcStorageProfile represents the parameters for fetched storage profile 600 // Type: AdminVdcStorageProfileType 601 // Namespace: http://www.vmware.com/vcloud/v1.5 602 // https://vdc-repo.vmware.com/vmwb-repository/dcr-public/71e12563-bc11-4d64-821d-92d30f8fcfa1/7424bf8e-aec2-44ad-be7d-b98feda7bae0/doc/doc/types/AdminVdcStorageProfileType.html 603 type AdminVdcStorageProfile struct { 604 Xmlns string `xml:"xmlns,attr"` 605 Name string `xml:"name,attr"` 606 Enabled *bool `xml:"Enabled,omitempty"` 607 Units string `xml:"Units"` 608 Limit int64 `xml:"Limit"` 609 Default bool `xml:"Default"` 610 IopsSettings *VdcStorageProfileIopsSettings `xml:"IopsSettings"` 611 StorageUsedMB int64 `xml:"StorageUsedMB"` 612 IopsAllocated int64 `xml:"IopsAllocated"` 613 ProviderVdcStorageProfile *Reference `xml:"ProviderVdcStorageProfile"` 614 } 615 616 // VdcStorageProfileIopsSettings represents the parameters for VDC storage profiles Iops settings. 617 // Type: VdcStorageProfileIopsSettings 618 // https://vdc-repo.vmware.com/vmwb-repository/dcr-public/71e12563-bc11-4d64-821d-92d30f8fcfa1/7424bf8e-aec2-44ad-be7d-b98feda7bae0/doc/doc/types/VdcStorageProfileIopsSettingsType.html 619 type VdcStorageProfileIopsSettings struct { 620 Xmlns string `xml:"xmlns,attr"` 621 Enabled bool `xml:"Enabled"` 622 DiskIopsMax int64 `xml:"DiskIopsMax"` 623 DiskIopsDefault int64 `xml:"DiskIopsDefault"` 624 StorageProfileIopsLimit int64 `xml:"StorageProfileIopsLimit,omitempty"` 625 DiskIopsPerGbMax int64 `xml:"DiskIopsPerGbMax"` 626 } 627 628 // VdcConfiguration models the payload for creating a VDC. 629 // Type: CreateVdcParamsType 630 // Namespace: http://www.vmware.com/vcloud/v1.5 631 // Description: Parameters for creating an organization VDC 632 // Since: 5.1 633 // https://code.vmware.com/apis/220/vcloud#/doc/doc/types/CreateVdcParamsType.html 634 type VdcConfiguration struct { 635 XMLName xml.Name `xml:"CreateVdcParams"` 636 Xmlns string `xml:"xmlns,attr"` 637 Name string `xml:"name,attr"` 638 Description string `xml:"Description,omitempty"` 639 AllocationModel string `xml:"AllocationModel"` // Flex supported from 32.0 640 ComputeCapacity []*ComputeCapacity `xml:"ComputeCapacity"` 641 NicQuota int `xml:"NicQuota,omitempty"` 642 NetworkQuota int `xml:"NetworkQuota,omitempty"` 643 VmQuota int `xml:"VmQuota,omitempty"` 644 IsEnabled bool `xml:"IsEnabled,omitempty"` 645 // Create uses VdcStorageProfileConfiguration and fetch AdminVdcStorageProfile or VdcStorageProfile 646 VdcStorageProfile []*VdcStorageProfileConfiguration `xml:"VdcStorageProfile"` 647 ResourceGuaranteedMemory *float64 `xml:"ResourceGuaranteedMemory,omitempty"` 648 ResourceGuaranteedCpu *float64 `xml:"ResourceGuaranteedCpu,omitempty"` 649 VCpuInMhz int64 `xml:"VCpuInMhz,omitempty"` 650 IsThinProvision bool `xml:"IsThinProvision,omitempty"` 651 NetworkPoolReference *Reference `xml:"NetworkPoolReference,omitempty"` 652 ProviderVdcReference *Reference `xml:"ProviderVdcReference"` 653 UsesFastProvisioning bool `xml:"UsesFastProvisioning,omitempty"` 654 OverCommitAllowed bool `xml:"OverCommitAllowed,omitempty"` 655 VmDiscoveryEnabled bool `xml:"VmDiscoveryEnabled,omitempty"` 656 IsElastic *bool `xml:"IsElastic,omitempty"` // Supported from 32.0 for the Flex model 657 IncludeMemoryOverhead *bool `xml:"IncludeMemoryOverhead,omitempty"` // Supported from 32.0 for the Flex model 658 } 659 660 // Task represents an asynchronous operation in VMware Cloud Director. 661 // Type: TaskType 662 // Namespace: http://www.vmware.com/vcloud/v1.5 663 // Description: Represents an asynchronous operation in VMware Cloud Director.u 664 // Since: 0.9 665 // Comments added from https://code.vmware.com/apis/912/vmware-cloud-director/doc/doc/types/TaskType.html 666 type Task struct { 667 HREF string `xml:"href,attr,omitempty" json:"HREF,omitempty"` // The URI of the entity. 668 Type string `xml:"type,attr,omitempty" json:"type,omitempty"` // The MIME type of the entity. 669 ID string `xml:"id,attr,omitempty" json:"ID,omitempty"` // The entity identifier, expressed in URN format. The value of this attribute uniquely identifies the entity, persists for the life of the entity, and is never reused. 670 OperationKey string `xml:"operationKey,attr,omitempty" json:"operationKey,omitempty"` // Optional unique identifier to support idempotent semantics for create and delete operations. 671 Name string `xml:"name,attr" json:"name,omitempty"` // The name of the entity. 672 Status string `xml:"status,attr" json:"status,omitempty"` // The execution status of the task. One of queued, preRunning, running, success, error, aborted 673 Operation string `xml:"operation,attr,omitempty" json:"operation,omitempty"` // A message describing the operation that is tracked by this task. 674 OperationName string `xml:"operationName,attr,omitempty" json:"operationName,omitempty"` // The short name of the operation that is tracked by this task. 675 ServiceNamespace string `xml:"serviceNamespace,attr,omitempty" json:"serviceNamespace,omitempty"` // Identifier of the service that created the task. It must not start with com.vmware.vcloud and the length must be between 1 and 128 symbols. 676 StartTime string `xml:"startTime,attr,omitempty" json:"startTime,omitempty"` // The date and time the system started executing the task. May not be present if the task has not been executed yet. 677 EndTime string `xml:"endTime,attr,omitempty" json:"endTime,omitempty"` // The date and time that processing of the task was completed. May not be present if the task is still being executed. 678 ExpiryTime string `xml:"expiryTime,attr,omitempty" json:"expiryTime,omitempty"` // The date and time at which the task resource will be destroyed and no longer available for retrieval. May not be present if the task has not been executed or is still being executed. 679 CancelRequested bool `xml:"cancelRequested,attr,omitempty" json:"cancelRequested,omitempty"` // Whether user has requested this processing to be canceled. 680 Link *LinkList `xml:"Link,omitempty" json:"link,omitempty"` // A reference to an entity or operation associated with this object. 681 Description string `xml:"Description,omitempty" json:"description,omitempty"` // Optional description. 682 Tasks *TasksInProgress `xml:"Tasks,omitempty" json:"tasks,omitempty"` // A list of queued, running, or recently completed tasks associated with this entity. 683 Owner *Reference `xml:"Owner,omitempty" json:"owner,omitempty"` // Reference to the owner of the task. This is typically the object that the task is creating or updating. 684 Error *Error `xml:"Error,omitempty" json:"error,omitempty"` // Represents error information from a failed task. 685 User *Reference `xml:"User,omitempty" json:"user,omitempty"` // The user who started the task. 686 Organization *Reference `xml:"Organization,omitempty" json:"organization,omitempty"` // The organization to which the User belongs. 687 Progress int `xml:"Progress,omitempty" json:"progress,omitempty"` // Read-only indicator of task progress as an approximate percentage between 0 and 100. Not available for all tasks. 688 Details string `xml:"Details,omitempty" json:"details,omitempty"` // Detailed message about the task. Also contained by the Owner entity when task status is preRunning. 689 Result *TaskResult `xml:"Result,omitempty" json:"result,omitempty"` // Result contains additional details that the task may expose 690 // 691 // TODO: add the following fields 692 // Params anyType The parameters with which this task was started. 693 // VcTaskList VcTaskListType List of Virtual Center tasks related to this vCD task. 694 } 695 696 // TaskResult contains additional details that the task may expose after finishing 697 type TaskResult struct { 698 ResultContent struct { 699 Text string `xml:",chardata"` 700 Xsi string `xml:"xsi,attr"` 701 Ns11 string `xml:"ns11,attr"` 702 Type string `xml:"type,attr"` 703 } `xml:"ResultContent"` 704 } 705 706 // CapacityWithUsage represents a capacity and usage of a given resource. 707 // Type: CapacityWithUsageType 708 // Namespace: http://www.vmware.com/vcloud/v1.5 709 // Description: Represents a capacity and usage of a given resource. 710 // Since: 0.9 711 type CapacityWithUsage struct { 712 Units string `xml:"Units"` 713 Allocated int64 `xml:"Allocated"` 714 Limit int64 `xml:"Limit"` 715 Reserved int64 `xml:"Reserved,omitempty"` 716 Used int64 `xml:"Used,omitempty"` 717 } 718 719 // ComputeCapacity represents VDC compute capacity. 720 // Type: ComputeCapacityType 721 // Namespace: http://www.vmware.com/vcloud/v1.5 722 // Description: Represents VDC compute capacity. 723 // Since: 0.9 724 type ComputeCapacity struct { 725 CPU *CapacityWithUsage `xml:"Cpu"` 726 Memory *CapacityWithUsage `xml:"Memory"` 727 } 728 729 // Reference is a reference to a resource. Contains an href attribute and optional name and type attributes. 730 // Type: ReferenceType 731 // Namespace: http://www.vmware.com/vcloud/v1.5 732 // Description: A reference to a resource. Contains an href attribute and optional name and type attributes. 733 // Since: 0.9 734 type Reference struct { 735 HREF string `xml:"href,attr,omitempty" json:"href,omitempty"` 736 ID string `xml:"id,attr,omitempty" json:"id,omitempty"` 737 Type string `xml:"type,attr,omitempty" json:"type,omitempty"` 738 Name string `xml:"name,attr,omitempty" json:"name,omitempty"` 739 } 740 741 // ResourceReference represents a reference to a resource. Contains an href attribute, a resource status attribute, and optional name and type attributes. 742 // Type: ResourceReferenceType 743 // Namespace: http://www.vmware.com/vcloud/v1.5 744 // Description: Represents a reference to a resource. Contains an href attribute, a resource status attribute, and optional name and type attributes. 745 // Since: 0.9 746 type ResourceReference struct { 747 HREF string `xml:"href,attr"` 748 ID string `xml:"id,attr,omitempty"` 749 Type string `xml:"type,attr,omitempty"` 750 Name string `xml:"name,attr,omitempty"` 751 Status string `xml:"status,attr,omitempty"` 752 } 753 754 // VdcStorageProfiles is a container for references to storage profiles associated with a vDC. 755 // Element: VdcStorageProfiles 756 // Type: VdcStorageProfilesType 757 // Namespace: http://www.vmware.com/vcloud/v1.5 758 // Description: Container for references to storage profiles associated with a vDC. 759 // Since: 5.1 760 type VdcStorageProfiles struct { 761 VdcStorageProfile []*Reference `xml:"VdcStorageProfile,omitempty"` 762 } 763 764 // ResourceEntities is a container for references to ResourceEntity objects in this vDC. 765 // Type: ResourceEntitiesType 766 // Namespace: http://www.vmware.com/vcloud/v1.5 767 // Description: Container for references to ResourceEntity objects in this vDC. 768 // Since: 0.9 769 type ResourceEntities struct { 770 ResourceEntity []*ResourceReference `xml:"ResourceEntity,omitempty"` 771 } 772 773 // AvailableNetworks is a container for references to available organization vDC networks. 774 // Type: AvailableNetworksType 775 // Namespace: http://www.vmware.com/vcloud/v1.5 776 // Description: Container for references to available organization vDC networks. 777 // Since: 0.9 778 type AvailableNetworks struct { 779 Network []*Reference `xml:"Network,omitempty" json:"network,omitempty"` 780 } 781 782 // Link extends reference type by adding relation attribute. Defines a hyper-link with a relationship, hyper-link reference, and an optional MIME type. 783 // Type: LinkType 784 // Namespace: http://www.vmware.com/vcloud/v1.5 785 // Description: Extends reference type by adding relation attribute. Defines a hyper-link with a relationship, hyper-link reference, and an optional MIME type. 786 // Since: 0.9 787 type Link struct { 788 HREF string `xml:"href,attr" json:"href,omitempty"` 789 ID string `xml:"id,attr,omitempty" json:"id,omitempty"` 790 Type string `xml:"type,attr,omitempty" json:"type,omitempty"` 791 Name string `xml:"name,attr,omitempty" json:"name,omitempty"` 792 Rel string `xml:"rel,attr" json:"rel,omitempty"` 793 } 794 795 // OrgList represents a lists of Organizations 796 // Type: OrgType 797 // Namespace: http://www.vmware.com/vcloud/v1.5 798 // Description: Represents a list of VMware Cloud Director organizations. 799 // Since: 0.9 800 type OrgList struct { 801 Link LinkList `xml:"Link,omitempty"` 802 Org []*Org `xml:"Org,omitempty"` 803 } 804 805 // Org represents the user view of a VMware Cloud Director organization. 806 // Type: OrgType 807 // Namespace: http://www.vmware.com/vcloud/v1.5 808 // Description: Represents the user view of a VMware Cloud Director organization. 809 // Since: 0.9 810 type Org struct { 811 HREF string `xml:"href,attr,omitempty"` 812 Type string `xml:"type,attr,omitempty"` 813 ID string `xml:"id,attr,omitempty"` 814 OperationKey string `xml:"operationKey,attr,omitempty"` 815 Name string `xml:"name,attr"` 816 Description string `xml:"Description,omitempty"` 817 FullName string `xml:"FullName"` 818 IsEnabled bool `xml:"IsEnabled,omitempty"` 819 Link LinkList `xml:"Link,omitempty"` 820 Tasks *TasksInProgress `xml:"Tasks,omitempty"` 821 } 822 823 // List of the users within the organization 824 type OrgUserList struct { 825 User []*Reference `xml:"UserReference,omitempty"` 826 } 827 828 type OrgGroupList struct { 829 Group []*Reference `xml:"GroupReference,omitempty"` 830 } 831 832 // List of available roles in the organization 833 type OrgRoleType struct { 834 RoleReference []*Reference `xml:"RoleReference,omitempty"` 835 } 836 837 // List of available rights in the organization 838 type RightsType struct { 839 Links LinkList `xml:"Link,omitempty"` 840 RightReference []*Reference `xml:"RightReference,omitempty"` 841 } 842 843 // AdminOrg represents the admin view of a VMware Cloud Director organization. 844 // Type: AdminOrgType 845 // Namespace: http://www.vmware.com/vcloud/v1.5 846 // Description: Represents the admin view of a VMware Cloud Director organization. 847 // Since: 0.9 848 type AdminOrg struct { 849 XMLName xml.Name `xml:"AdminOrg"` 850 Xmlns string `xml:"xmlns,attr"` 851 HREF string `xml:"href,attr,omitempty"` 852 Type string `xml:"type,attr,omitempty"` 853 ID string `xml:"id,attr,omitempty"` 854 OperationKey string `xml:"operationKey,attr,omitempty"` 855 Name string `xml:"name,attr"` 856 Description string `xml:"Description,omitempty"` 857 FullName string `xml:"FullName"` 858 IsEnabled bool `xml:"IsEnabled,omitempty"` 859 Link LinkList `xml:"Link,omitempty"` 860 Tasks *TasksInProgress `xml:"Tasks,omitempty"` 861 Users *OrgUserList `xml:"Users,omitempty"` 862 Groups *OrgGroupList `xml:"Groups,omitempty"` 863 Catalogs *CatalogsList `xml:"Catalogs,omitempty"` 864 OrgSettings *OrgSettings `xml:"Settings,omitempty"` 865 Vdcs *VDCList `xml:"Vdcs,omitempty"` 866 Networks *NetworksList `xml:"Networks,omitempty"` 867 RightReferences *OrgRoleType `xml:"RightReferences,omitempty"` 868 RoleReferences *OrgRoleType `xml:"RoleReferences,omitempty"` 869 } 870 871 // OrgSettingsType represents the settings for a VMware Cloud Director organization. 872 // Type: OrgSettingsType 873 // Namespace: http://www.vmware.com/vcloud/v1.5 874 // Description: Represents the settings of a VMware Cloud Director organization. 875 // Since: 0.9 876 type OrgSettings struct { 877 //attributes 878 HREF string `xml:"href,attr,omitempty"` // The URI of the entity. 879 Type string `xml:"type,attr,omitempty"` // The MIME type of the entity. 880 //elements 881 Link LinkList `xml:"Link,omitempty"` // A reference to an entity or operation associated with this object. 882 OrgGeneralSettings *OrgGeneralSettings `xml:"OrgGeneralSettings,omitempty"` // General Settings for the org, not-required 883 OrgVAppLeaseSettings *VAppLeaseSettings `xml:"VAppLeaseSettings,omitempty"` 884 OrgVAppTemplateSettings *VAppTemplateLeaseSettings `xml:"VAppTemplateLeaseSettings,omitempty"` // Vapp template lease settings, not required 885 OrgLdapSettings *OrgLdapSettingsType `xml:"OrgLdapSettings,omitempty"` //LDAP settings, not-requried, defaults to none 886 887 } 888 889 // OrgGeneralSettingsType represents the general settings for a VMware Cloud Director organization. 890 // Type: OrgGeneralSettingsType 891 // Namespace: http://www.vmware.com/vcloud/v1.5 892 // Description: Represents the user view of a VMware Cloud Director organization. 893 // Since: 0.9 894 type OrgGeneralSettings struct { 895 HREF string `xml:"href,attr,omitempty"` // The URI of the entity. 896 Type string `xml:"type,attr,omitempty"` // The MIME type of the entity. 897 Link LinkList `xml:"Link,omitempty"` // A reference to an entity or operation associated with this object. 898 899 CanPublishCatalogs bool `xml:"CanPublishCatalogs,omitempty"` 900 CanPublishExternally bool `xml:"CanPublishExternally,omitempty"` 901 CanSubscribe bool `xml:"CanSubscribe,omitempty"` 902 DeployedVMQuota int `xml:"DeployedVMQuota,omitempty"` 903 StoredVMQuota int `xml:"StoredVmQuota,omitempty"` 904 UseServerBootSequence bool `xml:"UseServerBootSequence,omitempty"` 905 DelayAfterPowerOnSeconds int `xml:"DelayAfterPowerOnSeconds,omitempty"` 906 } 907 908 // VAppTemplateLeaseSettings represents the vapp template lease settings for a VMware Cloud Director organization. 909 // Type: VAppTemplateLeaseSettingsType 910 // Namespace: http://www.vmware.com/vcloud/v1.5 911 // Description: Represents the vapp template lease settings of a VMware Cloud Director organization. 912 // Since: 0.9 913 type VAppTemplateLeaseSettings struct { 914 HREF string `xml:"href,attr,omitempty"` // The URI of the entity. 915 Type string `xml:"type,attr,omitempty"` // The MIME type of the entity. 916 Link LinkList `xml:"Link,omitempty"` // A reference to an entity or operation associated with this object. 917 918 DeleteOnStorageLeaseExpiration *bool `xml:"DeleteOnStorageLeaseExpiration,omitempty"` 919 StorageLeaseSeconds *int `xml:"StorageLeaseSeconds,omitempty"` 920 } 921 922 type VAppLeaseSettings struct { 923 HREF string `xml:"href,attr,omitempty"` // The URI of the entity. 924 Type string `xml:"type,attr,omitempty"` // The MIME type of the entity. 925 Link LinkList `xml:"Link,omitempty"` // A reference to an entity or operation associated with this object. 926 927 DeleteOnStorageLeaseExpiration *bool `xml:"DeleteOnStorageLeaseExpiration,omitempty"` 928 DeploymentLeaseSeconds *int `xml:"DeploymentLeaseSeconds,omitempty"` 929 StorageLeaseSeconds *int `xml:"StorageLeaseSeconds,omitempty"` 930 PowerOffOnRuntimeLeaseExpiration *bool `xml:"PowerOffOnRuntimeLeaseExpiration,omitempty"` 931 } 932 933 // OrgLdapSettingsType represents the ldap settings for a VMware Cloud Director organization. 934 // Type: OrgLdapSettingsType 935 // Namespace: http://www.vmware.com/vcloud/v1.5 936 // Description: Represents the ldap settings of a VMware Cloud Director organization. 937 // Since: 0.9 938 type OrgLdapSettingsType struct { 939 XMLName xml.Name `xml:"OrgLdapSettings"` 940 Xmlns string `xml:"xmlns,attr,omitempty"` 941 HREF string `xml:"href,attr,omitempty"` // The URI of the entity. 942 Type string `xml:"type,attr,omitempty"` // The MIME type of the entity. 943 Link LinkList `xml:"Link,omitempty"` // A reference to an entity or operation associated with this object. 944 945 OrgLdapMode string `xml:"OrgLdapMode,omitempty"` // LDAP mode you want 946 CustomUsersOu string `xml:"CustomUsersOu,omitempty"` // If OrgLdapMode is SYSTEM, specifies an LDAP attribute=value pair to use for OU (organizational unit). 947 CustomOrgLdapSettings *CustomOrgLdapSettings `xml:"CustomOrgLdapSettings,omitempty"` // Needs to be set if user chooses custom mode 948 } 949 950 // CustomOrgLdapSettings represents the custom ldap settings for a VMware Cloud Director organization. 951 // Type: CustomOrgLdapSettingsType 952 // Namespace: http://www.vmware.com/vcloud/v1.5 953 // Description: Represents the custom ldap settings of a VMware Cloud Director organization. 954 // Since: 0.9 955 // Note. Order of these fields matter and API will error if it is changed 956 type CustomOrgLdapSettings struct { 957 HREF string `xml:"href,attr,omitempty"` // The URI of the entity. 958 Type string `xml:"type,attr,omitempty"` // The MIME type of the entity. 959 Link LinkList `xml:"Link,omitempty"` // A reference to an entity or operation associated with this object. 960 961 HostName string `xml:"HostName,omitempty"` 962 Port int `xml:"Port"` 963 IsSsl bool `xml:"IsSsl,omitempty"` 964 IsSslAcceptAll bool `xml:"IsSslAcceptAll,omitempty"` 965 SearchBase string `xml:"SearchBase,omitempty"` 966 Username string `xml:"UserName,omitempty"` 967 Password string `xml:"Password,omitempty"` 968 AuthenticationMechanism string `xml:"AuthenticationMechanism"` 969 IsGroupSearchBaseEnabled bool `xml:"IsGroupSearchBaseEnabled"` 970 GroupSearchBase string `xml:"GroupSearchBase,omitempty"` 971 ConnectorType string `xml:"ConnectorType"` // Defines LDAP service implementation type 972 UserAttributes *OrgLdapUserAttributes `xml:"UserAttributes"` // Defines how LDAP attributes are used when importing a user. 973 GroupAttributes *OrgLdapGroupAttributes `xml:"GroupAttributes"` // Defines how LDAP attributes are used when importing a group. 974 UseExternalKerberos bool `xml:"UseExternalKerberos"` 975 976 Realm string `xml:"Realm,omitempty"` 977 } 978 979 // OrgLdapGroupAttributes represents the ldap group attribute settings for a VMware Cloud Director organization. 980 // Type: OrgLdapGroupAttributesType 981 // Namespace: http://www.vmware.com/vcloud/v1.5 982 // Description: Represents the ldap group attribute settings of a VMware Cloud Director organization. 983 // Since: 0.9 984 // Note. Order of these fields matter and API will error if it is changed 985 type OrgLdapGroupAttributes struct { 986 ObjectClass string `xml:"ObjectClass"` 987 ObjectIdentifier string `xml:"ObjectIdentifier"` 988 GroupName string `xml:"GroupName"` 989 Membership string `xml:"Membership"` 990 MembershipIdentifier string `xml:"MembershipIdentifier"` 991 BackLinkIdentifier string `xml:"BackLinkIdentifier,omitempty"` 992 } 993 994 // OrgLdapUserAttributesType represents the ldap user attribute settings for a VMware Cloud Director organization. 995 // Type: OrgLdapUserAttributesType 996 // Namespace: http://www.vmware.com/vcloud/v1.5 997 // Description: Represents the ldap user attribute settings of a VMware Cloud Director organization. 998 // Since: 0.9 999 // Note. Order of these fields matter and API will error if it is changed. 1000 type OrgLdapUserAttributes struct { 1001 ObjectClass string `xml:"ObjectClass"` 1002 ObjectIdentifier string `xml:"ObjectIdentifier"` 1003 Username string `xml:"UserName,omitempty"` 1004 Email string `xml:"Email"` 1005 FullName string `xml:"FullName"` 1006 GivenName string `xml:"GivenName"` 1007 Surname string `xml:"Surname"` 1008 Telephone string `xml:"Telephone"` 1009 GroupMembershipIdentifier string `xml:"GroupMembershipIdentifier"` 1010 GroupBackLinkIdentifier string `xml:"GroupBackLinkIdentifier,omitempty"` 1011 } 1012 1013 // VDCList contains a list of references to Org VDCs 1014 // Type: VdcListType 1015 // Namespace: http://www.vmware.com/vcloud/v1.5 1016 // Description: Represents a list of organization vDCs. 1017 // Since: 0.9 1018 type VDCList struct { 1019 Vdcs []*Reference `xml:"Vdc,omitempty" json:"vdcs,omitempty"` 1020 } 1021 1022 // NetworksListType contains a list of references to Org Networks 1023 // Type: NetworksListType 1024 // Namespace: http://www.vmware.com/vcloud/v1.5 1025 // Description: Represents a list of organization Networks. 1026 // Since: 0.9 1027 type NetworksList struct { 1028 Networks []*Reference `xml:"Network,omitempty"` 1029 } 1030 1031 // CatalogsList contains a list of references to Org Catalogs 1032 // Type: CatalogsListType 1033 // Namespace: http://www.vmware.com/vcloud/v1.5 1034 // Description: Represents a list of organization Catalogs. 1035 // Since: 0.9 1036 type CatalogsList struct { 1037 Catalog []*Reference `xml:"CatalogReference,omitempty"` 1038 } 1039 1040 // CatalogItem contains a reference to a VappTemplate or Media object and related metadata. 1041 // Type: CatalogItemType 1042 // Namespace: http://www.vmware.com/vcloud/v1.5 1043 // Description: Contains a reference to a VappTemplate or Media object and related metadata. 1044 // Since: 0.9 1045 type CatalogItem struct { 1046 HREF string `xml:"href,attr,omitempty"` 1047 Type string `xml:"type,attr,omitempty"` 1048 ID string `xml:"id,attr,omitempty"` 1049 OperationKey string `xml:"operationKey,attr,omitempty"` 1050 Name string `xml:"name,attr"` 1051 Size int64 `xml:"size,attr,omitempty"` 1052 DateCreated string `xml:"DateCreated,omitempty"` 1053 Description string `xml:"Description,omitempty"` 1054 Entity *Entity `xml:"Entity"` 1055 Link LinkList `xml:"Link,omitempty"` 1056 Tasks *TasksInProgress `xml:"Tasks,omitempty"` 1057 VersionNumber int64 `xml:"VersionNumber,omitempty"` 1058 } 1059 1060 // Entity is a basic entity type in the vCloud object model. Includes a name, an optional description, and an optional list of links. 1061 // Type: EntityType 1062 // Namespace: http://www.vmware.com/vcloud/v1.5 1063 // Description: Basic entity type in the vCloud object model. Includes a name, an optional description, and an optional list of links. 1064 // Since: 0.9 1065 type Entity struct { 1066 HREF string `xml:"href,attr,omitempty"` 1067 Type string `xml:"type,attr,omitempty"` 1068 ID string `xml:"id,attr,omitempty"` 1069 OperationKey string `xml:"operationKey,attr,omitempty"` 1070 Name string `xml:"name,attr"` 1071 Description string `xml:"Description,omitempty"` 1072 Link LinkList `xml:"Link,omitempty"` 1073 Tasks *TasksInProgress `xml:"Tasks,omitempty"` 1074 } 1075 1076 // CatalogItems is a container for references to catalog items. 1077 // Type: CatalogItemsType 1078 // Namespace: http://www.vmware.com/vcloud/v1.5 1079 // Description: Container for references to catalog items. 1080 // Since: 0.9 1081 type CatalogItems struct { 1082 CatalogItem []*Reference `xml:"CatalogItem"` 1083 } 1084 1085 // Catalog represents the user view of a Catalog object. 1086 // Type: CatalogType 1087 // Namespace: http://www.vmware.com/vcloud/v1.5 1088 // Description: Represents the user view of a Catalog object. 1089 // https://code.vmware.com/apis/287/vcloud#/doc/doc/types/CatalogType.html 1090 // Since: 0.9 1091 type Catalog struct { 1092 HREF string `xml:"href,attr,omitempty"` 1093 Type string `xml:"type,attr,omitempty"` 1094 ID string `xml:"id,attr,omitempty"` 1095 OperationKey string `xml:"operationKey,attr,omitempty"` 1096 Name string `xml:"name,attr"` 1097 CatalogItems []*CatalogItems `xml:"CatalogItems,omitempty"` 1098 DateCreated string `xml:"DateCreated,omitempty"` 1099 Description string `xml:"Description,omitempty"` 1100 IsPublished bool `xml:"IsPublished,omitempty"` 1101 Link LinkList `xml:"Link,omitempty"` 1102 Owner *Owner `xml:"Owner,omitempty"` 1103 Tasks *TasksInProgress `xml:"Tasks,omitempty"` 1104 VersionNumber int64 `xml:"VersionNumber,omitempty"` 1105 PublishExternalCatalogParams *PublishExternalCatalogParams `xml:"PublishExternalCatalogParams,omitempty"` 1106 } 1107 1108 // AdminCatalog represents the Admin view of a Catalog object. 1109 // Type: AdminCatalogType 1110 // Namespace: http://www.vmware.com/vcloud/v1.5 1111 // Description: Represents the Admin view of a Catalog object. 1112 // https://code.vmware.com/apis/287/vcloud#/doc/doc/types/AdminCatalogType.html 1113 // Since: 0.9 1114 type AdminCatalog struct { 1115 Catalog 1116 XMLName xml.Name `xml:"AdminCatalog"` 1117 Xmlns string `xml:"xmlns,attr"` 1118 PublishExternalCatalogParams *PublishExternalCatalogParams `xml:"PublishExternalCatalogParams,omitempty"` 1119 CatalogStorageProfiles *CatalogStorageProfiles `xml:"CatalogStorageProfiles,omitempty"` 1120 ExternalCatalogSubscription *ExternalCatalogSubscription `xml:"ExternalCatalogSubscriptionParams,omitempty"` 1121 IsPublished bool `xml:"IsPublished,omitempty"` 1122 } 1123 1124 // PublishExternalCatalogParamsType represents the configuration parameters of a catalog published externally 1125 // Type: PublishExternalCatalogParamsType 1126 // Namespace: http://www.vmware.com/vcloud/v1.5 1127 // Description: Represents the configuration parameters of a catalog published externally. 1128 // Since: 5.5 1129 type PublishExternalCatalogParams struct { 1130 Xmlns string `xml:"xmlns,attr,omitempty"` 1131 IsPublishedExternally *bool `xml:"IsPublishedExternally,omitempty"` // True enables external publication as configured by these parameters. 1132 CatalogPublishedUrl string `xml:"catalogPublishedUrl,omitempty"` // Read-only endpoint URL supplied by the server. External subscribers can connect to the catalog at this URL. 1133 Password string `xml:"Password,omitempty"` // Password required when connecting to the endpoint. 1134 IsCachedEnabled *bool `xml:"IsCacheEnabled,omitempty"` // True enables content caching for this catalog. All items in the catalog are created and stored in transfer storage. If false, items are not placed in transfer storage until they are requested by a subscriber. Note that access to this attribute is reserved to users with role that includes the right 'Catalog: VCSP Publish Subscribe Caching'. 1135 PreserveIdentityInfoFlag *bool `xml:"PreserveIdentityInfoFlag,omitempty"` // True includes BIOS UUIDs and MAC addresses in the downloaded OVF package. If false, those information will be excluded. 1136 } 1137 1138 // PublishCatalogParams represents the configuration parameters of a catalog published to other orgs. 1139 // It is used in conjunction with the "IsPublished" state of the catalog itself 1140 type PublishCatalogParams struct { 1141 XMLName xml.Name `xml:"PublishCatalogParams"` 1142 Xmlns string `xml:"xmlns,attr,omitempty"` 1143 IsPublished *bool `xml:"IsPublished,omitempty"` // True enables publication (read-only access) 1144 } 1145 1146 // ExternalCatalogSubscription represents the configuration parameters for a catalog that has an external subscription 1147 // Type: ExternalCatalogSubscriptionParamsType 1148 // Namespace: http://www.vmware.com/vcloud/v1.5 1149 // Description: Represents the configuration parameters for a catalog that has an external subscription. 1150 // Since: 5.5 1151 type ExternalCatalogSubscription struct { 1152 XMLName xml.Name `xml:"ExternalCatalogSubscriptionParams"` 1153 Xmlns string `xml:"xmlns,attr,omitempty"` 1154 ExpectedSslThumbprint string `xml:"ExpectedSslThumbprint,omitempty"` 1155 SubscribeToExternalFeeds bool `xml:"SubscribeToExternalFeeds,omitempty"` 1156 Location string `xml:"Location,omitempty"` 1157 Password string `xml:"Password,omitempty"` 1158 LocalCopy bool `xml:"LocalCopy,omitempty"` 1159 } 1160 1161 // CatalogStorageProfiles represents a container for storage profiles used by this catalog 1162 // Type: CatalogStorageProfiles 1163 // Namespace: http://www.vmware.com/vcloud/v1.5 1164 // Description: Represents a container for storage profiles used by this catalog 1165 // Since: 5.5 1166 type CatalogStorageProfiles struct { 1167 VdcStorageProfile []*Reference `xml:"VdcStorageProfile,omitempty"` 1168 } 1169 1170 // Owner represents the owner of this entity. 1171 // Type: OwnerType 1172 // Namespace: http://www.vmware.com/vcloud/v1.5 1173 // Description: Represents the owner of this entity. 1174 // Since: 1.5 1175 type Owner struct { 1176 HREF string `xml:"href,attr,omitempty"` 1177 Type string `xml:"type,attr,omitempty"` 1178 Link LinkList `xml:"Link,omitempty"` 1179 User *Reference `xml:"User"` 1180 } 1181 1182 // Error is the standard error message type used in the vCloud REST API. 1183 // Type: ErrorType 1184 // Namespace: http://www.vmware.com/vcloud/v1.5 1185 // Description: The standard error message type used in the vCloud REST API. 1186 // Since: 0.9 1187 type Error struct { 1188 Message string `xml:"message,attr" json:"message,omitempty"` 1189 MajorErrorCode int `xml:"majorErrorCode,attr" json:"majorErrorCode,omitempty"` 1190 MinorErrorCode string `xml:"minorErrorCode,attr" json:"minorErrorCode,omitempty"` 1191 VendorSpecificErrorCode string `xml:"vendorSpecificErrorCode,attr,omitempty" json:"vendorSpecificErrorCode,omitempty"` 1192 StackTrace string `xml:"stackTrace,attr,omitempty" json:"stackTrace,omitempty"` 1193 } 1194 1195 func (err Error) Error() string { 1196 return fmt.Sprintf("API Error: %d: %s", err.MajorErrorCode, err.Message) 1197 } 1198 1199 // NSXError is the standard error message type used in the NSX API which is proxied by vCD. 1200 // It has attached method `Error() string` and implements Go's default `type error` interface. 1201 type NSXError struct { 1202 XMLName xml.Name `xml:"error"` 1203 ErrorCode string `xml:"errorCode"` 1204 Details string `xml:"details"` 1205 ModuleName string `xml:"moduleName"` 1206 } 1207 1208 // Error method implements Go's default `error` interface for NSXError and formats NSX error 1209 // output for human readable output. 1210 func (nsxErr NSXError) Error() string { 1211 return fmt.Sprintf("%s %s (API error: %s)", nsxErr.ModuleName, nsxErr.Details, nsxErr.ErrorCode) 1212 } 1213 1214 // File represents a file to be transferred (uploaded or downloaded). 1215 // Type: FileType 1216 // Namespace: http://www.vmware.com/vcloud/v1.5 1217 // Description: Represents a file to be transferred (uploaded or downloaded). 1218 // Since: 0.9 1219 type File struct { 1220 HREF string `xml:"href,attr,omitempty"` 1221 Type string `xml:"type,attr,omitempty"` 1222 ID string `xml:"id,attr,omitempty"` 1223 OperationKey string `xml:"operationKey,attr,omitempty"` 1224 Name string `xml:"name,attr"` 1225 Size int64 `xml:"size,attr,omitempty"` 1226 BytesTransferred int64 `xml:"bytesTransferred,attr,omitempty"` 1227 Checksum string `xml:"checksum,attr,omitempty"` 1228 Description string `xml:"Description,omitempty"` 1229 Link LinkList `xml:"Link,omitempty"` 1230 Tasks *TasksInProgress `xml:"Tasks,omitempty"` 1231 } 1232 1233 // FilesList represents a list of files to be transferred (uploaded or downloaded). 1234 // Type: FilesListType 1235 // Namespace: http://www.vmware.com/vcloud/v1.5 1236 // Description: Represents a list of files to be transferred (uploaded or downloaded). 1237 // Since: 0.9 1238 type FilesList struct { 1239 File []*File `xml:"File"` 1240 } 1241 1242 // UndeployVAppParams parameters to an undeploy vApp request. 1243 // Type: UndeployVAppParamsType 1244 // Namespace: http://www.vmware.com/vcloud/v1.5 1245 // Description: Parameters to an undeploy vApp request. 1246 // Since: 0.9 1247 type UndeployVAppParams struct { 1248 Xmlns string `xml:"xmlns,attr"` 1249 UndeployPowerAction string `xml:"UndeployPowerAction,omitempty"` 1250 } 1251 1252 // VmCapabilities allows you to specify certain capabilities of this virtual machine. 1253 // Type: VmCapabilitiesType 1254 // Namespace: http://www.vmware.com/vcloud/v1.5 1255 // Description: Allows you to specify certain capabilities of this virtual machine. 1256 // Since: 5.1 1257 type VmCapabilities struct { 1258 Xmlns string `xml:"xmlns,attr"` 1259 HREF string `xml:"href,attr,omitempty"` 1260 Type string `xml:"type,attr,omitempty"` 1261 MemoryHotAddEnabled bool `xml:"MemoryHotAddEnabled,omitempty"` 1262 CPUHotAddEnabled bool `xml:"CpuHotAddEnabled,omitempty"` 1263 Link LinkList `xml:"Link,omitempty"` 1264 } 1265 1266 // VMs represents a list of virtual machines. 1267 // Type: VmsType 1268 // Namespace: http://www.vmware.com/vcloud/v1.5 1269 // Description: Represents a list of virtual machines. 1270 // Since: 5.1 1271 type VMs struct { 1272 HREF string `xml:"href,attr,omitempty"` 1273 Type string `xml:"type,attr,omitempty"` 1274 Link LinkList `xml:"Link,omitempty"` 1275 VMReference []*Reference `xml:"VmReference,omitempty"` 1276 } 1277 1278 /* 1279 * Types that are completely valid (position, comment, coverage complete) 1280 */ 1281 1282 // ComposeVAppParams represents vApp composition parameters 1283 // Type: ComposeVAppParamsType 1284 // Namespace: http://www.vmware.com/vcloud/v1.5 1285 // Description: Represents vApp composition parameters. 1286 // Since: 0.9 1287 type ComposeVAppParams struct { 1288 XMLName xml.Name `xml:"ComposeVAppParams"` 1289 Ovf string `xml:"xmlns:ovf,attr"` 1290 Xsi string `xml:"xmlns:xsi,attr"` 1291 Xmlns string `xml:"xmlns,attr"` 1292 // Attributes 1293 Name string `xml:"name,attr,omitempty"` // Typically used to name or identify the subject of the request. For example, the name of the object being created or modified. 1294 Deploy bool `xml:"deploy,attr"` // True if the vApp should be deployed at instantiation. Defaults to true. 1295 PowerOn bool `xml:"powerOn,attr"` // True if the vApp should be powered-on at instantiation. Defaults to true. 1296 LinkedClone bool `xml:"linkedClone,attr,omitempty"` // Reserved. Unimplemented. 1297 // Elements 1298 Description string `xml:"Description,omitempty"` // Optional description. 1299 VAppParent *Reference `xml:"VAppParent,omitempty"` // Reserved. Unimplemented. 1300 InstantiationParams *InstantiationParams `xml:"InstantiationParams,omitempty"` // Instantiation parameters for the composed vApp. 1301 SourcedItem *SourcedCompositionItemParam `xml:"SourcedItem,omitempty"` // Composition item. One of: vApp vAppTemplate VM. 1302 AllEULAsAccepted bool `xml:"AllEULAsAccepted,omitempty"` // True confirms acceptance of all EULAs in a vApp template. Instantiation fails if this element is missing, empty, or set to false and one or more EulaSection elements are present. 1303 } 1304 1305 type ReComposeVAppParams struct { 1306 XMLName xml.Name `xml:"RecomposeVAppParams"` 1307 Ovf string `xml:"xmlns:ovf,attr"` 1308 Xsi string `xml:"xmlns:xsi,attr"` 1309 Xmlns string `xml:"xmlns,attr"` 1310 // Attributes 1311 Name string `xml:"name,attr,omitempty"` // Typically used to name or identify the subject of the request. For example, the name of the object being created or modified. 1312 Deploy bool `xml:"deploy,attr"` // True if the vApp should be deployed at instantiation. Defaults to true. 1313 PowerOn bool `xml:"powerOn,attr"` // True if the vApp should be powered-on at instantiation. Defaults to true. 1314 LinkedClone bool `xml:"linkedClone,attr,omitempty"` // Reserved. Unimplemented. 1315 // Elements 1316 Description string `xml:"Description,omitempty"` // Optional description. 1317 VAppParent *Reference `xml:"VAppParent,omitempty"` // Reserved. Unimplemented. 1318 InstantiationParams *InstantiationParams `xml:"InstantiationParams,omitempty"` // Instantiation parameters for the composed vApp. 1319 SourcedItem *SourcedCompositionItemParam `xml:"SourcedItem,omitempty"` // Composition item. One of: vApp vAppTemplate VM. 1320 AllEULAsAccepted bool `xml:"AllEULAsAccepted,omitempty"` 1321 DeleteItem *DeleteItem `xml:"DeleteItem,omitempty"` 1322 } 1323 1324 // SmallRecomposeVappParams is used to update name and description of a vApp 1325 // Using the full definition (ReComposeVAppParams), the description can be changed but not removed 1326 type SmallRecomposeVappParams struct { 1327 XMLName xml.Name `xml:"RecomposeVAppParams"` 1328 Ovf string `xml:"xmlns:ovf,attr"` 1329 Xsi string `xml:"xmlns:xsi,attr"` 1330 Xmlns string `xml:"xmlns,attr"` 1331 Name string `xml:"name,attr"` 1332 Deploy bool `xml:"deploy,attr"` 1333 Description string `xml:"Description"` 1334 } 1335 1336 type DeleteItem struct { 1337 HREF string `xml:"href,attr,omitempty"` 1338 } 1339 1340 // SourcedCompositionItemParam represents a vApp, vApp template or VM to include in a composed vApp. 1341 // Type: SourcedCompositionItemParamType 1342 // Namespace: http://www.vmware.com/vcloud/v1.5 1343 // Description: Represents a vApp, vApp template or VM to include in a composed vApp. 1344 // Since: 0.9 1345 type SourcedCompositionItemParam struct { 1346 // Attributes 1347 SourceDelete bool `xml:"sourceDelete,attr,omitempty"` // True if the source item should be deleted after composition is complete. 1348 // Elements 1349 Source *Reference `xml:"Source"` // Reference to a vApp, vApp template or virtual machine to include in the composition. Changing the name of the newly created VM by specifying name attribute is deprecated. Include VmGeneralParams element instead. 1350 VMGeneralParams *VMGeneralParams `xml:"VmGeneralParams,omitempty"` // Specify name, description, and other properties of a VM during instantiation. 1351 VAppScopedLocalID string `xml:"VAppScopedLocalId,omitempty"` // If Source references a VM, this value provides a unique identifier for the VM in the scope of the composed vApp. 1352 InstantiationParams *InstantiationParams `xml:"InstantiationParams,omitempty"` // If Source references a VM this can include any of the following OVF sections: VirtualHardwareSection OperatingSystemSection NetworkConnectionSection GuestCustomizationSection. 1353 NetworkAssignment []*NetworkAssignment `xml:"NetworkAssignment,omitempty"` // If Source references a VM, this element maps a network name specified in the VM to the network name of a vApp network defined in the composed vApp. 1354 StorageProfile *Reference `xml:"StorageProfile,omitempty"` // If Source references a VM, this element contains a reference to a storage profile to be used for the VM. The specified storage profile must exist in the organization vDC that contains the composed vApp. If not specified, the default storage profile for the vDC is used. 1355 LocalityParams *LocalityParams `xml:"LocalityParams,omitempty"` // Represents locality parameters. Locality parameters provide a hint that may help the placement engine optimize placement of a VM and an independent a Disk so that the VM can make efficient use of the disk. 1356 ComputePolicy *ComputePolicy `xml:"ComputePolicy,omitempty"` // accessible only from version API 33.0 1357 } 1358 1359 // LocalityParams represents locality parameters. Locality parameters provide a hint that may help the placement engine optimize placement of a VM with respect to another VM or an independent disk. 1360 // Type: LocalityParamsType 1361 // Namespace: http://www.vmware.com/vcloud/v1.5 1362 // Description: Represents locality parameters. Locality parameters provide a hint that may help the placement engine optimize placement of a VM with respect to another VM or an independent disk. 1363 // Since: 5.1 1364 type LocalityParams struct { 1365 // Elements 1366 ResourceEntity *Reference `xml:"ResourceEntity,omitempty"` // Reference to a Disk, or a VM. 1367 } 1368 1369 // NetworkAssignment maps a network name specified in a VM to the network name of a vApp network defined in the VApp that contains the VM 1370 // Type: NetworkAssignmentType 1371 // Namespace: http://www.vmware.com/vcloud/v1.5 1372 // Description: Maps a network name specified in a VM to the network name of a vApp network defined in the VApp that contains the VM 1373 // Since: 0.9 1374 type NetworkAssignment struct { 1375 // Attributes 1376 InnerNetwork string `xml:"innerNetwork,attr"` // Name of the network as specified in the VM. 1377 ContainerNetwork string `xml:"containerNetwork,attr"` // Name of the vApp network to map to. 1378 } 1379 1380 // VMGeneralParams a set of overrides to source VM properties to apply to target VM during copying. 1381 // Type: VmGeneralParamsType 1382 // Namespace: http://www.vmware.com/vcloud/v1.5 1383 // Description: A set of overrides to source VM properties to apply to target VM during copying. 1384 // Since: 5.6 1385 type VMGeneralParams struct { 1386 // Elements 1387 Name string `xml:"Name,omitempty"` // Name of VM 1388 Description string `xml:"Description,omitempty"` // VM description 1389 NeedsCustomization bool `xml:"NeedsCustomization,omitempty"` // True if this VM needs guest customization 1390 RegenerateBiosUuid bool `xml:"RegenerateBiosUuid,omitempty"` // True if BIOS UUID of the virtual machine should be regenerated so that it is unique, and not the same as the source virtual machine's BIOS UUID. 1391 } 1392 1393 // VApp represents a vApp 1394 // Type: VAppType 1395 // Namespace: http://www.vmware.com/vcloud/v1.5 1396 // Description: Represents a vApp. 1397 // Since: 0.9 1398 type VApp struct { 1399 // Attributes 1400 HREF string `xml:"href,attr,omitempty"` // The URI of the entity. 1401 Type string `xml:"type,attr,omitempty"` // The MIME type of the entity. 1402 ID string `xml:"id,attr,omitempty"` // The entity identifier, expressed in URN format. The value of this attribute uniquely identifies the entity, persists for the life of the entity, and is never reused. 1403 OperationKey string `xml:"operationKey,attr,omitempty"` // Optional unique identifier to support idempotent semantics for create and delete operations. 1404 Name string `xml:"name,attr"` // The name of the entity. 1405 Status int `xml:"status,attr,omitempty"` // Creation status of the resource entity. 1406 Deployed bool `xml:"deployed,attr,omitempty"` // True if the virtual machine is deployed. 1407 OvfDescriptorUploaded bool `xml:"ovfDescriptorUploaded,attr,omitempty"` // Read-only indicator that the OVF descriptor for this vApp has been uploaded. 1408 // Elements 1409 Link LinkList `xml:"Link,omitempty"` // A reference to an entity or operation associated with this object. 1410 LeaseSettingsSection *LeaseSettingsSection `xml:"LeaseSettingsSection,omitempty"` // A reference to the lease section of the vApp 1411 NetworkConfigSection *NetworkConfigSection `xml:"NetworkConfigSection,omitempty"` // Represents vAPP network configuration 1412 Description string `xml:"Description,omitempty"` // Optional description. 1413 Tasks *TasksInProgress `xml:"Tasks,omitempty"` // A list of queued, running, or recently completed tasks associated with this entity. 1414 Files *FilesList `xml:"Files,omitempty"` // Represents a list of files to be transferred (uploaded or downloaded). Each File in the list is part of the ResourceEntity. 1415 VAppParent *Reference `xml:"VAppParent,omitempty"` // Reserved. Unimplemented. 1416 // TODO: OVF Sections to be implemented 1417 // Section OVF_Section `xml:"Section"` 1418 DateCreated string `xml:"DateCreated,omitempty"` // Creation date/time of the vApp. 1419 Owner *Owner `xml:"Owner,omitempty"` // vApp owner. 1420 IsAutoNature bool `xml:"autoNature,omitempty"` // True if the vApp is auto generated with a standalone VM 1421 InMaintenanceMode bool `xml:"InMaintenanceMode,omitempty"` // True if this vApp is in maintenance mode. Prevents users from changing vApp metadata. 1422 Children *VAppChildren `xml:"Children,omitempty"` // Container for virtual machines included in this vApp. 1423 ProductSection *ProductSection `xml:"ProductSection,omitempty"` 1424 } 1425 1426 type ProductSectionList struct { 1427 XMLName xml.Name `xml:"ProductSectionList"` 1428 Ovf string `xml:"xmlns:ovf,attr,omitempty"` 1429 Xmlns string `xml:"xmlns,attr"` 1430 ProductSection *ProductSection `xml:"http://schemas.dmtf.org/ovf/envelope/1 ProductSection,omitempty"` 1431 } 1432 1433 // SortByPropertyKeyName allows to sort ProductSectionList property slice by key name as the API is 1434 // does not always return an ordered slice 1435 func (p *ProductSectionList) SortByPropertyKeyName() { 1436 sort.SliceStable(p.ProductSection.Property, func(i, j int) bool { 1437 return p.ProductSection.Property[i].Key < p.ProductSection.Property[j].Key 1438 }) 1439 } 1440 1441 type ProductSection struct { 1442 Info string `xml:"Info,omitempty"` 1443 Property []*Property `xml:"http://schemas.dmtf.org/ovf/envelope/1 Property,omitempty"` 1444 } 1445 1446 type Property struct { 1447 Key string `xml:"http://schemas.dmtf.org/ovf/envelope/1 key,attr,omitempty"` 1448 Label string `xml:"http://schemas.dmtf.org/ovf/envelope/1 Label,omitempty"` 1449 Description string `xml:"http://schemas.dmtf.org/ovf/envelope/1 Description,omitempty"` 1450 DefaultValue string `xml:"http://schemas.dmtf.org/ovf/envelope/1 value,attr"` 1451 Value *Value `xml:"http://schemas.dmtf.org/ovf/envelope/1 Value,omitempty"` 1452 Type string `xml:"http://schemas.dmtf.org/ovf/envelope/1 type,attr,omitempty"` 1453 UserConfigurable bool `xml:"http://schemas.dmtf.org/ovf/envelope/1 userConfigurable,attr"` 1454 } 1455 1456 type Value struct { 1457 Value string `xml:"http://schemas.dmtf.org/ovf/envelope/1 value,attr,omitempty"` 1458 } 1459 1460 // MetadataValue is the type returned when querying a unique entry of metadata. 1461 // Type: MetadataValueType 1462 // Namespace: http://www.vmware.com/vcloud/v1.5 1463 type MetadataValue struct { 1464 XMLName xml.Name `xml:"MetadataValue"` 1465 Xsi string `xml:"xmlns:xsi,attr"` 1466 Xmlns string `xml:"xmlns,attr"` 1467 Domain *MetadataDomainTag `xml:"Domain,omitempty"` 1468 TypedValue *MetadataTypedValue `xml:"TypedValue"` 1469 } 1470 1471 // MetadataTypedValue is the content of a metadata entry. 1472 // Type: MetadataTypedValue 1473 // Namespace: http://www.vmware.com/vcloud/v1.5 1474 // Description: One of: MetadataStringValue, MetadataNumberValue, MetadataBooleanValue, MetadataDateTimeValue 1475 // Since: 5.1 1476 type MetadataTypedValue struct { 1477 XsiType string `xml:"http://www.w3.org/2001/XMLSchema-instance type,attr"` 1478 Value string `xml:"Value"` 1479 } 1480 1481 // Deprecated: Use MetadataTypedValue instead 1482 type TypedValue = MetadataTypedValue 1483 1484 // Metadata is the user-defined metadata associated with an object. 1485 // Type: MetadataType 1486 // Namespace: http://www.vmware.com/vcloud/v1.5 1487 // Description: User-defined metadata associated with an object. 1488 // Since: 1.5 1489 type Metadata struct { 1490 XMLName xml.Name `xml:"Metadata"` 1491 Xmlns string `xml:"xmlns,attr"` 1492 HREF string `xml:"href,attr"` 1493 Type string `xml:"type,attr,omitempty"` // The MIME type of the entity. 1494 Xsi string `xml:"xmlns:xsi,attr"` 1495 Link []*Link `xml:"Link,omitempty"` 1496 MetadataEntry []*MetadataEntry `xml:"MetadataEntry,omitempty"` 1497 } 1498 1499 // MetadataEntry is a single metadata entry. 1500 // Type: MetadataEntryType 1501 // Namespace: http://www.vmware.com/vcloud/v1.5 1502 type MetadataEntry struct { 1503 Xmlns string `xml:"xmlns,attr"` 1504 HREF string `xml:"href,attr"` 1505 Type string `xml:"type,attr,omitempty"` // The MIME type of the entity 1506 Xsi string `xml:"xmlns:xsi,attr"` 1507 Domain *MetadataDomainTag `xml:"Domain,omitempty"` 1508 Key string `xml:"Key"` // An arbitrary key name. Length cannot exceed 256 UTF-8 characters. 1509 Link []*Link `xml:"Link,omitempty"` // A reference to an entity or operation associated with this object. 1510 TypedValue *MetadataTypedValue `xml:"TypedValue"` 1511 } 1512 1513 // MetadataDomainTag contains both the visibility and the domain of the metadata. 1514 // Type: MetadataDomainTagType 1515 // Namespace: http://www.vmware.com/vcloud/v1.5 1516 // Description: A value of SYSTEM places this MetadataEntry in the SYSTEM domain. Omit or leave empty to place this MetadataEntry in the GENERAL domain. 1517 // Since: 5.1 1518 type MetadataDomainTag struct { 1519 Visibility string `xml:"visibility,attr"` // One of: PRIVATE (hidden), READONLY, READWRITE (read/write) 1520 Domain string `xml:",chardata"` 1521 } 1522 1523 // VAppChildren is a container for virtual machines included in this vApp. 1524 // Type: VAppChildrenType 1525 // Namespace: http://www.vmware.com/vcloud/v1.5 1526 // Description: Container for virtual machines included in this vApp. 1527 // Since: 0.9 1528 type VAppChildren struct { 1529 VM []*Vm `xml:"Vm,omitempty"` // Represents a virtual machine. 1530 } 1531 1532 // TasksInProgress is a list of queued, running, or recently completed tasks. 1533 // Type: TasksInProgressType 1534 // Namespace: http://www.vmware.com/vcloud/v1.5 1535 // Description: A list of queued, running, or recently completed tasks. 1536 // Since: 0.9 1537 type TasksInProgress struct { 1538 // Elements 1539 Task []*Task `xml:"Task" json:"task"` // A task. 1540 } 1541 1542 // VAppTemplateChildren is a container for virtual machines included in this vApp template. 1543 // Type: VAppTemplateChildrenType 1544 // Namespace: http://www.vmware.com/vcloud/v1.5 1545 // Description: Container for virtual machines included in this vApp template. 1546 // Since: 0.9 1547 type VAppTemplateChildren struct { 1548 // Elements 1549 VM []*VAppTemplate `xml:"Vm"` // Represents a virtual machine in this vApp template. 1550 } 1551 1552 // VAppTemplate represents a vApp template. 1553 // Type: VAppTemplateType 1554 // Namespace: http://www.vmware.com/vcloud/v1.5 1555 // Description: Represents a vApp template. 1556 // Since: 0.9 1557 type VAppTemplate struct { 1558 // Attributes 1559 HREF string `xml:"href,attr,omitempty"` // The URI of the entity. 1560 Type string `xml:"type,attr,omitempty"` // The MIME type of the entity. 1561 ID string `xml:"id,attr,omitempty"` // The entity identifier, expressed in URN format. The value of this attribute uniquely identifies the entity, persists for the life of the entity, and is never reused. 1562 OperationKey string `xml:"operationKey,attr,omitempty"` // Optional unique identifier to support idempotent semantics for create and delete operations. 1563 Name string `xml:"name,attr"` // The name of the entity. 1564 Status int `xml:"status,attr,omitempty"` // Creation status of the resource entity. 1565 OvfDescriptorUploaded string `xml:"ovfDescriptorUploaded,attr,omitempty"` // True if the OVF descriptor for this template has been uploaded. 1566 GoldMaster bool `xml:"goldMaster,attr,omitempty"` // True if this template is a gold master. 1567 // Elements 1568 Link LinkList `xml:"Link,omitempty"` // A reference to an entity or operation associated with this object. 1569 Description string `xml:"Description,omitempty"` // Optional description. 1570 Tasks *TasksInProgress `xml:"Tasks,omitempty"` // A list of queued, running, or recently completed tasks associated with this entity. 1571 Files *FilesList `xml:"Files,omitempty"` // Represents a list of files to be transferred (uploaded or downloaded). Each File in the list is part of the ResourceEntity. 1572 Owner *Owner `xml:"Owner,omitempty"` // vAppTemplate owner. 1573 Children *VAppTemplateChildren `xml:"Children,omitempty"` // Container for virtual machines included in this vApp template. 1574 VAppScopedLocalID string `xml:"VAppScopedLocalId"` // A unique identifier for the VM in the scope of the vApp template. 1575 DefaultStorageProfile string `xml:"DefaultStorageProfile,omitempty"` // The name of the storage profile to be used for this object. The named storage profile must exist in the organization vDC that contains the object. If not specified, the default storage profile for the vDC is used. 1576 DateCreated string `xml:"DateCreated,omitempty"` // Creation date/time of the template. 1577 // FIXME: Upstream bug? Missing NetworkConfigSection, LeaseSettingSection and 1578 // CustomizationSection at least, NetworkConnectionSection is required when 1579 // using ComposeVApp action in the context of a Children VM (still 1580 // referenced by VAppTemplateType). 1581 NetworkConfigSection *NetworkConfigSection `xml:"NetworkConfigSection,omitempty"` 1582 NetworkConnectionSection *NetworkConnectionSection `xml:"NetworkConnectionSection,omitempty"` 1583 LeaseSettingsSection *LeaseSettingsSection `xml:"LeaseSettingsSection,omitempty"` 1584 CustomizationSection *CustomizationSection `xml:"CustomizationSection,omitempty"` 1585 ProductSection *ProductSection `xml:"ProductSection,omitempty"` 1586 // OVF Section needs to be added 1587 // Section Section `xml:"Section,omitempty"` 1588 } 1589 1590 // VAppTemplateForUpdate represents a vApp template. 1591 // It is shrunken version of VAppTemplateType used for update calls. 1592 // Full VAppTemplateType isn't accepted by API 1593 // Type: VAppTemplateType 1594 // Namespace: http://www.vmware.com/vcloud/v1.5 1595 // Description: Represents a vApp template. 1596 type VAppTemplateForUpdate struct { 1597 XMLName xml.Name `xml:"VAppTemplate"` 1598 // Attributes 1599 Xmlns string `xml:"xmlns,attr,omitempty"` 1600 HREF string `xml:"href,attr,omitempty"` // The URI of the entity. 1601 ID string `xml:"id,attr,omitempty"` // The entity identifier, expressed in URN format. The value of this attribute uniquely identifies the entity, persists for the life of the entity, and is never reused. 1602 Name string `xml:"name,attr"` // The name of the entity. 1603 GoldMaster bool `xml:"goldMaster,attr,omitempty"` // True if this template is a gold master. 1604 // Elements 1605 Link LinkList `xml:"Link,omitempty"` // A reference to an entity or operation associated with this object. 1606 Description string `xml:"Description,omitempty"` // Optional description. 1607 } 1608 1609 // CaptureVAppParams is a configuration that can be supplied for capturing a vApp template from 1610 // existing vApp 1611 type CaptureVAppParams struct { 1612 XMLName xml.Name `xml:"CaptureVAppParams"` 1613 1614 Xmlns string `xml:"xmlns,attr"` 1615 XmlnsNs0 string `xml:"xmlns:ns0,attr,omitempty"` 1616 1617 // Name of vApp template 1618 Name string `xml:"name,attr"` 1619 // Description of vApp template 1620 Description string `xml:"Description,omitempty"` 1621 1622 // Source vApp reference. At least HREF field must be set 1623 Source *Reference `xml:"Source"` 1624 1625 // CustomizationSection section 1626 CustomizationSection CaptureVAppParamsCustomizationSection `xml:"CustomizationSection"` 1627 1628 // TargetCatalogItem can be used to overwrite existing item. To overwrite an existing vApp 1629 // template with the one created by this capture, place a reference to the existing template 1630 // here. Otherwise, the operation creates a new vApp template. 1631 TargetCatalogItem *Reference `xml:"TargetCatalogItem,omitempty"` 1632 1633 // CopyTpmOnInstantiate defines if TPM device is copied (`true`) to instantiated vApp from this 1634 // template or `false` if a new TPM device is created for instantiated vApp. 1635 // Note. Supported on VCD 10.4.2+ 1636 CopyTpmOnInstantiate *bool `xml:"CopyTpmOnInstantiate"` 1637 } 1638 1639 // CaptureVAppParamsCustomizationSection settings for CaptureVAppParams type 1640 type CaptureVAppParamsCustomizationSection struct { 1641 // This field must contain value "CustomizeOnInstantiate Settings" so that API does not reject 1642 // the request 1643 Info string `xml:"ns0:Info,omitempty"` 1644 // CustomizeOnInstantiate marks if instantiating this template applies customization settings 1645 // (`true`). `false` creates an identical copy. 1646 CustomizeOnInstantiate bool `xml:"CustomizeOnInstantiate"` 1647 } 1648 1649 // VMDiskChange represents a virtual machine only with Disk setting update part 1650 type VMDiskChange struct { 1651 XMLName xml.Name `xml:"Vm"` 1652 Ovf string `xml:"xmlns:ovf,attr,omitempty"` 1653 Xsi string `xml:"xmlns:xsi,attr,omitempty"` 1654 Xmlns string `xml:"xmlns,attr,omitempty"` 1655 1656 HREF string `xml:"href,attr,omitempty"` // The URI of the VM entity. 1657 Type string `xml:"type,attr,omitempty"` // The MIME type of the entity - application/vnd.vmware.vcloud.vm+xml 1658 Name string `xml:"name,attr"` // VM name 1659 Description string `xml:"Description,omitempty"` // Optional description. 1660 ID string `xml:"id,attr,omitempty"` // VM ID. The entity identifier, expressed in URN format. The value of this attribute uniquely identifies the entity, persists for the life of the entity, and is never reused. 1661 1662 VmSpecSection *VmSpecSection `xml:"VmSpecSection,omitempty"` // Container for the specification of this virtual machine. This is an alternative to using ovf:VirtualHardwareSection + ovf:OperatingSystemSection 1663 } 1664 1665 // DiskSection from Vm/VmSpecSection struct 1666 type DiskSection struct { 1667 DiskSettings []*DiskSettings `xml:"DiskSettings"` 1668 } 1669 1670 // DiskSettings from Vm/VmSpecSection/DiskSection struct 1671 type DiskSettings struct { 1672 DiskId string `xml:"DiskId,omitempty"` // Specifies a unique identifier for this disk in the scope of the corresponding VM. This element is optional when creating a VM, but if it is provided it should be unique. This element is mandatory when updating an existing disk. 1673 SizeMb int64 `xml:"SizeMb"` // The size of the disk in MB. 1674 UnitNumber int `xml:"UnitNumber"` // The device number on the SCSI or IDE controller of the disk. 1675 BusNumber int `xml:"BusNumber"` // The number of the SCSI or IDE controller itself. 1676 AdapterType string `xml:"AdapterType"` // The type of disk controller, e.g. IDE vs SCSI and if SCSI bus-logic vs LSI logic. 1677 ThinProvisioned *bool `xml:"ThinProvisioned,omitempty"` // Specifies whether the disk storage is pre-allocated or allocated on demand. 1678 Disk *Reference `xml:"Disk,omitempty"` // Specifies reference to a named disk. 1679 StorageProfile *Reference `xml:"StorageProfile,omitempty"` // Specifies reference to a storage profile to be associated with the disk. 1680 OverrideVmDefault bool `xml:"overrideVmDefault"` // Specifies that the disk storage profile overrides the VM's default storage profile. 1681 IopsAllocation *IopsResource `xml:"IopsAllocation"` // IOPS definition for the disk - added in 10.4 in replacement of 'iops' 1682 VirtualQuantity *int64 `xml:"VirtualQuantity,omitempty"` // The actual size of the disk. 1683 VirtualQuantityUnit string `xml:"VirtualQuantityUnit,omitempty"` // The units in which VirtualQuantity is measured. 1684 } 1685 1686 type IopsResource struct { 1687 Reservation int64 `xml:"Reservation"` // The amount of reservation of IOPS on the underlying virtualization infrastructure. This is a read-only. 1688 Limit int64 `xml:"Limit"` // The limit for how much of IOPS can be consumed on the underlying virtualization infrastructure. This is only valid when the resource allocation is not unlimited. 1689 SharesLevel string `xml:"SharesLevel"` // LOW - NORMAL - HIGH - CUSTOM 1690 Shares int64 `xml:"Shares"` // Custom priority for IOPS. This is a read-only. 1691 } 1692 1693 // MediaSection from Vm/VmSpecSection struct 1694 type MediaSection struct { 1695 MediaSettings []*MediaSettings `xml:"MediaSettings"` 1696 } 1697 1698 // MediaSettings from Vm/VmSpecSection/MediaSection struct 1699 type MediaSettings struct { 1700 DeviceId string `xml:"DeviceId,omitempty"` // Describes the media device whose media mount is being specified here. This deviceId must match the RASD.InstanceID attribute in the VirtualHardwareSection of the vApp's OVF description. 1701 MediaImage *Reference `xml:"MediaImage,omitempty"` // The media image that is mounted onto the device. This property can be 'null' which represents that no media is mounted on the device. 1702 MediaType string `xml:"MediaType,omitempty"` // Specified the type of media that is mounted onto the device. 1703 MediaState string `xml:"MediaState,omitempty"` // Specifies the state of the media device. 1704 UnitNumber int `xml:"UnitNumber"` // Specified the type of media that is mounted onto the device. 1705 BusNumber int `xml:"BusNumber"` // The bus number of the media device controller. 1706 AdapterType string `xml:"AdapterType,omitempty"` // The type of controller, e.g. IDE vs SCSI and if SCSI bus-logic vs LSI logic 1707 } 1708 1709 // CpuResourceMhz from Vm/VmSpecSection struct 1710 type CpuResourceMhz struct { 1711 Configured int64 `xml:"Configured"` // The amount of resource configured on the virtual machine. 1712 Reservation *int64 `xml:"Reservation,omitempty"` // The amount of reservation of this resource on the underlying virtualization infrastructure. 1713 Limit *int64 `xml:"Limit,omitempty"` // The limit for how much of this resource can be consumed on the underlying virtualization infrastructure. This is only valid when the resource allocation is not unlimited. 1714 SharesLevel string `xml:"SharesLevel,omitempty"` // Pre-determined relative priorities according to which the non-reserved portion of this resource is made available to the virtualized workload. 1715 Shares *int `xml:"Shares,omitempty"` // Custom priority for the resource. This field is read-only, unless the shares level is CUSTOM. 1716 } 1717 1718 // MemoryResourceMb from Vm/VmSpecSection struct 1719 type MemoryResourceMb struct { 1720 Configured int64 `xml:"Configured"` // The amount of resource configured on the virtual machine. 1721 Reservation *int64 `xml:"Reservation,omitempty"` // The amount of reservation of this resource on the underlying virtualization infrastructure. 1722 Limit *int64 `xml:"Limit,omitempty"` // The limit for how much of this resource can be consumed on the underlying virtualization infrastructure. This is only valid when the resource allocation is not unlimited. 1723 SharesLevel string `xml:"SharesLevel,omitempty"` // Pre-determined relative priorities according to which the non-reserved portion of this resource is made available to the virtualized workload. 1724 Shares *int `xml:"Shares,omitempty"` // Custom priority for the resource. This is a read-only, unless the share level is CUSTOM. 1725 } 1726 1727 // HardwareVersion from Vm/VmSpecSection struct 1728 type HardwareVersion struct { 1729 HREF string `xml:"href,attr"` 1730 Type string `xml:"type,attr,omitempty"` 1731 Value string `xml:",chardata"` 1732 } 1733 1734 // ovf:VirtualHardwareSection from Vm struct 1735 type VirtualHardwareSection struct { 1736 // Extends OVF Section_Type 1737 XMLName xml.Name `xml:"VirtualHardwareSection"` 1738 Xmlns string `xml:"vcloud,attr,omitempty"` 1739 1740 Info string `xml:"Info"` 1741 HREF string `xml:"href,attr,omitempty"` 1742 Type string `xml:"type,attr,omitempty"` 1743 Item []*VirtualHardwareItem `xml:"Item,omitempty"` 1744 } 1745 1746 // Each ovf:Item parsed from the ovf:VirtualHardwareSection 1747 type VirtualHardwareItem struct { 1748 XMLName xml.Name `xml:"Item"` 1749 ResourceType int `xml:"ResourceType,omitempty"` 1750 ResourceSubType string `xml:"ResourceSubType,omitempty"` 1751 ElementName string `xml:"ElementName,omitempty"` 1752 Description string `xml:"Description,omitempty"` 1753 InstanceID int `xml:"InstanceID,omitempty"` 1754 AutomaticAllocation bool `xml:"AutomaticAllocation,omitempty"` 1755 Address string `xml:"Address,omitempty"` 1756 AddressOnParent int `xml:"AddressOnParent,omitempty"` 1757 AllocationUnits string `xml:"AllocationUnits,omitempty"` 1758 Reservation int `xml:"Reservation,omitempty"` 1759 VirtualQuantity int64 `xml:"VirtualQuantity,omitempty"` 1760 Weight int `xml:"Weight,omitempty"` 1761 CoresPerSocket int `xml:"CoresPerSocket,omitempty"` 1762 Connection []*VirtualHardwareConnection `xml:"Connection,omitempty"` 1763 HostResource []*VirtualHardwareHostResource `xml:"HostResource,omitempty"` 1764 Link []*Link `xml:"Link,omitempty"` 1765 // Reference: https://code.vmware.com/apis/287/vcloud?h=Director#/doc/doc/operations/GET-DisksRasdItemsList-vApp.html 1766 Parent int `xml:"Parent,omitempty"` 1767 } 1768 1769 // Connection info from ResourceType=10 (Network Interface) 1770 type VirtualHardwareConnection struct { 1771 IPAddress string `xml:"ipAddress,attr,omitempty"` 1772 PrimaryConnection bool `xml:"primaryNetworkConnection,attr,omitempty"` 1773 IpAddressingMode string `xml:"ipAddressingMode,attr,omitempty"` 1774 NetworkName string `xml:",chardata"` 1775 } 1776 1777 // HostResource info from ResourceType=17 (Hard Disk) 1778 // Reference: vCloud API Programming Guide for Service Providers vCloud API 30.0, Page 188 - 189 1779 // https://vdc-download.vmware.com/vmwb-repository/dcr-public/1b6cf07d-adb3-4dba-8c47-9c1c92b04857/ 1780 // def8435d-a54a-4923-b26a-e2d1915b09c3/vcloud_sp_api_guide_30_0.pdf 1781 type VirtualHardwareHostResource struct { 1782 BusType int `xml:"busType,attr,omitempty"` 1783 BusSubType string `xml:"busSubType,attr,omitempty"` 1784 Capacity int `xml:"capacity,attr,omitempty"` 1785 StorageProfile string `xml:"storageProfileHref,attr,omitempty"` 1786 OverrideVmDefault bool `xml:"storageProfileOverrideVmDefault,attr,omitempty"` 1787 Disk string `xml:"disk,attr,omitempty"` 1788 //Iops int `xml:"iops,attr,omitempty"` 1789 //OsType string `xml:"osType,attr,omitempty"` 1790 } 1791 1792 // SnapshotSection from Vm struct 1793 type SnapshotSection struct { 1794 // Extends OVF Section_Type 1795 XMLName xml.Name `xml:"SnapshotSection"` 1796 Info string `xml:"Info"` 1797 HREF string `xml:"href,attr,omitempty"` 1798 Type string `xml:"type,attr,omitempty"` 1799 Snapshot []*SnapshotItem `xml:"Snapshot,omitempty"` 1800 } 1801 1802 // Each snapshot listed in the SnapshotSection 1803 type SnapshotItem struct { 1804 Created string `xml:"created,attr,omitempty"` 1805 PoweredOn bool `xml:"poweredOn,attr,omitempty"` 1806 Size int `xml:"size,attr,omitempty"` 1807 } 1808 1809 // OVFItem is a horrible kludge to process OVF, needs to be fixed with proper types. 1810 type OVFItem struct { 1811 XMLName xml.Name `xml:"vcloud:Item"` 1812 XmlnsRasd string `xml:"xmlns:rasd,attr"` 1813 XmlnsVCloud string `xml:"xmlns:vcloud,attr"` 1814 XmlnsXsi string `xml:"xmlns:xsi,attr"` 1815 XmlnsVmw string `xml:"xmlns:vmw,attr,omitempty"` 1816 VCloudHREF string `xml:"vcloud:href,attr"` 1817 VCloudType string `xml:"vcloud:type,attr"` 1818 AllocationUnits string `xml:"rasd:AllocationUnits"` 1819 Description string `xml:"rasd:Description"` 1820 ElementName string `xml:"rasd:ElementName"` 1821 InstanceID int `xml:"rasd:InstanceID"` 1822 Reservation int `xml:"rasd:Reservation"` 1823 ResourceType int `xml:"rasd:ResourceType"` 1824 VirtualQuantity int64 `xml:"rasd:VirtualQuantity"` 1825 // Weight corresponds to Shares when used for CPU and/or memory settings 1826 Weight int `xml:"rasd:Weight,omitempty"` 1827 CoresPerSocket *int `xml:"vmw:CoresPerSocket,omitempty"` 1828 Link *Link `xml:"vcloud:Link"` 1829 } 1830 1831 // DeployVAppParams are the parameters to a deploy vApp request 1832 // Type: DeployVAppParamsType 1833 // Namespace: http://www.vmware.com/vcloud/v1.5 1834 // Description: Parameters to a deploy vApp request. 1835 // Since: 0.9 1836 type DeployVAppParams struct { 1837 XMLName xml.Name `xml:"DeployVAppParams"` 1838 Xmlns string `xml:"xmlns,attr"` 1839 // Attributes 1840 PowerOn bool `xml:"powerOn,attr"` // Used to specify whether to power on vapp on deployment, if not set default value is true. 1841 DeploymentLeaseSeconds int `xml:"deploymentLeaseSeconds,attr,omitempty"` // Lease in seconds for deployment. A value of 0 is replaced by the organization default deploymentLeaseSeconds value. 1842 ForceCustomization bool `xml:"forceCustomization,attr,omitempty"` // Used to specify whether to force customization on deployment, if not set default value is false 1843 } 1844 1845 // GuestCustomizationStatusSection holds information about guest customization status 1846 // https://vdc-repo.vmware.com/vmwb-repository/dcr-public/76f491b4-679c-4e1e-8428-f813d668297a/a2555a1b-22f1-4cca-b481-2a98ab874022/doc/doc/operations/GET-GuestCustStatus.html 1847 type GuestCustomizationStatusSection struct { 1848 XMLName xml.Name `xml:"GuestCustomizationStatusSection"` 1849 Xmlns string `xml:"xmlns,attr"` 1850 1851 GuestCustStatus string `xml:"GuestCustStatus"` 1852 } 1853 1854 // GuestCustomizationSection represents guest customization settings 1855 // Type: GuestCustomizationSectionType 1856 // Namespace: http://www.vmware.com/vcloud/v1.5 1857 // Description: Represents a guest customization settings. 1858 // Since: 1.0 1859 type GuestCustomizationSection struct { 1860 // Extends OVF Section_Type 1861 // Attributes 1862 Ovf string `xml:"xmlns:ovf,attr,omitempty"` 1863 Xsi string `xml:"xmlns:xsi,attr,omitempty"` 1864 Xmlns string `xml:"xmlns,attr,omitempty"` 1865 1866 HREF string `xml:"href,attr,omitempty"` // A reference to the section in URL format. 1867 Type string `xml:"type,attr,omitempty"` // The MIME type of the section. 1868 // FIXME: Fix the OVF section 1869 Info string `xml:"ovf:Info"` 1870 // Elements 1871 Enabled *bool `xml:"Enabled,omitempty"` // True if guest customization is enabled. 1872 ChangeSid *bool `xml:"ChangeSid,omitempty"` // True if customization can change the Windows SID of this virtual machine. 1873 VirtualMachineID string `xml:"VirtualMachineId,omitempty"` // Virtual machine ID to apply. 1874 JoinDomainEnabled *bool `xml:"JoinDomainEnabled,omitempty"` // True if this virtual machine can join a Windows Domain. 1875 UseOrgSettings *bool `xml:"UseOrgSettings,omitempty"` // True if customization should use organization settings (OrgGuestPersonalizationSettings) when joining a Windows Domain. 1876 DomainName string `xml:"DomainName,omitempty"` // The name of the Windows Domain to join. 1877 DomainUserName string `xml:"DomainUserName,omitempty"` // User name to specify when joining a Windows Domain. 1878 DomainUserPassword string `xml:"DomainUserPassword,omitempty"` // Password to use with DomainUserName. 1879 MachineObjectOU string `xml:"MachineObjectOU,omitempty"` // The name of the Windows Domain Organizational Unit (OU) in which the computer account for this virtual machine will be created. 1880 AdminPasswordEnabled *bool `xml:"AdminPasswordEnabled,omitempty"` // True if guest customization can modify administrator password settings for this virtual machine. 1881 AdminPasswordAuto *bool `xml:"AdminPasswordAuto,omitempty"` // True if the administrator password for this virtual machine should be automatically generated. 1882 AdminPassword string `xml:"AdminPassword,omitempty"` // True if the administrator password for this virtual machine should be set to this string. (AdminPasswordAuto must be false.) 1883 AdminAutoLogonEnabled *bool `xml:"AdminAutoLogonEnabled,omitempty"` // True if guest administrator should automatically log into this virtual machine. 1884 AdminAutoLogonCount int `xml:"AdminAutoLogonCount,omitempty"` // Number of times administrator can automatically log into this virtual machine. In case AdminAutoLogon is set to True, this value should be between 1 and 100. Otherwise, it should be 0. 1885 ResetPasswordRequired *bool `xml:"ResetPasswordRequired,omitempty"` // True if the administrator password for this virtual machine must be reset after first use. 1886 CustomizationScript string `xml:"CustomizationScript,omitempty"` // Script to run on guest customization. The entire script must appear in this element. Use the XML entity to represent a newline. Unicode characters can be represented in the form &#xxxx; where xxxx is the character number. 1887 ComputerName string `xml:"ComputerName,omitempty"` // Computer name to assign to this virtual machine. 1888 Link LinkList `xml:"Link,omitempty"` // A link to an operation on this section. 1889 } 1890 1891 // InstantiateVAppTemplateParams represents vApp template instantiation parameters. 1892 // Type: InstantiateVAppTemplateParamsType 1893 // Namespace: http://www.vmware.com/vcloud/v1.5 1894 // Description: Represents vApp template instantiation parameters. 1895 // Since: 0.9 1896 type InstantiateVAppTemplateParams struct { 1897 XMLName xml.Name `xml:"InstantiateVAppTemplateParams"` 1898 Ovf string `xml:"xmlns:ovf,attr"` 1899 Xsi string `xml:"xmlns:xsi,attr,omitempty"` 1900 Xmlns string `xml:"xmlns,attr"` 1901 // Attributes 1902 Name string `xml:"name,attr,omitempty"` // Typically used to name or identify the subject of the request. For example, the name of the object being created or modified. 1903 Deploy bool `xml:"deploy,attr"` // True if the vApp should be deployed at instantiation. Defaults to true. 1904 PowerOn bool `xml:"powerOn,attr"` // True if the vApp should be powered-on at instantiation. Defaults to true. 1905 LinkedClone bool `xml:"linkedClone,attr,omitempty"` // Reserved. Unimplemented. 1906 // Elements 1907 Description string `xml:"Description,omitempty"` // Optional description. 1908 VAppParent *Reference `xml:"VAppParent,omitempty"` // Reserved. Unimplemented. 1909 InstantiationParams *InstantiationParams `xml:"InstantiationParams,omitempty"` // Instantiation parameters for the composed vApp. 1910 Source *Reference `xml:"Source"` // A reference to a source object such as a vApp or vApp template. 1911 IsSourceDelete bool `xml:"IsSourceDelete,omitempty"` // Set to true to delete the source object after the operation completes. 1912 SourcedItem *SourcedCompositionItemParam `xml:"SourcedItem,omitempty"` // Composition item. One of: vApp vAppTemplate VM. 1913 AllEULAsAccepted bool `xml:"AllEULAsAccepted,omitempty"` // True confirms acceptance of all EULAs in a vApp template. Instantiation fails if this element is missing, empty, or set to false and one or more EulaSection elements are present. 1914 } 1915 1916 // CloneVAppParams is used to copy one vApp into another 1917 type CloneVAppParams struct { 1918 XMLName xml.Name `xml:"CloneVAppParams"` 1919 Ovf string `xml:"xmlns:ovf,attr"` 1920 Xsi string `xml:"xmlns:xsi,attr,omitempty"` 1921 Xmlns string `xml:"xmlns,attr"` 1922 // Attributes 1923 Name string `xml:"name,attr,omitempty"` // Typically used to name or identify the subject of the request. For example, the name of the object being created or modified. 1924 Deploy bool `xml:"deploy,attr"` // True if the vApp should be deployed at instantiation. Defaults to true. 1925 PowerOn bool `xml:"powerOn,attr"` // True if the vApp should be powered-on at instantiation. Defaults to true. 1926 LinkedClone bool `xml:"linkedClone,attr,omitempty"` // Reserved. Unimplemented. 1927 // Elements 1928 Description string `xml:"Description,omitempty"` // Optional description. 1929 InstantiationParams *InstantiationParams `xml:"InstantiationParams,omitempty"` // Instantiation parameters for the composed vApp. 1930 Source *Reference `xml:"Source"` // A reference to a source object such as a vApp or vApp template. 1931 IsSourceDelete *bool `xml:"IsSourceDelete"` // Set to true to delete the source object after the operation completes. 1932 SourcedItem *SourcedCompositionItemParam `xml:"SourcedItem,omitempty"` // Composition item. One of: vApp vAppTemplate VM. 1933 } 1934 1935 // EdgeGateway represents a gateway. 1936 // Element: EdgeGateway 1937 // Type: GatewayType 1938 // Namespace: http://www.vmware.com/vcloud/v1.5 1939 // Description: Represents a gateway. 1940 // Since: 5.1 1941 type EdgeGateway struct { 1942 // Attributes 1943 Xmlns string `xml:"xmlns,attr,omitempty"` 1944 HREF string `xml:"href,attr,omitempty"` // The URI of the entity. 1945 Type string `xml:"type,attr,omitempty"` // The MIME type of the entity. 1946 ID string `xml:"id,attr,omitempty"` // The entity identifier, expressed in URN format. The value of this attribute uniquely identifies the entity, persists for the life of the entity, and is never reused 1947 OperationKey string `xml:"operationKey,attr,omitempty"` // Optional unique identifier to support idempotent semantics for create and delete operations. 1948 Name string `xml:"name,attr"` // The name of the entity. 1949 Status int `xml:"status,attr,omitempty"` // Creation status of the gateway. One of: 0 (The gateway is still being created) 1 (The gateway is ready) -1 (There was an error while creating the gateway). 1950 // Elements 1951 Link LinkList `xml:"Link,omitempty"` // A link to an operation on this section. 1952 Description string `xml:"Description,omitempty"` // Optional description. 1953 Tasks *TasksInProgress `xml:"Tasks,omitempty"` // A list of queued, running, or recently completed tasks associated with this entity. 1954 Configuration *GatewayConfiguration `xml:"Configuration"` // Gateway configuration. 1955 } 1956 1957 // GatewayConfiguration is the gateway configuration 1958 // Type: GatewayConfigurationType 1959 // Namespace: http://www.vmware.com/vcloud/v1.5 1960 // Description: Gateway Configuration. 1961 // Since: 5.1 1962 type GatewayConfiguration struct { 1963 Xmlns string `xml:"xmlns,attr,omitempty"` 1964 // BackwardCompatibilityMode. Default is false. If set to true, will allow users to write firewall 1965 // rules in the old 1.5 format. The new format does not require to use direction in firewall 1966 // rules. Also, for firewall rules to allow NAT traffic the filter is applied on the original IP 1967 // addresses. Once set to true cannot be reverted back to false. 1968 BackwardCompatibilityMode bool `xml:"BackwardCompatibilityMode,omitempty"` 1969 // GatewayBackingConfig defines configuration of the vShield edge VM for this gateway. One of: 1970 // compact, full. 1971 GatewayBackingConfig string `xml:"GatewayBackingConfig"` 1972 // GatewayInterfaces holds configuration for edge gateway interfaces, ip allocations, traffic 1973 // rate limits and ip sub-allocations 1974 GatewayInterfaces *GatewayInterfaces `xml:"GatewayInterfaces"` 1975 // EdgeGatewayServiceConfiguration represents Gateway Features. 1976 EdgeGatewayServiceConfiguration *GatewayFeatures `xml:"EdgeGatewayServiceConfiguration,omitempty"` 1977 // True if this gateway is highly available. (Requires two vShield edge VMs.) 1978 HaEnabled *bool `xml:"HaEnabled,omitempty"` 1979 // UseDefaultRouteForDNSRelay defines if the default gateway on the external network selected 1980 // for default route should be used as the DNS relay. 1981 UseDefaultRouteForDNSRelay *bool `xml:"UseDefaultRouteForDnsRelay,omitempty"` 1982 // AdvancedNetworkingEnabled allows to use NSX capabilities such dynamic routing (BGP, OSPF), 1983 // zero trust networking (DLR), enchanced VPN support (IPsec VPN, SSL VPN-Plus). 1984 AdvancedNetworkingEnabled *bool `xml:"AdvancedNetworkingEnabled,omitempty"` 1985 // DistributedRoutingEnabled enables distributed routing on the gateway to allow creation of 1986 // many more organization VDC networks. Traffic in those networks is optimized for VM-to-VM 1987 // communication. 1988 DistributedRoutingEnabled *bool `xml:"DistributedRoutingEnabled,omitempty"` 1989 // FipsModeEnabled allows any secure communication to or from the NSX Edge uses cryptographic 1990 // algorithms or protocols that are allowed by United States Federal Information Processing 1991 // Standards (FIPS). FIPS mode turns on the cipher suites that comply with FIPS. 1992 FipsModeEnabled *bool `xml:"FipsModeEnabled,omitempty"` 1993 } 1994 1995 // GatewayInterfaces is a list of Gateway Interfaces. 1996 // Type: GatewayInterfacesType 1997 // Namespace: http://www.vmware.com/vcloud/v1.5 1998 // Description: A list of Gateway Interfaces. 1999 // Since: 5.1 2000 type GatewayInterfaces struct { 2001 GatewayInterface []*GatewayInterface `xml:"GatewayInterface"` // Gateway Interface. 2002 } 2003 2004 // GatewayInterface is a gateway interface configuration. 2005 // Type: GatewayInterfaceType 2006 // Namespace: http://www.vmware.com/vcloud/v1.5 2007 // Description: Gateway Interface configuration. 2008 // Since: 5.1 2009 type GatewayInterface struct { 2010 Name string `xml:"Name,omitempty"` // Internally generated name for the Gateway Interface. 2011 DisplayName string `xml:"DisplayName,omitempty"` // Gateway Interface display name. 2012 Network *Reference `xml:"Network"` // A reference to the network connected to the gateway interface. 2013 InterfaceType string `xml:"InterfaceType"` // The type of interface: One of: Uplink, Internal 2014 SubnetParticipation []*SubnetParticipation `xml:"SubnetParticipation,omitempty"` // Slice of subnets for IP allocations. 2015 ApplyRateLimit bool `xml:"ApplyRateLimit,omitempty"` // True if rate limiting is applied on this interface. 2016 InRateLimit float64 `xml:"InRateLimit,omitempty"` // Incoming rate limit expressed as Gbps. 2017 OutRateLimit float64 `xml:"OutRateLimit,omitempty"` // Outgoing rate limit expressed as Gbps. 2018 UseForDefaultRoute bool `xml:"UseForDefaultRoute,omitempty"` // True if this network is default route for the gateway. 2019 } 2020 2021 // SortBySubnetParticipationGateway allows to sort SubnetParticipation property slice by gateway 2022 // address 2023 func (g *GatewayInterface) SortBySubnetParticipationGateway() { 2024 sort.SliceStable(g.SubnetParticipation, func(i, j int) bool { 2025 return g.SubnetParticipation[i].Gateway < g.SubnetParticipation[j].Gateway 2026 }) 2027 } 2028 2029 // SubnetParticipation allows to chose which subnets a gateway can be a part of 2030 // Type: SubnetParticipationType 2031 // Namespace: http://www.vmware.com/vcloud/v1.5 2032 // Description: Allows to chose which subnets a gateway can be part of 2033 // Since: 5.1 2034 // 2035 // Note. Field order is important and should not be changed as API returns errors if IPRanges come 2036 // before Gateway and Netmask 2037 type SubnetParticipation struct { 2038 Gateway string `xml:"Gateway"` // Gateway for subnet 2039 Netmask string `xml:"Netmask"` // Netmask for the subnet. 2040 IPAddress string `xml:"IpAddress,omitempty"` // Ip Address to be assigned. Keep empty or omit element for auto assignment 2041 IPRanges *IPRanges `xml:"IpRanges,omitempty"` // Range of IP addresses available for external interfaces. 2042 UseForDefaultRoute bool `xml:"UseForDefaultRoute,omitempty"` // True if this network is default route for the gateway. 2043 } 2044 2045 type EdgeGatewayServiceConfiguration struct { 2046 XMLName xml.Name `xml:"EdgeGatewayServiceConfiguration"` 2047 Xmlns string `xml:"xmlns,attr,omitempty"` 2048 GatewayDhcpService *GatewayDhcpService `xml:"GatewayDhcpService,omitempty"` 2049 FirewallService *FirewallService `xml:"FirewallService,omitempty"` 2050 NatService *NatService `xml:"NatService,omitempty"` 2051 GatewayIpsecVpnService *GatewayIpsecVpnService `xml:"GatewayIpsecVpnService,omitempty"` // Substitute for NetworkService. Gateway Ipsec VPN service settings 2052 } 2053 2054 // GatewayFeatures represents edge gateway services. 2055 // Element: EdgeGatewayServiceConfiguration 2056 // Type: GatewayFeaturesType 2057 // Namespace: http://www.vmware.com/vcloud/v1.5 2058 // Description: Represents edge gateway services. 2059 // Since: 5.1 2060 type GatewayFeatures struct { 2061 XMLName xml.Name 2062 Xmlns string `xml:"xmlns,attr,omitempty"` 2063 FirewallService *FirewallService `xml:"FirewallService,omitempty"` // Substitute for NetworkService. Firewall service settings 2064 NatService *NatService `xml:"NatService,omitempty"` // Substitute for NetworkService. NAT service settings 2065 GatewayDhcpService *GatewayDhcpService `xml:"GatewayDhcpService,omitempty"` // Substitute for NetworkService. Gateway DHCP service settings 2066 GatewayIpsecVpnService *GatewayIpsecVpnService `xml:"GatewayIpsecVpnService,omitempty"` // Substitute for NetworkService. Gateway Ipsec VPN service settings 2067 StaticRoutingService *StaticRoutingService `xml:"StaticRoutingService,omitempty"` // Substitute for NetworkService. Static Routing service settings 2068 } 2069 2070 // StaticRoutingService represents Static Routing network service. 2071 // Type: StaticRoutingServiceType 2072 // Namespace: http://www.vmware.com/vcloud/v1.5 2073 // Description: Represents Static Routing network service. 2074 // Since: 1.5 2075 type StaticRoutingService struct { 2076 IsEnabled bool `xml:"IsEnabled"` // Enable or disable the service using this flag 2077 StaticRoute []*StaticRoute `xml:"StaticRoute,omitempty"` // Details of each Static Route. 2078 } 2079 2080 // StaticRoute represents a static route entry 2081 // Type: StaticRouteType 2082 // Namespace: http://www.vmware.com/vcloud/v1.5 2083 // Description: 2084 // Since: 2085 type StaticRoute struct { 2086 Name string `xml:"Name"` // Name for the static route. 2087 Network string `xml:"Network"` // Network specification in CIDR. 2088 NextHopIP string `xml:"NextHopIp"` // IP Address of Next Hop router/gateway. 2089 Interface string `xml:"Interface,omitempty"` // Interface to use for static routing. Internal and External are the supported values. 2090 GatewayInterface *Reference `xml:"GatewayInterface,omitempty"` // Gateway interface to which static route is bound. 2091 } 2092 2093 // VendorTemplate is information about a vendor service template. This is optional. 2094 // Type: VendorTemplateType 2095 // Namespace: http://www.vmware.com/vcloud/v1.5 2096 // Description: Information about a vendor service template. This is optional. 2097 // Since: 5.1 2098 type VendorTemplate struct { 2099 Name string `xml:"Name"` // Name of the vendor template. This is required. 2100 ID string `xml:"Id"` // ID of the vendor template. This is required. 2101 } 2102 2103 // GatewayIpsecVpnService represents gateway IPsec VPN service. 2104 // Type: GatewayIpsecVpnServiceType 2105 // Namespace: http://www.vmware.com/vcloud/v1.5 2106 // Description: Represents gateway IPsec VPN service. 2107 // Since: 5.1 2108 type GatewayIpsecVpnService struct { 2109 IsEnabled bool `xml:"IsEnabled"` // Enable or disable the service using this flag 2110 Endpoint *GatewayIpsecVpnEndpoint `xml:"Endpoint,omitempty"` // List of IPsec VPN Service Endpoints. 2111 Tunnel []*GatewayIpsecVpnTunnel `xml:"Tunnel"` // List of IPsec VPN tunnels. 2112 } 2113 2114 // GatewayIpsecVpnEndpoint represents an IPsec VPN endpoint. 2115 // Type: GatewayIpsecVpnEndpointType 2116 // Namespace: http://www.vmware.com/vcloud/v1.5 2117 // Description: Represents an IPsec VPN endpoint. 2118 // Since: 5.1 2119 type GatewayIpsecVpnEndpoint struct { 2120 Network *Reference `xml:"Network"` // External network reference. 2121 PublicIP string `xml:"PublicIp,omitempty"` // Public IP for IPsec endpoint. 2122 } 2123 2124 // GatewayIpsecVpnTunnel represents an IPsec VPN tunnel. 2125 // Type: GatewayIpsecVpnTunnelType 2126 // Namespace: http://www.vmware.com/vcloud/v1.5 2127 // Description: Represents an IPsec VPN tunnel. 2128 // Since: 5.1 2129 type GatewayIpsecVpnTunnel struct { 2130 Name string `xml:"Name"` // The name of the tunnel. 2131 Description string `xml:"Description,omitempty"` // A description of the tunnel. 2132 // TODO: Fix this in a better way 2133 IpsecVpnThirdPartyPeer *IpsecVpnThirdPartyPeer `xml:"IpsecVpnThirdPartyPeer,omitempty"` // Details about the peer network. 2134 IpsecVpnLocalPeer *IpsecVpnLocalPeer `xml:"IpsecVpnLocalPeer"` // Details about the local peer network. 2135 PeerIPAddress string `xml:"PeerIpAddress"` // IP address of the peer endpoint. 2136 PeerID string `xml:"PeerId"` // Id for the peer end point 2137 LocalIPAddress string `xml:"LocalIpAddress"` // Address of the local network. 2138 LocalID string `xml:"LocalId"` // Id for local end point 2139 LocalSubnet []*IpsecVpnSubnet `xml:"LocalSubnet"` // List of local subnets in the tunnel. 2140 PeerSubnet []*IpsecVpnSubnet `xml:"PeerSubnet"` // List of peer subnets in the tunnel. 2141 SharedSecret string `xml:"SharedSecret"` // Shared secret used for authentication. 2142 SharedSecretEncrypted bool `xml:"SharedSecretEncrypted,omitempty"` // True if shared secret is encrypted. 2143 EncryptionProtocol string `xml:"EncryptionProtocol"` // Encryption protocol to be used. One of: AES, AES256, TRIPLEDES 2144 Mtu int `xml:"Mtu"` // MTU for the tunnel. 2145 IsEnabled bool `xml:"IsEnabled,omitempty"` // True if the tunnel is enabled. 2146 IsOperational bool `xml:"IsOperational,omitempty"` // True if the tunnel is operational. 2147 ErrorDetails string `xml:"ErrorDetails,omitempty"` // Error details of the tunnel. 2148 } 2149 2150 // IpsecVpnThirdPartyPeer represents details about a peer network 2151 type IpsecVpnThirdPartyPeer struct { 2152 PeerID string `xml:"PeerId,omitempty"` // Id for the peer end point 2153 } 2154 2155 // IpsecVpnThirdPartyPeer represents details about a peer network 2156 type IpsecVpnLocalPeer struct { 2157 ID string `xml:"Id"` // Id for the peer end point 2158 Name string `xml:"Name"` // Name for the peer 2159 } 2160 2161 // IpsecVpnSubnet represents subnet details. 2162 // Type: IpsecVpnSubnetType 2163 // Namespace: http://www.vmware.com/vcloud/v1.5 2164 // Description: Represents subnet details. 2165 // Since: 5.1 2166 type IpsecVpnSubnet struct { 2167 Name string `xml:"Name"` // Gateway Name. 2168 Gateway string `xml:"Gateway"` // Subnet Gateway. 2169 Netmask string `xml:"Netmask"` // Subnet Netmask. 2170 } 2171 2172 // GatewayDhcpService represents Gateway DHCP service. 2173 // Type: GatewayDhcpServiceType 2174 // Namespace: http://www.vmware.com/vcloud/v1.5 2175 // Description: Represents Gateway DHCP service. 2176 // Since: 5.1 2177 type GatewayDhcpService struct { 2178 IsEnabled bool `xml:"IsEnabled,omitempty"` // Enable or disable the service using this flag 2179 Pool []*DhcpPoolService `xml:"Pool,omitempty"` // A DHCP pool. 2180 } 2181 2182 // DhcpPoolService represents DHCP pool service. 2183 // Type: DhcpPoolServiceType 2184 // Namespace: http://www.vmware.com/vcloud/v1.5 2185 // Description: Represents DHCP pool service. 2186 // Since: 5.1 2187 type DhcpPoolService struct { 2188 IsEnabled bool `xml:"IsEnabled,omitempty"` // True if this DHCP Pool is enabled. 2189 Network *Reference `xml:"Network"` // Org vDC network to which the DHCP range is applicable. 2190 DefaultLeaseTime int `xml:"DefaultLeaseTime,omitempty"` // Default lease period for DHCP range. 2191 MaxLeaseTime int `xml:"MaxLeaseTime"` // Maximum lease period for DHCP range. 2192 LowIPAddress string `xml:"LowIpAddress"` // Low IP address in DHCP range. 2193 HighIPAddress string `xml:"HighIpAddress"` // High IP address in DHCP range. 2194 } 2195 2196 // VMSelection represents details of an vm+nic+iptype selection. 2197 // Type: VmSelectionType 2198 // Namespace: http://www.vmware.com/vcloud/v1.5 2199 // Description: Represents details of an vm+nic+iptype selection. 2200 // Since: 5.1 2201 type VMSelection struct { 2202 VAppScopedVMID string `xml:"VAppScopedVmId"` // VAppScopedVmId of VM to which this rule applies. 2203 VMNicID int `xml:"VmNicId"` // VM NIC ID to which this rule applies. 2204 IPType string `xml:"IpType"` // The value can be one of:- assigned: assigned internal IP be automatically choosen. NAT: NATed external IP will be automatically choosen. 2205 } 2206 2207 // FirewallRuleProtocols flags for a network protocol in a firewall rule 2208 // Type: FirewallRuleType/Protocols 2209 // Namespace: http://www.vmware.com/vcloud/v1.5 2210 // Description: 2211 // Since: 2212 type FirewallRuleProtocols struct { 2213 ICMP bool `xml:"Icmp,omitempty"` // True if the rule applies to the ICMP protocol. 2214 Any bool `xml:"Any,omitempty"` // True if the rule applies to any protocol. 2215 TCP bool `xml:"Tcp,omitempty"` // True if the rule applies to the TCP protocol. 2216 UDP bool `xml:"Udp,omitempty"` // True if the rule applies to the UDP protocol. 2217 // FIXME: this is supposed to extend protocol support to all the VSM supported protocols 2218 // Other string `xml:"Other,omitempty"` // Any other protocol supported by vShield Manager 2219 } 2220 2221 // FirewallRule represents a firewall rule 2222 // Type: FirewallRuleType 2223 // Namespace: http://www.vmware.com/vcloud/v1.5 2224 // Description: Represents a firewall rule. 2225 // Since: 0.9 2226 type FirewallRule struct { 2227 ID string `xml:"Id,omitempty"` // Firewall rule identifier. 2228 IsEnabled bool `xml:"IsEnabled"` // Used to enable or disable the firewall rule. Default value is true. 2229 MatchOnTranslate bool `xml:"MatchOnTranslate"` // For DNATed traffic, match the firewall rules only after the destination IP is translated. 2230 Description string `xml:"Description,omitempty"` // A description of the rule. 2231 Policy string `xml:"Policy,omitempty"` // One of: drop (drop packets that match the rule), allow (allow packets that match the rule to pass through the firewall) 2232 Protocols *FirewallRuleProtocols `xml:"Protocols,omitempty"` // Specify the protocols to which the rule should be applied. 2233 IcmpSubType string `xml:"IcmpSubType,omitempty"` // ICMP subtype. One of: address-mask-request, address-mask-reply, destination-unreachable, echo-request, echo-reply, parameter-problem, redirect, router-advertisement, router-solicitation, source-quench, time-exceeded, timestamp-request, timestamp-reply, any. 2234 Port int `xml:"Port,omitempty"` // The port to which this rule applies. A value of -1 matches any port. 2235 DestinationPortRange string `xml:"DestinationPortRange,omitempty"` // Destination port range to which this rule applies. 2236 DestinationIP string `xml:"DestinationIp,omitempty"` // Destination IP address to which the rule applies. A value of Any matches any IP address. 2237 DestinationVM *VMSelection `xml:"DestinationVm,omitempty"` // Details of the destination VM 2238 SourcePort int `xml:"SourcePort,omitempty"` // Destination port to which this rule applies. A value of -1 matches any port. 2239 SourcePortRange string `xml:"SourcePortRange,omitempty"` // Source port range to which this rule applies. 2240 SourceIP string `xml:"SourceIp,omitempty"` // Source IP address to which the rule applies. A value of Any matches any IP address. 2241 SourceVM *VMSelection `xml:"SourceVm,omitempty"` // Details of the source VM 2242 Direction string `xml:"Direction,omitempty"` // Direction of traffic to which rule applies. One of: in (rule applies to incoming traffic. This is the default value), out (rule applies to outgoing traffic). 2243 EnableLogging bool `xml:"EnableLogging"` // Used to enable or disable firewall rule logging. Default value is false. 2244 } 2245 2246 // FirewallService represent a network firewall service. 2247 // Type: FirewallServiceType 2248 // Namespace: http://www.vmware.com/vcloud/v1.5 2249 // Description: Represents a network firewall service. 2250 // Since: 2251 type FirewallService struct { 2252 IsEnabled bool `xml:"IsEnabled"` // Enable or disable the service using this flag 2253 DefaultAction string `xml:"DefaultAction,omitempty"` // Default action of the firewall. One of: drop (Default. Drop packets that match the rule.), allow (Allow packets that match the rule to pass through the firewall) 2254 LogDefaultAction bool `xml:"LogDefaultAction"` // Flag to enable logging for default action. Default value is false. 2255 FirewallRule []*FirewallRule `xml:"FirewallRule,omitempty"` // A firewall rule. 2256 } 2257 2258 // NatService represents a NAT network service. 2259 // Type: NatServiceType 2260 // Namespace: http://www.vmware.com/vcloud/v1.5 2261 // Description: Represents a NAT network service. 2262 // Since: 2263 type NatService struct { 2264 Xmlns string `xml:"xmlns,attr,omitempty"` 2265 // Elements 2266 2267 IsEnabled bool `xml:"IsEnabled"` // Enable or disable the service using this flag 2268 NatType string `xml:"NatType,omitempty"` // One of: ipTranslation (use IP translation), portForwarding (use port forwarding) 2269 Policy string `xml:"Policy,omitempty"` // One of: allowTraffic (Allow all traffic), allowTrafficIn (Allow inbound traffic only) 2270 NatRule []*NatRule `xml:"NatRule,omitempty"` // A NAT rule. 2271 ExternalIP string `xml:"ExternalIp,omitempty"` // External IP address for rule. 2272 } 2273 2274 // NatRule represents a NAT rule. 2275 // Type: NatRuleType 2276 // Namespace: http://www.vmware.com/vcloud/v1.5 2277 // Description: Represents a NAT rule. 2278 // Since: 0.9 2279 type NatRule struct { 2280 Xmlns string `xml:"xmlns,attr,omitempty"` 2281 // Elements 2282 Description string `xml:"Description,omitempty"` // A description of the rule. 2283 RuleType string `xml:"RuleType,omitempty"` // Type of NAT rule. One of: SNAT (source NAT), DNAT (destination NAT) 2284 IsEnabled *bool `xml:"IsEnabled"` // Used to enable or disable the firewall rule. 2285 ID string `xml:"Id,omitempty"` // Firewall rule identifier. 2286 GatewayNatRule *GatewayNatRule `xml:"GatewayNatRule,omitempty"` // Defines SNAT and DNAT types. 2287 OneToOneBasicRule *NatOneToOneBasicRule `xml:"OneToOneBasicRule,omitempty"` // Maps one internal IP address to one external IP address. 2288 OneToOneVMRule *NatOneToOneVMRule `xml:"OneToOneVmRule,omitempty"` // Maps one VM NIC to one external IP addresses. 2289 PortForwardingRule *NatPortForwardingRule `xml:"PortForwardingRule,omitempty"` // Port forwarding internal to external IP addresses. 2290 VMRule *NatVMRule `xml:"VmRule,omitempty"` // Port forwarding VM NIC to external IP addresses. 2291 } 2292 2293 // GatewayNatRule represents the SNAT and DNAT rules. 2294 // Type: GatewayNatRuleType represents the SNAT and DNAT rules. 2295 // Namespace: http://www.vmware.com/vcloud/v1.5 2296 // Description: Represents the SNAT and DNAT rules. 2297 // Since: 5.1 2298 type GatewayNatRule struct { 2299 Xmlns string `xml:"xmlns,attr,omitempty"` 2300 // Elements 2301 Interface *Reference `xml:"Interface,omitempty"` // Interface to which rule is applied. 2302 OriginalIP string `xml:"OriginalIp"` // Original IP for rule. 2303 OriginalPort string `xml:"OriginalPort,omitempty"` // Original port for rule. 2304 TranslatedIP string `xml:"TranslatedIp"` // Translated IP for rule. 2305 TranslatedPort string `xml:"TranslatedPort,omitempty"` // Translated port for rule. 2306 Protocol string `xml:"Protocol,omitempty"` // Protocol for rule. 2307 IcmpSubType string `xml:"IcmpSubType,omitempty"` // ICMP subtype. One of: address-mask-request, address-mask-reply, destination-unreachable, echo-request, echo-reply, parameter-problem, redirect, router-advertisement, router-solicitation, source-quench, time-exceeded, timestamp-request, timestamp-reply, any. 2308 } 2309 2310 // NatOneToOneBasicRule represents the NAT basic rule for one to one mapping of internal and external IP addresses from a network. 2311 // Type: NatOneToOneBasicRuleType 2312 // Namespace: http://www.vmware.com/vcloud/v1.5 2313 // Description: Represents the NAT basic rule for one to one mapping of internal and external IP addresses from a network. 2314 // Since: 0.9 2315 type NatOneToOneBasicRule struct { 2316 Xmlns string `xml:"xmlns,attr,omitempty"` 2317 // Elements 2318 MappingMode string `xml:"MappingMode"` // One of: automatic (map IP addresses automatically), manual (map IP addresses manually using ExternalIpAddress and InternalIpAddress) 2319 ExternalIPAddress string `xml:"ExternalIpAddress"` // External IP address to map. 2320 InternalIPAddress string `xml:"InternalIpAddress"` // Internal IP address to map. 2321 } 2322 2323 // NatOneToOneVMRule represents the NAT rule for one to one mapping of VM NIC and external IP addresses from a network. 2324 // Type: NatOneToOneVmRuleType 2325 // Namespace: http://www.vmware.com/vcloud/v1.5 2326 // Description: Represents the NAT rule for one to one mapping of VM NIC and external IP addresses from a network. 2327 // Since: 0.9 2328 type NatOneToOneVMRule struct { 2329 Xmlns string `xml:"xmlns,attr,omitempty"` 2330 // Elements 2331 MappingMode string `xml:"MappingMode"` // Mapping mode. 2332 ExternalIPAddress *string `xml:"ExternalIpAddress"` // External IP address to map. 2333 VAppScopedVMID string `xml:"VAppScopedVmId"` // VAppScopedVmId of VM to which this rule applies. 2334 VMNicID int `xml:"VmNicId"` // VM NIC ID to which this rule applies. 2335 } 2336 2337 // NatPortForwardingRule represents the NAT rule for port forwarding between internal IP/port and external IP/port. 2338 // Type: NatPortForwardingRuleType 2339 // Namespace: http://www.vmware.com/vcloud/v1.5 2340 // Description: Represents the NAT rule for port forwarding between internal IP/port and external IP/port. 2341 // Since: 0.9 2342 type NatPortForwardingRule struct { 2343 ExternalIPAddress string `xml:"ExternalIpAddress"` // External IP address to map. 2344 ExternalPort int `xml:"ExternalPort"` // External port to forward to. 2345 InternalIPAddress string `xml:"InternalIpAddress"` // Internal IP address to map. 2346 InternalPort int `xml:"InternalPort"` // Internal port to forward to. 2347 Protocol string `xml:"Protocol,omitempty"` // Protocol to forward. One of: TCP (forward TCP packets), UDP (forward UDP packets), TCP_UDP (forward TCP and UDP packets). 2348 } 2349 2350 // NatVMRule represents the NAT rule for port forwarding between VM NIC/port and external IP/port. 2351 // Type: NatVmRuleType 2352 // Namespace: http://www.vmware.com/vcloud/v1.5 2353 // Description: Represents the NAT rule for port forwarding between VM NIC/port and external IP/port. 2354 // Since: 0.9 2355 type NatVMRule struct { 2356 ExternalIPAddress string `xml:"ExternalIpAddress,omitempty"` // External IP address to map. 2357 ExternalPort int `xml:"ExternalPort"` // External port to forward to. 2358 VAppScopedVMID string `xml:"VAppScopedVmId"` // VAppScopedVmId of VM to which this rule applies. 2359 VMNicID int `xml:"VmNicId"` // VM NIC ID to which this rule applies. 2360 InternalPort int `xml:"InternalPort"` // Internal port to forward to. 2361 Protocol string `xml:"Protocol,omitempty"` // Protocol to forward. One of: TCP (forward TCP packets), UDP (forward UDP packets), TCP_UDP (forward TCP and UDP packets). 2362 } 2363 2364 // QueryResultEdgeGatewayRecordsType is a container for query results in records format. 2365 // Type: QueryResultRecordsType 2366 // Namespace: http://www.vmware.com/vcloud/v1.5 2367 // Description: Container for query results in records format. 2368 // Since: 1.5 2369 type QueryResultEdgeGatewayRecordsType struct { 2370 // Attributes 2371 HREF string `xml:"href,attr,omitempty"` // The URI of the entity. 2372 Type string `xml:"type,attr,omitempty"` // The MIME type of the entity. 2373 Name string `xml:"name,attr,omitempty"` // The name of the entity. 2374 Page int `xml:"page,attr,omitempty"` // Page of the result set that this container holds. The first page is page number 1. 2375 PageSize int `xml:"pageSize,attr,omitempty"` // Page size, as a number of records or references. 2376 Total float64 `xml:"total,attr,omitempty"` // Total number of records or references in the container. 2377 // Elements 2378 Link []*Link `xml:"Link,omitempty"` // A reference to an entity or operation associated with this object. 2379 EdgeGatewayRecord []*QueryResultEdgeGatewayRecordType `xml:"EdgeGatewayRecord"` // A record representing a EdgeGateway result. 2380 } 2381 2382 type QueryResultRecordsType struct { 2383 // Attributes 2384 HREF string `xml:"href,attr,omitempty"` // The URI of the entity. 2385 Type string `xml:"type,attr,omitempty"` // The MIME type of the entity. 2386 Name string `xml:"name,attr,omitempty"` // The name of the entity. 2387 Page int `xml:"page,attr,omitempty"` // Page of the result set that this container holds. The first page is page number 1. 2388 PageSize int `xml:"pageSize,attr,omitempty"` // Page size, as a number of records or references. 2389 Total float64 `xml:"total,attr,omitempty"` // Total number of records or references in the container. 2390 // Elements 2391 Link []*Link `xml:"Link,omitempty"` // A reference to an entity or operation associated with this object. 2392 EdgeGatewayRecord []*QueryResultEdgeGatewayRecordType `xml:"EdgeGatewayRecord"` // A record representing a EdgeGateway result. 2393 VMRecord []*QueryResultVMRecordType `xml:"VMRecord"` // A record representing a VM result. 2394 AdminVMRecord []*QueryResultVMRecordType `xml:"AdminVMRecord"` // A record representing a Admin VM result. 2395 VAppRecord []*QueryResultVAppRecordType `xml:"VAppRecord"` // A record representing a VApp result. 2396 AdminVAppRecord []*QueryResultVAppRecordType `xml:"AdminVAppRecord"` // A record representing a VApp result as admin. 2397 OrgVdcStorageProfileRecord []*QueryResultOrgVdcStorageProfileRecordType `xml:"OrgVdcStorageProfileRecord"` // A record representing storage profiles 2398 AdminOrgVdcStorageProfileRecord []*QueryResultAdminOrgVdcStorageProfileRecordType `xml:"AdminOrgVdcStorageProfileRecord"` // A record representing storage profiles as admin 2399 MediaRecord []*MediaRecordType `xml:"MediaRecord"` // A record representing media 2400 AdminMediaRecord []*MediaRecordType `xml:"AdminMediaRecord"` // A record representing Admin media 2401 VMWProviderVdcRecord []*QueryResultVMWProviderVdcRecordType `xml:"VMWProviderVdcRecord"` // A record representing a Provider VDC result. 2402 ProviderVdcStorageProfileRecord []*QueryResultProviderVdcStorageProfileRecordType `xml:"ProviderVdcStorageProfileRecord"` // A record representing a Provider VDC storage profile result 2403 NetworkPoolRecord []*QueryResultNetworkPoolRecordType `xml:"NetworkPoolRecord"` // A record representing a network pool 2404 DiskRecord []*DiskRecordType `xml:"DiskRecord"` // A record representing a independent Disk. 2405 AdminDiskRecord []*DiskRecordType `xml:"AdminDiskRecord"` // A record representing a independent Disk. 2406 VirtualCenterRecord []*QueryResultVirtualCenterRecordType `xml:"VirtualCenterRecord"` // A record representing a vSphere server 2407 PortGroupRecord []*PortGroupRecordType `xml:"PortgroupRecord"` // A record representing a port group 2408 OrgVdcNetworkRecord []*QueryResultOrgVdcNetworkRecordType `xml:"OrgVdcNetworkRecord"` // A record representing a org VDC network 2409 CatalogRecord []*CatalogRecord `xml:"CatalogRecord"` // A record representing a catalog 2410 AdminCatalogRecord []*CatalogRecord `xml:"AdminCatalogRecord"` // A record representing an admin catalog 2411 CatalogItemRecord []*QueryResultCatalogItemType `xml:"CatalogItemRecord"` // A record representing a catalog item 2412 AdminCatalogItemRecord []*QueryResultCatalogItemType `xml:"AdminCatalogItemRecord"` // A record representing an admin catalog item 2413 VappTemplateRecord []*QueryResultVappTemplateType `xml:"VAppTemplateRecord"` // A record representing a vApp template 2414 AdminVappTemplateRecord []*QueryResultVappTemplateType `xml:"AdminVAppTemplateRecord"` // A record representing an admin vApp template 2415 NsxtManagerRecord []*QueryResultNsxtManagerRecordType `xml:"NsxTManagerRecord"` // A record representing NSX-T manager 2416 OrgVdcRecord []*QueryResultOrgVdcRecordType `xml:"OrgVdcRecord"` // A record representing Org VDC 2417 OrgVdcAdminRecord []*QueryResultOrgVdcRecordType `xml:"AdminVdcRecord"` // A record representing Org VDC 2418 ResourcePoolRecord []*QueryResultResourcePoolRecordType `xml:"ResourcePoolRecord"` // A record representing a Resource Pool 2419 VmGroupsRecord []*QueryResultVmGroupsRecordType `xml:"VmGroupsRecord"` // A record representing a VM Group 2420 TaskRecord []*QueryResultTaskRecordType `xml:"TaskRecord"` // A record representing a Task 2421 AdminTaskRecord []*QueryResultTaskRecordType `xml:"AdminTaskRecord"` // A record representing an Admin Task 2422 VappNetworkRecord []*QueryResultVappNetworkRecordType `xml:"VAppNetworkRecord"` // A record representing a vApp network 2423 AdminVappNetworkRecord []*QueryResultVappNetworkRecordType `xml:"AdminVAppNetworkRecord"` // A record representing an admin vApp network 2424 } 2425 2426 // QueryResultVmGroupsRecordType represent a VM Groups record 2427 type QueryResultVmGroupsRecordType struct { 2428 HREF string `xml:"href,attr,omitempty"` 2429 ID string `xml:"vmGroupId,attr,omitempty"` 2430 Name string `xml:"vmGroupName,attr,omitempty"` 2431 ClusterMoref string `xml:"clusterMoref,attr,omitempty"` 2432 ClusterName string `xml:"clusterName,attr,omitempty"` 2433 VcenterId string `xml:"vcId,attr,omitempty"` 2434 NamedVmGroupId string `xml:"namedVmGroupId,attr,omitempty"` 2435 } 2436 2437 type QueryResultVappNetworkRecordType struct { 2438 HREF string `xml:"href,attr,omitempty"` 2439 ID string `xml:"id,attr,omitempty"` 2440 Name string `xml:"name,attr,omitempty"` 2441 Type string `xml:"linkType,attr,omitempty"` 2442 IpScopeId string `xml:"ipScopeId,attr,omitempty"` 2443 IpScopeInherited bool `xml:"ipScopeInherited,attr,omitempty"` 2444 Gateway string `xml:"gateway,attr,omitempty"` 2445 Netmask string `xml:"netmask,attr,omitempty"` 2446 SubnetPrefixLength int `xml:"subnetPrefixLength,attr,omitempty"` 2447 Dns1 string `xml:"dns1,attr,omitempty"` 2448 Dns2 string `xml:"dns2,attr,omitempty"` 2449 DnsSuffix string `xml:"dnsSuffix,attr,omitempty"` 2450 Vapp string `xml:"vApp,attr,omitempty"` // the HREF of the parent vApp 2451 VappName string `xml:"vAppName,attr,omitempty"` // the name of the parent vApp 2452 LinkNetworkName string `xml:"linkNetworkName,attr,omitempty"` // this field is filled when called in tenant context 2453 RealNetworkName string `xml:"realNetworkName,attr,omitempty"` 2454 RealNetworkPortgroupId string `xml:"realNetworkPortgroupId,attr,omitempty"` 2455 VCenterName string `xml:"vcName,attr,omitempty"` 2456 VCenter string `xml:"vc,attr,omitempty"` 2457 IsBusy bool `xml:"isBusy,attr,omitempty"` 2458 IsLinked bool `xml:"isLinked,attr,omitempty"` 2459 RetainNicResources bool `xml:"retainNicResources,attr,omitempty"` 2460 Metadata *Metadata `xml:"Metadata,omitempty"` 2461 } 2462 2463 // QueryResultResourcePoolRecordType represent a Resource Pool record 2464 type QueryResultResourcePoolRecordType struct { 2465 HREF string `xml:"href,attr,omitempty"` 2466 Name string `xml:"name,attr,omitempty"` 2467 Moref string `xml:"moref,attr,omitempty"` 2468 IsDeleted bool `xml:"isDeleted,attr,omitempty"` 2469 VcenterHREF string `xml:"vc,attr,omitempty"` 2470 VcenterName string `xml:"vcName,attr,omitempty"` 2471 ProviderVdcHREF string `xml:"providerVdc,attr,omitempty"` 2472 ProviderName string `xml:"providerName,attr,omitempty"` 2473 IsEnabled bool `xml:"isEnabled,attr,omitempty"` 2474 IsPrimary bool `xml:"isPrimary,attr,omitempty"` 2475 ClusterMoref string `xml:"clusterMoref,attr,omitempty"` 2476 IsKubernetesEnabled bool `xml:"isKubernetesEnabled,attr,omitempty"` 2477 } 2478 2479 // QueryResultOrgVdcRecordType represents an Org VDC record 2480 type QueryResultOrgVdcRecordType struct { 2481 HREF string `xml:"href,attr,omitempty"` 2482 Name string `xml:"name,attr,omitempty"` 2483 ComputeProviderScope string `xml:"computeProviderScope,attr,omitempty"` 2484 NetworkProviderScope string `xml:"networkProviderScope,attr,omitempty"` 2485 IsEnabled string `xml:"isEnabled,attr,omitempty"` 2486 CpuAllocationMhz *int `xml:"cpuAllocationMhz,attr,omitempty"` 2487 CpuLimitMhz *int `xml:"cpuLimitMhz,attr,omitempty"` 2488 CpuUsedMhz *int `xml:"cpuUsedMhz,attr,omitempty"` 2489 MemoryAllocationMB *int `xml:"memoryAllocationMB,attr,omitempty"` 2490 MemoryLimitMB *int `xml:"memoryLimitMB,attr,omitempty"` 2491 MemoryUsedMB *int `xml:"memoryUsedMB,attr,omitempty"` 2492 StorageLimitMB *int `xml:"storageLimitMB,attr,omitempty"` 2493 StorageUsedMB *int `xml:"storageUsedMB,attr,omitempty"` 2494 StorageOverheadMB *int `xml:"storageOverheadMB,attr,omitempty"` 2495 MemoryOverheadMB *int `xml:"memoryOverheadMB,attr,omitempty"` 2496 NumberOfVApps *int `xml:"numberOfVApps,attr,omitempty"` 2497 NumberOfUnmanagedVApps *int `xml:"numberOfUnmanagedVApps,attr,omitempty"` 2498 NumberOfMedia *int `xml:"numberOfMedia,attr,omitempty"` 2499 NumberOfDisks *int `xml:"numberOfDisks,attr,omitempty"` 2500 NumberOfVAppTemplates *int `xml:"numberOfVAppTemplates,attr,omitempty"` 2501 NumberOfStorageProfiles *int `xml:"numberOfStorageProfiles,attr,omitempty"` 2502 NumberOfVMs *int `xml:"numberOfVMs,attr,omitempty"` 2503 NumberOfRunningVMs *int `xml:"numberOfRunningVMs,attr,omitempty"` 2504 NumberOfDeployedVApps *int `xml:"numberOfDeployedVApps,attr,omitempty"` 2505 NumberOfDeployedUnmanagedVApps *int `xml:"numberOfDeployedUnmanagedVApps,attr,omitempty"` 2506 CpuOverheadMhz *int `xml:"cpuOverheadMhz,attr,omitempty"` 2507 OrgName string `xml:"orgName,attr,omitempty"` 2508 AllocationModel string `xml:"allocationModel,attr,omitempty"` 2509 VcName string `xml:"vcName,attr,omitempty"` 2510 IsBusy string `xml:"isBusy,attr,omitempty"` 2511 Status string `xml:"status,attr,omitempty"` 2512 TaskStatusName string `xml:"taskStatusName,attr,omitempty"` 2513 Task string `xml:"task,attr,omitempty"` 2514 TaskStatus string `xml:"taskStatus,attr,omitempty"` 2515 TaskDetails string `xml:"taskDetails,attr,omitempty"` 2516 Metadata *Metadata `xml:"Metadata,omitempty"` 2517 2518 // Admin Org VDC fields 2519 ProviderVdcName string `xml:"providerVdcName,attr,omitempty"` 2520 ProviderVdc string `xml:"providerVdc,attr,omitempty"` 2521 Org string `xml:"org,attr,omitempty"` 2522 NetworkPool string `xml:"networkPool,attr,omitempty"` 2523 NumberOfResourcePools *int `xml:"numberOfResourcePools,attr,omitempty"` 2524 UsedNetworksInVdc string `xml:"usedNetworksInVdc,attr,omitempty"` 2525 IsThinProvisioned string `xml:"isThinProvisioned,attr,omitempty"` 2526 IsFastProvisioned string `xml:"isFastProvisioned,attr,omitempty"` 2527 NetworkProviderType string `xml:"networkProviderType,attr,omitempty"` 2528 IsVCEnabled string `xml:"isVCEnabled,attr,omitempty"` 2529 MemoryReservedMB *int `xml:"memoryReservedMB,attr,omitempty"` 2530 CpuReservedMhz *int `xml:"cpuReservedMhz,attr,omitempty"` 2531 Vc string `xml:"vc,attr,omitempty"` 2532 } 2533 2534 // QueryResultCatalogItemType represents a catalog item as query result 2535 type QueryResultCatalogItemType struct { 2536 HREF string `xml:"href,attr,omitempty"` // The URI of the entity. 2537 ID string `xml:"id,attr,omitempty"` // Catalog Item ID. 2538 Type string `xml:"type,attr,omitempty"` // The MIME type of the entity. 2539 Entity string `xml:"entity,attr,omitempty"` // Entity reference or ID 2540 EntityName string `xml:"entityName,attr,omitempty"` // Entity name 2541 EntityType string `xml:"entityType,attr,omitempty"` // Entity type 2542 Catalog string `xml:"catalog,attr,omitempty"` // Catalog reference or ID 2543 CatalogName string `xml:"catalogName,attr,omitempty"` // Catalog name 2544 OwnerName string `xml:"ownerName,attr,omitempty"` // Owner name 2545 Owner string `xml:"owner,attr,omitempty"` // Owner reference or ID 2546 IsPublished bool `xml:"isPublished,attr,omitempty"` // True if this entity is in a published catalog 2547 Vdc string `xml:"vdc,attr,omitempty"` // VDC reference or ID 2548 VdcName string `xml:"vdcName,attr,omitempty"` // VDC name 2549 IsVdcEnabled bool `xml:"isVdcEnabled,attr,omitempty"` // True if the containing VDC is enabled 2550 CreationDate string `xml:"creationDate,attr,omitempty"` // Creation date 2551 IsExpired bool `xml:"isExpired,attr,omitempty"` // True if this entity is expired 2552 Status string `xml:"status,attr,omitempty"` // Status 2553 Name string `xml:"name,attr,omitempty"` // Catalog Item name. 2554 Link *Link `xml:"Link,omitempty"` 2555 Metadata *Metadata `xml:"Metadata,omitempty"` 2556 } 2557 2558 // QueryResultVappTemplateType represents a vApp template as query result 2559 type QueryResultVappTemplateType struct { 2560 HREF string `xml:"href,attr,omitempty"` // The URI of the entity. 2561 ID string `xml:"id,attr,omitempty"` // vApp template ID. 2562 Type string `xml:"type,attr,omitempty"` // The MIME type of the entity. 2563 OwnerName string `xml:"ownerName,attr,omitempty"` // Owner name 2564 Owner string `xml:"owner,attr,omitempty"` // Owner reference or ID 2565 CatalogName string `xml:"catalogName,attr,omitempty"` // Catalog name 2566 Catalog string `xml:"catalog,attr,omitempty"` // Catalog reference or ID 2567 CatalogItem string `xml:"catalogItem,attr,omitempty"` // CatalogItem reference or ID 2568 IsPublished bool `xml:"isPublished,attr,omitempty"` // True if this entity is in a published catalog 2569 PublishSubscriptionType string `xml:"publishSubscriptionType,attr,omitempty"` // PUBLISHED if parent catalog published externally, SUBSCRIBED if parent catalog subscribed to an external catalog, UNPUBLISHED otherwise. 2570 Name string `xml:"name,attr,omitempty"` // vApp template name. 2571 Description string `xml:"description,attr,omitempty"` // vApp template description. 2572 Vdc string `xml:"vdc,attr,omitempty"` // VDC reference or ID 2573 VdcName string `xml:"vdcName,attr,omitempty"` // VDC name 2574 IsVdcEnabled bool `xml:"isVdcEnabled,attr,omitempty"` // true if the containing VDC is enabled 2575 Org string `xml:"org,attr,omitempty"` // Organization reference or ID 2576 CreationDate string `xml:"creationDate,attr,omitempty"` // Creation date 2577 IsBusy bool `xml:"isBusy,attr,omitempty"` // True if the vApp template is busy 2578 IsGoldMaster bool `xml:"isGoldMaster,attr,omitempty"` // True if the vApp template is a gold master 2579 IsEnabled bool `xml:"isEnabled,attr,omitempty"` // True if the vApp template is enabled 2580 Status string `xml:"status,attr,omitempty"` // Status 2581 IsDeployed bool `xml:"isDeployed,attr,omitempty"` // True if this entity is deployed 2582 IsExpired bool `xml:"isExpired,attr,omitempty"` // True if this entity is expired 2583 StorageProfileName string `xml:"storageProfileName,attr,omitempty"` // Storage profile name 2584 Version string `xml:"version,attr,omitempty"` // Storage profile name 2585 LastSuccessfulSync string `xml:"lastSuccessfulSync,attr,omitempty"` // Date of last successful sync 2586 Link *Link `xml:"Link,omitempty"` 2587 Metadata *Metadata `xml:"Metadata,omitempty"` 2588 2589 // Undocumented fields 2590 // Provisionally used in some catalog synchronisation tasks. To be removed and replaced by using a different algorithm 2591 // https://developer.vmware.com/apis/1260/vmware-cloud-director/doc/doc/types/QueryResultAdminVAppTemplateRecordType.html 2592 // https://developer.vmware.com/apis/1260/vmware-cloud-director/doc/doc/types/QueryResultVAppTemplateRecordType.html 2593 IsInCatalog bool `xml:"isInCatalog,attr,omitempty"` // True if this vApp template is in a catalog 2594 HonorBootOrder bool `xml:"honorBootOrder,attr,omitempty"` // ? 2595 NumberOfShadowVms int `xml:"numberOfShadowVMs,attr,omitempty"` // number of shadow VMs 2596 NumberOfVms int `xml:"numberOfVMs,attr,omitempty"` // number of VMs 2597 TaskStatusName string `xml:"taskStatusName,attr,omitempty"` // name of the associated task 2598 TaskStatus string `xml:"taskStatus,attr,omitempty"` // status of the associated task 2599 Task string `xml:"task,attr,omitempty"` // ID or reference of the associated task 2600 TaskDetails string `xml:"taskDetails,attr,omitempty"` // details of the associated task 2601 IsDeleteUndeployNotified bool `xml:"isDeleteUndeployNotified,attr,omitempty"` // ? 2602 IsAutoUndeployNotified bool `xml:"isAutoUndeployNotified,attr,omitempty"` // ? 2603 CpuAllocationInMhz int `xml:"cpuAllocationInMhz,attr,omitempty"` // CPU allocation 2604 NumberOfCpus int `xml:"numberOfCpus,attr,omitempty"` // Number of CPUs 2605 MemoryAllocationMb int `xml:"memoryAllocationMB,attr,omitempty"` // Memory allocation in MB 2606 StorageKb int `xml:"storageKB,attr,omitempty"` // Storage allocation in Kb 2607 } 2608 2609 // QueryResultEdgeGatewayRecordType represents an edge gateway record as query result. 2610 type QueryResultEdgeGatewayRecordType struct { 2611 // Attributes 2612 HREF string `xml:"href,attr,omitempty"` // The URI of the entity. 2613 Type string `xml:"type,attr,omitempty"` // The MIME type of the entity. 2614 Name string `xml:"name,attr,omitempty"` // EdgeGateway name. 2615 Vdc string `xml:"vdc,attr,omitempty"` // VDC Reference or ID 2616 OrgVdcName string `xml:"orgVdcName,attr,omitempty"` // VDC name 2617 NumberOfExtNetworks int `xml:"numberOfExtNetworks,attr,omitempty"` // Number of external networks connected to the edgeGateway. Yes Yes 2618 NumberOfOrgNetworks int `xml:"numberOfOrgNetworks,attr,omitempty"` // Number of org VDC networks connected to the edgeGateway Yes Yes 2619 IsBusy bool `xml:"isBusy,attr"` // True if this Edge Gateway is busy. Yes Yes 2620 GatewayStatus string `xml:"gatewayStatus,attr,omitempty"` // 2621 HaStatus string `xml:"haStatus,attr,omitempty"` // High Availability Status of the edgeGateway Yes Yes 2622 } 2623 2624 // QueryResultVMRecordType represents a VM record as query result. 2625 type QueryResultVMRecordType struct { 2626 // Attributes 2627 HREF string `xml:"href,attr,omitempty"` // The URI of the entity. 2628 ID string `xml:"id,attr,omitempty"` 2629 Moref string `xml:"moref,attr,omitempty"` // VM moref id. 2630 Name string `xml:"name,attr,omitempty"` // VM name. 2631 Type string `xml:"type,attr,omitempty"` // Contains the type of the resource. 2632 ContainerName string `xml:"containerName,attr,omitempty"` // The name of the vApp or vApp template that contains this VM. 2633 ContainerID string `xml:"container,attr,omitempty"` // The ID of the vApp or vApp template that contains this VM. 2634 OwnerName string `xml:"ownerName,attr,omitempty"` 2635 Owner string `xml:"owner,attr,omitempty"` 2636 VdcHREF string `xml:"vdc,attr,omitempty"` 2637 VdcName string `xml:"vdcName,attr,omitempty"` 2638 VAppTemplate bool `xml:"isVAppTemplate,attr,omitempty"` 2639 Deleted bool `xml:"isDeleted,attr,omitempty"` 2640 GuestOS string `xml:"guestOs,attr,omitempty"` 2641 Cpus int `xml:"numberOfCpus,attr,omitempty"` 2642 MemoryMB int `xml:"memoryMB,attr,omitempty"` 2643 Status string `xml:"status,attr,omitempty"` 2644 NetworkName string `xml:"networkName,attr,omitempty"` 2645 NetworkHref string `xml:"network,attr,omitempty"` 2646 IpAddress string `xml:"ipAddress,attr,omitempty"` // If configured, the IP Address of the VM on the primary network, otherwise empty. 2647 Busy bool `xml:"isBusy,attr,omitempty"` 2648 Deployed bool `xml:"isDeployed,attr,omitempty"` // True if the virtual machine is deployed. 2649 Published bool `xml:"isPublished,attr,omitempty"` 2650 CatalogName string `xml:"catalogName,attr,omitempty"` 2651 HardwareVersion int `xml:"hardwareVersion,attr,omitempty"` 2652 VmToolsStatus string `xml:"vmToolsStatus,attr,omitempty"` 2653 MaintenanceMode bool `xml:"isInMaintenanceMode,attr,omitempty"` 2654 AutoNature bool `xml:"isAutoNature,attr,omitempty"` // True if the parent vApp is a managed vApp 2655 StorageProfileName string `xml:"storageProfileName,attr,omitempty"` 2656 GcStatus string `xml:"gcStatus,attr,omitempty"` // GC status of this VM. 2657 AutoUndeployDate string `xml:"autoUndeployDate,attr,omitempty"` 2658 AutoDeleteDate string `xml:"autoDeleteDate,attr,omitempty"` 2659 AutoUndeployNotified bool `xml:"isAutoUndeployNotified,attr,omitempty"` 2660 AutoDeleteNotified bool `xml:"isAutoDeleteNotified,attr,omitempty"` 2661 IsComputePolicyCompliant bool `xml:"isComputePolicyCompliant,attr,omitempty"` 2662 VmSizingPolicyId string `xml:"vmSizingPolicyId,attr,omitempty"` 2663 VmPlacementPolicyId string `xml:"vmPlacementPolicyId,attr,omitempty"` 2664 Encrypted bool `xml:"encrypted,attr,omitempty"` 2665 DateCreated string `xml:"dateCreated,attr,omitempty"` 2666 TotalStorageAllocatedMb string `xml:"totalStorageAllocatedMb,attr,omitempty"` 2667 IsExpired bool `xml:"isExpired,attr,omitempty"` 2668 HostName string `xml:"hostName,attr,omitempty"` // HostName=Hypervisor of virtual machine 2669 Link []*Link `xml:"Link,omitempty"` 2670 MetaData *Metadata `xml:"Metadata,omitempty"` 2671 } 2672 2673 // QueryResultVAppRecordType represents a VM record as query result. 2674 type QueryResultVAppRecordType struct { 2675 // Attributes 2676 HREF string `xml:"href,attr,omitempty"` // The URI of the entity. 2677 Name string `xml:"name,attr"` // The name of the entity. 2678 CreationDate string `xml:"creationDate,attr,omitempty"` // Creation date/time of the vApp. 2679 Busy bool `xml:"isBusy,attr,omitempty"` 2680 Deployed bool `xml:"isDeployed,attr,omitempty"` // True if the vApp is deployed. 2681 Enabled bool `xml:"isEnabled,attr,omitempty"` 2682 Expired bool `xml:"isExpired,attr,omitempty"` 2683 MaintenanceMode bool `xml:"isInMaintenanceMode,attr,omitempty"` 2684 Public bool `xml:"isPublic,attr,omitempty"` 2685 OwnerName string `xml:"ownerName,attr,omitempty"` 2686 Status string `xml:"status,attr,omitempty"` 2687 VdcHREF string `xml:"vdc,attr,omitempty"` 2688 VdcName string `xml:"vdcName,attr,omitempty"` 2689 NumberOfVMs int `xml:"numberOfVMs,attr,omitempty"` 2690 NumberOfCPUs int `xml:"numberOfCpus,attr,omitempty"` 2691 CpuAllocationMhz int `xml:"cpuAllocationMhz,attr,omitempty"` 2692 CpuAllocationInMhz int `xml:"cpuAllocationInMhz,attr,omitempty"` 2693 StorageKB int `xml:"storageKB,attr,omitempty"` 2694 MemoryAllocationMB int `xml:"memoryAllocationMB,attr,omitempty"` 2695 AutoDeleteNotified bool `xml:"isAutoDeleteNotified,attr,omitempty"` 2696 AutoUndeployNotified bool `xml:"isAutoUndeployNotified,attr,omitempty"` 2697 VdcEnabled bool `xml:"isVdcEnabled,attr,omitempty"` 2698 HonorBootOrder bool `xml:"honorBookOrder,attr,omitempty"` 2699 HighestSupportedVersion int `xml:"pvdcHighestSupportedHardwareVersion,attr,omitempty"` 2700 LowestHardwareVersion int `xml:"lowestHardwareVersionInVApp,attr,omitempty"` 2701 TaskHREF string `xml:"task,attr,omitempty"` 2702 TaskStatusName string `xml:"taskStatusName,attr,omitempty"` 2703 TaskStatus string `xml:"TaskStatus,attr,omitempty"` 2704 TaskDetails string `xml:"taskDetails,attr,omitempty"` 2705 MetaData *Metadata `xml:"Metadata,omitempty"` 2706 } 2707 2708 // QueryResultOrgVdcStorageProfileRecordType represents a storage 2709 // profile as query result. 2710 // https://code.vmware.com/apis/722/vmware-cloud-director/doc/doc/types/QueryResultOrgVdcStorageProfileRecordType.html 2711 type QueryResultOrgVdcStorageProfileRecordType struct { 2712 // Attributes 2713 HREF string `xml:"href,attr,omitempty"` // The URI of the entity. 2714 ID string `xml:"id,attr,omitempty"` // The ID of the entity. 2715 Type string `xml:"type,attr,omitempty"` // Contains the type of the resource. 2716 Name string `xml:"name,attr,omitempty"` // Name of the storage profile. 2717 IsEnabled bool `xml:"isEnabled,attr,omitempty"` // True if this entity is enabled. 2718 IsDefaultStorageProfile bool `xml:"isDefaultStorageProfile,attr,omitempty"` // True if this is the default storage profile for a VDC. 2719 StorageUsedMB uint64 `xml:"storageUsedMB,attr,omitempty"` // Storage used in MB. 2720 StorageLimitMB uint64 `xml:"storageLimitMB,attr,omitempty"` // Storage limit in MB. 2721 IopsAllocated uint64 `xml:"iopsAllocated,attr,omitempty"` // Total currently allocated IOPS on the storage profile. 2722 IopsLimit uint64 `xml:"iopsLimit,attr,omitempty"` // IOPS limit for the storage profile. 2723 NumberOfConditions int `xml:"numberOfConditions,attr,omitempty"` // Number of conditions on the storage profile. 2724 Vdc string `xml:"vdc,attr,omitempty"` // VDC reference or id. 2725 VdcName string `xml:"vdcName,attr,omitempty"` // VDC name. 2726 IsVdcBusy bool `xml:"isVdcBusy,attr,omitempty"` // True if the associated VDC is busy. 2727 // Elements 2728 Link []*Link `xml:"Link,omitempty"` 2729 MetadataEntry []*MetadataEntry `xml:"MetadataEntry,omitempty"` 2730 } 2731 2732 // QueryResultAdminOrgVdcStorageProfileRecordType represents a storage 2733 // profile as query result. 2734 // https://code.vmware.com/apis/722/vmware-cloud-director/doc/doc/types/QueryResultAdminOrgVdcStorageProfileRecordType.html 2735 type QueryResultAdminOrgVdcStorageProfileRecordType struct { 2736 // Attributes 2737 HREF string `xml:"href,attr,omitempty"` // The URI of the entity. 2738 ID string `xml:"id,attr,omitempty"` // The ID of the entity. 2739 Type string `xml:"type,attr,omitempty"` // Contains the type of the resource. 2740 Name string `xml:"name,attr,omitempty"` // Name of the storage profile. 2741 IsEnabled bool `xml:"isEnabled,attr,omitempty"` // True if this entity is enabled. 2742 IsDefaultStorageProfile bool `xml:"isDefaultStorageProfile,attr,omitempty"` // True if this is the default storage profile for a VDC. 2743 StorageUsedMB uint64 `xml:"storageUsedMB,attr,omitempty"` // Storage used in MB. 2744 StorageLimitMB uint64 `xml:"storageLimitMB,attr,omitempty"` // Storage limit in MB. 2745 IopsAllocated uint64 `xml:"iopsAllocated,attr,omitempty"` // Total currently allocated IOPS on the storage profile. 2746 IopsLimit uint64 `xml:"iopsLimit,attr,omitempty"` // IOPS limit for the storage profile. 2747 NumberOfConditions int `xml:"numberOfConditions,attr,omitempty"` // Number of conditions on the storage profile. 2748 Vdc string `xml:"vdc,attr,omitempty"` // VDC reference or id. 2749 VdcName string `xml:"vdcName,attr,omitempty"` // VDC name. 2750 Org string `xml:"org,attr,omitempty"` // Organization reference or id. 2751 VC string `xml:"vc,attr,omitempty"` // Virtual center reference or id. 2752 StorageProfileMoref string `xml:"storageProfileMoref,omitempty"` 2753 // Elements 2754 Link []*Link `xml:"Link,omitempty"` 2755 MetadataEntry []*MetadataEntry `xml:"MetadataEntry,omitempty"` 2756 } 2757 2758 // QueryResultVMWProviderVdcRecordType represents a Provider VDC as query result. 2759 type QueryResultVMWProviderVdcRecordType struct { 2760 // Attributes 2761 HREF string `xml:"href,attr,omitempty"` // The URI of the entity. 2762 Name string `xml:"name,attr,omitempty"` // Provider VDC name. 2763 Status string `xml:"status,attr,omitempty"` 2764 IsBusy bool `xml:"isBusy,attr,omitempty"` 2765 IsDeleted bool `xml:"isDeleted,attr,omitempty"` 2766 IsEnabled bool `xml:"isEnabled,attr,omitempty"` 2767 CpuAllocationMhz int `xml:"cpuAllocationMhz,attr,omitempty"` 2768 CpuLimitMhz int `xml:"cpuLimitMhz,attr,omitempty"` 2769 CpuUsedMhz int `xml:"cpuUsedMhz,attr,omitempty"` 2770 NumberOfDatastores int `xml:"numberOfDatastores,attr,omitempty"` 2771 NumberOfStorageProfiles int `xml:"numberOfStorageProfiles,attr,omitempty"` 2772 NumberOfVdcs int `xml:"numberOfVdcs,attr,omitempty"` 2773 MemoryAllocationMB int64 `xml:"memoryAllocationMB,attr,omitempty"` 2774 MemoryLimitMB int64 `xml:"memoryLimitMB,attr,omitempty"` 2775 MemoryUsedMB int64 `xml:"memoryUsedMB,attr,omitempty"` 2776 StorageAllocationMB int64 `xml:"storageAllocationMB,attr,omitempty"` 2777 StorageLimitMB int64 `xml:"storageLimitMB,attr,omitempty"` 2778 StorageUsedMB int64 `xml:"storageUsedMB,attr,omitempty"` 2779 CpuOverheadMhz int64 `xml:"cpuOverheadMhz,attr,omitempty"` 2780 StorageOverheadMB int64 `xml:"storageOverheadMB,attr,omitempty"` 2781 MemoryOverheadMB int64 `xml:"memoryOverheadMB,attr,omitempty"` 2782 } 2783 2784 // QueryResultProviderVdcStorageProfileRecordType represents a Provider VDC storage profile as query result. 2785 type QueryResultProviderVdcStorageProfileRecordType struct { 2786 // Attributes 2787 HREF string `xml:"href,attr,omitempty"` // The URI of the entity. 2788 Name string `xml:"name,attr,omitempty"` // Provider VDC Storage Profile name. 2789 ProviderVdcHREF string `xml:"providerVdc,attr,omitempty"` 2790 VcHREF string `xml:"vc,attr,omitempty"` 2791 StorageProfileMoref string `xml:"storageProfileMoref,attr,omitempty"` 2792 IsEnabled bool `xml:"isEnabled,attr,omitempty"` 2793 StorageProvisionedMB int64 `xml:"storageProvisionedMB,attr,omitempty"` 2794 StorageRequestedMB int64 `xml:"storageRequestedMB,attr,omitempty"` 2795 StorageTotalMB int64 `xml:"storageTotalMB,attr,omitempty"` 2796 StorageUsedMB int64 `xml:"storageUsedMB,attr,omitempty"` 2797 NumberOfConditions int `xml:"numberOfConditions,attr,omitempty"` 2798 } 2799 2800 // QueryResultNetworkPoolRecordType represents a network pool as query result. 2801 type QueryResultNetworkPoolRecordType struct { 2802 // Attributes 2803 HREF string `xml:"href,attr,omitempty"` // The URI of the entity. 2804 Name string `xml:"name,attr,omitempty"` // Network pool name. 2805 IsBusy bool `xml:"isBusy,attr,omitempty"` 2806 NetworkPoolType int `xml:"networkPoolType,attr,omitempty"` 2807 } 2808 2809 // Type: QueryResultVirtualCenterRecordType 2810 // Namespace: http://www.vmware.com/vcloud/v1.5 2811 // https://vdc-repo.vmware.com/vmwb-repository/dcr-public/7a028e78-bd37-4a6a-8298-9c26c7eeb9aa/09142237-dd46-4dee-8326-e07212fb63a8/doc/doc/types/QueryResultVirtualCenterRecordType.html 2812 // Description: Type for a single virtualCenter query result in records format. 2813 // Since: 1.5 2814 type QueryResultVirtualCenterRecordType struct { 2815 HREF string `xml:"href,attr,omitempty"` 2816 Name string `xml:"name,attr,omitempty"` 2817 IsBusy bool `xml:"isBusy,attr,omitempty"` 2818 IsEnabled bool `xml:"isEnabled,attr,omitempty"` 2819 IsSupported bool `xml:"isSupported,attr,omitempty"` 2820 ListenerState string `xml:"listenerState,attr,omitempty"` 2821 Status string `xml:"status,attr,omitempty"` 2822 Url string `xml:"url,attr,omitempty"` 2823 UserName string `xml:"userName,attr,omitempty"` 2824 VcVersion string `xml:"vcVersion,attr,omitempty"` 2825 UUID string `xml:"uuid,attr,omitempty"` 2826 VsmIP string `xml:"vsmIP,attr,omitempty"` 2827 } 2828 2829 // Namespace: http://www.vmware.com/vcloud/v1.5 2830 // Retrieve a list of extension objects and operations. 2831 // Since: 1.0 2832 type Extension struct { 2833 Link LinkList `xml:"Link,omitempty"` // A reference to an entity or operation associated with this object. 2834 } 2835 2836 // Namespace: http://www.vmware.com/vcloud/v1.5 2837 // Retrieve a list of tasks 2838 type TasksList struct { 2839 XMLName xml.Name `xml:"TasksList"` 2840 Task []*Task `xml:"Task,omitempty"` 2841 } 2842 2843 type ExternalNetworkReferences struct { 2844 ExternalNetworkReference []*ExternalNetworkReference `xml:"ExternalNetworkReference,omitempty"` // A reference to an entity or operation associated with this object. 2845 } 2846 2847 type ExternalNetworkReference struct { 2848 HREF string `xml:"href,attr"` 2849 Type string `xml:"type,attr,omitempty"` 2850 Name string `xml:"name,attr,omitempty"` 2851 } 2852 2853 // Type: VimObjectRefType 2854 // Namespace: http://www.vmware.com/vcloud/extension/v1.5 2855 // https://vdc-repo.vmware.com/vmwb-repository/dcr-public/7a028e78-bd37-4a6a-8298-9c26c7eeb9aa/09142237-dd46-4dee-8326-e07212fb63a8/doc/doc/types/VimObjectRefsType.html 2856 // Description: Represents the Managed Object Reference (MoRef) and the type of a vSphere object. 2857 // Since: 0.9 2858 type VimObjectRef struct { 2859 VimServerRef *Reference `xml:"VimServerRef" json:"vimServerRef"` 2860 MoRef string `xml:"MoRef" json:"moRef"` 2861 VimObjectType string `xml:"VimObjectType" json:"vimObjectType"` 2862 } 2863 2864 // Type: VimObjectRefsType 2865 // Namespace: http://www.vmware.com/vcloud/extension/v1.5 2866 // https://vdc-repo.vmware.com/vmwb-repository/dcr-public/7a028e78-bd37-4a6a-8298-9c26c7eeb9aa/09142237-dd46-4dee-8326-e07212fb63a8/doc/doc/types/VimObjectRefsType.html 2867 // Description: List of VimObjectRef elements. 2868 // Since: 0.9 2869 type VimObjectRefs struct { 2870 VimObjectRef []*VimObjectRef `xml:"VimObjectRef" json:"vimObjectRef"` 2871 } 2872 2873 // Type: VMWExternalNetworkType 2874 // Namespace: http://www.vmware.com/vcloud/extension/v1.5 2875 // https://vdc-repo.vmware.com/vmwb-repository/dcr-public/7a028e78-bd37-4a6a-8298-9c26c7eeb9aa/09142237-dd46-4dee-8326-e07212fb63a8/doc/doc/types/VMWExternalNetworkType.html 2876 // Description: External network type. 2877 // Since: 1.0 2878 type ExternalNetwork struct { 2879 XMLName xml.Name `xml:"VMWExternalNetwork"` 2880 HREF string `xml:"href,attr,omitempty"` 2881 Type string `xml:"type,attr,omitempty"` 2882 ID string `xml:"id,attr,omitempty"` 2883 OperationKey string `xml:"operationKey,attr,omitempty"` 2884 Name string `xml:"name,attr"` 2885 Link []*Link `xml:"Link,omitempty"` 2886 Description string `xml:"Description,omitempty"` 2887 Tasks *TasksInProgress `xml:"Tasks,omitempty"` 2888 Configuration *NetworkConfiguration `xml:"Configuration,omitempty"` 2889 VimPortGroupRef *VimObjectRef `xml:"VimPortGroupRef,omitempty"` 2890 VimPortGroupRefs *VimObjectRefs `xml:"VimPortGroupRefs,omitempty"` 2891 VCloudExtension *VCloudExtension `xml:"VCloudExtension,omitempty"` 2892 } 2893 2894 // Type: MediaType 2895 // Namespace: http://www.vmware.com/vcloud/v1.5 2896 // https://vdc-repo.vmware.com/vmwb-repository/dcr-public/ca48e1bb-282b-4fdc-b827-649b819249ed/55142cf1-5bb8-4ab1-8d09-b84f717af5ec/doc/doc/types/MediaType.html 2897 // Description: Represents Media image 2898 // Since: 0.9 2899 type Media struct { 2900 HREF string `xml:"href,attr,omitempty"` 2901 Type string `xml:"type,attr,omitempty"` 2902 ID string `xml:"id,attr,omitempty"` 2903 OperationKey string `xml:"operationKey,attr,omitempty"` 2904 Name string `xml:"name,attr"` 2905 Status int64 `xml:"status,attr,omitempty"` 2906 ImageType string `xml:"imageType,attr,omitempty"` 2907 Size int64 `xml:"size,attr,omitempty"` 2908 Description string `xml:"Description,omitempty"` 2909 Files *FilesList `xml:"Files,omitempty"` 2910 Link LinkList `xml:"Link,omitempty"` 2911 Tasks *TasksInProgress `xml:"Tasks,omitempty"` 2912 Owner *Reference `xml:"Owner,omitempty"` 2913 Entity *Entity `xml:"Entity"` 2914 } 2915 2916 // Type: MediaRecord 2917 // Namespace: http://www.vmware.com/vcloud/v1.5 2918 // https://code.vmware.com/apis/287/vcloud#/doc/doc/operations/GET-MediasFromQuery.html 2919 // Issue that description partly matches with what is returned 2920 // Description: Represents Media record 2921 // Since: 1.5 2922 type MediaRecordType struct { 2923 HREF string `xml:"href,attr,omitempty"` 2924 ID string `xml:"id,attr,omitempty"` 2925 Type string `xml:"type,attr,omitempty"` 2926 OwnerName string `xml:"ownerName,attr,omitempty"` 2927 CatalogName string `xml:"catalogName,attr,omitempty"` 2928 IsPublished bool `xml:"isPublished,attr,omitempty"` 2929 Name string `xml:"name,attr"` 2930 Vdc string `xml:"vdc,attr,omitempty"` 2931 VdcName string `xml:"vdcName,attr,omitempty"` 2932 Org string `xml:"org,attr,omitempty"` 2933 CreationDate string `xml:"creationDate,attr,omitempty"` 2934 IsBusy bool `xml:"isBusy,attr,omitempty"` 2935 StorageB int64 `xml:"storageB,attr,omitempty"` 2936 Owner string `xml:"owner,attr,omitempty"` 2937 Catalog string `xml:"catalog,attr,omitempty"` 2938 CatalogItem string `xml:"catalogItem,attr,omitempty"` 2939 Status string `xml:"status,attr,omitempty"` 2940 StorageProfileName string `xml:"storageProfileName,attr,omitempty"` 2941 Version int64 `xml:"version,attr,omitempty"` 2942 LastSuccessfulSync string `xml:"lastSuccessfulSync,attr,omitempty"` 2943 TaskStatusName string `xml:"taskStatusName,attr,omitempty"` 2944 IsInCatalog bool `xml:"isInCatalog,attr,omitempty"` 2945 Task string `xml:"task,attr,omitempty"` 2946 IsIso bool `xml:"isIso,attr,omitempty"` 2947 IsVdcEnabled bool `xml:"isVdcEnabled,attr,omitempty"` 2948 TaskStatus string `xml:"taskStatus,attr,omitempty"` 2949 TaskDetails string `xml:"taskDetails,attr,omitempty"` 2950 Link *Link `xml:"Link,omitempty"` 2951 Metadata *Metadata `xml:"Metadata,omitempty"` 2952 } 2953 2954 // DiskCreateParams element for create independent disk 2955 // Reference: vCloud API 30.0 - DiskCreateParamsType 2956 // https://code.vmware.com/apis/287/vcloud?h=Director#/doc/doc/types/DiskCreateParamsType.html 2957 type DiskCreateParams struct { 2958 XMLName xml.Name `xml:"DiskCreateParams"` 2959 Xmlns string `xml:"xmlns,attr,omitempty"` 2960 Disk *Disk `xml:"Disk"` 2961 Locality *Reference `xml:"Locality,omitempty"` 2962 VCloudExtension *VCloudExtension `xml:"VCloudExtension,omitempty"` 2963 } 2964 2965 // Represents an independent disk 2966 // Reference: vCloud API 30.0 - DiskType 2967 // https://code.vmware.com/apis/287/vcloud?h=Director#/doc/doc/types/DiskType.html 2968 type Disk struct { 2969 XMLName xml.Name `xml:"Disk"` 2970 Xmlns string `xml:"xmlns,attr,omitempty"` 2971 HREF string `xml:"href,attr,omitempty"` 2972 Type string `xml:"type,attr,omitempty"` 2973 Id string `xml:"id,attr,omitempty"` 2974 OperationKey string `xml:"operationKey,attr,omitempty"` 2975 Name string `xml:"name,attr"` 2976 Status int `xml:"status,attr,omitempty"` 2977 // Size of the disk in bytes. No longer supported in API V33.0+. 2978 // Size int64 `xml:"size,attr"` 2979 // SizeMb is the size of disk in MB. It has replaced Size (in bytes) field as of API V33.0 2980 SizeMb int64 `xml:"sizeMb,attr,omitempty"` 2981 Iops *int `xml:"iops,attr,omitempty"` 2982 BusType string `xml:"busType,attr,omitempty"` 2983 BusSubType string `xml:"busSubType,attr,omitempty"` 2984 Encrypted bool `xml:"encrypted,attr,omitempty"` 2985 Shareable bool `xml:"shareable,attr,omitempty"` 2986 SharingType string `xml:"sharingType,attr,omitempty"` 2987 UUID string `xml:"uuid,attr,omitempty"` 2988 Description string `xml:"Description,omitempty"` 2989 Files *FilesList `xml:"Files,omitempty"` 2990 Link []*Link `xml:"Link,omitempty"` 2991 StorageProfile *Reference `xml:"StorageProfile,omitempty"` 2992 Owner *Owner `xml:"Owner,omitempty"` 2993 Tasks *TasksInProgress `xml:"Tasks,omitempty"` 2994 VCloudExtension *VCloudExtension `xml:"VCloudExtension,omitempty"` 2995 } 2996 2997 // General purpose extension element 2998 // Not related to extension services 2999 // Reference: vCloud API 30.0 - DiskAttachOrDetachParamsType 3000 // https://code.vmware.com/apis/287/vcloud?h=Director#/doc/doc/types/VCloudExtensionType.html 3001 type VCloudExtension struct { 3002 Required bool `xml:"required,attr,omitempty"` 3003 } 3004 3005 // Parameters for attaching or detaching an independent disk 3006 // Reference: vCloud API 30.0 - DiskAttachOrDetachParamsType 3007 // https://code.vmware.com/apis/287/vcloud?h=Director#/doc/doc/types/DiskAttachOrDetachParamsType.html 3008 type DiskAttachOrDetachParams struct { 3009 XMLName xml.Name `xml:"DiskAttachOrDetachParams"` 3010 Xmlns string `xml:"xmlns,attr,omitempty"` 3011 Disk *Reference `xml:"Disk"` 3012 BusNumber *int `xml:"BusNumber,omitempty"` 3013 UnitNumber *int `xml:"UnitNumber,omitempty"` 3014 VCloudExtension *VCloudExtension `xml:"VCloudExtension,omitempty"` 3015 } 3016 3017 // Represents a list of virtual machines 3018 // Reference: vCloud API 30.0 - VmsType 3019 // https://code.vmware.com/apis/287/vcloud?h=Director#/doc/doc/types/FilesListType.html 3020 type Vms struct { 3021 XMLName xml.Name `xml:"Vms"` 3022 Xmlns string `xml:"xmlns,attr,omitempty"` 3023 Type string `xml:"type,attr"` 3024 HREF string `xml:"href,attr"` 3025 VmReference []*Reference `xml:"VmReference,omitempty"` 3026 } 3027 3028 // Parameters for inserting and ejecting virtual media for VM as CD/DVD 3029 // Reference: vCloud API 30.0 - MediaInsertOrEjectParamsType 3030 // https://code.vmware.com/apis/287/vcloud#/doc/doc/types/MediaInsertOrEjectParamsType.html 3031 type MediaInsertOrEjectParams struct { 3032 XMLName xml.Name `xml:"MediaInsertOrEjectParams"` 3033 Xmlns string `xml:"xmlns,attr,omitempty"` 3034 Media *Reference `xml:"Media"` 3035 VCloudExtension *VCloudExtension `xml:"VCloudExtension,omitempty"` 3036 } 3037 3038 // Parameters for VM pending questions 3039 // Reference: vCloud API 27.0 - VmPendingQuestionType 3040 // https://code.vmware.com/apis/287/vcloud#/doc/doc/types/VmPendingQuestionType.html 3041 type VmPendingQuestion struct { 3042 XMLName xml.Name `xml:"VmPendingQuestion"` 3043 Xmlns string `xml:"xmlns,attr,omitempty"` 3044 Type string `xml:"type,attr"` 3045 HREF string `xml:"href,attr"` 3046 Link LinkList `xml:"Link,omitempty"` 3047 Question string `xml:"Question"` 3048 QuestionId string `xml:"QuestionId"` 3049 Choices []*VmQuestionAnswerChoiceType `xml:"Choices"` 3050 } 3051 3052 // Parameters for VM question answer choice 3053 // Reference: vCloud API 27.0 - VmQuestionAnswerChoiceType 3054 // https://code.vmware.com/apis/287/vcloud#/doc/doc/types/VmQuestionAnswerChoiceType.html 3055 type VmQuestionAnswerChoiceType struct { 3056 Id int `xml:"Id"` 3057 Text string `xml:"Text,omitempty"` 3058 } 3059 3060 // Parameters for VM question answer 3061 // Reference: vCloud API 27.0 - VmQuestionAnswerType 3062 // https://code.vmware.com/apis/287/vcloud#/doc/doc/types/VmQuestionAnswerType.html 3063 type VmQuestionAnswer struct { 3064 XMLName xml.Name `xml:"VmQuestionAnswer"` 3065 Xmlns string `xml:"xmlns,attr,omitempty"` 3066 ChoiceId int `xml:"ChoiceId"` 3067 QuestionId string `xml:"QuestionId"` 3068 } 3069 3070 // Represents an independent disk record 3071 // Reference: vCloud API 27.0 - DiskType 3072 // https://code.vmware.com/apis/287/vcloud#/doc/doc/types/QueryResultDiskRecordType.html 3073 type DiskRecordType struct { 3074 Xmlns string `xml:"xmlns,attr,omitempty"` 3075 HREF string `xml:"href,attr,omitempty"` 3076 Id string `xml:"id,attr,omitempty"` 3077 Type string `xml:"type,attr,omitempty"` 3078 Name string `xml:"name,attr,omitempty"` 3079 Vdc string `xml:"vdc,attr,omitempty"` 3080 SizeMb int64 `xml:"sizeMb,attr,omitempty"` 3081 Iops int64 `xml:"iops,attr,omitempty"` 3082 Encrypted bool `xml:"encrypted,attr,omitempty"` 3083 UUID string `xml:"uuid,attr,omitempty"` 3084 DataStore string `xml:"dataStore,attr,omitempty"` 3085 DataStoreName string `xml:"datastoreName,attr,omitempty"` 3086 OwnerName string `xml:"ownerName,attr,omitempty"` 3087 VdcName string `xml:"vdcName,attr,omitempty"` 3088 Task string `xml:"task,attr,omitempty"` 3089 StorageProfile string `xml:"storageProfile,attr,omitempty"` 3090 StorageProfileName string `xml:"storageProfileName,attr,omitempty"` 3091 Status string `xml:"status,attr,omitempty"` 3092 BusType string `xml:"busType,attr,omitempty"` 3093 BusSubType string `xml:"busSubType,attr,omitempty"` 3094 BusTypeDesc string `xml:"busTypeDesc,attr,omitempty"` 3095 AttachedVmCount int32 `xml:"attachedVmCount,attr,omitempty"` 3096 SharingType string `xml:"sharingType,attr,omitempty"` 3097 IsAttached bool `xml:"isAttached,attr,omitempty"` 3098 IsShareable bool `xml:"isShareable,attr,omitempty"` 3099 Description string `xml:"description,attr,omitempty"` 3100 Link []*Link `xml:"Link,omitempty"` 3101 Metadata *Metadata `xml:"Metadata,omitempty"` 3102 } 3103 3104 // Represents port group 3105 // Reference: vCloud API 27.0 - Port group type 3106 // https://code.vmware.com/apis/72/doc/doc/types/QueryResultPortgroupRecordType.html 3107 type PortGroupRecordType struct { 3108 Xmlns string `xml:"xmlns,attr,omitempty"` 3109 HREF string `xml:"href,attr,omitempty"` 3110 Id string `xml:"id,attr,omitempty"` 3111 Type string `xml:"type,attr,omitempty"` 3112 MoRef string `xml:"moref,attr,omitempty"` 3113 Name string `xml:"name,attr,omitempty"` 3114 PortgroupType string `xml:"portgroupType,attr,omitempty"` 3115 Vc string `xml:"vc,attr,omitempty"` 3116 VcName string `xml:"vcName,attr,omitempty"` 3117 IsVCEnabled bool `xml:"isVCEnabled,attr,omitempty"` 3118 Network string `xml:"network,attr,omitempty"` 3119 NetworkName string `xml:"networkName,attr,omitempty"` 3120 ScopeType int `xml:"scopeType,attr,omitempty"` // Scope of network using the portgroup(1=Global, 2=Organization, 3=vApp) 3121 Link []*Link `xml:"Link,omitempty"` 3122 } 3123 3124 // Represents org VDC Network 3125 // Reference: vCloud API 27.0 - Org VDC Network 3126 // https://code.vmware.com/apis/72/doc/doc/types/QueryResultOrgVdcNetworkRecordType.html 3127 type QueryResultOrgVdcNetworkRecordType struct { 3128 Xmlns string `xml:"xmlns,attr,omitempty"` 3129 HREF string `xml:"href,attr,omitempty"` 3130 Id string `xml:"id,attr,omitempty"` 3131 Type string `xml:"type,attr,omitempty"` 3132 Name string `xml:"name,attr,omitempty"` 3133 DefaultGateway string `xml:"defaultGateway,attr,omitempty"` 3134 Netmask string `xml:"netmask,attr,omitempty"` 3135 Dns1 string `xml:"dns1,attr,omitempty"` 3136 Dns2 string `xml:"dns2,attr,omitempty"` 3137 DnsSuffix string `xml:"dnsSuffix,attr,omitempty"` 3138 LinkType int `xml:"linkType,attr,omitempty"` // 0 = direct, 1 = routed, 2 = isolated 3139 ConnectedTo string `xml:"connectedTo,attr,omitempty"` 3140 Vdc string `xml:"vdc,attr,omitempty"` 3141 IsBusy bool `xml:"isBusy,attr,omitempty"` 3142 IsShared bool `xml:"isShared,attr,omitempty"` 3143 VdcName string `xml:"vdcName,attr,omitempty"` 3144 IsIpScopeInherited bool `xml:"isIpScopeInherited,attr,omitempty"` 3145 Link []*Link `xml:"Link,omitempty"` 3146 Metadata *Metadata `xml:"Metadata,omitempty"` 3147 } 3148 3149 type QueryResultNsxtManagerRecordType struct { 3150 Xmlns string `xml:"xmlns,attr,omitempty"` 3151 Name string `xml:"name,attr"` 3152 URL string `xml:"url,attr"` 3153 HREF string `xml:"href,attr"` 3154 Site string `xml:"site,attr"` 3155 LocationId string `xml:"locationId,attr"` 3156 SiteName string `xml:"siteName,attr"` 3157 Link []*Link `xml:"Link,omitempty"` 3158 } 3159 3160 // Represents org VDC Network 3161 // Reference: vCloud API 27.0 - Network Pool 3162 // https://code.vmware.com/apis/72/vcloud-director#/doc/doc/types/VMWNetworkPoolType.html 3163 type VMWNetworkPool struct { 3164 HREF string `xml:"href,attr,omitempty"` 3165 Id string `xml:"id,attr,omitempty"` 3166 Type string `xml:"type,attr,omitempty"` 3167 Name string `xml:"name,attr"` 3168 Status int `xml:"status,attr,omitempty"` 3169 Description string `xml:"netmask,omitempty"` 3170 Tasks *TasksInProgress `xml:"Tasks,omitempty"` 3171 } 3172 3173 type GroupReference struct { 3174 GroupReference []*Reference `xml:"GroupReference,omitempty"` 3175 } 3176 3177 // Represents an org user 3178 // Reference: vCloud API 27.0 - UserType 3179 // https://code.vmware.com/apis/442/vcloud-director#/doc/doc/types/UserType.html 3180 // Note that the order of fields is important. If this structure needs to change, 3181 // the field order must be preserved. 3182 type User struct { 3183 XMLName xml.Name `xml:"User"` 3184 Xmlns string `xml:"xmlns,attr"` 3185 Href string `xml:"href,attr"` 3186 Type string `xml:"type,attr"` 3187 ID string `xml:"id,attr"` 3188 OperationKey string `xml:"operationKey,attr"` 3189 Name string `xml:"name,attr"` 3190 Links LinkList `xml:"Link,omitempty"` 3191 Description string `xml:"Description,omitempty"` 3192 FullName string `xml:"FullName,omitempty"` 3193 EmailAddress string `xml:"EmailAddress,omitempty"` 3194 Telephone string `xml:"Telephone,omitempty"` 3195 IsEnabled bool `xml:"IsEnabled,omitempty"` 3196 IsLocked bool `xml:"IsLocked,omitempty"` 3197 IM string `xml:"IM,omitempty"` 3198 NameInSource string `xml:"NameInSource,omitempty"` 3199 IsExternal bool `xml:"IsExternal,omitempty"` 3200 ProviderType string `xml:"ProviderType,omitempty"` 3201 IsGroupRole bool `xml:"IsGroupRole,omitempty"` 3202 StoredVmQuota int `xml:"StoredVmQuota"` 3203 DeployedVmQuota int `xml:"DeployedVmQuota"` 3204 Role *Reference `xml:"Role,omitempty"` 3205 GroupReferences *GroupReference `xml:"GroupReferences,omitempty"` 3206 Password string `xml:"Password,omitempty"` 3207 Tasks *TasksInProgress `xml:"Tasks"` 3208 } 3209 3210 // Group represents Org group definition 3211 type Group struct { 3212 XMLName xml.Name `xml:"Group"` 3213 Xmlns string `xml:"xmlns,attr"` 3214 // Id holds ID in format urn:vcloud:group:252fe08e-ae1b-409c-9dda-a531bb1ed69a 3215 ID string `xml:"id,attr,omitempty"` 3216 // Href holds reference to group object 3217 Href string `xml:"href,attr,omitempty"` 3218 // Type holds mime type for group 3219 Type string `xml:"type,attr"` 3220 // Description sets description for group 3221 Description string `xml:"Description"` 3222 // Name of the group. Cannot be updated. 3223 Name string `xml:"name,attr"` 3224 // ProviderType - 'SAML', 'INTEGRATED' 3225 ProviderType string `xml:"ProviderType"` 3226 // Role - reference to existing role 3227 Role *Reference `xml:"Role,omitempty"` 3228 // UsersList - references to existing users of type User 3229 UsersList *UsersList `xml:"UsersList,omitempty"` 3230 } 3231 3232 // UsersList is a tagged list of User Reference's 3233 type UsersList struct { 3234 UserReference []*Reference `xml:"UserReference,omitempty"` 3235 } 3236 3237 // Type: AdminCatalogRecord 3238 // Namespace: http://www.vmware.com/vcloud/v1.5 3239 // https://code.vmware.com/apis/287/vcloud#/doc/doc/types/QueryResultCatalogRecordType.html 3240 // Issue that description partly matches with what is returned 3241 // Description: Represents Catalog record 3242 // Since: 1.5 3243 type CatalogRecord struct { 3244 HREF string `xml:"href,attr,omitempty"` 3245 ID string `xml:"id,attr,omitempty"` 3246 Type string `xml:"type,attr,omitempty"` 3247 Name string `xml:"name,attr,omitempty"` 3248 Description string `xml:"description,attr,omitempty"` 3249 IsPublished bool `xml:"isPublished,attr,omitempty"` 3250 IsShared bool `xml:"isShared,attr,omitempty"` 3251 IsLocal bool `xml:"isLocal,attr,omitempty"` 3252 CreationDate string `xml:"creationDate,attr,omitempty"` 3253 OrgName string `xml:"orgName,attr,omitempty"` 3254 OwnerName string `xml:"ownerName,attr,omitempty"` 3255 NumberOfVAppTemplates int64 `xml:"numberOfVAppTemplates,attr,omitempty"` 3256 NumberOfMedia int64 `xml:"numberOfMedia,attr,omitempty"` 3257 Owner string `xml:"owner,attr,omitempty"` 3258 PublishSubscriptionType string `xml:"publishSubscriptionType,attr,omitempty"` 3259 Version int64 `xml:"version,attr,omitempty"` 3260 Status string `xml:"status,attr,omitempty"` 3261 Link *Link `xml:"Link,omitempty"` 3262 Metadata *Metadata `xml:"Metadata,omitempty"` 3263 } 3264 3265 type AdminCatalogRecord CatalogRecord 3266 3267 // VmAffinityRule defines an affinity (or anti-affinity) rule for a group of VmReferences` 3268 // https://code.vmware.com/apis/722/doc/doc/types/VmAffinityRuleType.html 3269 type VmAffinityRule struct { 3270 XMLName xml.Name `xml:"VmAffinityRule"` 3271 Xmlns string `xml:"xmlns,attr"` 3272 HREF string `xml:"href,attr,omitempty"` 3273 ID string `xml:"id,attr,omitempty"` 3274 Name string `xml:"Name"` 3275 OperationKey string `xml:"OperationKey,attr,omitempty"` // Optional unique identifier to support idempotent semantics for create and delete operations 3276 IsEnabled *bool `xml:"IsEnabled"` // True if the affinity rule is enabled 3277 IsMandatory *bool `xml:"IsMandatory"` // True if this affinity rule is mandatory. When a rule is mandatory, a host failover will not power on the VM if doing so would violate the rule 3278 Polarity string `xml:"Polarity"` // The polarity of this rule. One of: Affinity, Anti-Affinity 3279 VmReferences []*VMs `xml:"VmReferences"` // A list of VmReferences under a specific VM affinity rule. 3280 Link []*Link `xml:"Link,omitempty"` // 3281 VCloudExtension *VCloudExtension `xml:"VCloudExtension,omitempty"` // An optional extension element that can contain an arbitrary number of elements and attributes 3282 } 3283 3284 // VmAffinityRules defines a list of VmAffinityRule 3285 type VmAffinityRules struct { 3286 HREF string `xml:"href,attr,omitempty"` 3287 Type string `xml:"type,attr,omitempty"` 3288 Link *Link `xml:"Link,omitempty"` // 3289 VmAffinityRule []*VmAffinityRule `xml:"VmAffinityRule,omitempty"` 3290 } 3291 3292 // ControlAccessParams specifies access controls for a resource. 3293 type ControlAccessParams struct { 3294 XMLName xml.Name `xml:"ControlAccessParams"` 3295 Xmlns string `xml:"xmlns,attr"` 3296 IsSharedToEveryone bool `xml:"IsSharedToEveryone"` // If true, the resource is shared with everyone in the organization. Defaults to false. 3297 EveryoneAccessLevel *string `xml:"EveryoneAccessLevel,omitempty"` // If IsSharedToEveryone is true, this element must be present to specify the access level. for all members of the organization. One of: FullControl Change ReadOnly 3298 AccessSettings *AccessSettingList `xml:"AccessSettings,omitempty"` // The access settings to be applied if IsSharedToEveryone is false. Required on create and modify if IsSharedToEveryone is false. 3299 } 3300 3301 // AccessSettingList is a tagged list of AccessSetting 3302 type AccessSettingList struct { 3303 AccessSetting []*AccessSetting `xml:"AccessSetting"` 3304 } 3305 3306 // LocalSubject is the user, group, or organization to which control access settings apply. 3307 type LocalSubject struct { 3308 HREF string `xml:"href,attr"` // Required - The URL with the full identification of the subject 3309 Name string `xml:"name,attr"` // The name of the subject. Not needed in input, but it is returned on reading 3310 Type string `xml:"type,attr"` // Required - The MIME type of the subject. So far, we are using users, groups, and organizations 3311 } 3312 3313 // AccessSetting controls access to the resource. 3314 type AccessSetting struct { 3315 XMLName xml.Name `xml:"AccessSetting"` 3316 Subject *LocalSubject `xml:"Subject,omitempty"` // The user or group to which these settings apply. 3317 ExternalSubject *ExternalSubject `xml:"ExternalSubject,omitempty"` // Subject existing external of VCD, to which these settings apply. 3318 AccessLevel string `xml:"AccessLevel"` // The access level for the subject. One of: FullControl Change ReadOnly Deny (only for a VDC resource) 3319 } 3320 3321 // ExternalSubjectType is a reference to a user or group managed by an identity provider configured for use in this organization. 3322 type ExternalSubject struct { 3323 IdpType string `xml:"IdpType"` // The type of identity provider for example: OAUTH, SAML, LDAP etc for this SubjectID. 3324 IsUser bool `xml:"IsUser"` // If true, SubjectID is a reference to a user defined by this organization's identity provider. If false or empty, SubjectID is a reference to a group defined by this organization's identity provider. 3325 SubjectId string `xml:"SubjectId"` // The primary key that your identity provider uses to uniquely identify the user or group referenced in SubjectId. 3326 } 3327 3328 type VdcComputePolicyReferences struct { 3329 Xmlns string `xml:"xmlns,attr"` 3330 HREF string `xml:"href,attr,omitempty"` 3331 Type string `xml:"type,attr,omitempty"` 3332 Link *Link `xml:"Link,omitempty"` 3333 VdcComputePolicyReference []*Reference `xml:"VdcComputePolicyReference,omitempty"` 3334 } 3335 3336 // Structure returned by /api/admin call 3337 type VCloud struct { 3338 XMLName xml.Name `xml:"VCloud"` 3339 Xmlns string `xml:"xmlns,attr,omitempty"` 3340 Name string `xml:"name,attr"` 3341 HREF string `xml:"href,attr"` 3342 Type string `xml:"type,attr,omitempty"` 3343 Description string `xml:"Description"` // Contains VCD version, build number and build timestamp 3344 Link *Link `xml:"Link,omitempty"` 3345 // TODO: Add other fields if needed 3346 // OrganizationReferences 3347 // ProviderVdcReferences 3348 // RightReferences 3349 // RoleReferences 3350 // Networks 3351 } 3352 3353 // UpdateVdcStorageProfiles is used to add a storage profile to an Org VDC or to remove one 3354 type UpdateVdcStorageProfiles struct { 3355 XMLName xml.Name `xml:"UpdateVdcStorageProfiles"` 3356 Xmlns string `xml:"xmlns,attr,omitempty"` 3357 Name string `xml:"name,attr"` 3358 Description string `xml:"Description,omitempty"` 3359 AddStorageProfile *VdcStorageProfileConfiguration `xml:"AddStorageProfile,omitempty"` 3360 RemoveStorageProfile *Reference `xml:"RemoveStorageProfile,omitempty"` 3361 } 3362 3363 // Token is used for managing VCD API Tokens for a User in an Org 3364 type Token struct { 3365 ID string `json:"id,omitempty"` 3366 Name string `json:"name,omitempty"` 3367 Owner *OpenApiReference `json:"owner,omitempty"` 3368 Org *OpenApiReference `json:"org,omitempty"` 3369 Type string `json:"type,omitempty"` 3370 } 3371 3372 // ServiceAccount is used for managing a Service Account that belongs to a specific Org 3373 type ServiceAccount struct { 3374 ID string `json:"id,omitempty"` 3375 Name string `json:"name,omitempty"` 3376 SoftwareID string `json:"softwareId,omitempty"` 3377 SoftwareVersion string `json:"softwareVersion,omitempty"` 3378 Role *OpenApiReference `json:"role,omitempty"` 3379 URI string `json:"uri,omitempty"` 3380 Org *OpenApiReference `json:"org,omitempty"` 3381 Status string `json:"status,omitempty"` 3382 } 3383 3384 // ApiTokenRefresh contains the access token resulting from a refresh_token operation 3385 type ApiTokenRefresh struct { 3386 AccessToken string `json:"access_token,omitempty"` 3387 TokenType string `json:"token_type,omitempty"` 3388 ExpiresIn int `json:"expires_in,omitempty"` 3389 RefreshToken string `json:"refresh_token,omitempty"` 3390 UpdatedBy string `json:"updated_by,omitempty"` 3391 UpdatedOn string `json:"updated_on,omitempty"` 3392 } 3393 3394 // ApiTokenParams contains the parameters required and returned by oauth/register operation 3395 type ApiTokenParams struct { 3396 ClientName string `json:"client_name"` 3397 ClientID string `json:"client_id,omitempty"` 3398 GrantTypes []string `json:"grant_types,omitempty"` 3399 TokenEndpointAuthMethod string `json:"token_endpoint_auth_method,omitempty"` 3400 ClientURI string `json:"client_uri,omitempty"` 3401 SoftwareID string `json:"software_id,omitempty"` 3402 SoftwareVersion string `json:"software_version,omitempty"` 3403 Scope string `json:"scope,omitempty"` 3404 } 3405 3406 // ServiceAccountAuthParams is used to store the generated user code and device code that 3407 // are needed for granting and activating a Service Account 3408 type ServiceAccountAuthParams struct { 3409 DeviceCode string `json:"device_code,omitempty"` 3410 UserCode string `json:"user_code"` 3411 VerificationURI string `json:"verification_uri,omitempty"` 3412 ExpiresIn int `json:"expires_in,omitempty"` 3413 Interval int `json:"interval,omitempty"` 3414 } 3415 3416 /**/ 3417 type QueryResultTaskRecordType struct { 3418 HREF string `xml:"href,attr,omitempty"` // Contains the URI to the resource. 3419 ID string `xml:"id,attr,omitempty"` // The resource identifier, expressed in URN format. The value of this attribute uniquely identifies the resource, persists for the life of the resource, and is never reused. Yes Yes 3420 Type string `xml:"type,attr,omitempty"` // Contains the type of the resource. 3421 Org string `xml:"org,attr,omitempty"` // Organization reference or id 3422 OrgName string `xml:"orgName,attr,omitempty"` // Organization name 3423 Name string `xml:"name,attr,omitempty"` // The name of this task. 3424 OperationFull string `xml:"operationFull,attr,omitempty"` // The full human-readable name of this task. 3425 Message string `xml:"message,attr,omitempty"` // message 3426 StartDate string `xml:"startDate,attr,omitempty"` // Start date 3427 EndDate string `xml:"endDate,attr,omitempty"` // End date 3428 Status string `xml:"status,attr,omitempty"` // Status 3429 Progress int `xml:"progress,attr,omitempty"` // Progress of the task, expressed as a percentage. 3430 OwnerName string `xml:"ownerName,attr,omitempty"` // Owner name 3431 Object string `xml:"object,attr,omitempty"` // Object 3432 ObjectType string `xml:"objectType,attr,omitempty"` // Object 3433 ObjectName string `xml:"objectName,attr,omitempty"` // Object name 3434 ServiceNamespace string `xml:"serviceNamespace,attr,omitempty"` // Service name space 3435 Link *Link `xml:"Link,omitempty"` 3436 Metadata *Metadata `xml:"Metadata,omitempty"` 3437 } 3438 3439 // ProviderVdcCreation contains the data needed to create a provider VDC. 3440 // Note that this is a subset of the full structure of a provider VDC. 3441 type ProviderVdcCreation struct { 3442 Name string `json:"name"` 3443 Description string `json:"description"` 3444 ResourcePoolRefs *VimObjectRefs `json:"resourcePoolRefs"` 3445 HighestSupportedHardwareVersion string `json:"highestSupportedHardwareVersion"` 3446 IsEnabled bool `json:"isEnabled"` 3447 VimServer []*Reference `json:"vimServer"` 3448 StorageProfile []string `json:"storageProfile"` 3449 NsxTManagerReference *Reference `json:"nsxTManagerReference"` 3450 NetworkPool *Reference `json:"networkPool"` 3451 AutoCreateNetworkPool bool `json:"autoCreateNetworkPool"` 3452 } 3453 3454 // AddResourcePool is used to add one or more resource pools to a provider VDC 3455 type AddResourcePool struct { 3456 VimObjectRef []*VimObjectRef `xml:"AddItem" json:"addItem"` 3457 } 3458 3459 // DeleteResourcePool is used to remove one or more resource pools from a provider VDC 3460 type DeleteResourcePool struct { 3461 ResourcePoolRefs []*Reference `xml:"DeleteItem" json:"deleteItem"` 3462 } 3463 3464 // AddStorageProfiles is used to add storage profiles to an existing provider VDC 3465 type AddStorageProfiles struct { 3466 AddStorageProfile []string `json:"addStorageProfile"` 3467 } 3468 3469 type EnableStorageProfile struct { 3470 Enabled bool `json:"enabled"` 3471 } 3472 3473 type RemoveStorageProfile struct { 3474 RemoveStorageProfile []*Reference `json:"removeStorageProfile"` 3475 } 3476 3477 // VirtualHardwareVersion describes supported hardware by the VMs created on the VDC 3478 type VirtualHardwareVersion struct { 3479 HardDiskAdapter []*HardDiskAdapter `xml:"HardDiskAdapter"` 3480 Link Link `xml:"Link"` 3481 MaxCPUs int `xml:"maxCPUs"` 3482 MaxCoresPerSocket int `xml:"maxCoresPerSocket"` 3483 MaxMemorySizeMb int `xml:"maxMemorySizeMb"` 3484 MaxNICs int `xml:"maxNICs"` 3485 Name string `xml:"name"` 3486 SupportedMemorySizeGb []int `xml:"supportedMemorySizeGb"` 3487 SupportedCoresPerSocket []int `xml:"supportedCoresPerSocket"` 3488 SupportedOperatingSystems *SupportedOperatingSystemsInfoType `xml:"supportedOperatingSystems"` 3489 3490 SupportsHotAdd *bool `xml:"supportsHotAdd"` 3491 SupportsHotPlugPCI *bool `xml:"supportsHotPlugPCI"` 3492 SupportsNestedHV *bool `xml:"supportsNestedHV"` 3493 } 3494 3495 // HardDiskAdapter describes a hard disk controller type 3496 type HardDiskAdapter struct { 3497 Id string `xml:"id,attr"` 3498 LegacyId int `xml:"legacyId,attr"` 3499 Name string `xml:"name,attr"` 3500 MaximumDiskSizeGb int `xml:"maximumDiskSizeGb,attr"` 3501 3502 BusNumberRanges struct { 3503 Begin int `xml:"begin,attr"` 3504 End int `xml:"end,attr"` 3505 } `xml:"BusNumberRanges>Range"` 3506 UnitNumberRanges struct { 3507 Begin int `xml:"begin,attr"` 3508 End int `xml:"end,attr"` 3509 } `xml:"UnitNumberRanges>Range"` 3510 3511 ReservedBusUnitNumber struct { 3512 BusNumber int `xml:"busNumber,attr"` 3513 UnitNumber int `xml:"unitNumber,attr"` 3514 } `xml:"ReservedBusUnitNumber"` 3515 } 3516 3517 // SupportedOperatingSystemsInfoType describes what operating system families a hardware version supports 3518 type SupportedOperatingSystemsInfoType struct { 3519 Link *Link 3520 OperatingSystemFamilyInfo []*OperatingSystemFamilyInfoType `xml:"OperatingSystemFamilyInfo"` 3521 } 3522 3523 // OperatingSystemFamilyInfoType describes operating systems of a given OS family 3524 type OperatingSystemFamilyInfoType struct { 3525 Name string `xml:"Name"` 3526 OperatingSystemFamilyId *int `xml:"OperatingSystemFamilyId"` 3527 OperatingSystems []*OperatingSystemInfoType `xml:"OperatingSystem"` 3528 } 3529 3530 // OperatingSystemInfoType describes a operating system 3531 type OperatingSystemInfoType struct { 3532 OperatingSystemId *int `xml:"OperatingSystemId,omitempty"` 3533 DefaultHardDiskAdapterType string `xml:"DefaultHardDiskAdapterType"` 3534 SupportedHardDiskAdapter []struct { 3535 Ref string `xml:"ref,attr"` 3536 } `xml:"SupportedHardDiskAdapter,omitempty"` 3537 MinimumHardDiskSizeGigabytes *int `xml:"MinimumHardDiskSizeGigabytes"` 3538 MinimumMemoryMegabytes *int `xml:"MinimumMemoryMegabytes"` 3539 Name string `xml:"Name"` 3540 InternalName string `xml:"InternalName"` 3541 Supported *bool `xml:"Supported"` 3542 SupportLevel string `xml:"SupportLevel"` 3543 X64 *bool `xml:"x64"` 3544 MaximumCpuCount *int `xml:"MaximumCpuCount"` 3545 MaximumCoresPerSocket *int `xml:"MaximumCoresPerSocket"` 3546 MaximumSocketCount *int `xml:"MaximumSocketCount"` 3547 MinimumHardwareVersion *int `xml:"MinimumHardwareVersion"` 3548 PersonalizationEnabled *bool `xml:"PersonalizationEnabled"` 3549 PersonalizationAuto *bool `xml:"PersonalizationAuto"` 3550 SysprepPackagingSupported *bool `xml:"SysprepPackagingSupported"` 3551 SupportsMemHotAdd *bool `xml:"SupportsMemHotAdd"` 3552 CimOsId *int `xml:"cimOsId"` 3553 CimVersion *int `xml:"CimVersion"` 3554 SupportedForCreate *bool `xml:"SupportedForCreate"` 3555 3556 RecommendedNIC []struct { 3557 Name string `xml:"name,attr"` 3558 Id *int `xml:"id,attr,omitempty"` 3559 } `xml:"RecommendedNIC"` 3560 3561 SupportedNICType []struct { 3562 Name string `xml:"name,attr"` 3563 Id *int `xml:"id,attr,omitempty"` 3564 } `xml:"SupportedNICType"` 3565 3566 RecommendedFirmware string `xml:"RecommendedFirmware"` 3567 SupportedFirmware []string `xml:"SupportedFirmware"` 3568 SupportsTPM *bool `xml:"SupportsTPM"` 3569 }