github.com/vmware/go-vcloud-director/v2@v2.24.0/types/v56/constants.go (about) 1 /* 2 * Copyright 2023 VMware, Inc. All rights reserved. Licensed under the Apache v2 License. 3 */ 4 5 package types 6 7 const ( 8 // PublicCatalog Name 9 PublicCatalog = "Public Catalog" 10 11 // DefaultCatalog Name 12 DefaultCatalog = "Default Catalog" 13 14 // JSONMimeV57 the json mime for version 5.7 of the API 15 JSONMimeV57 = "application/json;version=5.7" 16 // AnyXMLMime511 the wildcard xml mime for version 5.11 of the API 17 AnyXMLMime511 = "application/*+xml;version=5.11" 18 AnyXMLMime = "application/xml" 19 // Version511 the 5.11 version 20 Version511 = "5.11" 21 // Version is the default version number 22 Version = Version511 23 // SoapXML mime type 24 SoapXML = "application/soap+xml" 25 // JSONMime 26 JSONMime = "application/json" 27 ) 28 29 const ( 30 // MimeOrgList mime for org list 31 MimeOrgList = "application/vnd.vmware.vcloud.orgList+xml" 32 // MimeOrg mime for org 33 MimeOrg = "application/vnd.vmware.vcloud.org+xml" 34 // MimeAdminOrg mime for admin org 35 MimeAdminOrg = "application/vnd.vmware.admin.organization+xml" 36 // MimeCatalog mime for catalog 37 MimeCatalog = "application/vnd.vmware.vcloud.catalog+xml" 38 // MimeCatalogItem mime for catalog item 39 MimeCatalogItem = "application/vnd.vmware.vcloud.catalogItem+xml" 40 // MimeVDC mime for a VDC 41 MimeVDC = "application/vnd.vmware.vcloud.vdc+xml" 42 // MimeVDC mime for a admin VDC 43 MimeAdminVDC = "application/vnd.vmware.admin.vdc+xml" 44 // MimeEdgeGateway mime for an Edge Gateway 45 MimeEdgeGateway = "application/vnd.vmware.admin.edgeGateway+xml" 46 // MimeVAppTemplate mime for a vapp template 47 MimeVAppTemplate = "application/vnd.vmware.vcloud.vAppTemplate+xml" 48 // MimeVApp mime for a vApp 49 MimeVApp = "application/vnd.vmware.vcloud.vApp+xml" 50 // MimeQueryRecords mime for the query records 51 MimeQueryRecords = "application/vnd.vmware.vcloud.query.records+xml" 52 // MimeAPIExtensibility mime for api extensibility 53 MimeAPIExtensibility = "application/vnd.vmware.vcloud.apiextensibility+xml" 54 // MimeEntity mime for vcloud entity 55 MimeEntity = "application/vnd.vmware.vcloud.entity+xml" 56 // MimeQueryList mime for query list 57 MimeQueryList = "application/vnd.vmware.vcloud.query.queryList+xml" 58 // MimeSession mime for a session 59 MimeSession = "application/vnd.vmware.vcloud.session+xml" 60 // MimeTask mime for task 61 MimeTask = "application/vnd.vmware.vcloud.task+xml" 62 // MimeError mime for error 63 MimeError = "application/vnd.vmware.vcloud.error+xml" 64 // MimeNetwork mime for a network 65 MimeNetwork = "application/vnd.vmware.vcloud.network+xml" 66 // MimeOrgVdcNetwork mime for an Org VDC network 67 MimeOrgVdcNetwork = "application/vnd.vmware.vcloud.orgVdcNetwork+xml" 68 //MimeDiskCreateParams mime for create independent disk 69 MimeDiskCreateParams = "application/vnd.vmware.vcloud.diskCreateParams+xml" 70 // Mime for VMs 71 MimeVMs = "application/vnd.vmware.vcloud.vms+xml" 72 // Mime for attach or detach independent disk 73 MimeDiskAttachOrDetachParams = "application/vnd.vmware.vcloud.diskAttachOrDetachParams+xml" 74 // Mime for Disk 75 MimeDisk = "application/vnd.vmware.vcloud.disk+xml" 76 // Mime for insert or eject media 77 MimeMediaInsertOrEjectParams = "application/vnd.vmware.vcloud.mediaInsertOrEjectParams+xml" 78 // Mime for catalog 79 MimeAdminCatalog = "application/vnd.vmware.admin.catalog+xml" 80 // Mime for virtual hardware section 81 MimeVirtualHardwareSection = "application/vnd.vmware.vcloud.virtualHardwareSection+xml" 82 // Mime for networkConnectionSection 83 MimeNetworkConnectionSection = "application/vnd.vmware.vcloud.networkConnectionSection+xml" 84 // Mime for Item 85 MimeRasdItem = "application/vnd.vmware.vcloud.rasdItem+xml" 86 // Mime for guest customization section 87 MimeGuestCustomizationSection = "application/vnd.vmware.vcloud.guestCustomizationSection+xml" 88 // Mime for guest customization status 89 MimeGuestCustomizationStatus = "application/vnd.vmware.vcloud.guestcustomizationstatussection" 90 // Mime for network config section 91 MimeNetworkConfigSection = "application/vnd.vmware.vcloud.networkconfigsection+xml" 92 // Mime for recompose vApp params 93 MimeRecomposeVappParams = "application/vnd.vmware.vcloud.recomposeVAppParams+xml" 94 // Mime for compose vApp params 95 MimeComposeVappParams = "application/vnd.vmware.vcloud.composeVAppParams+xml" 96 // Mime for undeploy vApp params 97 MimeUndeployVappParams = "application/vnd.vmware.vcloud.undeployVAppParams+xml" 98 // Mime for deploy vApp params 99 MimeDeployVappParams = "application/vnd.vmware.vcloud.deployVAppParams+xml" 100 // Mime for VM 101 MimeVM = "application/vnd.vmware.vcloud.vm+xml" 102 // Mime for instantiate vApp template params 103 MimeInstantiateVappTemplateParams = "application/vnd.vmware.vcloud.instantiateVAppTemplateParams+xml" 104 // Mime for capture vApp into template 105 MimeCaptureVappTemplateParams = "application/vnd.vmware.vcloud.captureVAppParams+xml" 106 // Mime for clone vApp template params 107 MimeCloneVapp = "application/vnd.vmware.vcloud.cloneVAppParams+xml" 108 // Mime for product section 109 MimeProductSection = "application/vnd.vmware.vcloud.productSections+xml" 110 // Mime for metadata 111 MimeMetaData = "application/vnd.vmware.vcloud.metadata+xml" 112 // Mime for metadata value 113 MimeMetaDataValue = "application/vnd.vmware.vcloud.metadata.value+xml" 114 // Mime for a admin network 115 MimeExtensionNetwork = "application/vnd.vmware.admin.extension.network+xml" 116 // Mime for an external network 117 MimeExternalNetwork = "application/vnd.vmware.admin.vmwexternalnet+xml" 118 // Mime of an Org User 119 MimeAdminUser = "application/vnd.vmware.admin.user+xml" 120 // MimeAdminGroup specifies groups 121 MimeAdminGroup = "application/vnd.vmware.admin.group+xml" 122 // MimeOrgLdapSettings 123 MimeOrgLdapSettings = "application/vnd.vmware.admin.organizationldapsettings+xml" 124 // Mime of vApp network 125 MimeVappNetwork = "application/vnd.vmware.vcloud.vAppNetwork+xml" 126 // Mime of access control 127 MimeControlAccess = "application/vnd.vmware.vcloud.controlAccess+xml" 128 // Mime of VM capabilities 129 MimeVmCapabilities = "application/vnd.vmware.vcloud.vmCapabilitiesSection+xml" 130 // Mime of Vdc Compute Policy References 131 MimeVdcComputePolicyReferences = "application/vnd.vmware.vcloud.vdcComputePolicyReferences+xml" 132 // Mime for Storage profile 133 MimeStorageProfile = "application/vnd.vmware.admin.vdcStorageProfile+xml " 134 // Mime for create VM Params 135 MimeCreateVmParams = "application/vnd.vmware.vcloud.CreateVmParams+xml" 136 // Mime for instantiate VM Params from template 137 MimeInstantiateVmTemplateParams = "application/vnd.vmware.vcloud.instantiateVmTemplateParams+xml" 138 // Mime for adding or removing VDC storage profiles 139 MimeUpdateVdcStorageProfiles = "application/vnd.vmware.admin.updateVdcStorageProfiles+xml" 140 // Mime to modify lease settings 141 MimeLeaseSettingSection = "application/vnd.vmware.vcloud.leaseSettingsSection+xml" 142 // Mime to publish external catalog 143 PublishExternalCatalog = "application/vnd.vmware.admin.publishExternalCatalogParams+xml" 144 // Mime to publish a catalog 145 PublishCatalog = "application/vnd.vmware.admin.publishCatalogParams+xml" 146 // Mime to subscribe to an external catalog 147 MimeSubscribeToExternalCatalog = "application/vnd.vmware.admin.externalCatalogSubscriptionParams+json" 148 // Mime to identify a media item 149 MimeMediaItem = "application/vnd.vmware.vcloud.media+xml" 150 // Mime to identify a provider VDC 151 MimeProviderVdc = "application/vnd.vmware.admin.vmwprovidervdc+xml" 152 // Mime to identify SAML metadata 153 MimeSamlMetadata = "application/samlmetadata+xml" 154 // Mime to identify organization federation settings (SAML) XML and JSON 155 MimeFederationSettingsXml = "application/vnd.vmware.admin.organizationFederationSettings+xml" 156 MimeFederationSettingsJson = "application/vnd.vmware.admin.organizationFederationSettings+json" 157 // Mime to handle virtual hardware versions 158 MimeVirtualHardwareVersion = "application/vnd.vmware.vcloud.virtualHardwareVersion+xml" 159 ) 160 161 const ( 162 VMsCDResourceSubType = "vmware.cdrom.iso" 163 ) 164 165 // https://blogs.vmware.com/vapp/2009/11/virtual-hardware-in-ovf-part-1.html 166 167 const ( 168 ResourceTypeOther int = 0 169 ResourceTypeProcessor int = 3 170 ResourceTypeMemory int = 4 171 ResourceTypeIDE int = 5 172 ResourceTypeSCSI int = 6 173 ResourceTypeEthernet int = 10 174 ResourceTypeFloppy int = 14 175 ResourceTypeCD int = 15 176 ResourceTypeDVD int = 16 177 ResourceTypeDisk int = 17 178 ResourceTypeUSB int = 23 179 ) 180 181 const ( 182 FenceModeIsolated = "isolated" 183 FenceModeBridged = "bridged" 184 FenceModeNAT = "natRouted" 185 ) 186 187 const ( 188 IPAllocationModeDHCP = "DHCP" 189 IPAllocationModeManual = "MANUAL" 190 IPAllocationModeNone = "NONE" 191 IPAllocationModePool = "POOL" 192 ) 193 194 // NoneNetwork is a special type of network in vCD which represents a network card which is not 195 // attached to any network. 196 const ( 197 NoneNetwork = "none" 198 ) 199 200 const ( 201 XMLNamespaceVCloud = "http://www.vmware.com/vcloud/v1.5" 202 XMLNamespaceOVF = "http://schemas.dmtf.org/ovf/envelope/1" 203 XMLNamespaceVMW = "http://www.vmware.com/schema/ovf" 204 XMLNamespaceXSI = "http://www.w3.org/2001/XMLSchema-instance" 205 XMLNamespaceRASD = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData" 206 XMLNamespaceVSSD = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData" 207 XMLNamespaceExtension = "http://www.vmware.com/vcloud/extension/v1.5" 208 ) 209 210 // NSX-V Edge gateway API endpoints 211 const ( 212 EdgeNatPath = "/nat/config" 213 EdgeCreateNatPath = "/nat/config/rules" 214 EdgeFirewallPath = "/firewall/config" 215 EdgeCreateFirewallPath = "/firewall/config/rules" 216 EdgeVnicConfig = "/vnics" 217 EdgeVdcVnicConfig = "/vdcNetworks" 218 EdgeDhcpRelayPath = "/dhcp/config/relay" 219 EdgeDhcpLeasePath = "/dhcp/leaseInfo" 220 LbConfigPath = "/loadbalancer/config/" 221 LbMonitorPath = "/loadbalancer/config/monitors/" 222 LbServerPoolPath = "/loadbalancer/config/pools/" 223 LbAppProfilePath = "/loadbalancer/config/applicationprofiles/" 224 LbAppRulePath = "/loadbalancer/config/applicationrules/" 225 LbVirtualServerPath = "/loadbalancer/config/virtualservers/" 226 ) 227 228 // NSX-V proxied services API endpoints 229 const ( 230 NsxvIpSetServicePath = "/ipset" 231 ) 232 233 // Guest customization statuses. These are all known possible statuses 234 const ( 235 GuestCustStatusPending = "GC_PENDING" 236 GuestCustStatusPostPending = "POST_GC_PENDING" 237 GuestCustStatusComplete = "GC_COMPLETE" 238 GuestCustStatusFailed = "GC_FAILED" 239 GuestCustStatusRebootPending = "REBOOT_PENDING" 240 ) 241 242 // Edge gateway vNic types 243 const ( 244 EdgeGatewayVnicTypeUplink = "uplink" 245 EdgeGatewayVnicTypeInternal = "internal" 246 EdgeGatewayVnicTypeTrunk = "trunk" 247 EdgeGatewayVnicTypeSubinterface = "subinterface" 248 EdgeGatewayVnicTypeAny = "any" 249 ) 250 251 // Names of the filters allowed in the search engine 252 const ( 253 FilterNameRegex = "name_regex" // a name, searched by regular expression 254 FilterDate = "date" // a date expression (>|<|==|>=|<= date) 255 FilterIp = "ip" // An IP, searched by regular expression 256 FilterLatest = "latest" // gets the newest element 257 FilterEarliest = "earliest" // gets the oldest element 258 FilterParent = "parent" // matches the entity parent 259 FilterParentId = "parent_id" // matches the entity parent ID 260 ) 261 262 const ( 263 // The Qt* (Query Type) constants are the names used with Query requests to retrieve the corresponding entities 264 QtVappTemplate = "vAppTemplate" // vApp template 265 QtAdminVappTemplate = "adminVAppTemplate" // vApp template as admin 266 QtEdgeGateway = "edgeGateway" // edge gateway 267 QtOrgVdcNetwork = "orgVdcNetwork" // Org VDC network 268 QtCatalog = "catalog" // catalog 269 QtAdminCatalog = "adminCatalog" // catalog as admin 270 QtCatalogItem = "catalogItem" // catalog item 271 QtAdminCatalogItem = "adminCatalogItem" // catalog item as admin 272 QtAdminMedia = "adminMedia" // media item as admin 273 QtMedia = "media" // media item 274 QtVm = "vm" // Virtual machine 275 QtAdminVm = "adminVM" // Virtual machine as admin 276 QtVapp = "vApp" // vApp 277 QtAdminVapp = "adminVApp" // vApp as admin 278 QtOrgVdc = "orgVdc" // Org VDC 279 QtAdminOrgVdc = "adminOrgVdc" // Org VDC as admin 280 QtOrgVdcStorageProfile = "orgVdcStorageProfile" // StorageProfile of VDC 281 QtAdminOrgVdcStorageProfile = "adminOrgVdcStorageProfile" // StorageProfile of VDC as admin 282 QtTask = "task" // Task 283 QtAdminTask = "adminTask" // Task as admin 284 QtResourcePool = "resourcePool" // Resource Pool 285 QtNetworkPool = "networkPool" // Network Pool 286 QtProviderVdcStorageProfile = "providerVdcStorageProfile" // StorageProfile of Provider VDC 287 QtVappNetwork = "vAppNetwork" 288 QtAdminVappNetwork = "adminVAppNetwork" 289 ) 290 291 // AdminQueryTypes returns the corresponding "admin" query type for each regular type 292 var AdminQueryTypes = map[string]string{ 293 QtEdgeGateway: QtEdgeGateway, // EdgeGateway query type is the same for admin and regular users 294 QtOrgVdcNetwork: QtOrgVdcNetwork, // Org VDC Network query type is the same for admin and regular users 295 QtVappTemplate: QtAdminVappTemplate, 296 QtCatalog: QtAdminCatalog, 297 QtCatalogItem: QtAdminCatalogItem, 298 QtMedia: QtAdminMedia, 299 QtVm: QtAdminVm, 300 QtVapp: QtAdminVapp, 301 QtOrgVdc: QtAdminOrgVdc, 302 } 303 304 const ( 305 // Affinity and anti affinity definitions 306 PolarityAffinity = "Affinity" 307 PolarityAntiAffinity = "Anti-Affinity" 308 ) 309 310 // VmQueryFilter defines how we search VMs 311 type VmQueryFilter int 312 313 const ( 314 // VmQueryFilterAll defines a no-filter search, i.e. will return all elements 315 VmQueryFilterAll VmQueryFilter = iota 316 317 // VmQueryFilterOnlyDeployed defines a filter for deployed VMs 318 VmQueryFilterOnlyDeployed 319 320 // VmQueryFilterOnlyTemplates defines a filter for VMs inside a template 321 VmQueryFilterOnlyTemplates 322 ) 323 324 // String converts a VmQueryFilter into the corresponding filter needed by the query to get the wanted result 325 func (qf VmQueryFilter) String() string { 326 // Makes sure that we handle out-of-range values 327 if qf < VmQueryFilterAll || qf > VmQueryFilterOnlyTemplates { 328 return "" 329 } 330 return [...]string{ 331 "", // No filter: will not remove any items 332 "isVAppTemplate==false", // Will find only the deployed VMs 333 "isVAppTemplate==true", // Will find only those VM that are inside a template 334 }[qf] 335 } 336 337 // LDAP modes for Organization 338 const ( 339 LdapModeNone = "NONE" 340 LdapModeSystem = "SYSTEM" 341 LdapModeCustom = "CUSTOM" 342 ) 343 344 // Access control modes 345 const ( 346 ControlAccessReadOnly = "ReadOnly" 347 ControlAccessReadWrite = "Change" 348 ControlAccessFullControl = "FullControl" 349 ) 350 351 // BodyType allows to define API body types where applicable 352 type BodyType int 353 354 const ( 355 // BodyTypeXML 356 BodyTypeXML BodyType = iota 357 358 // BodyTypeJSON 359 BodyTypeJSON 360 ) 361 362 const ( 363 // FiqlQueryTimestampFormat is the format accepted by Cloud API time comparison operator in FIQL query filters 364 FiqlQueryTimestampFormat = "2006-01-02T15:04:05.000Z" 365 ) 366 367 // These constants allow constructing OpenAPI endpoint paths and avoid strings in code for easy replacement in the 368 // future. 369 const ( 370 OpenApiPathVersion1_0_0 = "1.0.0/" 371 OpenApiPathVersion2_0_0 = "2.0.0/" 372 OpenApiEndpointRoles = "roles/" 373 OpenApiEndpointGlobalRoles = "globalRoles/" 374 OpenApiEndpointRights = "rights/" 375 OpenApiEndpointRightsCategories = "rightsCategories/" 376 OpenApiEndpointRightsBundles = "rightsBundles/" 377 OpenApiEndpointAuditTrail = "auditTrail/" 378 OpenApiEndpointImportableTier0Routers = "nsxTResources/importableTier0Routers" 379 OpenApiEndpointImportableSwitches = "/network/orgvdcnetworks/importableswitches" 380 OpenApiEndpointImportableDvpgs = "virtualCenters/resources/importableDvpgs" 381 OpenApiEndpointEdgeClusters = "nsxTResources/edgeClusters" 382 OpenApiEndpointQosProfiles = "nsxTResources/gatewayQoSProfiles" 383 OpenApiEndpointExternalNetworks = "externalNetworks/" 384 OpenApiEndpointVdcComputePolicies = "vdcComputePolicies/" 385 OpenApiEndpointVdcAssignedComputePolicies = "vdcs/%s/computePolicies" 386 OpenApiEndpointVdcCapabilities = "vdcs/%s/capabilities" 387 OpenApiEndpointVdcNetworkProfile = "vdcs/%s/networkProfile" 388 OpenApiEndpointEdgeGateways = "edgeGateways/" 389 OpenApiEndpointEdgeGatewayQos = "edgeGateways/%s/qos" 390 OpenApiEndpointEdgeGatewayDhcpForwarder = "edgeGateways/%s/dhcpForwarder" 391 OpenApiEndpointEdgeGatewayDns = "edgeGateways/%s/dns" 392 OpenApiEndpointEdgeGatewaySlaacProfile = "edgeGateways/%s/slaacProfile" 393 OpenApiEndpointEdgeGatewayStaticRoutes = "edgeGateways/%s/routing/staticRoutes/" 394 OpenApiEndpointEdgeGatewayUsedIpAddresses = "edgeGateways/%s/usedIpAddresses" 395 OpenApiEndpointNsxtFirewallRules = "edgeGateways/%s/firewall/rules" 396 OpenApiEndpointEdgeGatewayL2VpnTunnel = "edgeGateways/%s/l2vpn/tunnels/" 397 OpenApiEndpointEdgeGatewayL2VpnTunnelStatistics = "edgeGateways/%s/l2vpn/tunnels/%s/metrics" 398 OpenApiEndpointEdgeGatewayL2VpnTunnelStatus = "edgeGateways/%s/l2vpn/tunnels/%s/status" 399 OpenApiEndpointFirewallGroups = "firewallGroups/" 400 OpenApiEndpointOrgVdcNetworks = "orgVdcNetworks/" 401 OpenApiEndpointOrgVdcNetworkSegmentProfiles = "orgVdcNetworks/%s/segmentProfiles" 402 OpenApiEndpointOrgVdcNetworksDhcp = "orgVdcNetworks/%s/dhcp" 403 OpenApiEndpointOrgVdcNetworksDhcpBindings = "orgVdcNetworks/%s/dhcp/bindings/" 404 OpenApiEndpointNsxtNatRules = "edgeGateways/%s/nat/rules/" 405 OpenApiEndpointAppPortProfiles = "applicationPortProfiles/" 406 OpenApiEndpointIpSecVpnTunnel = "edgeGateways/%s/ipsec/tunnels/" 407 OpenApiEndpointIpSecVpnTunnelConnectionProperties = "edgeGateways/%s/ipsec/tunnels/%s/connectionProperties" 408 OpenApiEndpointIpSecVpnTunnelStatus = "edgeGateways/%s/ipsec/tunnels/%s/status" 409 OpenApiEndpointSSLCertificateLibrary = "ssl/certificateLibrary/" 410 OpenApiEndpointSSLCertificateLibraryOld = "ssl/cetificateLibrary/" 411 OpenApiEndpointSessionCurrent = "sessions/current" 412 OpenApiEndpointVdcGroups = "vdcGroups/" 413 OpenApiEndpointVdcGroupsCandidateVdcs = "vdcGroups/networkingCandidateVdcs" 414 OpenApiEndpointVdcGroupsDfwPolicies = "vdcGroups/%s/dfwPolicies" 415 OpenApiEndpointVdcGroupsDfwDefaultPolicies = "vdcGroups/%s/dfwPolicies/default" 416 OpenApiEndpointVdcGroupsDfwRules = "vdcGroups/%s/dfwPolicies/%s/rules" 417 OpenApiEndpointLogicalVmGroups = "logicalVmGroups/" 418 OpenApiEndpointNetworkContextProfiles = "networkContextProfiles" 419 OpenApiEndpointSecurityTags = "securityTags" 420 OpenApiEndpointNsxtRouteAdvertisement = "edgeGateways/%s/routing/advertisement" 421 OpenApiEndpointTestConnection = "testConnection/" 422 OpenApiEndpointEdgeBgpNeighbor = "edgeGateways/%s/routing/bgp/neighbors/" // '%s' is NSX-T Edge Gateway ID 423 OpenApiEndpointEdgeBgpConfigPrefixLists = "edgeGateways/%s/routing/bgp/prefixLists/" // '%s' is NSX-T Edge Gateway ID 424 OpenApiEndpointEdgeBgpConfig = "edgeGateways/%s/routing/bgp" // '%s' is NSX-T Edge Gateway ID 425 OpenApiEndpointRdeInterfaces = "interfaces/" 426 OpenApiEndpointRdeInterfaceBehaviors = "interfaces/%s/behaviors/" 427 OpenApiEndpointRdeEntityTypes = "entityTypes/" 428 OpenApiEndpointRdeTypeBehaviors = "entityTypes/%s/behaviors/" 429 OpenApiEndpointRdeTypeBehaviorAccessControls = "entityTypes/%s/behaviorAccessControls" 430 OpenApiEndpointRdeEntities = "entities/" 431 OpenApiEndpointRdeEntitiesTypes = "entities/types/" 432 OpenApiEndpointRdeEntitiesResolve = "entities/%s/resolve" 433 OpenApiEndpointRdeEntitiesBehaviorsInvocations = "entities/%s/behaviors/%s/invocations" 434 OpenApiEndpointVirtualCenters = "virtualCenters" 435 OpenApiEndpointResourcePools = "virtualCenters/%s/resourcePools/browse" // '%s' is vCenter ID 436 OpenApiEndpointResourcePoolsBrowseAll = "virtualCenters/%s/resourcePools/browseAll" // '%s' is vCenter ID 437 OpenApiEndpointResourcePoolHardware = "virtualCenters/%s/resourcePools/%s/hwv" // first '%s' is vCenter ID. Second one is Resource Pool MoRef 438 OpenApiEndpointNetworkPools = "networkPools/" 439 OpenApiEndpointNetworkPoolSummaries = "networkPools/networkPoolSummaries" 440 OpenApiEndpointStorageProfiles = "virtualCenters/%s/storageProfiles" // '%s' is vCenter ID 441 OpenApiEndpointExtensionsUi = "extensions/ui/" 442 OpenApiEndpointExtensionsUiPlugin = "extensions/ui/%s/plugin" 443 OpenApiEndpointExtensionsUiTenants = "extensions/ui/%s/tenants" 444 OpenApiEndpointExtensionsUiTenantsPublishAll = "extensions/ui/%s/tenants/publishAll" 445 OpenApiEndpointExtensionsUiTenantsPublish = "extensions/ui/%s/tenants/publish" 446 OpenApiEndpointExtensionsUiTenantsUnpublishAll = "extensions/ui/%s/tenants/unpublishAll" 447 OpenApiEndpointExtensionsUiTenantsUnpublish = "extensions/ui/%s/tenants/unpublish" 448 OpenApiEndpointImportableTransportZones = "nsxTResources/importableTransportZones" 449 OpenApiEndpointVCenterDistributedSwitch = "virtualCenters/resources/dvSwitches" 450 451 OpenApiEndpointNsxtSegmentProfileTemplates = "segmentProfileTemplates/" 452 OpenApiEndpointNsxtGlobalDefaultSegmentProfileTemplates = "segmentProfileTemplates/default" 453 OpenApiEndpointNsxtSegmentIpDiscoveryProfiles = "nsxTResources/segmentIpDiscoveryProfiles" 454 OpenApiEndpointNsxtSegmentMacDiscoveryProfiles = "nsxTResources/segmentMacDiscoveryProfiles" 455 OpenApiEndpointNsxtSegmentSpoofGuardProfiles = "nsxTResources/segmentSpoofGuardProfiles" 456 OpenApiEndpointNsxtSegmentQosProfiles = "nsxTResources/segmentQoSProfiles" 457 OpenApiEndpointNsxtSegmentSecurityProfiles = "nsxTResources/segmentSecurityProfiles" 458 459 // IP Spaces 460 OpenApiEndpointIpSpaces = "ipSpaces/" 461 OpenApiEndpointIpSpaceSummaries = "ipSpaces/summaries" 462 OpenApiEndpointIpSpaceUplinks = "ipSpaceUplinks/" 463 OpenApiEndpointIpSpaceUplinksAllocate = "ipSpaces/%s/allocate" // '%s' is IP Space ID 464 OpenApiEndpointIpSpaceIpAllocations = "ipSpaces/%s/allocations/" // '%s' is IP Space ID 465 OpenApiEndpointIpSpaceOrgAssignments = "ipSpaces/orgAssignments/" // '%s' is IP Space ID 466 OpenApiEndpointIpSpaceFloatingIpSuggestions = "ipSpaces/floatingIpSuggestions/" 467 468 // NSX-T ALB related endpoints 469 470 OpenApiEndpointAlbController = "loadBalancer/controllers/" 471 472 // OpenApiEndpointAlbImportableClouds endpoint requires a filter _context==urn:vcloud:loadBalancerController:aa23ef66-ba32-48b2-892f-7acdffe4587e 473 OpenApiEndpointAlbImportableClouds = "nsxAlbResources/importableClouds/" 474 OpenApiEndpointAlbImportableServiceEngineGroups = "nsxAlbResources/importableServiceEngineGroups" 475 OpenApiEndpointAlbCloud = "loadBalancer/clouds/" 476 OpenApiEndpointAlbServiceEngineGroups = "loadBalancer/serviceEngineGroups/" 477 OpenApiEndpointAlbPools = "loadBalancer/pools/" 478 // OpenApiEndpointAlbPoolSummaries returns a limited subset of data provided by OpenApiEndpointAlbPools 479 // however only the summary endpoint can list all available pools for an edge gateway 480 OpenApiEndpointAlbPoolSummaries = "edgeGateways/%s/loadBalancer/poolSummaries" // %s contains edge gateway 481 OpenApiEndpointAlbVirtualServices = "loadBalancer/virtualServices/" 482 OpenApiEndpointAlbVirtualServiceSummaries = "edgeGateways/%s/loadBalancer/virtualServiceSummaries" // %s contains edge gateway 483 OpenApiEndpointAlbServiceEngineGroupAssignments = "loadBalancer/serviceEngineGroups/assignments/" 484 OpenApiEndpointAlbEdgeGateway = "edgeGateways/%s/loadBalancer" 485 486 // OpenApiEndpointServiceAccountGrant is needed for granting a Service Account 487 OpenApiEndpointServiceAccountGrant = "deviceLookup/grant" 488 OpenApiEndpointTokens = "tokens/" 489 OpenApiEndpointServiceAccounts = "serviceAccounts/" 490 491 // OpenApiEndpointVgpuProfile is used to query vGPU profiles 492 OpenApiEndpointVgpuProfile = "vgpuProfiles" 493 ) 494 495 // Header keys to run operations in tenant context 496 const ( 497 // HeaderTenantContext requires the Org ID of the tenant 498 HeaderTenantContext = "X-VMWARE-VCLOUD-TENANT-CONTEXT" 499 // HeaderAuthContext requires the Org name of the tenant 500 HeaderAuthContext = "X-VMWARE-VCLOUD-AUTH-CONTEXT" 501 ) 502 503 const ( 504 // ExternalNetworkBackingTypeNsxtTier0Router defines backing type of NSX-T Tier-0 router 505 ExternalNetworkBackingTypeNsxtTier0Router = "NSXT_TIER0" 506 // ExternalNetworkBackingTypeNsxtVrfTier0Router defines backing type of NSX-T Tier-0 VRF router 507 ExternalNetworkBackingTypeNsxtVrfTier0Router = "NSXT_VRF_TIER0" 508 // ExternalNetworkBackingTypeNsxtSegment defines backing type of NSX-T Segment (supported in VCD 10.3+) 509 ExternalNetworkBackingTypeNsxtSegment = "IMPORTED_T_LOGICAL_SWITCH" 510 // ExternalNetworkBackingTypeNetwork defines vSwitch portgroup 511 ExternalNetworkBackingTypeNetwork = "NETWORK" 512 // ExternalNetworkBackingDvPortgroup refers distributed switch portgroup 513 ExternalNetworkBackingDvPortgroup = "DV_PORTGROUP" 514 ) 515 516 const ( 517 // OrgVdcNetworkTypeRouted can be used to create NSX-T or NSX-V routed Org Vdc network 518 OrgVdcNetworkTypeRouted = "NAT_ROUTED" 519 // OrgVdcNetworkTypeIsolated can be used to create NSX-T or NSX-V isolated Org Vdc network 520 OrgVdcNetworkTypeIsolated = "ISOLATED" 521 // OrgVdcNetworkTypeDirect can be used to create NSX-V direct Org Vdc network 522 OrgVdcNetworkTypeDirect = "DIRECT" 523 // OrgVdcNetworkTypeOpaque type is used to create NSX-T imported Org Vdc network 524 OrgVdcNetworkTypeOpaque = "OPAQUE" 525 ) 526 527 const ( 528 // OrgVdcNetworkBackingTypeVirtualWire matches Org VDC network backing type for NSX-V 529 OrgVdcNetworkBackingTypeVirtualWire = "VIRTUAL_WIRE" 530 // OrgVdcNetworkBackingTypeNsxtFlexibleSegment matches Org VDC network backing type for NSX-T networks 531 OrgVdcNetworkBackingTypeNsxtFlexibleSegment = "NSXT_FLEXIBLE_SEGMENT" 532 // OrgVdcNetworkBackingTypeDvPortgroup matches Org VDC network backing type for NSX-T Imported network backed by DV Portgroup 533 OrgVdcNetworkBackingTypeDvPortgroup = "DV_PORTGROUP" 534 ) 535 536 const ( 537 // VdcCapabilityNetworkProviderNsxv is a convenience constant to match VDC capability 538 VdcCapabilityNetworkProviderNsxv = "NSX_V" 539 // VdcCapabilityNetworkProviderNsxt is a convenience constant to match VDC capability 540 VdcCapabilityNetworkProviderNsxt = "NSX_T" 541 ) 542 543 const ( 544 // FirewallGroupTypeSecurityGroup can be used in types.NsxtFirewallGroup for 'TypeValue' field 545 // to create Security Group 546 FirewallGroupTypeSecurityGroup = "SECURITY_GROUP" 547 // FirewallGroupTypeIpSet can be used in types.NsxtFirewallGroup for 'TypeValue' field to create 548 // IP Set 549 FirewallGroupTypeIpSet = "IP_SET" 550 551 // FirewallGroupTypeVmCriteria can be used in types.NsxtFirewallGroup for 'TypeValue' field to 552 // create Dynamic Security Group (VCD 10.3+) 553 FirewallGroupTypeVmCriteria = "VM_CRITERIA" 554 ) 555 556 // These constants can be used to pick type of NSX-T NAT Rule 557 const ( 558 NsxtNatRuleTypeDnat = "DNAT" 559 NsxtNatRuleTypeNoDnat = "NO_DNAT" 560 NsxtNatRuleTypeSnat = "SNAT" 561 NsxtNatRuleTypeNoSnat = "NO_SNAT" 562 NsxtNatRuleTypeReflexive = "REFLEXIVE" // Only in VCD 10.3+ (API V36.0) 563 ) 564 565 // In VCD versions 10.2.2+ (API V35.2+) there is a FirewallMatch field in NAT rule with these 566 // options 567 const ( 568 // NsxtNatRuleFirewallMatchInternalAddress will match firewall rules based on NAT rules internal 569 // address (DEFAULT) 570 NsxtNatRuleFirewallMatchInternalAddress = "MATCH_INTERNAL_ADDRESS" 571 // NsxtNatRuleFirewallMatchExternalAddress will match firewall rules based on NAT rule external 572 // address 573 NsxtNatRuleFirewallMatchExternalAddress = "MATCH_EXTERNAL_ADDRESS" 574 // NsxtNatRuleFirewallMatchBypass will skip evaluating NAT rules in firewall 575 NsxtNatRuleFirewallMatchBypass = "BYPASS" 576 ) 577 578 const ( 579 // ApplicationPortProfileScopeSystem is a defined scope which allows user to only read (no write capability) system 580 // predefined Application Port Profiles 581 ApplicationPortProfileScopeSystem = "SYSTEM" 582 // ApplicationPortProfileScopeProvider allows user to read and set Application Port Profiles at provider level. In 583 // reality Network Provider (NSX-T Manager) must be specified while creating. 584 ApplicationPortProfileScopeProvider = "PROVIDER" 585 // ApplicationPortProfileScopeTenant allows user to read and set Application Port Profiles at Org VDC level. 586 ApplicationPortProfileScopeTenant = "TENANT" 587 ) 588 589 const ( 590 // VcloudUndefinedKey is the bundles key automatically added to new role related objects 591 VcloudUndefinedKey = "com.vmware.vcloud.undefined.key" 592 ) 593 594 const ( 595 // NsxtAlbCloudBackingTypeNsxtAlb is a backing type for NSX-T ALB used in types.NsxtAlbCloudBacking 596 NsxtAlbCloudBackingTypeNsxtAlb = "NSXALB_NSXT" 597 ) 598 599 const ( 600 // UrnTypeVdcGroup is the third segment of URN for VDC Group 601 UrnTypeVdcGroup = "vdcGroup" 602 // UrnTypeVdc is the third segment of URN for VDC 603 UrnTypeVdc = "vdc" 604 ) 605 606 // Metadata type constants 607 const ( 608 MetadataStringValue string = "MetadataStringValue" 609 MetadataNumberValue string = "MetadataNumberValue" 610 MetadataDateTimeValue string = "MetadataDateTimeValue" 611 MetadataBooleanValue string = "MetadataBooleanValue" 612 613 MetadataReadOnlyVisibility string = "READONLY" 614 MetadataHiddenVisibility string = "PRIVATE" 615 MetadataReadWriteVisibility string = "READWRITE" 616 617 OpenApiMetadataStringEntry string = "StringEntry" 618 OpenApiMetadataNumberEntry string = "NumberEntry" 619 OpenApiMetadataBooleanEntry string = "BoolEntry" 620 ) 621 622 const ( 623 // DistributedFirewallPolicyDefault is a constant for "default" Distributed Firewall Policy 624 DistributedFirewallPolicyDefault = "default" 625 ) 626 627 // NSX-V distributed firewall 628 629 // Protocols 630 const ( 631 DFWProtocolTcp = "TCP" 632 DFWProtocolUdp = "UDP" 633 DFWProtocolIcmp = "ICMP" 634 ) 635 636 // Action types 637 const ( 638 DFWActionAllow = "allow" 639 DFWActionDeny = "deny" 640 ) 641 642 // Directions 643 const ( 644 DFWDirectionIn = "in" 645 DFWDirectionOut = "out" 646 DFWDirectionInout = "inout" 647 ) 648 649 // Types of packet 650 const ( 651 DFWPacketAny = "any" 652 DFWPacketIpv4 = "ipv4" 653 DFWPacketIpv6 = "ipv6" 654 ) 655 656 // Elements of Source, Destination, and Applies-To 657 const ( 658 DFWElementVdc = "VDC" 659 DFWElementVirtualMachine = "VirtualMachine" 660 DFWElementNetwork = "Network" 661 DFWElementEdge = "Edge" 662 DFWElementIpSet = "IPSet" 663 DFWElementIpv4 = "Ipv4Address" 664 ) 665 666 // Types of service 667 const ( 668 DFWServiceTypeApplication = "Application" 669 DFWServiceTypeApplicationGroup = "ApplicationGroup" 670 ) 671 672 var NsxvProtocolCodes = map[string]int{ 673 DFWProtocolTcp: 6, 674 DFWProtocolUdp: 17, 675 DFWProtocolIcmp: 1, 676 } 677 678 // NSX-T DHCP Binding Type 679 const ( 680 NsxtDhcpBindingTypeIpv4 = "IPV4" 681 NsxtDhcpBindingTypeIpv6 = "IPV6" 682 ) 683 684 // NSX-T IPSec VPN authentication modes 685 const ( 686 NsxtIpSecVpnAuthenticationModePSK = "PSK" 687 NsxtIpSecVpnAuthenticationModeCertificate = "CERTIFICATE" 688 ) 689 690 // Org VDC network backing types 691 const ( 692 OpenApiOrgVdcNetworkBackingTypeNsxv = "VIRTUAL_WIRE" 693 OpenApiOrgVdcNetworkBackingTypeNsxt = "NSXT_FLEXIBLE_SEGMENT" 694 ) 695 696 // IP Space types 697 const ( 698 IpSpaceShared = "SHARED_SERVICES" 699 IpSpacePublic = "PUBLIC" 700 IpSpacePrivate = "PRIVATE" 701 ) 702 703 // IP Space IP Allocation Reservation Types 704 const ( 705 IpSpaceIpAllocationUsedManual = "USED_MANUAL" 706 IpSpaceIpAllocationUsed = "USED" 707 IpSpaceIpAllocationUnused = "UNUSED" 708 ) 709 710 // IP Space IP Allocation Types 711 const ( 712 IpSpaceIpAllocationTypeFloatingIp = "FLOATING_IP" 713 IpSpaceIpAllocationTypeIpPrefix = "IP_PREFIX" 714 ) 715 716 // Values used for SAML metadata normalization and validation 717 const ( 718 SamlNamespaceMd = "urn:oasis:names:tc:SAML:2.0:metadata" 719 SamlNamespaceDs = "http://www.w3.org/2000/09/xmldsig#" 720 SamlNamespaceHoksso = "urn:oasis:names:tc:SAML:2.0:profiles:holder-of-key:SSO:browser" 721 ) 722 723 // Values used to identify the type of network pool 724 const ( 725 NetworkPoolVxlanType = "VXLAN" // NSX-V backed network pool. Only used as read-only 726 NetworkPoolVlanType = "VLAN" 727 NetworkPoolGeneveType = "GENEVE" 728 NetworkPoolPortGroupType = "PORTGROUP_BACKED" 729 ) 730 731 // BackingUseConstraint is a constraint about the use of a backing in a network pool 732 type BackingUseConstraint string 733 734 const ( 735 BackingUseExplicit BackingUseConstraint = "use-explicit-name" // use explicitly named backing 736 BackingUseWhenOnlyOne BackingUseConstraint = "use-when-only-one" // use automatically when only one was found 737 BackingUseFirstAvailable BackingUseConstraint = "use-first-available" // use the first available backing with no conditions 738 )