Documentation ¶
Overview ¶
Package govcd provides a simple binding for vCloud Director REST APIs.
Contains auxiliary functions to show library entities structure. Used for debugging and testing.
Index ¶
- Constants
- Variables
- func BuildUrnWithUuid(urnPrefix, uuid string) (string, error)
- func ContainsNotFound(err error) bool
- func GetExternalNetworkByName(vcdClient *VCDClient, networkName string) (*types.ExternalNetworkReference, error)deprecated
- func GetNetworkPoolByHREF(client *VCDClient, href string) (*types.VMWNetworkPool, error)
- func GetStorageProfileByHref(vcdClient *VCDClient, url string) (*types.VdcStorageProfile, error)
- func GetUuidFromHref(href string, idAtEnd bool) (string, error)
- func IsNotFound(err error) bool
- func IsUuid(identifier string) bool
- func IsVappNetwork(networkConfig *types.NetworkConfiguration) bool
- func LogAdminCatalog(catalog types.AdminCatalog)
- func LogAdminOrg(org types.AdminOrg)
- func LogCatalog(catalog types.Catalog)
- func LogCatalogItem(catalogItem types.CatalogItem)
- func LogDisk(disk types.Disk)
- func LogEdgeGateway(edgeGateway types.EdgeGateway)
- func LogExternalNetwork(network types.ExternalNetwork)
- func LogNetwork(conf types.OrgVDCNetwork)
- func LogOrg(org types.Org)
- func LogTask(task *types.Task, howManyTimes int, elapsed time.Duration, first, last bool)
- func LogUser(user types.User)
- func LogVapp(vapp types.VApp)
- func LogVdc(vdc types.Vdc)
- func ParseErr(bodyType types.BodyType, resp *http.Response, errType error) error
- func QueryDistributedPortGroup(vcdCli *VCDClient, name string) ([]*types.PortGroupRecordType, error)
- func QueryNetworkPoolByName(vcdCli *VCDClient, name string) ([]*types.QueryResultNetworkPoolRecordType, error)
- func QueryNetworkPortGroup(vcdCli *VCDClient, name string) ([]*types.PortGroupRecordType, error)
- func QueryOrgVdcNetworkByName(vcdCli *VCDClient, name string) ([]*types.QueryResultOrgVdcNetworkRecordType, error)
- func QueryPortGroups(vcdCli *VCDClient, filter string) ([]*types.PortGroupRecordType, error)
- func QueryProviderVdcByName(vcdCli *VCDClient, name string) ([]*types.QueryResultVMWProviderVdcRecordType, error)
- func QueryProviderVdcStorageProfileByName(vcdCli *VCDClient, name string) ([]*types.QueryResultProviderVdcStorageProfileRecordType, error)
- func QueryVirtualCenters(vcdClient *VCDClient, filter string) ([]*types.QueryResultVirtualCenterRecordType, error)
- func RemoveMediaImageIfExists(vdc Vdc, mediaName string) error
- func RemoveOrgVdcNetworkIfExists(vdc Vdc, networkName string) error
- func ShowAdminCatalog(catalog types.AdminCatalog)
- func ShowAdminOrg(org types.AdminOrg)
- func ShowCatalog(catalog types.Catalog)
- func ShowCatalogItem(catalogItem types.CatalogItem)
- func ShowDisk(disk types.Disk)
- func ShowEdgeGateway(edgeGateway types.EdgeGateway)
- func ShowExternalNetwork(network types.ExternalNetwork)
- func ShowNetwork(conf types.OrgVDCNetwork)
- func ShowOrg(org types.Org)
- func ShowTask(task *types.Task, howManyTimes int, elapsed time.Duration, first, last bool)
- func ShowUser(user types.User)
- func ShowVapp(vapp types.VApp)
- func ShowVdc(vdc types.Vdc)
- func SimpleLogTask(task *types.Task, howManyTimes int, elapsed time.Duration, first, last bool)
- func SimpleShowTask(task *types.Task, howManyTimes int, elapsed time.Duration, first, last bool)
- type AdminCatalog
- func (adminCatalog *AdminCatalog) Delete(force, recursive bool) error
- func (adminCatalog AdminCatalog) GetAccessControl(useTenantContext bool) (*types.ControlAccessParams, error)
- func (adminCatalog *AdminCatalog) GetMediaByHref(mediaHref string) (*Media, error)
- func (adminCatalog *AdminCatalog) GetMediaById(mediaId string) (*Media, error)
- func (adminCatalog *AdminCatalog) GetMediaByName(mediaName string, refresh bool) (*Media, error)
- func (adminCatalog *AdminCatalog) GetMediaByNameOrId(identifier string, refresh bool) (*Media, error)
- func (adminCatalog AdminCatalog) IsShared(useTenantContext bool) (bool, error)
- func (adminCatalog *AdminCatalog) QueryMedia(mediaName string) (*MediaRecord, error)
- func (adminCatalog *AdminCatalog) Refresh() error
- func (adminCatalog AdminCatalog) RemoveAccessControl(useTenantContext bool) error
- func (adminCatalog *AdminCatalog) RemoveMediaIfExists(mediaName string) error
- func (adminCatalog AdminCatalog) SetAccessControl(accessControl *types.ControlAccessParams, useTenantContext bool) error
- func (adminCatalog *AdminCatalog) Update() error
- func (adminCatalog *AdminCatalog) UploadOvf(ovaFileName, itemName, description string, uploadPieceSize int64) (UploadTask, error)
- type AdminOrg
- func (adminOrg *AdminOrg) CreateCatalog(name, description string) (AdminCatalog, error)
- func (adminOrg *AdminOrg) CreateCatalogWithStorageProfile(name, description string, storageProfiles *types.CatalogStorageProfiles) (*AdminCatalog, error)
- func (adminOrg *AdminOrg) CreateGroup(group *types.Group) (*OrgGroup, error)
- func (adminOrg *AdminOrg) CreateNsxtEdgeGateway(edgeGatewayConfig *types.OpenAPIEdgeGateway) (*NsxtEdgeGateway, error)
- func (adminOrg *AdminOrg) CreateOrgVdc(vdcConfiguration *types.VdcConfiguration) (*Vdc, error)
- func (adminOrg *AdminOrg) CreateOrgVdcAsync(vdcConfiguration *types.VdcConfiguration) (Task, error)
- func (adminOrg *AdminOrg) CreateRole(newRole *types.Role) (*Role, error)
- func (adminOrg *AdminOrg) CreateUser(userConfiguration *types.User) (*OrgUser, error)
- func (adminOrg *AdminOrg) CreateUserSimple(userData OrgUserConfiguration) (*OrgUser, error)
- func (adminOrg *AdminOrg) CreateVdc(vdcConfiguration *types.VdcConfiguration) (Task, error)
- func (org *AdminOrg) CreateVdcComputePolicy(newVdcComputePolicy *types.VdcComputePolicy) (*VdcComputePolicy, error)
- func (adminOrg *AdminOrg) CreateVdcWait(vdcDefinition *types.VdcConfiguration) error
- func (adminOrg *AdminOrg) Delete(force bool, recursive bool) error
- func (adminOrg *AdminOrg) Disable() error
- func (adminOrg *AdminOrg) FetchUserByHref(href string) (*OrgUser, error)
- func (adminOrg *AdminOrg) FetchUserById(id string, refresh bool) (*OrgUser, error)
- func (adminOrg *AdminOrg) FetchUserByName(name string, refresh bool) (*OrgUser, error)
- func (adminOrg *AdminOrg) FetchUserByNameOrId(identifier string, refresh bool) (*OrgUser, error)
- func (adminOrg *AdminOrg) FindAdminCatalog(catalogName string) (AdminCatalog, error)
- func (adminOrg *AdminOrg) FindAdminCatalogRecords(name string) ([]*types.CatalogRecord, error)
- func (adminOrg *AdminOrg) FindCatalog(catalogName string) (Catalog, error)
- func (adminOrg *AdminOrg) GetAdminCatalogByHref(catalogHref string) (*AdminCatalog, error)
- func (adminOrg *AdminOrg) GetAdminCatalogById(catalogId string, refresh bool) (*AdminCatalog, error)
- func (adminOrg *AdminOrg) GetAdminCatalogByName(catalogName string, refresh bool) (*AdminCatalog, error)
- func (adminOrg *AdminOrg) GetAdminCatalogByNameOrId(identifier string, refresh bool) (*AdminCatalog, error)
- func (adminOrg *AdminOrg) GetAdminVDCByHref(vdcHref string) (*AdminVdc, error)
- func (adminOrg *AdminOrg) GetAdminVDCById(vdcId string, refresh bool) (*AdminVdc, error)
- func (adminOrg *AdminOrg) GetAdminVDCByName(vdcName string, refresh bool) (*AdminVdc, error)
- func (adminOrg *AdminOrg) GetAdminVDCByNameOrId(identifier string, refresh bool) (*AdminVdc, error)
- func (adminOrg *AdminOrg) GetAdminVdcByName(vdcname string) (AdminVdc, error)
- func (adminOrg *AdminOrg) GetAllNsxtEdgeGateways(queryParameters url.Values) ([]*NsxtEdgeGateway, error)
- func (adminOrg *AdminOrg) GetAllOpenApiRoles(queryParameters url.Values) ([]*Role, error)
- func (adminOrg *AdminOrg) GetAllStorageProfileReferences(refresh bool) ([]*types.Reference, error)
- func (adminOrg *AdminOrg) GetAllVDCs(refresh bool) ([]*Vdc, error)
- func (org *AdminOrg) GetAllVdcComputePolicies(queryParameters url.Values) ([]*VdcComputePolicy, error)
- func (org *AdminOrg) GetCatalogAccessControl(catalogIdentifier string, useTenantContext bool) (*types.ControlAccessParams, error)
- func (adminOrg *AdminOrg) GetCatalogByHref(catalogHref string) (*Catalog, error)
- func (adminOrg *AdminOrg) GetCatalogById(catalogId string, refresh bool) (*Catalog, error)
- func (adminOrg *AdminOrg) GetCatalogByName(catalogName string, refresh bool) (*Catalog, error)
- func (adminOrg *AdminOrg) GetCatalogByNameOrId(identifier string, refresh bool) (*Catalog, error)
- func (adminOrg *AdminOrg) GetGroupByHref(href string) (*OrgGroup, error)
- func (adminOrg *AdminOrg) GetGroupById(id string, refresh bool) (*OrgGroup, error)
- func (adminOrg *AdminOrg) GetGroupByName(name string, refresh bool) (*OrgGroup, error)
- func (adminOrg *AdminOrg) GetGroupByNameOrId(identifier string, refresh bool) (*OrgGroup, error)
- func (adminOrg *AdminOrg) GetLdapConfiguration() (*types.OrgLdapSettingsType, error)
- func (adminOrg *AdminOrg) GetNsxtEdgeGatewayById(id string) (*NsxtEdgeGateway, error)
- func (adminOrg *AdminOrg) GetNsxtEdgeGatewayByName(name string) (*NsxtEdgeGateway, error)
- func (adminOrg *AdminOrg) GetOpenApiRoleById(id string) (*Role, error)
- func (adminOrg *AdminOrg) GetRole(roleName string) (*types.Reference, error)
- func (adminOrg *AdminOrg) GetRoleReference(roleName string) (*types.Reference, error)
- func (adminOrg *AdminOrg) GetStorageProfileReferenceById(id string, refresh bool) (*types.Reference, error)
- func (adminOrg *AdminOrg) GetUserByHref(href string) (*OrgUser, error)
- func (adminOrg *AdminOrg) GetUserById(id string, refresh bool) (*OrgUser, error)
- func (adminOrg *AdminOrg) GetUserByName(name string, refresh bool) (*OrgUser, error)
- func (adminOrg *AdminOrg) GetUserByNameOrId(identifier string, refresh bool) (*OrgUser, error)
- func (adminOrg *AdminOrg) GetVDCByHref(vdcHref string) (*Vdc, error)
- func (adminOrg *AdminOrg) GetVDCById(vdcId string, refresh bool) (*Vdc, error)
- func (adminOrg *AdminOrg) GetVDCByName(vdcName string, refresh bool) (*Vdc, error)
- func (adminOrg *AdminOrg) GetVDCByNameOrId(identifier string, refresh bool) (*Vdc, error)
- func (adminOrg *AdminOrg) GetVdcByName(vdcname string) (Vdc, error)
- func (org *AdminOrg) GetVdcComputePolicyById(id string) (*VdcComputePolicy, error)
- func (adminOrg *AdminOrg) LdapConfigure(settings *types.OrgLdapSettingsType) (*types.OrgLdapSettingsType, error)
- func (adminOrg *AdminOrg) LdapDisable() error
- func (adminOrg *AdminOrg) QueryCatalogList() ([]*types.CatalogRecord, error)
- func (adminOrg *AdminOrg) Refresh() error
- func (org *AdminOrg) SearchByFilter(queryType string, criteria *FilterDef) ([]QueryItem, string, error)
- func (adminOrg *AdminOrg) Update() (Task, error)
- type AdminVdc
- func (vdc *AdminVdc) GetAllAssignedVdcComputePolicies(queryParameters url.Values) ([]*VdcComputePolicy, error)
- func (vdc *AdminVdc) GetVappList() []*types.ResourceReference
- func (vdc *AdminVdc) QueryCatalogItemList() ([]*types.QueryResultCatalogItemType, error)
- func (vdc *AdminVdc) QueryVappTemplateList() ([]*types.QueryResultVappTemplateType, error)
- func (adminVdc *AdminVdc) Refresh() error
- func (vdc *AdminVdc) SetAssignedComputePolicies(computePolicyReferences types.VdcComputePolicyReferences) (*types.VdcComputePolicyReferences, error)
- func (adminVdc *AdminVdc) Update() (AdminVdc, error)
- func (adminVdc *AdminVdc) UpdateAsync() (Task, error)
- func (vdc *AdminVdc) UpdateStorageProfile(storageProfileId string, storageProfile *types.AdminVdcStorageProfile) (*types.AdminVdcStorageProfile, error)
- type Catalog
- func (catalog *Catalog) Delete(force, recursive bool) error
- func (cat *Catalog) FindCatalogItem(catalogItemName string) (CatalogItem, error)
- func (catalog Catalog) GetAccessControl(useTenantContext bool) (*types.ControlAccessParams, error)
- func (cat *Catalog) GetCatalogItemByHref(catalogItemHref string) (*CatalogItem, error)
- func (cat *Catalog) GetCatalogItemById(catalogItemId string, refresh bool) (*CatalogItem, error)
- func (cat *Catalog) GetCatalogItemByName(catalogItemName string, refresh bool) (*CatalogItem, error)
- func (cat *Catalog) GetCatalogItemByNameOrId(identifier string, refresh bool) (*CatalogItem, error)
- func (cat *Catalog) GetMediaByHref(mediaHref string) (*Media, error)
- func (catalog *Catalog) GetMediaById(mediaId string) (*Media, error)
- func (cat *Catalog) GetMediaByName(mediaName string, refresh bool) (*Media, error)
- func (cat *Catalog) GetMediaByNameOrId(identifier string, refresh bool) (*Media, error)
- func (cat *Catalog) GetVappTemplateByHref(href string) (*VAppTemplate, error)
- func (catalog Catalog) IsShared(useTenantContext bool) (bool, error)
- func (catalog *Catalog) QueryCatalogItemList() ([]*types.QueryResultCatalogItemType, error)
- func (catalog *Catalog) QueryMedia(mediaName string) (*MediaRecord, error)
- func (catalog *Catalog) QueryMediaList() ([]*types.MediaRecordType, error)
- func (catalog *Catalog) QueryVappTemplateList() ([]*types.QueryResultVappTemplateType, error)
- func (cat *Catalog) Refresh() error
- func (catalog Catalog) RemoveAccessControl(useTenantContext bool) error
- func (catalog *Catalog) SearchByFilter(queryType, parentField string, criteria *FilterDef) ([]QueryItem, string, error)
- func (catalog Catalog) SetAccessControl(accessControl *types.ControlAccessParams, useTenantContext bool) error
- func (cat *Catalog) UploadMediaImage(mediaName, mediaDescription, filePath string, uploadPieceSize int64) (UploadTask, error)
- func (cat *Catalog) UploadOvf(ovaFileName, itemName, description string, uploadPieceSize int64) (UploadTask, error)
- type CatalogItem
- type Client
- func (cli *Client) APIClientVersionIs(versionConstraint string) bool
- func (cli *Client) APIVCDMaxVersionIs(versionConstraint string) bool
- func (client *Client) ExecuteParamRequestWithCustomError(pathURL string, params map[string]string, ...) (*http.Response, error)
- func (client *Client) ExecuteRequest(pathURL, requestType, contentType, errorMessage string, ...) (*http.Response, error)
- func (client *Client) ExecuteRequestWithApiVersion(pathURL, requestType, contentType, errorMessage string, ...) (*http.Response, error)
- func (client *Client) ExecuteRequestWithCustomError(pathURL, requestType, contentType, errorMessage string, payload interface{}, ...) (*http.Response, error)
- func (client *Client) ExecuteRequestWithoutResponse(pathURL, requestType, contentType, errorMessage string, payload interface{}) error
- func (client *Client) ExecuteRequestWithoutResponseWithApiVersion(pathURL, requestType, contentType, errorMessage string, payload interface{}, ...) error
- func (client *Client) ExecuteTaskRequest(pathURL, requestType, contentType, errorMessage string, payload interface{}) (Task, error)
- func (client *Client) ExecuteTaskRequestWithApiVersion(pathURL, requestType, contentType, errorMessage string, payload interface{}, ...) (Task, error)
- func (cli *Client) FindVMByHREF(vmHREF string) (VM, error)deprecated
- func (client Client) GetAccessControl(href, entityType, entityName string, headerValues map[string]string) (*types.ControlAccessParams, error)
- func (client Client) GetQueryType(queryType string) string
- func (cli *Client) GetSpecificApiVersionOnCondition(vcdApiVersionCondition, wantedApiVersion string) string
- func (client *Client) GetVMByHref(vmHref string) (*VM, error)
- func (cli *Client) GetVcdFullVersion() (VcdVersion, error)
- func (cli *Client) GetVcdShortVersion() (string, error)
- func (cli *Client) GetVcdVersion() (string, time.Time, error)
- func (cli *Client) MaxSupportedVersion() (string, error)
- func (cli *Client) NewRequest(params map[string]string, method string, reqUrl url.URL, body io.Reader) *http.Request
- func (cli *Client) NewRequestWitNotEncodedParams(params map[string]string, notEncodedParams map[string]string, method string, ...) *http.Request
- func (cli *Client) NewRequestWitNotEncodedParamsWithApiVersion(params map[string]string, notEncodedParams map[string]string, method string, ...) *http.Request
- func (cli *Client) NewRequestWithApiVersion(params map[string]string, method string, reqUrl url.URL, body io.Reader, ...) *http.Request
- func (client *Client) OpenApiBuildEndpoint(endpoint ...string) (*url.URL, error)
- func (client *Client) OpenApiDeleteItem(apiVersion string, urlRef *url.URL, params url.Values) error
- func (client *Client) OpenApiGetAllItems(apiVersion string, urlRef *url.URL, queryParams url.Values, ...) error
- func (client *Client) OpenApiGetItem(apiVersion string, urlRef *url.URL, params url.Values, outType interface{}) error
- func (client *Client) OpenApiIsSupported() bool
- func (client *Client) OpenApiPostItem(apiVersion string, urlRef *url.URL, params url.Values, ...) error
- func (client *Client) OpenApiPostItemAsync(apiVersion string, urlRef *url.URL, params url.Values, payload interface{}) (Task, error)
- func (client *Client) OpenApiPostItemSync(apiVersion string, urlRef *url.URL, params url.Values, ...) error
- func (client *Client) OpenApiPutItem(apiVersion string, urlRef *url.URL, params url.Values, ...) error
- func (client *Client) OpenApiPutItemAsync(apiVersion string, urlRef *url.URL, params url.Values, payload interface{}) (Task, error)
- func (client *Client) OpenApiPutItemSync(apiVersion string, urlRef *url.URL, params url.Values, ...) error
- func (client *Client) QueryVappList() ([]*types.QueryResultVAppRecordType, error)
- func (client *Client) QueryVmList(filter types.VmQueryFilter) ([]*types.QueryResultVMRecordType, error)
- func (client *Client) QueryWithNotEncodedParams(params map[string]string, notEncodedParams map[string]string) (Results, error)
- func (client *Client) QueryWithNotEncodedParamsWithApiVersion(params map[string]string, notEncodedParams map[string]string, ...) (Results, error)
- func (client *Client) SearchByFilter(queryType string, criteria *FilterDef) ([]QueryItem, string, error)
- func (client *Client) SetAccessControl(accessControl *types.ControlAccessParams, href, entityType, entityName string, ...) error
- func (cli *Client) VersionEqualOrGreater(compareTo string, howManyDigits int) (bool, error)
- type DFW
- type DFWApplied
- type DFWAppliedTo
- type DFWRule
- type DFWSection
- type DateItem
- type DhcpSettings
- type Disk
- type DiskRecord
- type EdgeGateway
- func (egw *EdgeGateway) AddDNATRule(ruleDetails NatRule) (*types.NatRule, error)
- func (egw *EdgeGateway) AddDhcpPool(network *types.OrgVDCNetwork, dhcppool []interface{}) (Task, error)
- func (egw *EdgeGateway) AddIpsecVPN(ipsecVPNConfig *types.EdgeGatewayServiceConfiguration) (Task, error)
- func (egw *EdgeGateway) AddNATMapping(natType, externalIP, internalIP string) (Task, error)deprecated
- func (egw *EdgeGateway) AddNATPortMapping(...) (Task, error)deprecated
- func (egw *EdgeGateway) AddNATPortMappingWithUplink(network *types.OrgVDCNetwork, ...) (Task, error)deprecated
- func (egw *EdgeGateway) AddNATRule(network *types.OrgVDCNetwork, natType, externalIP, internalIP string) (Task, error)deprecated
- func (egw *EdgeGateway) AddNATRuleAsync(ruleDetails NatRule) (Task, error)
- func (egw *EdgeGateway) AddSNATRule(networkHref, externalIP, internalIP, description string) (*types.NatRule, error)
- func (egw *EdgeGateway) Create1to1Mapping(internal, external, description string) (Task, error)
- func (egw *EdgeGateway) CreateFirewallRules(defaultAction string, rules []*types.FirewallRule) (Task, error)
- func (egw *EdgeGateway) CreateLbAppProfile(lbAppProfileConfig *types.LbAppProfile) (*types.LbAppProfile, error)
- func (egw *EdgeGateway) CreateLbAppRule(lbAppRuleConfig *types.LbAppRule) (*types.LbAppRule, error)
- func (egw *EdgeGateway) CreateLbServerPool(lbPoolConfig *types.LbPool) (*types.LbPool, error)
- func (egw *EdgeGateway) CreateLbServiceMonitor(lbMonitorConfig *types.LbMonitor) (*types.LbMonitor, error)
- func (egw *EdgeGateway) CreateLbVirtualServer(lbVirtualServerConfig *types.LbVirtualServer) (*types.LbVirtualServer, error)
- func (egw *EdgeGateway) CreateNsxvFirewallRule(firewallRuleConfig *types.EdgeFirewallRule, aboveRuleId string) (*types.EdgeFirewallRule, error)
- func (egw *EdgeGateway) CreateNsxvNatRule(natRuleConfig *types.EdgeNatRule) (*types.EdgeNatRule, error)
- func (egw *EdgeGateway) Delete(force bool, recursive bool) error
- func (egw *EdgeGateway) DeleteAsync(force bool, recursive bool) (Task, error)
- func (egw *EdgeGateway) DeleteLbAppProfile(lbAppProfileConfig *types.LbAppProfile) error
- func (egw *EdgeGateway) DeleteLbAppProfileById(id string) error
- func (egw *EdgeGateway) DeleteLbAppProfileByName(name string) error
- func (egw *EdgeGateway) DeleteLbAppRule(lbAppRuleConfig *types.LbAppRule) error
- func (egw *EdgeGateway) DeleteLbAppRuleById(id string) error
- func (egw *EdgeGateway) DeleteLbAppRuleByName(name string) error
- func (egw *EdgeGateway) DeleteLbServerPool(lbPoolConfig *types.LbPool) error
- func (egw *EdgeGateway) DeleteLbServerPoolById(id string) error
- func (egw *EdgeGateway) DeleteLbServerPoolByName(name string) error
- func (egw *EdgeGateway) DeleteLbServiceMonitor(lbMonitorConfig *types.LbMonitor) error
- func (egw *EdgeGateway) DeleteLbServiceMonitorById(id string) error
- func (egw *EdgeGateway) DeleteLbServiceMonitorByName(name string) error
- func (egw *EdgeGateway) DeleteLbVirtualServer(lbVirtualServerConfig *types.LbVirtualServer) error
- func (egw *EdgeGateway) DeleteLbVirtualServerById(id string) error
- func (egw *EdgeGateway) DeleteLbVirtualServerByName(name string) error
- func (egw *EdgeGateway) DeleteNsxvFirewallRuleById(id string) error
- func (egw *EdgeGateway) DeleteNsxvNatRuleById(id string) error
- func (egw *EdgeGateway) GetAllNsxvDhcpLeases() ([]*types.EdgeDhcpLeaseInfo, error)
- func (egw *EdgeGateway) GetAllNsxvFirewallRules() ([]*types.EdgeFirewallRule, error)
- func (egw *EdgeGateway) GetAnyVnicIndexByNetworkName(networkName string) (*int, string, error)
- func (egw *EdgeGateway) GetDhcpRelay() (*types.EdgeDhcpRelay, error)
- func (egw *EdgeGateway) GetFirewallConfig() (*types.FirewallConfigWithXml, error)
- func (egw *EdgeGateway) GetLBGeneralParams() (*types.LbGeneralParamsWithXml, error)
- func (egw *EdgeGateway) GetLbAppProfileById(id string) (*types.LbAppProfile, error)
- func (egw *EdgeGateway) GetLbAppProfileByName(name string) (*types.LbAppProfile, error)
- func (egw *EdgeGateway) GetLbAppProfiles() ([]*types.LbAppProfile, error)
- func (egw *EdgeGateway) GetLbAppRuleById(id string) (*types.LbAppRule, error)
- func (egw *EdgeGateway) GetLbAppRuleByName(name string) (*types.LbAppRule, error)
- func (egw *EdgeGateway) GetLbAppRules() ([]*types.LbAppRule, error)
- func (egw *EdgeGateway) GetLbServerPoolById(id string) (*types.LbPool, error)
- func (egw *EdgeGateway) GetLbServerPoolByName(name string) (*types.LbPool, error)
- func (egw *EdgeGateway) GetLbServerPools() ([]*types.LbPool, error)
- func (egw *EdgeGateway) GetLbServiceMonitorById(id string) (*types.LbMonitor, error)
- func (egw *EdgeGateway) GetLbServiceMonitorByName(name string) (*types.LbMonitor, error)
- func (egw *EdgeGateway) GetLbServiceMonitors() ([]*types.LbMonitor, error)
- func (egw *EdgeGateway) GetLbVirtualServerById(id string) (*types.LbVirtualServer, error)
- func (egw *EdgeGateway) GetLbVirtualServerByName(name string) (*types.LbVirtualServer, error)
- func (egw *EdgeGateway) GetLbVirtualServers() ([]*types.LbVirtualServer, error)
- func (egw *EdgeGateway) GetNatRule(id string) (*types.NatRule, error)
- func (egw *EdgeGateway) GetNetworkNameAndTypeByVnicIndex(vNicIndex int) (string, string, error)
- func (egw *EdgeGateway) GetNetworks() ([]SimpleNetworkIdentifier, error)
- func (egw *EdgeGateway) GetNsxvActiveDhcpLeaseByMac(mac string) (*types.EdgeDhcpLeaseInfo, error)
- func (egw *EdgeGateway) GetNsxvFirewallRuleById(id string) (*types.EdgeFirewallRule, error)
- func (egw *EdgeGateway) GetNsxvNatRuleById(id string) (*types.EdgeNatRule, error)
- func (egw *EdgeGateway) GetNsxvNatRules() ([]*types.EdgeNatRule, error)
- func (egw *EdgeGateway) GetVnicIndexByNetworkNameAndType(networkName, networkType string) (*int, error)
- func (egw *EdgeGateway) HasAdvancedNetworking() bool
- func (egw *EdgeGateway) HasDefaultGateway() bool
- func (egw *EdgeGateway) Refresh() error
- func (egw *EdgeGateway) Remove1to1Mapping(internal, external string) (Task, error)
- func (egw *EdgeGateway) RemoveIpsecVPN() (Task, error)
- func (egw *EdgeGateway) RemoveNATMapping(natType, externalIP, internalIP, port string) (Task, error)deprecated
- func (egw *EdgeGateway) RemoveNATPortMapping(natType, externalIP, externalPort, internalIP, internalPort string) (Task, error)deprecated
- func (egw *EdgeGateway) RemoveNATRule(id string) error
- func (egw *EdgeGateway) RemoveNATRuleAsync(id string) (Task, error)
- func (egw *EdgeGateway) ResetDhcpRelay() error
- func (egw *EdgeGateway) Update() error
- func (egw *EdgeGateway) UpdateAsync() (Task, error)
- func (egw *EdgeGateway) UpdateDhcpRelay(dhcpRelayConfig *types.EdgeDhcpRelay) (*types.EdgeDhcpRelay, error)
- func (egw *EdgeGateway) UpdateFirewallConfig(enabled, defaultLoggingEnabled bool, defaultAction string) (*types.FirewallConfigWithXml, error)
- func (egw *EdgeGateway) UpdateLBGeneralParams(enabled, accelerationEnabled, loggingEnabled bool, logLevel string) (*types.LbGeneralParamsWithXml, error)
- func (egw *EdgeGateway) UpdateLbAppProfile(lbAppProfileConfig *types.LbAppProfile) (*types.LbAppProfile, error)
- func (egw *EdgeGateway) UpdateLbAppRule(lbAppRuleConfig *types.LbAppRule) (*types.LbAppRule, error)
- func (egw *EdgeGateway) UpdateLbServerPool(lbPoolConfig *types.LbPool) (*types.LbPool, error)
- func (egw *EdgeGateway) UpdateLbServiceMonitor(lbMonitorConfig *types.LbMonitor) (*types.LbMonitor, error)
- func (egw *EdgeGateway) UpdateLbVirtualServer(lbVirtualServerConfig *types.LbVirtualServer) (*types.LbVirtualServer, error)
- func (egw *EdgeGateway) UpdateNatRule(natRule *types.NatRule) (*types.NatRule, error)
- func (egw *EdgeGateway) UpdateNatRuleAsync(natRule *types.NatRule) (Task, error)
- func (egw *EdgeGateway) UpdateNsxvFirewallRule(firewallRuleConfig *types.EdgeFirewallRule) (*types.EdgeFirewallRule, error)
- func (egw *EdgeGateway) UpdateNsxvNatRule(natRuleConfig *types.EdgeNatRule) (*types.EdgeNatRule, error)
- type EdgeGatewayCreation
- type EjectTask
- type Envelope
- type ExternalNetwork
- type ExternalNetworkV2
- func CreateExternalNetworkV2(vcdClient *VCDClient, newExtNet *types.ExternalNetworkV2) (*ExternalNetworkV2, error)
- func GetAllExternalNetworksV2(vcdClient *VCDClient, queryParameters url.Values) ([]*ExternalNetworkV2, error)
- func GetExternalNetworkV2ById(vcdClient *VCDClient, id string) (*ExternalNetworkV2, error)
- func GetExternalNetworkV2ByName(vcdClient *VCDClient, name string) (*ExternalNetworkV2, error)
- type FilterDef
- type FilterMatch
- func HelperMakeFiltersFromCatalogItem(catalog *Catalog) ([]FilterMatch, error)
- func HelperMakeFiltersFromCatalogs(org *AdminOrg) ([]FilterMatch, error)
- func HelperMakeFiltersFromEdgeGateways(vdc *Vdc) ([]FilterMatch, error)
- func HelperMakeFiltersFromMedia(vdc *Vdc, catalogName string) ([]FilterMatch, error)
- func HelperMakeFiltersFromNetworks(vdc *Vdc) ([]FilterMatch, error)
- func HelperMakeFiltersFromVappTemplate(catalog *Catalog) ([]FilterMatch, error)
- type InspectionFunc
- type Media
- func (media *Media) AddMetadata(key string, value string) (*Media, error)
- func (media *Media) AddMetadataAsync(key string, value string) (Task, error)
- func (media *Media) Delete() (Task, error)
- func (media *Media) DeleteMetadata(key string) error
- func (media *Media) DeleteMetadataAsync(key string) (Task, error)
- func (media *Media) GetMetadata() (*types.Metadata, error)
- func (media *Media) Refresh() error
- type MediaItemdeprecated
- func NewMediaItem(vdc *Vdc) *MediaItemdeprecated
- func (mediaItem *MediaItem) AddMetadata(key string, value string) (*MediaItem, error)
- func (mediaItem *MediaItem) AddMetadataAsync(key string, value string) (Task, error)
- func (mediaItem *MediaItem) Delete() (Task, error)
- func (mediaItem *MediaItem) DeleteMetadata(key string) error
- func (mediaItem *MediaItem) DeleteMetadataAsync(key string) (Task, error)
- func (mediaItem *MediaItem) GetMetadata() (*types.Metadata, error)
- func (mediaItem *MediaItem) Refresh() error
- type MediaRecord
- func (mediaRecord *MediaRecord) AddMetadata(key string, value string) (*MediaRecord, error)
- func (mediaRecord *MediaRecord) AddMetadataAsync(key string, value string) (Task, error)
- func (mediaRecord *MediaRecord) Delete() (Task, error)
- func (mediaRecord *MediaRecord) DeleteMetadata(key string) error
- func (mediaRecord *MediaRecord) DeleteMetadataAsync(key string) (Task, error)
- func (mediaRecord *MediaRecord) GetMetadata() (*types.Metadata, error)
- func (mediaRecord *MediaRecord) Refresh() error
- type MetadataDef
- type MetadataFilter
- type NatRule
- type NsxtEdgeCluster
- type NsxtEdgeGateway
- type NsxtTier0Router
- type Org
- func (org *Org) CreateCatalog(name, description string) (Catalog, error)
- func (org *Org) CreateCatalogWithStorageProfile(name, description string, storageProfiles *types.CatalogStorageProfiles) (*Catalog, error)
- func (org *Org) FindCatalog(catalogName string) (Catalog, error)
- func (org *Org) GetAllNsxtEdgeGateways(queryParameters url.Values) ([]*NsxtEdgeGateway, error)
- func (org *Org) GetAllVdcComputePolicies(queryParameters url.Values) ([]*VdcComputePolicy, error)
- func (org *Org) GetCatalogAccessControl(catalogIdentifier string, useTenantContext bool) (*types.ControlAccessParams, error)
- func (org *Org) GetCatalogByHref(catalogHref string) (*Catalog, error)
- func (org *Org) GetCatalogById(catalogId string, refresh bool) (*Catalog, error)
- func (org *Org) GetCatalogByName(catalogName string, refresh bool) (*Catalog, error)
- func (org *Org) GetCatalogByNameOrId(identifier string, refresh bool) (*Catalog, error)
- func (org *Org) GetNsxtEdgeGatewayById(id string) (*NsxtEdgeGateway, error)
- func (org *Org) GetNsxtEdgeGatewayByName(name string) (*NsxtEdgeGateway, error)
- func (org *Org) GetTaskList() (*types.TasksList, error)
- func (org *Org) GetVDCByHref(vdcHref string) (*Vdc, error)
- func (org *Org) GetVDCById(vdcId string, refresh bool) (*Vdc, error)
- func (org *Org) GetVDCByName(vdcName string, refresh bool) (*Vdc, error)
- func (org *Org) GetVDCByNameOrId(identifier string, refresh bool) (*Vdc, error)
- func (org *Org) GetVdcByName(vdcname string) (Vdc, error)
- func (org *Org) GetVdcComputePolicyById(id string) (*VdcComputePolicy, error)
- func (org *Org) QueryCatalogList() ([]*types.CatalogRecord, error)
- func (org *Org) Refresh() error
- func (org *Org) SearchByFilter(queryType string, criteria *FilterDef) ([]QueryItem, string, error)
- type OrgGroup
- type OrgUser
- func (user *OrgUser) ChangePassword(newPass string) error
- func (user *OrgUser) ChangeRole(roleName string) error
- func (user *OrgUser) Delete(takeOwnership bool) error
- func (user *OrgUser) Disable() error
- func (user *OrgUser) Enable() error
- func (user *OrgUser) GetRoleName() string
- func (user *OrgUser) TakeOwnership() error
- func (user *OrgUser) Unlock() error
- func (user *OrgUser) Update() error
- func (user *OrgUser) UpdateSimple(userData OrgUserConfiguration) error
- type OrgUserConfiguration
- type OrgVDCNetwork
- type QueryAdminCatalog
- func (catalog QueryAdminCatalog) GetDate() string
- func (catalog QueryAdminCatalog) GetHref() string
- func (catalog QueryAdminCatalog) GetIp() string
- func (catalog QueryAdminCatalog) GetMetadataValue(key string) string
- func (catalog QueryAdminCatalog) GetName() string
- func (catalog QueryAdminCatalog) GetParentId() string
- func (catalog QueryAdminCatalog) GetParentName() string
- func (catalog QueryAdminCatalog) GetType() string
- type QueryCatalog
- func (catalog QueryCatalog) GetDate() string
- func (catalog QueryCatalog) GetHref() string
- func (catalog QueryCatalog) GetIp() string
- func (catalog QueryCatalog) GetMetadataValue(key string) string
- func (catalog QueryCatalog) GetName() string
- func (catalog QueryCatalog) GetParentId() string
- func (catalog QueryCatalog) GetParentName() string
- func (catalog QueryCatalog) GetType() string
- type QueryCatalogItem
- func (catItem QueryCatalogItem) GetDate() string
- func (catItem QueryCatalogItem) GetHref() string
- func (catItem QueryCatalogItem) GetIp() string
- func (catItem QueryCatalogItem) GetMetadataValue(key string) string
- func (catItem QueryCatalogItem) GetName() string
- func (catItem QueryCatalogItem) GetParentId() string
- func (catItem QueryCatalogItem) GetParentName() string
- func (catItem QueryCatalogItem) GetType() string
- type QueryEdgeGateway
- func (egw QueryEdgeGateway) GetDate() string
- func (egw QueryEdgeGateway) GetHref() string
- func (egw QueryEdgeGateway) GetIp() string
- func (egw QueryEdgeGateway) GetMetadataValue(key string) string
- func (egw QueryEdgeGateway) GetName() string
- func (egw QueryEdgeGateway) GetParentId() string
- func (egw QueryEdgeGateway) GetParentName() string
- func (egw QueryEdgeGateway) GetType() string
- type QueryItem
- type QueryMedia
- func (media QueryMedia) GetDate() string
- func (media QueryMedia) GetHref() string
- func (media QueryMedia) GetIp() string
- func (media QueryMedia) GetMetadataValue(key string) string
- func (media QueryMedia) GetName() string
- func (media QueryMedia) GetParentId() string
- func (media QueryMedia) GetParentName() string
- func (media QueryMedia) GetType() string
- type QueryOrgVdcNetwork
- func (network QueryOrgVdcNetwork) GetDate() string
- func (network QueryOrgVdcNetwork) GetHref() string
- func (network QueryOrgVdcNetwork) GetIp() string
- func (network QueryOrgVdcNetwork) GetMetadataValue(key string) string
- func (network QueryOrgVdcNetwork) GetName() string
- func (network QueryOrgVdcNetwork) GetParentId() string
- func (network QueryOrgVdcNetwork) GetParentName() string
- func (network QueryOrgVdcNetwork) GetType() string
- type QueryVAppTemplate
- func (vappTemplate QueryVAppTemplate) GetDate() string
- func (vappTemplate QueryVAppTemplate) GetHref() string
- func (vappTemplate QueryVAppTemplate) GetIp() string
- func (vappTemplate QueryVAppTemplate) GetMetadataValue(key string) string
- func (vappTemplate QueryVAppTemplate) GetName() string
- func (vappTemplate QueryVAppTemplate) GetParentId() string
- func (vappTemplate QueryVAppTemplate) GetParentName() string
- func (vappTemplate QueryVAppTemplate) GetType() string
- type QueryVapp
- func (vapp QueryVapp) GetDate() string
- func (vapp QueryVapp) GetHref() string
- func (vapp QueryVapp) GetIp() string
- func (vapp QueryVapp) GetMetadataValue(key string) string
- func (vapp QueryVapp) GetName() string
- func (vapp QueryVapp) GetParentId() string
- func (vapp QueryVapp) GetParentName() string
- func (vapp QueryVapp) GetType() string
- type QueryVm
- func (vm QueryVm) GetDate() string
- func (vm QueryVm) GetHref() string
- func (vm QueryVm) GetIp() string
- func (vm QueryVm) GetMetadataValue(key string) string
- func (vm QueryVm) GetName() string
- func (vm QueryVm) GetParentId() string
- func (vm QueryVm) GetParentName() string
- func (vm QueryVm) GetType() string
- type Results
- type Role
- type SimpleNetworkIdentifier
- type StringMap
- type SupportedVersions
- type Task
- func CreateAndConfigureEdgeGatewayAsync(vcdClient *VCDClient, orgName, vdcName, egwName string, ...) (Task, error)
- func CreateEdgeGatewayAsync(vcdClient *VCDClient, egwc EdgeGatewayCreation) (Task, error)
- func CreateExternalNetwork(vcdClient *VCDClient, externalNetworkData *types.ExternalNetwork) (Task, error)
- func CreateOrg(vcdClient *VCDClient, name string, fullName string, description string, ...) (Task, error)
- func NewTask(cli *Client) *Task
- type UploadTask
- type VApp
- func (vapp *VApp) AddEmptyVm(reComposeVAppParams *types.RecomposeVAppParamsForEmptyVm) (*VM, error)
- func (vapp *VApp) AddEmptyVmAsync(reComposeVAppParams *types.RecomposeVAppParamsForEmptyVm) (Task, error)
- func (vapp *VApp) AddIsolatedNetwork(newIsolatedNetworkSettings *VappNetworkSettings) (Task, error)
- func (vapp *VApp) AddMetadata(key string, value string) (Task, error)
- func (vapp *VApp) AddNewVM(name string, vappTemplate VAppTemplate, ...) (Task, error)
- func (vapp *VApp) AddNewVMWithComputePolicy(name string, vappTemplate VAppTemplate, ...) (Task, error)
- func (vapp *VApp) AddNewVMWithStorageProfile(name string, vappTemplate VAppTemplate, ...) (Task, error)
- func (vapp *VApp) AddOrgNetwork(newNetworkSettings *VappNetworkSettings, orgNetwork *types.OrgVDCNetwork, ...) (*types.NetworkConfigSection, error)
- func (vapp *VApp) AddOrgNetworkAsync(newNetworkSettings *VappNetworkSettings, orgNetwork *types.OrgVDCNetwork, ...) (Task, error)
- func (vapp *VApp) AddRAWNetworkConfig(orgvdcnetworks []*types.OrgVDCNetwork) (Task, error)
- func (vapp *VApp) AddVM(orgVdcNetworks []*types.OrgVDCNetwork, vappNetworkName string, ...) (Task, error)deprecated
- func (vapp *VApp) BlockWhileStatus(unwantedStatus string, timeOutAfterSeconds int) error
- func (vapp *VApp) ChangeCPUCount(virtualCpuCount int) (Task, error)
- func (vapp *VApp) ChangeCPUCountWithCore(virtualCpuCount int, coresPerSocket *int) (Task, error)
- func (vapp *VApp) ChangeMemorySize(size int) (Task, error)
- func (vapp *VApp) ChangeNetworkConfig(networks []map[string]interface{}, ip string) (Task, error)
- func (vapp *VApp) ChangeStorageProfile(name string) (Task, error)
- func (vapp *VApp) ChangeVMName(name string) (Task, error)
- func (vapp *VApp) CreateVappNetwork(newNetworkSettings *VappNetworkSettings, orgNetwork *types.OrgVDCNetwork) (*types.NetworkConfigSection, error)
- func (vapp *VApp) CreateVappNetworkAsync(newNetworkSettings *VappNetworkSettings, orgNetwork *types.OrgVDCNetwork) (Task, error)
- func (vapp *VApp) Customize(computername, script string, changeSid bool) (Task, error)deprecated
- func (vapp *VApp) Delete() (Task, error)
- func (vapp *VApp) DeleteMetadata(key string) (Task, error)
- func (vapp *VApp) Deploy() (Task, error)
- func (vapp VApp) GetAccessControl(useTenantContext bool) (*types.ControlAccessParams, error)
- func (vapp *VApp) GetMetadata() (*types.Metadata, error)
- func (vapp *VApp) GetNetworkConfig() (*types.NetworkConfigSection, error)
- func (vapp *VApp) GetNetworkConnectionSection() (*types.NetworkConnectionSection, error)
- func (vapp *VApp) GetProductSectionList() (*types.ProductSectionList, error)
- func (vapp *VApp) GetStatus() (string, error)
- func (vapp *VApp) GetVMById(id string, refresh bool) (*VM, error)
- func (vapp *VApp) GetVMByName(vmName string, refresh bool) (*VM, error)
- func (vapp *VApp) GetVMByNameOrId(identifier string, refresh bool) (*VM, error)
- func (vapp *VApp) GetVappNetworkById(id string, refresh bool) (*types.VAppNetwork, error)
- func (vapp *VApp) GetVappNetworkByName(vappNetworkName string, refresh bool) (*types.VAppNetwork, error)
- func (vapp *VApp) GetVappNetworkByNameOrId(identifier string, refresh bool) (*types.VAppNetwork, error)
- func (vapp VApp) IsShared(useTenantContext bool) (bool, error)
- func (vapp *VApp) PowerOff() (Task, error)
- func (vapp *VApp) PowerOn() (Task, error)
- func (vapp *VApp) Reboot() (Task, error)
- func (vapp *VApp) Refresh() error
- func (vapp VApp) RemoveAccessControl(useTenantContext bool) error
- func (vapp *VApp) RemoveAllNetworkFirewallRules(networkId string) error
- func (vapp *VApp) RemoveAllNetworkNatRules(networkId string) error
- func (vapp *VApp) RemoveAllNetworkStaticRoutes(networkId string) error
- func (vapp *VApp) RemoveAllNetworks() (Task, error)
- func (vapp *VApp) RemoveIsolatedNetwork(networkName string) (Task, error)
- func (vapp *VApp) RemoveNetwork(identifier string) (*types.NetworkConfigSection, error)
- func (vapp *VApp) RemoveNetworkAsync(identifier string) (Task, error)
- func (vapp *VApp) RemoveVM(vm VM) error
- func (vapp *VApp) Reset() (Task, error)
- func (vapp *VApp) RunCustomizationScript(computername, script string) (Task, error)
- func (vapp VApp) SetAccessControl(accessControl *types.ControlAccessParams, useTenantContext bool) error
- func (vapp *VApp) SetOvf(parameters map[string]string) (Task, error)deprecated
- func (vapp *VApp) SetProductSectionList(productSection *types.ProductSectionList) (*types.ProductSectionList, error)
- func (vapp *VApp) Shutdown() (Task, error)
- func (vapp *VApp) Suspend() (Task, error)
- func (vapp *VApp) Undeploy() (Task, error)
- func (vapp *VApp) UpdateNetwork(newNetworkSettings *VappNetworkSettings, orgNetwork *types.OrgVDCNetwork) (*types.NetworkConfigSection, error)
- func (vapp *VApp) UpdateNetworkAsync(networkSettingsToUpdate *VappNetworkSettings, orgNetwork *types.OrgVDCNetwork) (Task, error)
- func (vapp *VApp) UpdateNetworkFirewallRules(networkId string, firewallRules []*types.FirewallRule, enabled bool, ...) (*types.VAppNetwork, error)
- func (vapp *VApp) UpdateNetworkFirewallRulesAsync(networkId string, firewallRules []*types.FirewallRule, enabled bool, ...) (Task, error)
- func (vapp *VApp) UpdateNetworkNatRules(networkId string, natRules []*types.NatRule, enabled bool, ...) (*types.VAppNetwork, error)
- func (vapp *VApp) UpdateNetworkNatRulesAsync(networkId string, natRules []*types.NatRule, enabled bool, ...) (Task, error)
- func (vapp *VApp) UpdateNetworkStaticRouting(networkId string, staticRoutes []*types.StaticRoute, enabled bool) (*types.VAppNetwork, error)
- func (vapp *VApp) UpdateNetworkStaticRoutingAsync(networkId string, staticRoutes []*types.StaticRoute, enabled bool) (Task, error)
- func (vapp *VApp) UpdateOrgNetwork(newNetworkSettings *VappNetworkSettings, isFenced bool) (*types.NetworkConfigSection, error)
- func (vapp *VApp) UpdateOrgNetworkAsync(networkSettingsToUpdate *VappNetworkSettings, isFenced bool) (Task, error)
- type VAppTemplate
- func (vAppTemplate *VAppTemplate) AddMetadata(key string, value string) (*VAppTemplate, error)
- func (vAppTemplate *VAppTemplate) AddMetadataAsync(key string, value string) (Task, error)
- func (vAppTemplate *VAppTemplate) DeleteMetadata(key string) error
- func (vAppTemplate *VAppTemplate) DeleteMetadataAsync(key string) (Task, error)
- func (vAppTemplate *VAppTemplate) GetMetadata() (*types.Metadata, error)
- func (vAppTemplate *VAppTemplate) Refresh() error
- type VCDClient
- func (vcdCli *VCDClient) Authenticate(username, password, org string) error
- func (vcdCli *VCDClient) Disconnect() error
- func (vcdClient *VCDClient) GetAdminOrgById(orgId string) (*AdminOrg, error)
- func (vcdClient *VCDClient) GetAdminOrgByName(orgName string) (*AdminOrg, error)
- func (vcdClient *VCDClient) GetAdminOrgByNameOrId(identifier string) (*AdminOrg, error)
- func (vcdCli *VCDClient) GetAllImportableNsxtTier0Routers(nsxtManagerId string, queryParameters url.Values) ([]*NsxtTier0Router, error)
- func (vcdCli *VCDClient) GetAuthResponse(username, password, org string) (*http.Response, error)
- func (vcdClient *VCDClient) GetExternalNetworkById(id string) (*ExternalNetwork, error)
- func (vcdClient *VCDClient) GetExternalNetworkByName(networkName string) (*ExternalNetwork, error)
- func (vcdClient *VCDClient) GetExternalNetworkByNameOrId(identifier string) (*ExternalNetwork, error)
- func (vcdClient *VCDClient) GetExternalNetworks() (*types.ExternalNetworkReferences, error)
- func (vcdCli *VCDClient) GetImportableNsxtTier0RouterByName(name, nsxtManagerId string) (*NsxtTier0Router, error)
- func (vcdClient *VCDClient) GetOrgById(orgId string) (*Org, error)
- func (vcdClient *VCDClient) GetOrgByName(orgName string) (*Org, error)
- func (vcdClient *VCDClient) GetOrgByNameOrId(identifier string) (*Org, error)
- func (vcdCli *VCDClient) GetOrgList() (*types.OrgList, error)
- func (vcdCli *VCDClient) NewVApp(client *Client) VApp
- func (vcdCli *VCDClient) Query(params map[string]string) (Results, error)
- func (vcdClient *VCDClient) QueryNetworkPools() ([]*types.QueryResultNetworkPoolRecordType, error)
- func (vcdCli *VCDClient) QueryNsxtManagerByName(name string) ([]*types.QueryResultNsxtManagerRecordType, error)
- func (vcdClient *VCDClient) QueryProviderVdcStorageProfiles() ([]*types.QueryResultProviderVdcStorageProfileRecordType, error)
- func (vcdClient *VCDClient) QueryProviderVdcs() ([]*types.QueryResultVMWProviderVdcRecordType, error)
- func (vcdCli *VCDClient) QueryWithNotEncodedParams(params map[string]string, notEncodedParams map[string]string) (Results, error)
- func (vcdCli *VCDClient) QueryWithNotEncodedParamsWithApiVersion(params map[string]string, notEncodedParams map[string]string, ...) (Results, error)
- func (vcdCli *VCDClient) SetToken(org, authHeader, token string) error
- type VCDClientOption
- type VM
- func (vm *VM) AddInternalDisk(diskData *types.DiskSettings) (string, error)
- func (vm *VM) AddMetadata(key string, value string) (Task, error)
- func (vm *VM) AnswerQuestion(questionId string, choiceId int) error
- func (vm *VM) AttachDisk(diskParams *types.DiskAttachOrDetachParams) (Task, error)
- func (vm *VM) BlockWhileGuestCustomizationStatus(unwantedStatus string, timeOutAfterSeconds int) error
- func (vm *VM) ChangeCPUCount(virtualCpuCount int) (Task, error)
- func (vm *VM) ChangeCPUCountWithCore(virtualCpuCount int, coresPerSocket *int) (Task, error)
- func (vm *VM) ChangeMemorySize(size int) (Task, error)
- func (vm *VM) ChangeNetworkConfig(networks []map[string]interface{}) (Task, error)
- func (vm *VM) Customize(computername, script string, changeSid bool) (Task, error)deprecated
- func (vm *VM) DeleteInternalDisk(diskId string) error
- func (vm *VM) DeleteMetadata(key string) (Task, error)
- func (vm *VM) DetachDisk(diskParams *types.DiskAttachOrDetachParams) (Task, error)
- func (vm *VM) EjectMedia(mediaParams *types.MediaInsertOrEjectParams) (EjectTask, error)
- func (vm *VM) GetGuestCustomizationSection() (*types.GuestCustomizationSection, error)
- func (vm *VM) GetGuestCustomizationStatus() (string, error)
- func (vm *VM) GetInternalDiskById(diskId string, refresh bool) (*types.DiskSettings, error)
- func (vm *VM) GetMetadata() (*types.Metadata, error)
- func (vm *VM) GetNetworkConnectionSection() (*types.NetworkConnectionSection, error)
- func (vm *VM) GetParentVApp() (*VApp, error)
- func (vm *VM) GetParentVdc() (*Vdc, error)
- func (vm *VM) GetProductSectionList() (*types.ProductSectionList, error)
- func (vm *VM) GetQuestion() (types.VmPendingQuestion, error)
- func (vm *VM) GetStatus() (string, error)
- func (vm *VM) GetVirtualHardwareSection() (*types.VirtualHardwareSection, error)
- func (vm *VM) HandleEjectMedia(org *Org, catalogName, mediaName string) (EjectTask, error)
- func (vm *VM) HandleEjectMediaAndAnswer(org *Org, catalogName, mediaName string, answerYes bool) (*VM, error)
- func (vm *VM) HandleInsertMedia(org *Org, catalogName, mediaName string) (Task, error)
- func (vm *VM) InsertMedia(mediaParams *types.MediaInsertOrEjectParams) (Task, error)
- func (vm *VM) IsDeployed() (bool, error)
- func (vm *VM) PowerOff() (Task, error)
- func (vm *VM) PowerOn() (Task, error)
- func (vm *VM) PowerOnAndForceCustomization() error
- func (vm *VM) Refresh() error
- func (vm *VM) RunCustomizationScript(computername, script string) (Task, error)
- func (vm *VM) SetGuestCustomizationSection(guestCustomizationSection *types.GuestCustomizationSection) (*types.GuestCustomizationSection, error)
- func (vm *VM) SetProductSectionList(productSection *types.ProductSectionList) (*types.ProductSectionList, error)
- func (vm *VM) ToggleHardwareVirtualization(isEnabled bool) (Task, error)
- func (vm *VM) Undeploy() (Task, error)
- func (vm *VM) UpdateComputePolicy(computePolicy *types.VdcComputePolicy) (*VM, error)
- func (vm *VM) UpdateComputePolicyAsync(computePolicy *types.VdcComputePolicy) (Task, error)
- func (vm *VM) UpdateInternalDisks(disksSettingToUpdate *types.VmSpecSection) (*types.VmSpecSection, error)
- func (vm *VM) UpdateInternalDisksAsync(disksSettingToUpdate *types.VmSpecSection) (Task, error)
- func (vm *VM) UpdateNetworkConnectionSection(networks *types.NetworkConnectionSection) error
- func (vm *VM) UpdateStorageProfile(storageProfileHref string) (*VM, error)
- func (vm *VM) UpdateStorageProfileAsync(storageProfileHref string) (Task, error)
- func (vm *VM) UpdateVmCpuAndMemoryHotAdd(cpuAdd, memoryAdd bool) (*VM, error)
- func (vm *VM) UpdateVmCpuAndMemoryHotAddAsync(cpuHot, memoryAdd bool) (Task, error)
- func (vm *VM) UpdateVmSpecSection(vmSettingsToUpdate *types.VmSpecSection, description string) (*VM, error)
- func (vm *VM) UpdateVmSpecSectionAsync(vmSettingsToUpdate *types.VmSpecSection, description string) (Task, error)
- func (vm *VM) WaitForDhcpIpByNicIndexes(nicIndexes []int, maxWaitSeconds int, useDhcpLeaseCheck bool) ([]string, bool, error)
- type VMRecord
- type VappNetworkSettings
- type VappTemplateData
- type VcdVersion
- type Vdc
- func (vdc *Vdc) AddMetadata(key string, value string) (Vdc, error)
- func (vdc *Vdc) AddMetadataAsync(key string, value string) (Task, error)
- func (vdc *Vdc) ComposeRawVApp(name string) error
- func (vdc *Vdc) ComposeVApp(orgvdcnetworks []*types.OrgVDCNetwork, vapptemplate VAppTemplate, ...) (Task, error)
- func (vdc *Vdc) CreateDisk(diskCreateParams *types.DiskCreateParams) (Task, error)
- func (vdc *Vdc) CreateNsxvIpSet(ipSetConfig *types.EdgeIpSet) (*types.EdgeIpSet, error)
- func (vdc *Vdc) CreateOrgVDCNetwork(networkConfig *types.OrgVDCNetwork) (Task, error)
- func (vdc *Vdc) CreateOrgVDCNetworkWait(networkConfig *types.OrgVDCNetwork) error
- func (vdc *Vdc) CreateVmAffinityRule(affinityRuleDef *types.VmAffinityRule) (*VmAffinityRule, error)
- func (vdc *Vdc) CreateVmAffinityRuleAsync(affinityRuleDef *types.VmAffinityRule) (Task, error)
- func (vdc *Vdc) Delete(force bool, recursive bool) (Task, error)
- func (vdc *Vdc) DeleteMetadata(key string) (Vdc, error)
- func (vdc *Vdc) DeleteMetadataAsync(key string) (Task, error)
- func (vdc *Vdc) DeleteNsxvIpSetById(id string) error
- func (vdc *Vdc) DeleteNsxvIpSetByName(name string) error
- func (vdc *Vdc) DeleteWait(force bool, recursive bool) error
- func (vdc *Vdc) FindDiskByHREF(href string) (*Disk, error)
- func (vdc *Vdc) FindEdgeGateway(edgegateway string) (EdgeGateway, error)deprecated
- func (vdc *Vdc) FindEdgeGatewayNameByNetwork(networkName string) (string, error)
- func (vdc *Vdc) FindMediaImage(mediaName string) (MediaItem, error)
- func (vdc *Vdc) FindStorageProfileReference(name string) (types.Reference, error)
- func (vdc *Vdc) FindVAppByID(vappid string) (VApp, error)deprecated
- func (vdc *Vdc) FindVAppByName(vapp string) (VApp, error)deprecated
- func (vdc *Vdc) FindVDCNetwork(network string) (OrgVDCNetwork, error)deprecated
- func (vdc *Vdc) FindVMByName(vapp VApp, vm string) (VM, error)deprecated
- func (vdc *Vdc) GetAllNsxtEdgeClusters(queryParameters url.Values) ([]*NsxtEdgeCluster, error)
- func (vdc *Vdc) GetAllNsxtEdgeGateways(queryParameters url.Values) ([]*NsxtEdgeGateway, error)
- func (vdc *Vdc) GetAllNsxvIpSets() ([]*types.EdgeIpSet, error)
- func (vdc *Vdc) GetAllVmAffinityRuleList() ([]*types.VmAffinityRule, error)
- func (vdc *Vdc) GetDefaultStorageProfileReference(storageprofiles *types.QueryResultRecordsType) (types.Reference, error)
- func (vdc *Vdc) GetDiskByHref(diskHref string) (*Disk, error)
- func (vdc *Vdc) GetDiskById(diskId string, refresh bool) (*Disk, error)
- func (vdc *Vdc) GetDisksByName(diskName string, refresh bool) (*[]Disk, error)
- func (vdc *Vdc) GetEdgeGatewayByHref(href string) (*EdgeGateway, error)
- func (vdc *Vdc) GetEdgeGatewayById(id string, refresh bool) (*EdgeGateway, error)
- func (vdc *Vdc) GetEdgeGatewayByName(name string, refresh bool) (*EdgeGateway, error)
- func (vdc *Vdc) GetEdgeGatewayByNameOrId(identifier string, refresh bool) (*EdgeGateway, error)
- func (vdc *Vdc) GetEdgeGatewayRecordsType(refresh bool) (*types.QueryResultEdgeGatewayRecordsType, error)
- func (vdc *Vdc) GetMetadata() (*types.Metadata, error)
- func (vdc *Vdc) GetNetworkList() ([]*types.QueryResultOrgVdcNetworkRecordType, error)
- func (vdc *Vdc) GetNsxtEdgeClusterByName(name string) (*NsxtEdgeCluster, error)
- func (vdc *Vdc) GetNsxtEdgeGatewayById(id string) (*NsxtEdgeGateway, error)
- func (vdc *Vdc) GetNsxtEdgeGatewayByName(name string) (*NsxtEdgeGateway, error)
- func (vdc *Vdc) GetNsxvIpSetById(id string) (*types.EdgeIpSet, error)
- func (vdc *Vdc) GetNsxvIpSetByName(name string) (*types.EdgeIpSet, error)
- func (vdc *Vdc) GetNsxvIpSetByNameOrId(identifier string) (*types.EdgeIpSet, error)
- func (vdc *Vdc) GetOrgVdcNetworkByHref(href string) (*OrgVDCNetwork, error)
- func (vdc *Vdc) GetOrgVdcNetworkById(id string, refresh bool) (*OrgVDCNetwork, error)
- func (vdc *Vdc) GetOrgVdcNetworkByName(name string, refresh bool) (*OrgVDCNetwork, error)
- func (vdc *Vdc) GetOrgVdcNetworkByNameOrId(identifier string, refresh bool) (*OrgVDCNetwork, error)
- func (vdc *Vdc) GetVAppByHref(vappHref string) (*VApp, error)
- func (vdc *Vdc) GetVAppById(id string, refresh bool) (*VApp, error)
- func (vdc *Vdc) GetVAppByName(vappName string, refresh bool) (*VApp, error)
- func (vdc *Vdc) GetVAppByNameOrId(identifier string, refresh bool) (*VApp, error)
- func (vdc *Vdc) GetVappAccessControl(vappIdentifier string, useTenantContext bool) (*types.ControlAccessParams, error)
- func (vdc *Vdc) GetVappList() []*types.ResourceReference
- func (vdc *Vdc) GetVmAffinityRuleByHref(href string) (*VmAffinityRule, error)
- func (vdc *Vdc) GetVmAffinityRuleById(id string) (*VmAffinityRule, error)
- func (vdc *Vdc) GetVmAffinityRuleByNameOrId(identifier string) (*VmAffinityRule, error)
- func (vdc *Vdc) GetVmAffinityRuleList() ([]*types.VmAffinityRule, error)
- func (vdc *Vdc) GetVmAffinityRulesByName(name string, polarity string) ([]*VmAffinityRule, error)
- func (vdc *Vdc) GetVmAntiAffinityRuleList() ([]*types.VmAffinityRule, error)
- func (vdc *Vdc) InstantiateVAppTemplate(template *types.InstantiateVAppTemplateParams) error
- func (vdc *Vdc) Query(params map[string]string) (Results, error)
- func (vdc *Vdc) QueryAllMedia(mediaName string) ([]*MediaRecord, error)
- func (vdc *Vdc) QueryCatalogItemList() ([]*types.QueryResultCatalogItemType, error)
- func (vdc *Vdc) QueryDisk(diskName string) (DiskRecord, error)
- func (vdc *Vdc) QueryDisks(diskName string) (*[]*types.DiskRecordType, error)
- func (vdc *Vdc) QueryMediaList() ([]*types.MediaRecordType, error)
- func (vdc *Vdc) QueryVM(vappName, vmName string) (VMRecord, error)
- func (vdc *Vdc) QueryVappTemplateList() ([]*types.QueryResultVappTemplateType, error)
- func (vdc *Vdc) QueryVappVmTemplate(catalogName, vappTemplateName, vmNameInTemplate string) (*types.QueryResultVMRecordType, error)
- func (vdc *Vdc) QueryWithNotEncodedParams(params map[string]string, notEncodedParams map[string]string) (Results, error)
- func (vdc *Vdc) QueryWithNotEncodedParamsWithApiVersion(params map[string]string, notEncodedParams map[string]string, ...) (Results, error)
- func (vdc *Vdc) Refresh() error
- func (vdc *Vdc) SearchByFilter(queryType, parentField string, criteria *FilterDef) ([]QueryItem, string, error)
- func (vdc *Vdc) UpdateNsxvIpSet(ipSetConfig *types.EdgeIpSet) (*types.EdgeIpSet, error)
- func (vdc *Vdc) UploadMediaImage(mediaName, mediaDescription, filePath string, uploadPieceSize int64) (UploadTask, error)deprecated
- type VdcComputePolicy
- type VersionInfo
- type VersionInfos
- type VmAffinityRule
Constants ¶
const ( OrgUserRoleOrganizationAdministrator = "Organization Administrator" OrgUserRoleCatalogAuthor = "Catalog Author" OrgUserRoleVappAuthor = "vApp Author" OrgUserRoleVappUser = "vApp User" OrgUserRoleConsoleAccessOnly = "Console Access Only" OrgUserRoleDeferToIdentityProvider = "Defer to Identity Provider" // Allowed values for provider types OrgUserProviderIntegrated = "INTEGRATED" // The user is created locally or imported from LDAP OrgUserProviderSAML = "SAML" // The user is imported from a SAML identity provider. OrgUserProviderOAUTH = "OAUTH" // The user is imported from an OAUTH identity provider )
const AuthorizationHeader = "X-Vcloud-Authorization"
AuthorizationHeader header key used by default to set the authorization token.
const BearerTokenHeader = "X-Vmware-Vcloud-Access-Token"
BearerTokenHeader is the header key containing a bearer token
const MinimumDiskSize int64 = 1048576 // = 1Mb
While theoretically we can use smaller amounts, there is an issue when updating disks with size < 1MB
Variables ¶
var ErrorEntityNotFound = fmt.Errorf(errorEntityNotFoundMessage)
var OrgUserProviderTypes = []string{ OrgUserProviderIntegrated, OrgUserProviderSAML, OrgUserProviderOAUTH, }
Used to check the validity of provider type on creation
var ( // SupportedMetadataTypes are the metadata types recognized so far. "NONE" is the same as "" SupportedMetadataTypes = []string{"NONE", "STRING", "NUMBER", "BOOLEAN", "DATETIME"} )
Functions ¶
func BuildUrnWithUuid ¶
BuildUrnWithUuid helps to build valid URNs where APIs require URN format, but other API responds with UUID (or extracted from HREF)
func ContainsNotFound ¶
ContainsNotFound is a convenience function, similar to os.IsNotExist that checks whether a given error contains a "Not found" error. It is almost the same as `IsNotFound` but checks if an error contains substring ErrorEntityNotFound
func GetExternalNetworkByName
deprecated
func GetNetworkPoolByHREF ¶
GetNetworkPoolByHREF functions fetches an network pool using VDC client and network pool href
func GetStorageProfileByHref ¶
GetStorageProfileByHref fetches storage profile using provided HREF.
func GetUuidFromHref ¶
Returns the UUID part of an HREF Similar to getBareEntityUuid, but tailored to HREF
func IsNotFound ¶
Convenience function, similar to os.IsNotExist that checks whether a given error is a "Not found" error, such as
if isNotFound(err) { // do what is needed in case of not found }
func IsVappNetwork ¶
func IsVappNetwork(networkConfig *types.NetworkConfiguration) bool
IsVappNetwork allows to identify if given network config is a vApp network and not a vApp Org network
func LogAdminCatalog ¶
func LogAdminCatalog(catalog types.AdminCatalog)
func LogAdminOrg ¶
func LogAdminOrg(org types.AdminOrg)
func LogCatalog ¶
func LogCatalog(catalog types.Catalog)
func LogCatalogItem ¶
func LogCatalogItem(catalogItem types.CatalogItem)
func LogEdgeGateway ¶
func LogEdgeGateway(edgeGateway types.EdgeGateway)
func LogExternalNetwork ¶
func LogExternalNetwork(network types.ExternalNetwork)
func LogNetwork ¶
func LogNetwork(conf types.OrgVDCNetwork)
func ParseErr ¶
ParseErr takes an error XML resp, error interface for unmarshalling and returns a single string for use in error messages.
func QueryDistributedPortGroup ¶
func QueryDistributedPortGroup(vcdCli *VCDClient, name string) ([]*types.PortGroupRecordType, error)
Find a Distributed port group by name
func QueryNetworkPoolByName ¶
func QueryNetworkPoolByName(vcdCli *VCDClient, name string) ([]*types.QueryResultNetworkPoolRecordType, error)
QueryNetworkPoolByName finds a network pool by name
func QueryNetworkPortGroup ¶
Find a Network port group by name
func QueryOrgVdcNetworkByName ¶
func QueryOrgVdcNetworkByName(vcdCli *VCDClient, name string) ([]*types.QueryResultOrgVdcNetworkRecordType, error)
QueryOrgVdcNetworkByName finds a org VDC network by name which has edge gateway as reference
func QueryPortGroups ¶
Find a list of Port groups matching the filter parameter.
func QueryProviderVdcByName ¶
func QueryProviderVdcByName(vcdCli *VCDClient, name string) ([]*types.QueryResultVMWProviderVdcRecordType, error)
QueryProviderVdcByName finds a provider VDC by name
func QueryProviderVdcStorageProfileByName ¶
func QueryProviderVdcStorageProfileByName(vcdCli *VCDClient, name string) ([]*types.QueryResultProviderVdcStorageProfileRecordType, error)
QueryProviderVdcStorageProfileByName finds a provider VDC storage profile by name
func QueryVirtualCenters ¶
func QueryVirtualCenters(vcdClient *VCDClient, filter string) ([]*types.QueryResultVirtualCenterRecordType, error)
Find a list of Virtual Centers matching the filter parameter. Filter constructing guide: https://pubs.vmware.com/vcloud-api-1-5/wwhelp/wwhimpl/js/html/wwhelp.htm#href=api_prog/GUID-CDF04296-5EB5-47E1-9BEC-228837C584CE.html Possible parameters are any attribute from QueryResultVirtualCenterRecordType struct E.g. filter could look like: name==vC1
func RemoveMediaImageIfExists ¶
Looks for media and, if found, will delete it. Deprecated: Use catalog.RemoveMediaIfExist
func RemoveOrgVdcNetworkIfExists ¶
RemoveOrgVdcNetworkIfExists looks for an Org Vdc network and, if found, will delete it.
func ShowAdminCatalog ¶
func ShowAdminCatalog(catalog types.AdminCatalog)
func ShowAdminOrg ¶
func ShowAdminOrg(org types.AdminOrg)
func ShowCatalog ¶
func ShowCatalog(catalog types.Catalog)
func ShowCatalogItem ¶
func ShowCatalogItem(catalogItem types.CatalogItem)
func ShowEdgeGateway ¶
func ShowEdgeGateway(edgeGateway types.EdgeGateway)
func ShowExternalNetwork ¶
func ShowExternalNetwork(network types.ExternalNetwork)
func ShowNetwork ¶
func ShowNetwork(conf types.OrgVDCNetwork)
func SimpleLogTask ¶
Types ¶
type AdminCatalog ¶
type AdminCatalog struct { AdminCatalog *types.AdminCatalog // contains filtered or unexported fields }
AdminCatalog is a admin view of a vCloud Director Catalog To be able to get an AdminCatalog representation, users must have admin credentials to the System org. AdminCatalog is used for creating, updating, and deleting a Catalog. Definition: https://code.vmware.com/apis/220/vcloud#/doc/doc/types/AdminCatalogType.html
func CreateCatalog ¶
func CreateCatalog(client *Client, links types.LinkList, Name, Description string) (AdminCatalog, error)
CreateCatalog creates a catalog with specified name and description
func CreateCatalogWithStorageProfile ¶ added in v2.11.9
func CreateCatalogWithStorageProfile(client *Client, links types.LinkList, Name, Description string, storageProfiles *types.CatalogStorageProfiles) (*AdminCatalog, error)
CreateCatalogWithStorageProfile is like CreateCatalog, but allows to specify storage profile
func NewAdminCatalog ¶
func NewAdminCatalog(client *Client) *AdminCatalog
func (*AdminCatalog) Delete ¶
func (adminCatalog *AdminCatalog) Delete(force, recursive bool) error
Deletes the Catalog, returning an error if the vCD call fails. Link to API call: https://code.vmware.com/apis/220/vcloud#/doc/doc/operations/DELETE-Catalog.html
func (AdminCatalog) GetAccessControl ¶
func (adminCatalog AdminCatalog) GetAccessControl(useTenantContext bool) (*types.ControlAccessParams, error)
GetAccessControl retrieves the access control information for this catalog
func (*AdminCatalog) GetMediaByHref ¶
func (adminCatalog *AdminCatalog) GetMediaByHref(mediaHref string) (*Media, error)
GetMediaByHref finds a Media by HREF On success, returns a pointer to the Media structure and a nil error On failure, returns a nil pointer and an error
func (*AdminCatalog) GetMediaById ¶
func (adminCatalog *AdminCatalog) GetMediaById(mediaId string) (*Media, error)
GetMediaById finds a Media by ID On success, returns a pointer to the Media structure and a nil error On failure, returns a nil pointer and an error
func (*AdminCatalog) GetMediaByName ¶
func (adminCatalog *AdminCatalog) GetMediaByName(mediaName string, refresh bool) (*Media, error)
GetMediaByName finds a Media by Name On success, returns a pointer to the Media structure and a nil error On failure, returns a nil pointer and an error
func (*AdminCatalog) GetMediaByNameOrId ¶
func (adminCatalog *AdminCatalog) GetMediaByNameOrId(identifier string, refresh bool) (*Media, error)
GetMediaByNameOrId finds a Media by Name or ID On success, returns a pointer to the Media structure and a nil error On failure, returns a nil pointer and an error
func (AdminCatalog) IsShared ¶
func (adminCatalog AdminCatalog) IsShared(useTenantContext bool) (bool, error)
IsShared shows whether a catalog is shared or not, regardless of the number of subjects sharing it
func (*AdminCatalog) QueryMedia ¶
func (adminCatalog *AdminCatalog) QueryMedia(mediaName string) (*MediaRecord, error)
QueryMedia returns media image found in system using `name` and `catalog name` as query.
func (*AdminCatalog) Refresh ¶
func (adminCatalog *AdminCatalog) Refresh() error
func (AdminCatalog) RemoveAccessControl ¶
func (adminCatalog AdminCatalog) RemoveAccessControl(useTenantContext bool) error
RemoveAccessControl is a shortcut to SetAccessControl with all access disabled
func (*AdminCatalog) RemoveMediaIfExists ¶
func (adminCatalog *AdminCatalog) RemoveMediaIfExists(mediaName string) error
Looks for media and, if found, will delete it.
func (AdminCatalog) SetAccessControl ¶
func (adminCatalog AdminCatalog) SetAccessControl(accessControl *types.ControlAccessParams, useTenantContext bool) error
SetAccessControl changes the access control information for this catalog
func (*AdminCatalog) Update ¶
func (adminCatalog *AdminCatalog) Update() error
Updates the Catalog definition from current Catalog struct contents. Any differences that may be legally applied will be updated. Returns an error if the call to vCD fails. Update automatically performs a refresh with the admin catalog it gets back from the rest api Link to API call: https://code.vmware.com/apis/220/vcloud#/doc/doc/operations/PUT-Catalog.html
func (*AdminCatalog) UploadOvf ¶
func (adminCatalog *AdminCatalog) UploadOvf(ovaFileName, itemName, description string, uploadPieceSize int64) (UploadTask, error)
Uploads an ova file to a catalog. This method only uploads bits to vCD spool area. Returns errors if any occur during upload from vCD or upload process. On upload fail client may need to remove vCD catalog item which waits for files to be uploaded. Files from ova are extracted to system temp folder "govcd+random number" and left for inspection on error.
type AdminOrg ¶
type AdminOrg struct { AdminOrg *types.AdminOrg // contains filtered or unexported fields }
AdminOrg gives an admin representation of an org. Administrators can delete and update orgs with an admin org object. AdminOrg includes all members of the Org element, and adds several elements that can be viewed and modified only by system administrators. Definition: https://code.vmware.com/apis/220/vcloud#/doc/doc/types/AdminOrgType.html
func GetAdminOrgByName ¶
If user specifies valid organization name, then this returns an admin organization object. If no valid org is found, it returns an empty org and no error. Otherwise returns an empty AdminOrg and an error. API Documentation: https://code.vmware.com/apis/220/vcloud#/doc/doc/operations/GET-Organization-AdminView.html Deprecated: Use vcdClient.GetAdminOrgByName instead
func NewAdminOrg ¶
func (*AdminOrg) CreateCatalog ¶
func (adminOrg *AdminOrg) CreateCatalog(name, description string) (AdminCatalog, error)
CreateCatalog creates a catalog with given name and description under the the given organization. Returns an AdminCatalog that contains a creation task. API Documentation: https://code.vmware.com/apis/220/vcloud#/doc/doc/operations/POST-CreateCatalog.html
func (*AdminOrg) CreateCatalogWithStorageProfile ¶ added in v2.11.9
func (adminOrg *AdminOrg) CreateCatalogWithStorageProfile(name, description string, storageProfiles *types.CatalogStorageProfiles) (*AdminCatalog, error)
CreateCatalogWithStorageProfile is like CreateCatalog, but allows to specify storage profile
func (*AdminOrg) CreateGroup ¶
CreateGroup creates a group in Org. Supported provider types are `OrgUserProviderIntegrated` and `OrgUserProviderSAML`.
Note. This request will return HTTP 403 if Org is not configured for SAML or LDAP usage.
func (*AdminOrg) CreateNsxtEdgeGateway ¶ added in v2.11.9
func (adminOrg *AdminOrg) CreateNsxtEdgeGateway(edgeGatewayConfig *types.OpenAPIEdgeGateway) (*NsxtEdgeGateway, error)
CreateNsxtEdgeGateway allows to create NSX-T edge gateway for Org admins
func (*AdminOrg) CreateOrgVdc ¶
CreateOrgVdc creates a VDC with the given params under the given organization and waits for the asynchronous task to complete. Returns an AdminVdc pointer and an error.
func (*AdminOrg) CreateOrgVdcAsync ¶
CreateOrgVdcAsync creates a VDC with the given params under the given organization. Returns a Task and an error.
func (*AdminOrg) CreateRole ¶
CreateRole creates a new role using OpenAPI endpoint
func (*AdminOrg) CreateUser ¶
CreateUser creates an OrgUser from a full configuration structure The timeOut variable is the maximum time we wait for the user to be ready (This operation does not return a task) This function returns as soon as the user has been created, which could be as little as 200ms or as much as Client.MaxRetryTimeout Mandatory fields are: Name, Role, Password. https://code.vmware.com/apis/442/vcloud-director#/doc/doc/operations/POST-CreateUser.html
func (*AdminOrg) CreateUserSimple ¶
func (adminOrg *AdminOrg) CreateUserSimple(userData OrgUserConfiguration) (*OrgUser, error)
CreateUserSimple creates an org user from a simplified structure
func (*AdminOrg) CreateVdc ¶
CreateVdc creates a VDC with the given params under the given organization. Returns an AdminVdc. API Documentation: https://code.vmware.com/apis/220/vcloud#/doc/doc/operations/POST-VdcConfiguration.html Deprecated in favor of adminOrg.CreateOrgVdcAsync
func (*AdminOrg) CreateVdcComputePolicy ¶
func (org *AdminOrg) CreateVdcComputePolicy(newVdcComputePolicy *types.VdcComputePolicy) (*VdcComputePolicy, error)
CreateVdcComputePolicy creates a new VDC Compute Policy using OpenAPI endpoint
func (*AdminOrg) CreateVdcWait ¶
Creates the VDC and waits for the asynchronous task to complete. Deprecated in favor of adminOrg.CreateOrgVdc
func (*AdminOrg) Delete ¶
Deletes the org, returning an error if the vCD call fails. API Documentation: https://code.vmware.com/apis/220/vcloud#/doc/doc/operations/DELETE-Organization.html
func (*AdminOrg) Disable ¶
Disables the org. Returns an error if the call to vCD fails. API Documentation: https://code.vmware.com/apis/220/vcloud#/doc/doc/operations/POST-DisableOrg.html
func (*AdminOrg) FetchUserByHref ¶
FetchUserByHref returns a user by its HREF Deprecated: use GetUserByHref instead
func (*AdminOrg) FetchUserById ¶
FetchUserById returns a user by its ID Deprecated: use GetUserById instead
func (*AdminOrg) FetchUserByName ¶
FetchUserByName returns a user by its Name Deprecated: use GetUserByName instead
func (*AdminOrg) FetchUserByNameOrId ¶
FetchUserById returns a user by its Name or ID Deprecated: use GetUserByNameOrId instead
func (*AdminOrg) FindAdminCatalog ¶
func (adminOrg *AdminOrg) FindAdminCatalog(catalogName string) (AdminCatalog, error)
Given a valid catalog name, FindAdminCatalog returns an AdminCatalog object. If no catalog is found, then returns an empty AdminCatalog and no error. Otherwise it returns an error. Function allows user to use an AdminOrg to also fetch a Catalog. If user does not have proper credentials to perform administrator tasks then function returns an error. API Documentation: https://code.vmware.com/apis/220/vcloud#/doc/doc/operations/GET-Catalog-AdminView.html Deprecated: Use adminOrg.GetAdminCatalog instead
func (*AdminOrg) FindAdminCatalogRecords ¶
FindAdminCatalogRecords uses catalog name to return AdminCatalogRecord information.
func (*AdminOrg) FindCatalog ¶
Given a valid catalog name, FindCatalog returns a Catalog object. If no catalog is found, then returns an empty catalog and no error. Otherwise it returns an error. Function allows user to use an AdminOrg to also fetch a Catalog. Deprecated: Use adminOrg.GetCatalogByName instead
func (*AdminOrg) GetAdminCatalogByHref ¶
func (adminOrg *AdminOrg) GetAdminCatalogByHref(catalogHref string) (*AdminCatalog, error)
GetAdminCatalogByHref finds an AdminCatalog by HREF On success, returns a pointer to the Catalog structure and a nil error On failure, returns a nil pointer and an error
func (*AdminOrg) GetAdminCatalogById ¶
func (adminOrg *AdminOrg) GetAdminCatalogById(catalogId string, refresh bool) (*AdminCatalog, error)
GetCatalogById finds an AdminCatalog by ID On success, returns a pointer to the AdminCatalog structure and a nil error On failure, returns a nil pointer and an error
func (*AdminOrg) GetAdminCatalogByName ¶
func (adminOrg *AdminOrg) GetAdminCatalogByName(catalogName string, refresh bool) (*AdminCatalog, error)
GetCatalogByName finds an AdminCatalog by Name On success, returns a pointer to the AdminCatalog structure and a nil error On failure, returns a nil pointer and an error
func (*AdminOrg) GetAdminCatalogByNameOrId ¶
func (adminOrg *AdminOrg) GetAdminCatalogByNameOrId(identifier string, refresh bool) (*AdminCatalog, error)
GetAdminCatalogByNameOrId finds an AdminCatalog by name or ID On success, returns a pointer to the AdminCatalog structure and a nil error On failure, returns a nil pointer and an error
func (*AdminOrg) GetAdminVDCByHref ¶
GetAdminVDCByHref retrieves a VDC using a direct call with the HREF
func (*AdminOrg) GetAdminVDCById ¶
GetAdminVDCById finds an Admin VDC by ID On success, returns a pointer to the AdminVdc structure and a nil error On failure, returns a nil pointer and an error
func (*AdminOrg) GetAdminVDCByName ¶
GetAdminVDCByName finds an Admin VDC by Name On success, returns a pointer to the AdminVdc structure and a nil error On failure, returns a nil pointer and an error
func (*AdminOrg) GetAdminVDCByNameOrId ¶
GetAdminVDCByNameOrId finds an Admin VDC by Name Or ID On success, returns a pointer to the AdminVdc structure and a nil error On failure, returns a nil pointer and an error
func (*AdminOrg) GetAdminVdcByName ¶
GetAdminVdcByName function uses a valid VDC name and returns a admin VDC object. If no VDC is found, then it returns an empty VDC and no error. Otherwise it returns an empty VDC and an error. Deprecated: Use adminOrg.GetAdminVDCByName
func (*AdminOrg) GetAllNsxtEdgeGateways ¶ added in v2.11.9
func (adminOrg *AdminOrg) GetAllNsxtEdgeGateways(queryParameters url.Values) ([]*NsxtEdgeGateway, error)
GetAllNsxtEdgeGateways allows to retrieve all NSX-T edge gateways for Org Admins
func (*AdminOrg) GetAllOpenApiRoles ¶
GetAllOpenApiRoles retrieves all roles using OpenAPI endpoint. Query parameters can be supplied to perform additional filtering
func (*AdminOrg) GetAllStorageProfileReferences ¶ added in v2.11.9
GetAllStorageProfileReferences traverses all depending VDCs and returns a slice of storage profile references available in those VDCs
func (*AdminOrg) GetAllVDCs ¶ added in v2.11.9
GetAllVDCs returns all depending VDCs for a particular Org
func (*AdminOrg) GetAllVdcComputePolicies ¶
func (org *AdminOrg) GetAllVdcComputePolicies(queryParameters url.Values) ([]*VdcComputePolicy, error)
GetAllVdcComputePolicies retrieves all VDC compute policies using OpenAPI endpoint. Query parameters can be supplied to perform additional filtering
func (*AdminOrg) GetCatalogAccessControl ¶
func (org *AdminOrg) GetCatalogAccessControl(catalogIdentifier string, useTenantContext bool) (*types.ControlAccessParams, error)
GetCatalogAccessControl is a convenience method to retrieve access control for a catalog from an organization. The input variable catalogIdentifier can be either the catalog name or its ID
func (*AdminOrg) GetCatalogByHref ¶
GetCatalogByHref finds a Catalog by HREF On success, returns a pointer to the Catalog structure and a nil error On failure, returns a nil pointer and an error
func (*AdminOrg) GetCatalogById ¶
GetCatalogById finds a Catalog by ID On success, returns a pointer to the Catalog structure and a nil error On failure, returns a nil pointer and an error
func (*AdminOrg) GetCatalogByName ¶
GetCatalogByName finds a Catalog by Name On success, returns a pointer to the Catalog structure and a nil error On failure, returns a nil pointer and an error
func (*AdminOrg) GetCatalogByNameOrId ¶
GetCatalogByNameOrId finds a Catalog by name or ID On success, returns a pointer to the Catalog structure and a nil error On failure, returns a nil pointer and an error
func (*AdminOrg) GetGroupByHref ¶
GetGroupByHref retrieves group by HREF
func (*AdminOrg) GetGroupById ¶
GetGroupById retrieves group by Id
func (*AdminOrg) GetGroupByName ¶
GetGroupByName retrieves group by Name
func (*AdminOrg) GetGroupByNameOrId ¶
GetGroupByNameOrId retrieves group by Name or Id. Id is prioritized for search
func (*AdminOrg) GetLdapConfiguration ¶
GetLdapConfiguration retrieves LDAP configuration structure
func (*AdminOrg) GetNsxtEdgeGatewayById ¶ added in v2.11.9
func (adminOrg *AdminOrg) GetNsxtEdgeGatewayById(id string) (*NsxtEdgeGateway, error)
GetNsxtEdgeGatewayById allows to retrieve NSX-T edge gateway by ID for Org admins
func (*AdminOrg) GetNsxtEdgeGatewayByName ¶ added in v2.11.9
func (adminOrg *AdminOrg) GetNsxtEdgeGatewayByName(name string) (*NsxtEdgeGateway, error)
GetNsxtEdgeGatewayByName allows to retrieve NSX-T edge gateway by Name for Org admins
func (*AdminOrg) GetOpenApiRoleById ¶
GetOpenApiRoleById retrieves role by given ID
func (*AdminOrg) GetRole ¶
GetRole finds a role within the organization Deprecated: use GetRoleReference
func (*AdminOrg) GetRoleReference ¶
GetRoleReference finds a role within the organization
func (*AdminOrg) GetStorageProfileReferenceById ¶ added in v2.11.9
func (adminOrg *AdminOrg) GetStorageProfileReferenceById(id string, refresh bool) (*types.Reference, error)
GetStorageProfileReferenceById finds storage profile reference by specified ID in Org or returns ErrorEntityNotFound
func (*AdminOrg) GetUserByHref ¶
GetUserByHref returns a user by its HREF, without need for searching in the adminOrg user list
func (*AdminOrg) GetUserById ¶
GetUserById retrieves a user within an admin organization by ID Returns a valid user if it exists. If it doesn't, returns nil and ErrorEntityNotFound If argument refresh is true, the AdminOrg will be refreshed before searching. This is usually done after creating, modifying, or deleting users. If it is false, it will search within the data already in memory (useful when looping through the users and we know that no changes have occurred in the meantime)
func (*AdminOrg) GetUserByName ¶
GetUserByName retrieves a user within an admin organization by name Returns a valid user if it exists. If it doesn't, returns nil and ErrorEntityNotFound If argument refresh is true, the AdminOrg will be refreshed before searching. This is usually done after creating, modifying, or deleting users. If it is false, it will search within the data already in memory (useful when looping through the users and we know that no changes have occurred in the meantime)
func (*AdminOrg) GetUserByNameOrId ¶
GetUserByNameOrId retrieves a user within an admin organization by either name or ID Returns a valid user if it exists. If it doesn't, returns nil and ErrorEntityNotFound If argument refresh is true, the AdminOrg will be refreshed before searching. This is usually done after creating, modifying, or deleting users. If it is false, it will search within the data already in memory (useful when looping through the users and we know that no changes have occurred in the meantime)
func (*AdminOrg) GetVDCByHref ¶
GetVDCByHref retrieves a VDC using a direct call with the HREF
func (*AdminOrg) GetVDCById ¶
GetVDCById finds a VDC by ID On success, returns a pointer to the Vdc structure and a nil error On failure, returns a nil pointer and an error
func (*AdminOrg) GetVDCByName ¶
GetVDCByName finds a VDC by Name On success, returns a pointer to the Vdc structure and a nil error On failure, returns a nil pointer and an error
func (*AdminOrg) GetVDCByNameOrId ¶
GetVDCByNameOrId finds a VDC by name or ID On success, returns a pointer to the VDC structure and a nil error On failure, returns a nil pointer and an error
func (*AdminOrg) GetVdcByName ¶
If user specifies valid vdc name then this returns a vdc object. If no vdc is found, then it returns an empty vdc and no error. Otherwise it returns an empty vdc and an error. This function allows users to use an AdminOrg to fetch a vdc as well. Deprecated: Use adminOrg.GetVDCByName instead
func (*AdminOrg) GetVdcComputePolicyById ¶
func (org *AdminOrg) GetVdcComputePolicyById(id string) (*VdcComputePolicy, error)
GetVdcComputePolicyById retrieves VDC compute policy by given ID
func (*AdminOrg) LdapConfigure ¶
func (adminOrg *AdminOrg) LdapConfigure(settings *types.OrgLdapSettingsType) (*types.OrgLdapSettingsType, error)
LdapConfigure allows to configure LDAP mode in use by the Org
func (*AdminOrg) LdapDisable ¶
LdapDisable wraps LdapConfigure to disable LDAP configuration for org
func (*AdminOrg) QueryCatalogList ¶
QueryCatalogList returns a list of catalogs for this organization
func (*AdminOrg) Refresh ¶
Given an adminorg with a valid HREF, the function refetches the adminorg and updates the user's adminorg data. Otherwise if the function fails, it returns an error. Users should use refresh whenever they have a stale org due to the creation/update/deletion of a resource within the org or the org itself.
func (*AdminOrg) SearchByFilter ¶
func (org *AdminOrg) SearchByFilter(queryType string, criteria *FilterDef) ([]QueryItem, string, error)
SearchByFilter runs the search for a specific Org
func (*AdminOrg) Update ¶
Updates the Org definition from current org struct contents. Any differences that may be legally applied will be updated. Returns an error if the call to vCD fails. API Documentation: https://code.vmware.com/apis/220/vcloud#/doc/doc/operations/PUT-Organization.html
type AdminVdc ¶
type AdminVdc struct { AdminVdc *types.AdminVdc // contains filtered or unexported fields }
func NewAdminVdc ¶
func (*AdminVdc) GetAllAssignedVdcComputePolicies ¶
func (vdc *AdminVdc) GetAllAssignedVdcComputePolicies(queryParameters url.Values) ([]*VdcComputePolicy, error)
GetAllAssignedVdcComputePolicies retrieves all VDC assigned compute policies using OpenAPI endpoint. Query parameters can be supplied to perform additional filtering
func (*AdminVdc) GetVappList ¶
func (vdc *AdminVdc) GetVappList() []*types.ResourceReference
GetVappList returns the list of vApps for an Admin VDC
func (*AdminVdc) QueryCatalogItemList ¶
QueryCatalogItemList returns a list of Catalog Item for the given Admin VDC
func (*AdminVdc) QueryVappTemplateList ¶
QueryVappTemplateList returns a list of vApp templates for the given VDC
func (*AdminVdc) Refresh ¶
Given an adminVdc with a valid HREF, the function refresh the adminVdc and updates the adminVdc data. Returns an error on failure Users should use refresh whenever they suspect a stale VDC due to the creation/update/deletion of a resource within the the VDC itself.
func (*AdminVdc) SetAssignedComputePolicies ¶
func (vdc *AdminVdc) SetAssignedComputePolicies(computePolicyReferences types.VdcComputePolicyReferences) (*types.VdcComputePolicyReferences, error)
SetAssignedComputePolicies assign(set) compute policies.
func (*AdminVdc) Update ¶
Update function updates an Admin VDC from current VDC struct contents. Any differences that may be legally applied will be updated. Returns an empty AdminVdc struct and error if the call to vCD fails. API Documentation: https://vdc-repo.vmware.com/vmwb-repository/dcr-public/7a028e78-bd37-4a6a-8298-9c26c7eeb9aa/09142237-dd46-4dee-8326-e07212fb63a8/doc/doc/operations/PUT-Vdc.html
func (*AdminVdc) UpdateAsync ¶
UpdateAsync updates VDC from current VDC struct contents. Any differences that may be legally applied will be updated. Returns an error if the call to vCD fails. API Documentation: https://vdc-repo.vmware.com/vmwb-repository/dcr-public/7a028e78-bd37-4a6a-8298-9c26c7eeb9aa/09142237-dd46-4dee-8326-e07212fb63a8/doc/doc/operations/PUT-Vdc.html
func (*AdminVdc) UpdateStorageProfile ¶
func (vdc *AdminVdc) UpdateStorageProfile(storageProfileId string, storageProfile *types.AdminVdcStorageProfile) (*types.AdminVdcStorageProfile, error)
UpdateStorageProfile updates VDC storage profile and returns refreshed VDC or error.
type Catalog ¶
type Catalog struct { Catalog *types.Catalog // contains filtered or unexported fields }
func NewCatalog ¶
func (*Catalog) Delete ¶
Deletes the Catalog, returning an error if the vCD call fails. Link to API call: https://code.vmware.com/apis/220/vcloud#/doc/doc/operations/DELETE-Catalog.html
func (*Catalog) FindCatalogItem ¶
func (cat *Catalog) FindCatalogItem(catalogItemName string) (CatalogItem, error)
If catalog item is a valid CatalogItem and the call succeeds, then the function returns a CatalogItem. If the item does not exist, then it returns an empty CatalogItem. If the call fails at any point, it returns an error. Deprecated: use GetCatalogItemByName instead
func (Catalog) GetAccessControl ¶
GetAccessControl retrieves the access control information for this catalog
func (*Catalog) GetCatalogItemByHref ¶
func (cat *Catalog) GetCatalogItemByHref(catalogItemHref string) (*CatalogItem, error)
GetCatalogItemByHref finds a CatalogItem by HREF On success, returns a pointer to the CatalogItem structure and a nil error On failure, returns a nil pointer and an error
func (*Catalog) GetCatalogItemById ¶
func (cat *Catalog) GetCatalogItemById(catalogItemId string, refresh bool) (*CatalogItem, error)
GetCatalogItemById finds a Catalog Item by ID On success, returns a pointer to the CatalogItem structure and a nil error On failure, returns a nil pointer and an error
func (*Catalog) GetCatalogItemByName ¶
func (cat *Catalog) GetCatalogItemByName(catalogItemName string, refresh bool) (*CatalogItem, error)
GetCatalogItemByName finds a CatalogItem by Name On success, returns a pointer to the CatalogItem structure and a nil error On failure, returns a nil pointer and an error
func (*Catalog) GetCatalogItemByNameOrId ¶
func (cat *Catalog) GetCatalogItemByNameOrId(identifier string, refresh bool) (*CatalogItem, error)
GetCatalogItemByNameOrId finds a Catalog Item by Name or ID On success, returns a pointer to the CatalogItem structure and a nil error On failure, returns a nil pointer and an error
func (*Catalog) GetMediaByHref ¶
GetMediaByHref finds a Media by HREF On success, returns a pointer to the Media structure and a nil error On failure, returns a nil pointer and an error
func (*Catalog) GetMediaById ¶
GetMediaById finds a Media by ID On success, returns a pointer to the Media structure and a nil error On failure, returns a nil pointer and an error
func (*Catalog) GetMediaByName ¶
GetMediaByName finds a Media by Name On success, returns a pointer to the Media structure and a nil error On failure, returns a nil pointer and an error
func (*Catalog) GetMediaByNameOrId ¶
GetMediaByNameOrId finds a Media by Name or ID On success, returns a pointer to the Media structure and a nil error On failure, returns a nil pointer and an error
func (*Catalog) GetVappTemplateByHref ¶
func (cat *Catalog) GetVappTemplateByHref(href string) (*VAppTemplate, error)
GetVappTemplateByHref finds a vApp template by HREF On success, returns a pointer to the vApp template structure and a nil error On failure, returns a nil pointer and an error
func (Catalog) IsShared ¶
IsShared shows whether a catalog is shared or not, regardless of the number of subjects sharing it
func (*Catalog) QueryCatalogItemList ¶
QueryCatalogItemList returns a list of Catalog Item for the given catalog
func (*Catalog) QueryMedia ¶
func (catalog *Catalog) QueryMedia(mediaName string) (*MediaRecord, error)
QueryMedia returns media image found in system using `name` and `catalog name` as query.
func (*Catalog) QueryMediaList ¶
QueryMediaList retrieves a list of media items for the catalog
func (*Catalog) QueryVappTemplateList ¶
QueryVappTemplateList returns a list of vApp templates for the given catalog
func (Catalog) RemoveAccessControl ¶
RemoveAccessControl is a shortcut to SetAccessControl with all access disabled
func (*Catalog) SearchByFilter ¶
func (catalog *Catalog) SearchByFilter(queryType, parentField string, criteria *FilterDef) ([]QueryItem, string, error)
SearchByFilter runs the search for a specific catalog The 'parentField' argument defines which filter will be added, depending on the items we search for:
- 'catalog' contains the catalog HREF or ID
- 'catalogName' contains the catalog name
func (Catalog) SetAccessControl ¶
func (catalog Catalog) SetAccessControl(accessControl *types.ControlAccessParams, useTenantContext bool) error
SetAccessControl changes the access control information for this catalog
func (*Catalog) UploadMediaImage ¶
func (cat *Catalog) UploadMediaImage(mediaName, mediaDescription, filePath string, uploadPieceSize int64) (UploadTask, error)
func (*Catalog) UploadOvf ¶
func (cat *Catalog) UploadOvf(ovaFileName, itemName, description string, uploadPieceSize int64) (UploadTask, error)
UploadOvf uploads an ova/ovf file to a catalog. This method only uploads bits to vCD spool area. ovaFileName should be the path of OVA or OVF file(not ovf folder) itself. For OVF, user need to make sure all the files that OVF depends on exist and locate under the same folder. Returns errors if any occur during upload from vCD or upload process. On upload fail client may need to remove vCD catalog item which waits for files to be uploaded. Files from ova are extracted to system temp folder "govcd+random number" and left for inspection on error.
type CatalogItem ¶
type CatalogItem struct { CatalogItem *types.CatalogItem // contains filtered or unexported fields }
func FindMediaAsCatalogItem ¶
func FindMediaAsCatalogItem(org *Org, catalogName, mediaName string) (CatalogItem, error)
Finds media in catalog and returns catalog item Deprecated: Use catalog.GetMediaByName()
func NewCatalogItem ¶
func NewCatalogItem(cli *Client) *CatalogItem
func (*CatalogItem) Delete ¶
func (catalogItem *CatalogItem) Delete() error
Deletes the Catalog Item, returning an error if the vCD call fails. Link to API call: https://code.vmware.com/apis/220/vcloud#/doc/doc/operations/DELETE-CatalogItem.html
func (*CatalogItem) GetVAppTemplate ¶
func (catalogItem *CatalogItem) GetVAppTemplate() (VAppTemplate, error)
type Client ¶
type Client struct { APIVersion string // The API version required VCDToken string // Access Token (authorization header) VCDAuthHeader string // Authorization header VCDHREF url.URL // VCD API ENDPOINT Http http.Client // HttpClient is the client to use. Default will be used if not provided. IsSysAdmin bool // flag if client is connected as system administrator // MaxRetryTimeout specifies a time limit (in seconds) for retrying requests made by the SDK // where vCloud director may take time to respond and retry mechanism is needed. // This must be >0 to avoid instant timeout errors. MaxRetryTimeout int // UseSamlAdfs specifies if SAML auth is used for authenticating vCD instead of local login. // The following conditions must be met so that authentication SAML authentication works: // * SAML IdP (Identity Provider) is Active Directory Federation Service (ADFS) // * Authentication endpoint "/adfs/services/trust/13/usernamemixed" must be enabled on ADFS // server UseSamlAdfs bool // CustomAdfsRptId allows to set custom Relaying Party Trust identifier. By default vCD Entity // ID is used as Relaying Party Trust identifier. CustomAdfsRptId string // UserAgent to send for API queries. Standard format is described as: // "User-Agent: <product> / <product-version> <comment>" UserAgent string // contains filtered or unexported fields }
Client provides a client to vCloud Director, values can be populated automatically using the Authenticate method.
func (*Client) APIClientVersionIs ¶
APIClientVersionIs allows to compare against currently used API version VCDClient.Client.APIVersion. Can be useful to validate if a certain feature can be used or not. It does not require for the client to be authenticated.
Format: ">= 27.0, < 32.0", ">= 30.0", "= 27.0"
vCD version mapping to API version support https://code.vmware.com/doc/preview?id=8072
func (*Client) APIVCDMaxVersionIs ¶
APIVCDMaxVersionIs compares against maximum vCD supported API version from /api/versions (not necessarily the currently used one). This allows to check what is the maximum API version that vCD instance supports and can be used to guess vCD product version. API 31.0 support was first introduced in vCD 9.5 (as per https://code.vmware.com/doc/preview?id=8072). Therefore APIMaxVerIs(">= 31.0") implies that you have vCD 9.5 or newer running inside. It does not require for the client to be authenticated.
Format: ">= 27.0, < 32.0", ">= 30.0", "= 27.0"
vCD version mapping to API version support https://code.vmware.com/doc/preview?id=8072
func (*Client) ExecuteParamRequestWithCustomError ¶
func (client *Client) ExecuteParamRequestWithCustomError(pathURL string, params map[string]string, requestType, contentType, errorMessage string, payload interface{}, errType error) (*http.Response, error)
ExecuteParamRequestWithCustomError behaves exactly like ExecuteRequestWithCustomError but accepts query parameter specification
func (*Client) ExecuteRequest ¶
func (client *Client) ExecuteRequest(pathURL, requestType, contentType, errorMessage string, payload, out interface{}) (*http.Response, error)
Helper function creates request, runs it, check responses and parses out interface from response. pathURL - request URL requestType - HTTP method type contentType - value to set for "Content-Type" errorMessage - error message to return when error happens payload - XML struct which will be marshalled and added as body/payload out - structure to be used for unmarshalling xml E.g. unmarshalledAdminOrg := &types.AdminOrg{} client.ExecuteRequest(adminOrg.AdminOrg.HREF, http.MethodGet, "", "error refreshing organization: %s", nil, unmarshalledAdminOrg)
func (*Client) ExecuteRequestWithApiVersion ¶
func (client *Client) ExecuteRequestWithApiVersion(pathURL, requestType, contentType, errorMessage string, payload, out interface{}, apiVersion string) (*http.Response, error)
Helper function creates request, runs it, check responses and parses out interface from response. pathURL - request URL requestType - HTTP method type contentType - value to set for "Content-Type" errorMessage - error message to return when error happens payload - XML struct which will be marshalled and added as body/payload out - structure to be used for unmarshalling xml apiVersion - api version which will be used in request E.g. unmarshalledAdminOrg := &types.AdminOrg{} client.ExecuteRequest(adminOrg.AdminOrg.HREF, http.MethodGet, "", "error refreshing organization: %s", nil, unmarshalledAdminOrg)
func (*Client) ExecuteRequestWithCustomError ¶
func (client *Client) ExecuteRequestWithCustomError(pathURL, requestType, contentType, errorMessage string, payload interface{}, errType error) (*http.Response, error)
ExecuteRequestWithCustomError sends the request and checks for 2xx response. If the returned status code was not as expected - the returned error will be unmarshalled to `errType` which implements Go's standard `error` interface.
func (*Client) ExecuteRequestWithoutResponse ¶
func (client *Client) ExecuteRequestWithoutResponse(pathURL, requestType, contentType, errorMessage string, payload interface{}) error
Helper function creates request, runs it, checks response and do not expect any values from it. pathURL - request URL requestType - HTTP method type contentType - value to set for "Content-Type" errorMessage - error message to return when error happens payload - XML struct which will be marshalled and added as body/payload E.g. client.ExecuteRequestWithoutResponse(catalogItemHREF.String(), http.MethodDelete, "", "error deleting Catalog item: %s", nil)
func (*Client) ExecuteRequestWithoutResponseWithApiVersion ¶
func (client *Client) ExecuteRequestWithoutResponseWithApiVersion(pathURL, requestType, contentType, errorMessage string, payload interface{}, apiVersion string) error
Helper function creates request, runs it, checks response and do not expect any values from it. pathURL - request URL requestType - HTTP method type contentType - value to set for "Content-Type" errorMessage - error message to return when error happens payload - XML struct which will be marshalled and added as body/payload apiVersion - api version which will be used in request E.g. client.ExecuteRequestWithoutResponse(catalogItemHREF.String(), http.MethodDelete, "", "error deleting Catalog item: %s", nil)
func (*Client) ExecuteTaskRequest ¶
func (client *Client) ExecuteTaskRequest(pathURL, requestType, contentType, errorMessage string, payload interface{}) (Task, error)
Helper function creates request, runs it, checks response and parses task from response. pathURL - request URL requestType - HTTP method type contentType - value to set for "Content-Type" errorMessage - error message to return when error happens payload - XML struct which will be marshalled and added as body/payload E.g. client.ExecuteTaskRequest(updateDiskLink.HREF, http.MethodPut, updateDiskLink.Type, "error updating disk: %s", xmlPayload)
func (*Client) ExecuteTaskRequestWithApiVersion ¶
func (client *Client) ExecuteTaskRequestWithApiVersion(pathURL, requestType, contentType, errorMessage string, payload interface{}, apiVersion string) (Task, error)
Helper function creates request, runs it, checks response and parses task from response. pathURL - request URL requestType - HTTP method type contentType - value to set for "Content-Type" errorMessage - error message to return when error happens payload - XML struct which will be marshalled and added as body/payload apiVersion - api version which will be used in request E.g. client.ExecuteTaskRequest(updateDiskLink.HREF, http.MethodPut, updateDiskLink.Type, "error updating disk: %s", xmlPayload)
func (*Client) FindVMByHREF
deprecated
func (Client) GetAccessControl ¶
func (client Client) GetAccessControl(href, entityType, entityName string, headerValues map[string]string) (*types.ControlAccessParams, error)
GetAccessControl retrieves the access control information for the requested entity
func (Client) GetQueryType ¶
GetQueryType is an utility function to get the appropriate query type depending on the user's role
func (*Client) GetSpecificApiVersionOnCondition ¶
func (cli *Client) GetSpecificApiVersionOnCondition(vcdApiVersionCondition, wantedApiVersion string) string
GetSpecificApiVersionOnCondition returns default version or wantedApiVersion if it is connected to version described in vcdApiVersionCondition f.e. values ">= 32.0", "32.0" returns 32.0 if vCD version is above or 9.7
func (*Client) GetVMByHref ¶
GetVMByHref returns a VM reference by running a vCD API call If no valid VM is found, it returns a nil VM reference and an error Note that the pointer receiver here is a Client instead of a VApp, because there are cases where we know the VM HREF but not which VApp it belongs to.
func (*Client) GetVcdFullVersion ¶
func (cli *Client) GetVcdFullVersion() (VcdVersion, error)
GetVcdFullVersion returns the full VCD version information as a structure
func (*Client) GetVcdShortVersion ¶
GetVcdShortVersion returns the VCD version (three digits, no build info)
func (*Client) GetVcdVersion ¶
GetVcdVersion finds the VCD version and the time of build
func (*Client) MaxSupportedVersion ¶
MaxSupportedVersion parses supported version list and returns the highest version in string format.
func (*Client) NewRequest ¶
func (cli *Client) NewRequest(params map[string]string, method string, reqUrl url.URL, body io.Reader) *http.Request
NewRequest creates a new HTTP request and applies necessary auth headers if set.
func (*Client) NewRequestWitNotEncodedParams ¶
func (cli *Client) NewRequestWitNotEncodedParams(params map[string]string, notEncodedParams map[string]string, method string, reqUrl url.URL, body io.Reader) *http.Request
NewRequestWitNotEncodedParams allows passing complex values params that shouldn't be encoded like for queries. e.g. /query?filter=name=foo
func (*Client) NewRequestWitNotEncodedParamsWithApiVersion ¶
func (cli *Client) NewRequestWitNotEncodedParamsWithApiVersion(params map[string]string, notEncodedParams map[string]string, method string, reqUrl url.URL, body io.Reader, apiVersion string) *http.Request
NewRequestWitNotEncodedParamsWithApiVersion allows passing complex values params that shouldn't be encoded like for queries. e.g. /query?filter=name=foo * params - request parameters * notEncodedParams - request parameters which will be added not encoded * method - request type * reqUrl - request url * body - request body * apiVersion - provided Api version overrides default Api version value used in request parameter
func (*Client) NewRequestWithApiVersion ¶
func (cli *Client) NewRequestWithApiVersion(params map[string]string, method string, reqUrl url.URL, body io.Reader, apiVersion string) *http.Request
NewRequestWithApiVersion creates a new HTTP request and applies necessary auth headers if set. Allows to override default request API Version
func (*Client) OpenApiBuildEndpoint ¶
OpenApiBuildEndpoint helps to construct OpenAPI endpoint by using already configured VCD HREF while requiring only the last bit for endpoint. This is a variadic function and multiple pieces can be supplied for convenience. Leading '/' is added automatically. Sample URL construct: https://HOST/cloudapi/endpoint
func (*Client) OpenApiDeleteItem ¶
func (client *Client) OpenApiDeleteItem(apiVersion string, urlRef *url.URL, params url.Values) error
OpenApiDeleteItem is a low level OpenAPI client function to perform DELETE request for any item. The urlRef must point to ID of exact item (e.g. '/1.0.0/edgeGateways/{EDGE_ID}') It handles synchronous and asynchronous tasks. When a task is synchronous - it will block until it is finished.
func (*Client) OpenApiGetAllItems ¶
func (client *Client) OpenApiGetAllItems(apiVersion string, urlRef *url.URL, queryParams url.Values, outType interface{}) error
OpenApiGetAllItems retrieves and accumulates all pages then parsing them to a single 'outType' object. It works by at first crawling pages and accumulating all responses into []json.RawMessage (as strings). Because there is no intermediate unmarshalling to exact `outType` for every page it unmarshals into response struct in one go. 'outType' must be a slice of object (e.g. []*types.OpenAPIEdgeGateway) because this response contains slice of structs.
Note. Query parameter 'pageSize' is defaulted to 128 (maximum supported) unless it is specified in queryParams
func (*Client) OpenApiGetItem ¶
func (client *Client) OpenApiGetItem(apiVersion string, urlRef *url.URL, params url.Values, outType interface{}) error
OpenApiGetItem is a low level OpenAPI client function to perform GET request for any item. The urlRef must point to ID of exact item (e.g. '/1.0.0/edgeGateways/{EDGE_ID}') It responds with HTTP 403: Forbidden - If the user is not authorized or the entity does not exist. When HTTP 403 is returned this function returns "ErrorEntityNotFound: API_ERROR" so that one can use ContainsNotFound(err) to differentiate when an objects was not found from any other error.
func (*Client) OpenApiIsSupported ¶
OpenApiIsSupported allows to check whether VCD supports OpenAPI. Each OpenAPI endpoint however is introduced with different VCD API versions so this is just a general check if OpenAPI is supported at all. Particular endpoint introduction version can be checked in self hosted docs (https://HOSTNAME/docs/)
func (*Client) OpenApiPostItem ¶
func (client *Client) OpenApiPostItem(apiVersion string, urlRef *url.URL, params url.Values, payload, outType interface{}) error
OpenApiPostItem is a low level OpenAPI client function to perform POST request for item supporting synchronous or asynchronous requests. The urlRef must point to POST endpoint (e.g. '/1.0.0/edgeGateways'). When a task is synchronous - it will track task until it is finished and pick reference to marshal outType.
func (*Client) OpenApiPostItemAsync ¶
func (client *Client) OpenApiPostItemAsync(apiVersion string, urlRef *url.URL, params url.Values, payload interface{}) (Task, error)
OpenApiPostItemAsync is a low level OpenAPI client function to perform POST request for items that support asynchronous requests. The urlRef must point to POST endpoint (e.g. '/1.0.0/edgeGateways') that supports asynchronous requests. It will return an error if item does not support asynchronous request (does not respond with HTTP 202).
Note. Even though it may return error if the item does not support asynchronous request - the object may still be created. OpenApiPostItem would handle both cases and always return created item.
func (*Client) OpenApiPostItemSync ¶
func (client *Client) OpenApiPostItemSync(apiVersion string, urlRef *url.URL, params url.Values, payload, outType interface{}) error
OpenApiPostItemSync is a low level OpenAPI client function to perform POST request for items that support synchronous requests. The urlRef must point to POST endpoint (e.g. '/1.0.0/edgeGateways') that supports synchronous requests. It will return an error when endpoint does not support synchronous requests (HTTP response status code is not 201). Response will be unmarshalled into outType.
Note. Even though it may return error if the item does not support synchronous request - the object may still be created. OpenApiPostItem would handle both cases and always return created item.
func (*Client) OpenApiPutItem ¶
func (client *Client) OpenApiPutItem(apiVersion string, urlRef *url.URL, params url.Values, payload, outType interface{}) error
OpenApiPutItem is a low level OpenAPI client function to perform PUT request for any item. The urlRef must point to ID of exact item (e.g. '/1.0.0/edgeGateways/{EDGE_ID}') It handles synchronous and asynchronous tasks. When a task is synchronous - it will block until it is finished.
func (*Client) OpenApiPutItemAsync ¶
func (client *Client) OpenApiPutItemAsync(apiVersion string, urlRef *url.URL, params url.Values, payload interface{}) (Task, error)
OpenApiPutItemAsync is a low level OpenAPI client function to perform PUT request for items that support asynchronous requests. The urlRef must point to ID of exact item (e.g. '/1.0.0/edgeGateways/{EDGE_ID}') that supports asynchronous requests. It will return an error if item does not support asynchronous request (does not respond with HTTP 202).
Note. Even though it may return error if the item does not support asynchronous request - the object may still be created. OpenApiPutItem would handle both cases and always return created item.
func (*Client) OpenApiPutItemSync ¶
func (client *Client) OpenApiPutItemSync(apiVersion string, urlRef *url.URL, params url.Values, payload, outType interface{}) error
OpenApiPutItemSync is a low level OpenAPI client function to perform PUT request for items that support synchronous requests. The urlRef must point to ID of exact item (e.g. '/1.0.0/edgeGateways/{EDGE_ID}') and support synchronous requests. It will return an error when endpoint does not support synchronous requests (HTTP response status code is not 201). Response will be unmarshalled into outType.
Note. Even though it may return error if the item does not support synchronous request - the object may still be updated. OpenApiPutItem would handle both cases and always return updated item.
func (*Client) QueryVappList ¶
QueryVappList returns a list of all vApps in all the organizations available to the caller
func (*Client) QueryVmList ¶
func (client *Client) QueryVmList(filter types.VmQueryFilter) ([]*types.QueryResultVMRecordType, error)
QueryVmList returns a list of all VMs in all the organizations available to the caller
func (*Client) QueryWithNotEncodedParams ¶
func (client *Client) QueryWithNotEncodedParams(params map[string]string, notEncodedParams map[string]string) (Results, error)
QueryWithNotEncodedParams uses Query API to search for requested data
func (*Client) QueryWithNotEncodedParamsWithApiVersion ¶
func (client *Client) QueryWithNotEncodedParamsWithApiVersion(params map[string]string, notEncodedParams map[string]string, apiVersion string) (Results, error)
QueryWithNotEncodedParams uses Query API to search for requested data
func (*Client) SearchByFilter ¶
func (client *Client) SearchByFilter(queryType string, criteria *FilterDef) ([]QueryItem, string, error)
SearchByFilter is a generic filter that can operate on entities that implement the QueryItem interface It requires a queryType and a set of criteria. Returns a list of QueryItem interface elements, which can be cast back to the wanted real type Also returns a human readable text of the conditions being passed and how they matched the data found See "## Query engine" in CODING_GUIDELINES.md for more info
func (*Client) SetAccessControl ¶
func (client *Client) SetAccessControl(accessControl *types.ControlAccessParams, href, entityType, entityName string, headerValues map[string]string) error
SetAccessControl changes the access control information for this entity There are two ways of setting the access: with accessControl.IsSharedToEveryone = true we give access to everyone with accessControl.IsSharedToEveryone = false, accessControl.AccessSettings defines which subjects can access the vApp For each setting we must provide: * The subject (HREF and Type are mandatory) * The access level (one of ReadOnly, Change, FullControl)
func (*Client) VersionEqualOrGreater ¶
VersionEqualOrGreater return true if the current version is the same or greater than the one being compared. If howManyDigits is > 3, the comparison includes the build. Examples:
client version is 1.2.3.1234 compare version is 1.2.3.2000
function return true if howManyDigits is <= 3, but false if howManyDigits is > 3
client version is 1.2.3.1234 compare version is 1.1.1.0
function returns true regardless of value of howManyDigits
type DFW ¶
type DFW struct { Section *DFWSection Client *Client }
func (*DFW) CheckDistributedFirewall ¶
type DFWApplied ¶
type DFWAppliedTo ¶
type DFWAppliedTo struct {
ID DFWApplied `xml:"appliedTo"`
}
type DFWRule ¶
type DFWRule struct { Name string `xml:"name"` Action string `xml:"action"` AppliedToList []DFWAppliedTo `xml:"appliedToList"` SectionID int `xml:"sectionId"` Direction string `xml:"direction"` PacketType string `xml:"packetType"` Tag string `xml:"tag"` ID int `xml:"id,attr"` Disabled bool `xml:"disabled,attr"` Logged bool `xml:"logged,attr"` }
type DFWSection ¶
type DFWSection struct { XMLName xml.Name `xml:"section"` Rules []DFWRule `xml:"rule"` ID int `xml:"id,attr"` Name string `xml:"name,attr"` GenerationNumber string `xml:"generationNumber,attr"` Timestamp string `xml:"timestamp,attr"` TCPStrict bool `xml:"tcpStrict,attr"` Stateless bool `xml:"stateless,attr"` UseSid bool `xml:"useSid,attr"` Type string `xml:"type,attr"` }
type DhcpSettings ¶
type DhcpSettings struct { IsEnabled bool MaxLeaseTime int DefaultLeaseTime int IPRange *types.IPRange }
struct type used to pass information for vApp network DHCP
type Disk ¶
type Disk struct { Disk *types.Disk // contains filtered or unexported fields }
Independent disk
func FindDiskByHREF ¶
Find an independent disk by VDC client and disk href Deprecated: Use VDC.GetDiskByHref()
func (*Disk) AttachedVM ¶
Get a VM that is attached the disk An independent disk can be attached to at most one virtual machine. If the disk isn't attached to any VM, return empty VM reference and no error. Otherwise return the first VM reference and no error. Reference: vCloud API Programming Guide for Service Providers vCloud API 30.0 PDF Page 107, https://vdc-download.vmware.com/vmwb-repository/dcr-public/1b6cf07d-adb3-4dba-8c47-9c1c92b04857/ 241956dd-e128-4fcc-8131-bf66e1edd895/vcloud_sp_api_guide_30_0.pdf
func (*Disk) Delete ¶
Remove an independent disk 1 Verify the independent disk is not connected to any VM 2 Delete the independent disk. Make a DELETE request to the URL in the rel="remove" link in the Disk 3 Return task of independent disk deletion If the independent disk is connected to a VM, the task will be failed. Reference: vCloud API Programming Guide for Service Providers vCloud API 30.0 PDF Page 106 - 107, https://vdc-download.vmware.com/vmwb-repository/dcr-public/1b6cf07d-adb3-4dba-8c47-9c1c92b04857/ 241956dd-e128-4fcc-8131-bf66e1edd895/vcloud_sp_api_guide_30_0.pdf
func (*Disk) Update ¶
Update an independent disk 1 Verify the independent disk is not connected to any VM 2 Use newDiskInfo to change update the independent disk 3 Return task of independent disk update If the independent disk is connected to a VM, the task will be failed. Reference: vCloud API Programming Guide for Service Providers vCloud API 30.0 PDF Page 104 - 106, https://vdc-download.vmware.com/vmwb-repository/dcr-public/1b6cf07d-adb3-4dba-8c47-9c1c92b04857/ 241956dd-e128-4fcc-8131-bf66e1edd895/vcloud_sp_api_guide_30_0.pdf
type DiskRecord ¶
type DiskRecord struct { Disk *types.DiskRecordType // contains filtered or unexported fields }
Independent disk query record
func NewDiskRecord ¶
func NewDiskRecord(cli *Client) *DiskRecord
Create instance with reference to types.DiskRecordType
type EdgeGateway ¶
type EdgeGateway struct { EdgeGateway *types.EdgeGateway // contains filtered or unexported fields }
func CreateAndConfigureEdgeGateway ¶
func CreateAndConfigureEdgeGateway(vcdClient *VCDClient, orgName, vdcName, egwName string, egwConfiguration *types.EdgeGateway) (EdgeGateway, error)
CreateAndConfigureEdgeGateway creates an edge gateway using a full configuration structure
func CreateEdgeGateway ¶
func CreateEdgeGateway(vcdClient *VCDClient, egwc EdgeGatewayCreation) (EdgeGateway, error)
CreateEdgeGateway creates an edge gateway using a simplified configuration structure
func NewEdgeGateway ¶
func NewEdgeGateway(cli *Client) *EdgeGateway
func (*EdgeGateway) AddDNATRule ¶
func (egw *EdgeGateway) AddDNATRule(ruleDetails NatRule) (*types.NatRule, error)
AddDNATRule creates DNAT rule and returns the NAT struct that was created or an error. Allows assigning a specific Org VDC or an external network. When edge gateway is advanced vCD API uses element <tag> to map with NSX edge gateway ID. A known issue is that updating rule using User interface resets <tag> and as result mapping is lost. Getting using NatRule.ID won't be valid anymore. Old functions AddNATPortMapping and AddNATMapping assigned rule only to first external network
func (*EdgeGateway) AddDhcpPool ¶
func (egw *EdgeGateway) AddDhcpPool(network *types.OrgVDCNetwork, dhcppool []interface{}) (Task, error)
AddDhcpPool adds (or updates) the DHCP pool connected to a specific network. TODO: this is legacy code from 2015, which requires a Terraform structure to work. It may need some re-thinking.
func (*EdgeGateway) AddIpsecVPN ¶
func (egw *EdgeGateway) AddIpsecVPN(ipsecVPNConfig *types.EdgeGatewayServiceConfiguration) (Task, error)
func (*EdgeGateway) AddNATMapping
deprecated
func (egw *EdgeGateway) AddNATMapping(natType, externalIP, internalIP string) (Task, error)
Deprecated: Use eGW.AddNATRule()
func (*EdgeGateway) AddNATPortMapping
deprecated
func (egw *EdgeGateway) AddNATPortMapping(natType, externalIP, externalPort, internalIP, internalPort, protocol, icmpSubType string) (Task, error)
Deprecated: Use eGW.AddNATPortMappingWithUplink()
func (*EdgeGateway) AddNATPortMappingWithUplink
deprecated
func (egw *EdgeGateway) AddNATPortMappingWithUplink(network *types.OrgVDCNetwork, natType, externalIP, externalPort, internalIP, internalPort, protocol, icmpSubType string) (Task, error)
Deprecated: Use eGW.AddDNATRule() or eGW.CreateNsxvNatRule() for NSX-V
func (*EdgeGateway) AddNATRule
deprecated
func (egw *EdgeGateway) AddNATRule(network *types.OrgVDCNetwork, natType, externalIP, internalIP string) (Task, error)
Deprecated: Use eGW.AddSNATRule() or eGW.AddDNATRule()
func (*EdgeGateway) AddNATRuleAsync ¶
func (egw *EdgeGateway) AddNATRuleAsync(ruleDetails NatRule) (Task, error)
AddNATRuleAsync creates NAT rule and return task or err Allows assigning specific network Org VDC or external. Old function AddNATPortMapping and AddNATMapping function shouldn't be used because assigns rule to first external network
func (*EdgeGateway) AddSNATRule ¶
func (egw *EdgeGateway) AddSNATRule(networkHref, externalIP, internalIP, description string) (*types.NatRule, error)
AddSNATRule creates SNAT rule and returns created NAT rule or error. Allows assigning a specific Org VDC or an external network. Old functions AddNATPortMapping and AddNATMapping aren't correct as assigned rule only to first external network
func (*EdgeGateway) Create1to1Mapping ¶
func (egw *EdgeGateway) Create1to1Mapping(internal, external, description string) (Task, error)
func (*EdgeGateway) CreateFirewallRules ¶
func (egw *EdgeGateway) CreateFirewallRules(defaultAction string, rules []*types.FirewallRule) (Task, error)
func (*EdgeGateway) CreateLbAppProfile ¶
func (egw *EdgeGateway) CreateLbAppProfile(lbAppProfileConfig *types.LbAppProfile) (*types.LbAppProfile, error)
CreateLbAppProfile creates a load balancer application profile based on mandatory fields. It is a synchronous operation. It returns created object with all fields (including ID) populated or an error.
func (*EdgeGateway) CreateLbAppRule ¶
func (egw *EdgeGateway) CreateLbAppRule(lbAppRuleConfig *types.LbAppRule) (*types.LbAppRule, error)
CreateLbAppRule creates a load balancer application rule based on mandatory fields. It is a synchronous operation. It returns created object with all fields (including ID) populated or an error.
func (*EdgeGateway) CreateLbServerPool ¶
func (egw *EdgeGateway) CreateLbServerPool(lbPoolConfig *types.LbPool) (*types.LbPool, error)
CreateLbServerPool creates a load balancer server pool based on mandatory fields. It is a synchronous operation. It returns created object with all fields (including ID) populated or an error. Name and Algorithm fields must be populated.
func (*EdgeGateway) CreateLbServiceMonitor ¶
func (egw *EdgeGateway) CreateLbServiceMonitor(lbMonitorConfig *types.LbMonitor) (*types.LbMonitor, error)
CreateLbServiceMonitor creates a load balancer service monitor based on mandatory fields. It is a synchronous operation. It returns created object with all fields (including ID) populated or an error.
func (*EdgeGateway) CreateLbVirtualServer ¶
func (egw *EdgeGateway) CreateLbVirtualServer(lbVirtualServerConfig *types.LbVirtualServer) (*types.LbVirtualServer, error)
CreateLbVirtualServer creates a load balancer virtual server based on mandatory fields. It is a synchronous operation. It returns created object with all fields (including ID) populated or an error. Name, Protocol, Port and IpAddress fields must be populated
func (*EdgeGateway) CreateNsxvFirewallRule ¶
func (egw *EdgeGateway) CreateNsxvFirewallRule(firewallRuleConfig *types.EdgeFirewallRule, aboveRuleId string) (*types.EdgeFirewallRule, error)
CreateNsxvFirewallRule creates firewall rule using proxied NSX-V API. It is a synchronuous operation. It returns an object with all fields populated (including ID) If aboveRuleId is not empty, it will send a query parameter aboveRuleId= which instructs NSX to place this rule above the specified rule ID
func (*EdgeGateway) CreateNsxvNatRule ¶
func (egw *EdgeGateway) CreateNsxvNatRule(natRuleConfig *types.EdgeNatRule) (*types.EdgeNatRule, error)
CreateNsxvNatRule creates NAT rule using proxied NSX-V API. It is a synchronuous operation. It returns an object with all fields populated (including ID)
func (*EdgeGateway) Delete ¶
func (egw *EdgeGateway) Delete(force bool, recursive bool) error
Deletes the edge gateway, returning an error with the operation result. https://code.vmware.com/apis/442/vcloud-director/doc/doc/operations/DELETE-EdgeGateway.html
func (*EdgeGateway) DeleteAsync ¶
func (egw *EdgeGateway) DeleteAsync(force bool, recursive bool) (Task, error)
Deletes the edge gateway, returning a task and an error with the operation result. https://code.vmware.com/apis/442/vcloud-director/doc/doc/operations/DELETE-EdgeGateway.html
func (*EdgeGateway) DeleteLbAppProfile ¶
func (egw *EdgeGateway) DeleteLbAppProfile(lbAppProfileConfig *types.LbAppProfile) error
DeleteLbAppProfile is able to delete the types.LbAppProfile type by Name and/or ID. If both - Name and ID are specified it performs a lookup by ID and returns an error if the specified name and found name do not match.
func (*EdgeGateway) DeleteLbAppProfileById ¶
func (egw *EdgeGateway) DeleteLbAppProfileById(id string) error
DeleteLbAppProfileById wraps DeleteLbAppProfile and requires only ID for deletion
func (*EdgeGateway) DeleteLbAppProfileByName ¶
func (egw *EdgeGateway) DeleteLbAppProfileByName(name string) error
DeleteLbAppProfileByName wraps DeleteLbAppProfile and requires only Name for deletion
func (*EdgeGateway) DeleteLbAppRule ¶
func (egw *EdgeGateway) DeleteLbAppRule(lbAppRuleConfig *types.LbAppRule) error
DeleteLbAppRule is able to delete the types.LbAppRule type by Name and/or ID. If both - Name and ID are specified it performs a lookup by ID and returns an error if the specified name and found name do not match.
func (*EdgeGateway) DeleteLbAppRuleById ¶
func (egw *EdgeGateway) DeleteLbAppRuleById(id string) error
DeleteLBAppRuleById wraps DeleteLbAppRule and requires only ID for deletion
func (*EdgeGateway) DeleteLbAppRuleByName ¶
func (egw *EdgeGateway) DeleteLbAppRuleByName(name string) error
DeleteLbAppRuleByName wraps DeleteLbAppRule and requires only Name for deletion
func (*EdgeGateway) DeleteLbServerPool ¶
func (egw *EdgeGateway) DeleteLbServerPool(lbPoolConfig *types.LbPool) error
DeleteLbServerPool is able to delete the types.LbPool type by Name and/or ID. If both - Name and ID are specified it performs a lookup by ID and returns an error if the specified name and found name do not match.
func (*EdgeGateway) DeleteLbServerPoolById ¶
func (egw *EdgeGateway) DeleteLbServerPoolById(id string) error
DeleteLbServerPoolById wraps DeleteLbServerPool and requires only ID for deletion
func (*EdgeGateway) DeleteLbServerPoolByName ¶
func (egw *EdgeGateway) DeleteLbServerPoolByName(name string) error
DeleteLbServerPoolByName wraps DeleteLbServerPool and requires only Name for deletion
func (*EdgeGateway) DeleteLbServiceMonitor ¶
func (egw *EdgeGateway) DeleteLbServiceMonitor(lbMonitorConfig *types.LbMonitor) error
DeleteLbServiceMonitor is able to delete the types.LbMonitor type by Name and/or ID. If both - Name and ID are specified it performs a lookup by ID and returns an error if the specified name and found name do not match.
func (*EdgeGateway) DeleteLbServiceMonitorById ¶
func (egw *EdgeGateway) DeleteLbServiceMonitorById(id string) error
DeleteLbServiceMonitorById wraps DeleteLbServiceMonitor and requires only ID for deletion
func (*EdgeGateway) DeleteLbServiceMonitorByName ¶
func (egw *EdgeGateway) DeleteLbServiceMonitorByName(name string) error
DeleteLbServiceMonitorByName wraps DeleteLbServiceMonitor and requires only Name for deletion
func (*EdgeGateway) DeleteLbVirtualServer ¶
func (egw *EdgeGateway) DeleteLbVirtualServer(lbVirtualServerConfig *types.LbVirtualServer) error
DeleteLbVirtualServer is able to delete the types.LbVirtualServer type by Name and/or ID. If both - Name and ID are specified it performs a lookup by ID and returns an error if the specified name and found name do not match.
func (*EdgeGateway) DeleteLbVirtualServerById ¶
func (egw *EdgeGateway) DeleteLbVirtualServerById(id string) error
DeleteLbVirtualServerById wraps DeleteLbVirtualServer and requires only ID for deletion
func (*EdgeGateway) DeleteLbVirtualServerByName ¶
func (egw *EdgeGateway) DeleteLbVirtualServerByName(name string) error
DeleteLbVirtualServerByName wraps DeleteLbVirtualServer and requires only Name for deletion
func (*EdgeGateway) DeleteNsxvFirewallRuleById ¶
func (egw *EdgeGateway) DeleteNsxvFirewallRuleById(id string) error
DeleteNsxvFirewallRuleById deletes types.EdgeFirewallRule by real (not the number shown in UI) firewall rule ID as shown in the UI using proxied NSX-V API. It returns and error `ErrorEntityNotFound` if the firewall rule is not found.
func (*EdgeGateway) DeleteNsxvNatRuleById ¶
func (egw *EdgeGateway) DeleteNsxvNatRuleById(id string) error
DeleteNsxvNatRuleById deletes types.EdgeNatRule by NAT rule ID as shown in the UI using proxied NSX-V API. It returns and error `ErrorEntityNotFound` if the NAT rule is now found.
func (*EdgeGateway) GetAllNsxvDhcpLeases ¶
func (egw *EdgeGateway) GetAllNsxvDhcpLeases() ([]*types.EdgeDhcpLeaseInfo, error)
GetAllNsxvDhcpLeases retrieves all DHCP leases defined in NSX-V edge gateway
func (*EdgeGateway) GetAllNsxvFirewallRules ¶
func (egw *EdgeGateway) GetAllNsxvFirewallRules() ([]*types.EdgeFirewallRule, error)
GetAllNsxvFirewallRules retrieves all firewall rules and returns []*types.EdgeFirewallRule or an error of type ErrorEntityNotFound if there are no firewall rules
func (*EdgeGateway) GetAnyVnicIndexByNetworkName ¶
func (egw *EdgeGateway) GetAnyVnicIndexByNetworkName(networkName string) (*int, string, error)
GetAnyVnicIndexByNetworkName parses XML structure of vNic mapping to networks in edge gateway XML and returns *int of vNic index and network type by network name networkName cannot be empty networkType will be one of: 'internal', 'uplink', 'trunk', 'subinterface'
Warning: this function assumes that there are no duplicate network names attached. If it is so this function will return the first network
func (*EdgeGateway) GetDhcpRelay ¶
func (egw *EdgeGateway) GetDhcpRelay() (*types.EdgeDhcpRelay, error)
GetDhcpRelay retrieves a structure of *types.EdgeDhcpRelay with all DHCP relay settings present on a particular edge gateway.
func (*EdgeGateway) GetFirewallConfig ¶
func (egw *EdgeGateway) GetFirewallConfig() (*types.FirewallConfigWithXml, error)
GetFirewallConfig retrieves firewall configuration and can be used to alter master configuration options. These are 3 fields only: FirewallConfigWithXml.Enabled, FirewallConfigWithXml.DefaultPolicy.LoggingEnabled and FirewallConfigWithXml.DefaultPolicy.Action
func (*EdgeGateway) GetLBGeneralParams ¶
func (egw *EdgeGateway) GetLBGeneralParams() (*types.LbGeneralParamsWithXml, error)
GetLBGeneralParams retrieves load balancer configuration of `&types.LoadBalancer` and can be used to access global configuration options. These are 4 fields only: LoadBalancer.Enabled, LoadBalancer.AccelerationEnabled, LoadBalancer.Logging.Enable, LoadBalancer.Logging.LogLevel
func (*EdgeGateway) GetLbAppProfileById ¶
func (egw *EdgeGateway) GetLbAppProfileById(id string) (*types.LbAppProfile, error)
GetLbAppProfileById wraps getLbAppProfile and needs only an ID for lookup
func (*EdgeGateway) GetLbAppProfileByName ¶
func (egw *EdgeGateway) GetLbAppProfileByName(name string) (*types.LbAppProfile, error)
GetLbAppProfileByName wraps getLbAppProfile and needs only a Name for lookup
func (*EdgeGateway) GetLbAppProfiles ¶
func (egw *EdgeGateway) GetLbAppProfiles() ([]*types.LbAppProfile, error)
GetLbAppProfiles returns a list of all LB application profiles in a given edge gateway
func (*EdgeGateway) GetLbAppRuleById ¶
func (egw *EdgeGateway) GetLbAppRuleById(id string) (*types.LbAppRule, error)
ReadLBAppRuleById wraps getLbAppRule and needs only an ID for lookup
func (*EdgeGateway) GetLbAppRuleByName ¶
func (egw *EdgeGateway) GetLbAppRuleByName(name string) (*types.LbAppRule, error)
GetLbAppRuleByName wraps getLbAppRule and needs only a Name for lookup
func (*EdgeGateway) GetLbAppRules ¶
func (egw *EdgeGateway) GetLbAppRules() ([]*types.LbAppRule, error)
GetLbAppRules returns a list of all LB application rules for a given edge gateway
func (*EdgeGateway) GetLbServerPoolById ¶
func (egw *EdgeGateway) GetLbServerPoolById(id string) (*types.LbPool, error)
GetLbServerPoolByName wraps getLbServerPool and needs only an ID for lookup
func (*EdgeGateway) GetLbServerPoolByName ¶
func (egw *EdgeGateway) GetLbServerPoolByName(name string) (*types.LbPool, error)
GetLbServerPoolByName wraps getLbServerPool and needs only a Name for lookup
func (*EdgeGateway) GetLbServerPools ¶
func (egw *EdgeGateway) GetLbServerPools() ([]*types.LbPool, error)
GetLbServerPools return all created server pools without filtering.
func (*EdgeGateway) GetLbServiceMonitorById ¶
func (egw *EdgeGateway) GetLbServiceMonitorById(id string) (*types.LbMonitor, error)
GetLbServiceMonitorById wraps getLbServiceMonitor and needs only an ID for lookup
func (*EdgeGateway) GetLbServiceMonitorByName ¶
func (egw *EdgeGateway) GetLbServiceMonitorByName(name string) (*types.LbMonitor, error)
GetLbServiceMonitorByName wraps getLbServiceMonitor and needs only a Name for lookup
func (*EdgeGateway) GetLbServiceMonitors ¶
func (egw *EdgeGateway) GetLbServiceMonitors() ([]*types.LbMonitor, error)
GetLbServiceMonitors return all service monitors without filtering
func (*EdgeGateway) GetLbVirtualServerById ¶
func (egw *EdgeGateway) GetLbVirtualServerById(id string) (*types.LbVirtualServer, error)
GetLbVirtualServerById wraps getLbVirtualServers and needs only an ID for lookup
func (*EdgeGateway) GetLbVirtualServerByName ¶
func (egw *EdgeGateway) GetLbVirtualServerByName(name string) (*types.LbVirtualServer, error)
GetLbVirtualServerByName wraps getLbVirtualServers and needs only a Name for lookup
func (*EdgeGateway) GetLbVirtualServers ¶
func (egw *EdgeGateway) GetLbVirtualServers() ([]*types.LbVirtualServer, error)
GetLbVirtualServers is getting all virtual servers without filtering anything
func (*EdgeGateway) GetNatRule ¶
func (egw *EdgeGateway) GetNatRule(id string) (*types.NatRule, error)
GetNatRule returns NAT rule or error.
func (*EdgeGateway) GetNetworkNameAndTypeByVnicIndex ¶
func (egw *EdgeGateway) GetNetworkNameAndTypeByVnicIndex(vNicIndex int) (string, string, error)
GetNetworkNameAndTypeByVnicIndex returns network name and network type for given vNic index returned networkType can be one of: 'internal', 'uplink', 'trunk', 'subinterface'
func (*EdgeGateway) GetNetworks ¶
func (egw *EdgeGateway) GetNetworks() ([]SimpleNetworkIdentifier, error)
GetNetworks returns the list of networks associated with an edge gateway In the return structure, an interfaceType of "uplink" indicates an external network, while "internal" is for Org VDC routed networks
func (*EdgeGateway) GetNsxvActiveDhcpLeaseByMac ¶
func (egw *EdgeGateway) GetNsxvActiveDhcpLeaseByMac(mac string) (*types.EdgeDhcpLeaseInfo, error)
GetNsxvActiveDhcpLeaseByMac finds active DHCP lease for a given hardware address (MAC)
func (*EdgeGateway) GetNsxvFirewallRuleById ¶
func (egw *EdgeGateway) GetNsxvFirewallRuleById(id string) (*types.EdgeFirewallRule, error)
GetNsxvFirewallRuleById retrieves types.EdgeFirewallRule by real (not the number shown in UI) firewall rule ID as shown in the UI using proxied NSX-V API. It returns and error `ErrorEntityNotFound` if the firewall rule is not found
func (*EdgeGateway) GetNsxvNatRuleById ¶
func (egw *EdgeGateway) GetNsxvNatRuleById(id string) (*types.EdgeNatRule, error)
GetNsxvNatRuleById retrieves types.EdgeNatRule by NAT rule ID as shown in the UI using proxied NSX-V API. It returns and error `ErrorEntityNotFound` if the NAT rule is not found.
func (*EdgeGateway) GetNsxvNatRules ¶
func (egw *EdgeGateway) GetNsxvNatRules() ([]*types.EdgeNatRule, error)
GetNsxvNatRules returns a list of all NAT rules in a given edge gateway
func (*EdgeGateway) GetVnicIndexByNetworkNameAndType ¶
func (egw *EdgeGateway) GetVnicIndexByNetworkNameAndType(networkName, networkType string) (*int, error)
GetVnicIndexByNetworkNameAndType returns *int of vNic index for specified network name and network type networkType one of: 'internal', 'uplink', 'trunk', 'subinterface' networkName cannot be empty
func (*EdgeGateway) HasAdvancedNetworking ¶
func (egw *EdgeGateway) HasAdvancedNetworking() bool
HasAdvancedNetworking returns true if the edge gateway has advanced network configuration enabled
func (*EdgeGateway) HasDefaultGateway ¶
func (egw *EdgeGateway) HasDefaultGateway() bool
HasDefaultGateway returns true if the edge gateway uses one of the external networks as default gateway
func (*EdgeGateway) Refresh ¶
func (egw *EdgeGateway) Refresh() error
func (*EdgeGateway) Remove1to1Mapping ¶
func (egw *EdgeGateway) Remove1to1Mapping(internal, external string) (Task, error)
func (*EdgeGateway) RemoveIpsecVPN ¶
func (egw *EdgeGateway) RemoveIpsecVPN() (Task, error)
Removes an Edge Gateway VPN, by passing an empty configuration
func (*EdgeGateway) RemoveNATMapping
deprecated
func (egw *EdgeGateway) RemoveNATMapping(natType, externalIP, internalIP, port string) (Task, error)
Deprecated: use one of RemoveNATRuleAsync, RemoveNATRule
func (*EdgeGateway) RemoveNATPortMapping
deprecated
func (egw *EdgeGateway) RemoveNATPortMapping(natType, externalIP, externalPort, internalIP, internalPort string) (Task, error)
Deprecated: use one of RemoveNATRuleAsync, RemoveNATRule
func (*EdgeGateway) RemoveNATRule ¶
func (egw *EdgeGateway) RemoveNATRule(id string) error
RemoveNATRule removes NAT removes NAT rule identified by ID and handles task. Returns error if issues rise. Old functions RemoveNATPortMapping and RemoveNATMapping removed using rule details and expected interface to be of external network type.
func (*EdgeGateway) RemoveNATRuleAsync ¶
func (egw *EdgeGateway) RemoveNATRuleAsync(id string) (Task, error)
RemoveNATRuleAsync removes NAT rule or returns an error. Old functions RemoveNATPortMapping and RemoveNATMapping removed using rule details and expected interface to be of external network type.
func (*EdgeGateway) ResetDhcpRelay ¶
func (egw *EdgeGateway) ResetDhcpRelay() error
ResetDhcpRelay removes all configuration by sending a DELETE request for DHCP relay configuration endpoint
func (*EdgeGateway) Update ¶
func (egw *EdgeGateway) Update() error
Update is a wrapper around UpdateAsync The pointer receiver is refreshed after update
func (*EdgeGateway) UpdateAsync ¶
func (egw *EdgeGateway) UpdateAsync() (Task, error)
UpdateAsync updates the edge gateway in place with the information contained in the internal structure
func (*EdgeGateway) UpdateDhcpRelay ¶
func (egw *EdgeGateway) UpdateDhcpRelay(dhcpRelayConfig *types.EdgeDhcpRelay) (*types.EdgeDhcpRelay, error)
UpdateDhcpRelay updates DHCP relay settings for a particular edge gateway and returns them. The feature itself enables you to leverage your existing DHCP infrastructure from within NSX without any interruption to the IP address management in your environment. DHCP messages are relayed from virtual machine(s) to the designated DHCP server(s) in the physical world. This enables IP addresses within NSX to continue to be in sync with IP addresses in other environments.
func (*EdgeGateway) UpdateFirewallConfig ¶
func (egw *EdgeGateway) UpdateFirewallConfig(enabled, defaultLoggingEnabled bool, defaultAction string) (*types.FirewallConfigWithXml, error)
UpdateFirewallConfig allows to update firewall configuration. It accepts three fields (Enabled, DefaultLoggingEnabled, DefaultAction) and uses them to construct types.FirewallConfigWithXml without altering other options to prevent config corruption. They are represented in firewall configuration page in the UI.
func (*EdgeGateway) UpdateLBGeneralParams ¶
func (egw *EdgeGateway) UpdateLBGeneralParams(enabled, accelerationEnabled, loggingEnabled bool, logLevel string) (*types.LbGeneralParamsWithXml, error)
UpdateLBGeneralParams allows to update global load balancer configuration. It accepts four fields (Enabled, AccelerationEnabled, Logging.Enable, Logging.LogLevel) and uses them to construct types.LbGeneralParamsWithXml without altering other options to prevent config corruption. They are represented in load balancer global configuration tab in the UI.
func (*EdgeGateway) UpdateLbAppProfile ¶
func (egw *EdgeGateway) UpdateLbAppProfile(lbAppProfileConfig *types.LbAppProfile) (*types.LbAppProfile, error)
UpdateLbAppProfile updates types.LbAppProfile with all fields. At least name or ID must be specified. If both - Name and ID are specified it performs a lookup by ID and returns an error if the specified name and found name do not match.
func (*EdgeGateway) UpdateLbAppRule ¶
func (egw *EdgeGateway) UpdateLbAppRule(lbAppRuleConfig *types.LbAppRule) (*types.LbAppRule, error)
UpdateLbAppRule updates types.LbAppRule with all fields. At least name or ID must be specified. If both - Name and ID are specified it performs a lookup by ID and returns an error if the specified name and found name do not match.
func (*EdgeGateway) UpdateLbServerPool ¶
func (egw *EdgeGateway) UpdateLbServerPool(lbPoolConfig *types.LbPool) (*types.LbPool, error)
UpdateLbServerPool updates types.LbPool with all fields. At least name or ID must be specified. If both - Name and ID are specified it performs a lookup by ID and returns an error if the specified name and found name do not match. Name and Algorithm fields must be populated.
func (*EdgeGateway) UpdateLbServiceMonitor ¶
func (egw *EdgeGateway) UpdateLbServiceMonitor(lbMonitorConfig *types.LbMonitor) (*types.LbMonitor, error)
UpdateLbServiceMonitor updates types.LbMonitor with all fields. At least name or ID must be specified. If both - Name and ID are specified it performs a lookup by ID and returns an error if the specified name and found name do not match.
func (*EdgeGateway) UpdateLbVirtualServer ¶
func (egw *EdgeGateway) UpdateLbVirtualServer(lbVirtualServerConfig *types.LbVirtualServer) (*types.LbVirtualServer, error)
UpdateLbVirtualServer updates types.LbVirtualServer with all fields. At least name or ID must be specified. If both - Name and ID are specified it performs a lookup by ID and returns an error if the specified name and found name do not match. Name, Protocol, Port and IpAddress fields must be populated
func (*EdgeGateway) UpdateNatRule ¶
func (egw *EdgeGateway) UpdateNatRule(natRule *types.NatRule) (*types.NatRule, error)
UpdateNatRule updates NAT rule and handles task. Returns updated NAT rule or error.
func (*EdgeGateway) UpdateNatRuleAsync ¶
func (egw *EdgeGateway) UpdateNatRuleAsync(natRule *types.NatRule) (Task, error)
UpdateNatRuleAsync updates NAT rule and returns task or error.
func (*EdgeGateway) UpdateNsxvFirewallRule ¶
func (egw *EdgeGateway) UpdateNsxvFirewallRule(firewallRuleConfig *types.EdgeFirewallRule) (*types.EdgeFirewallRule, error)
UpdateNsxvFirewallRule updates types.EdgeFirewallRule with all fields using proxied NSX-V API. Real firewall rule ID (not the number shown in UI) is mandatory to perform the update.
func (*EdgeGateway) UpdateNsxvNatRule ¶
func (egw *EdgeGateway) UpdateNsxvNatRule(natRuleConfig *types.EdgeNatRule) (*types.EdgeNatRule, error)
UpdateNsxvNatRule updates types.EdgeNatRule with all fields using proxied NSX-V API. ID is mandatory to perform the update.
type EdgeGatewayCreation ¶
type EdgeGatewayCreation struct { ExternalNetworks []string // List of external networks to be linked to this gateway DefaultGateway string // Which network should be used as default gateway (empty name = no default gateway) OrgName string // parent Org VdcName string // parent VDC Name string // edge gateway name Description string // Optional description BackingConfiguration string // Type of backing configuration (compact, full) AdvancedNetworkingEnabled bool // enable advanced gateway HAEnabled bool // enable HA UseDefaultRouteForDNSRelay bool // True if the default gateway should be used as the DNS relay DistributedRoutingEnabled bool // If advanced networking enabled, also enable distributed routing }
Simple structure to pass Edge Gateway creation parameters.
type EjectTask ¶
type EjectTask struct { *Task // contains filtered or unexported fields }
func NewEjectTask ¶
Creates wrapped Task which is dedicated for eject media functionality and provides additional functionality to answer VM questions
func (*EjectTask) WaitInspectTaskCompletion ¶
function which handles answers for ejecting
func (*EjectTask) WaitTaskCompletion ¶
Checks the status of the task every 3 seconds and returns when the eject task is either completed or failed
type Envelope ¶
type Envelope struct { File []struct { HREF string `xml:"href,attr"` ID string `xml:"id,attr"` Size int `xml:"size,attr"` ChunkSize int `xml:"chunkSize,attr"` } `xml:"References>File"` }
Envelope is a ovf description root element. File contains information for vmdk files. Namespace: http://schemas.dmtf.org/ovf/envelope/1 Description: Envelope is a ovf description root element. File contains information for vmdk files..
type ExternalNetwork ¶
type ExternalNetwork struct { ExternalNetwork *types.ExternalNetwork // contains filtered or unexported fields }
func GetExternalNetwork ¶
func GetExternalNetwork(vcdClient *VCDClient, networkName string) (*ExternalNetwork, error)
GetExternalNetwork returns an ExternalNetwork reference if the network name matches an existing one. If no valid external network is found, it returns an empty ExternalNetwork reference and an error Deprecated: use vcdClient.GetExternalNetworkByName instead
func NewExternalNetwork ¶
func NewExternalNetwork(cli *Client) *ExternalNetwork
func (*ExternalNetwork) Delete ¶
func (externalNetwork *ExternalNetwork) Delete() (Task, error)
func (*ExternalNetwork) DeleteWait ¶
func (externalNetwork *ExternalNetwork) DeleteWait() error
func (ExternalNetwork) Refresh ¶
func (externalNetwork ExternalNetwork) Refresh() error
type ExternalNetworkV2 ¶
type ExternalNetworkV2 struct { ExternalNetwork *types.ExternalNetworkV2 // contains filtered or unexported fields }
ExternalNetworkV2 is a type for version 2 of external network which uses OpenAPI endpoint to manage external networks of both types (NSX-V and NSX-T)
func CreateExternalNetworkV2 ¶
func CreateExternalNetworkV2(vcdClient *VCDClient, newExtNet *types.ExternalNetworkV2) (*ExternalNetworkV2, error)
CreateExternalNetworkV2 creates a new external network using OpenAPI endpoint. It can create NSX-V and NSX-T backed networks based on what ExternalNetworkV2.NetworkBackings is provided. types.ExternalNetworkV2 has documented fields.
func GetAllExternalNetworksV2 ¶
func GetAllExternalNetworksV2(vcdClient *VCDClient, queryParameters url.Values) ([]*ExternalNetworkV2, error)
GetAllExternalNetworksV2 retrieves all external networks using OpenAPI endpoint. Query parameters can be supplied to perform additional filtering
func GetExternalNetworkV2ById ¶
func GetExternalNetworkV2ById(vcdClient *VCDClient, id string) (*ExternalNetworkV2, error)
GetExternalNetworkV2ById retrieves external network by given ID using OpenAPI endpoint
func GetExternalNetworkV2ByName ¶
func GetExternalNetworkV2ByName(vcdClient *VCDClient, name string) (*ExternalNetworkV2, error)
GetExternalNetworkV2ByName retrieves external network by given name using OpenAPI endpoint. Returns an error if not exactly one network is found.
func (*ExternalNetworkV2) Delete ¶
func (extNet *ExternalNetworkV2) Delete() error
Delete deletes external network using OpenAPI endpoint
func (*ExternalNetworkV2) Update ¶
func (extNet *ExternalNetworkV2) Update() (*ExternalNetworkV2, error)
Update updates existing external network using OpenAPI endpoint
type FilterDef ¶
type FilterDef struct { // A collection of filters (with keys from SupportedFilters) Filters map[string]string // A list of metadata filters Metadata []MetadataDef // If true, the query will include metadata fields and search for exact values. // Otherwise, the engine will collect metadata fields and search by regexp UseMetadataApiFilter bool }
FilterDef defines all the criteria used by the engine to retrieve data
type FilterMatch ¶
type FilterMatch struct { Criteria *FilterDef ExpectedName string Entity interface{} EntityType string }
FilterMatch contains a filter, the name of the item that is expected to match, and the item itself
func HelperMakeFiltersFromCatalogItem ¶
func HelperMakeFiltersFromCatalogItem(catalog *Catalog) ([]FilterMatch, error)
func HelperMakeFiltersFromCatalogs ¶
func HelperMakeFiltersFromCatalogs(org *AdminOrg) ([]FilterMatch, error)
func HelperMakeFiltersFromEdgeGateways ¶
func HelperMakeFiltersFromEdgeGateways(vdc *Vdc) ([]FilterMatch, error)
HelperMakeFiltersFromEdgeGateways looks at the existing edge gateways and creates a set of criteria to retrieve each of them
func HelperMakeFiltersFromMedia ¶
func HelperMakeFiltersFromMedia(vdc *Vdc, catalogName string) ([]FilterMatch, error)
func HelperMakeFiltersFromNetworks ¶
func HelperMakeFiltersFromNetworks(vdc *Vdc) ([]FilterMatch, error)
HelperMakeFiltersFromNetworks looks at the existing networks and creates a set of criteria to retrieve each of them
func HelperMakeFiltersFromVappTemplate ¶
func HelperMakeFiltersFromVappTemplate(catalog *Catalog) ([]FilterMatch, error)
type InspectionFunc ¶
type InspectionFunc func(task *types.Task, howManyTimes int, elapsed time.Duration, first, last bool)
This callback function can be passed to task.WaitInspectTaskCompletion to perform user defined operations * task is the task object being processed * howManyTimes is the number of times the task has been refreshed * elapsed is how much time since the task was initially processed * first is true if this is the first refresh of the task * last is true if the function is being called for the last time.
type Media ¶
type Media struct { Media *types.Media // contains filtered or unexported fields }
func (*Media) AddMetadata ¶
AddMetadata adds metadata key/value pair provided as input.
func (*Media) AddMetadataAsync ¶
AddMetadataAsync calls private function addMetadata() with Media.client and Media.Media.HREF which adds metadata key/value pair provided as input.
func (*Media) Delete ¶
Deletes the Media Item, returning an error if the vCD call fails. Link to API call: https://code.vmware.com/apis/220/vcloud#/doc/doc/operations/DELETE-Media.html
func (*Media) DeleteMetadata ¶
DeleteMetadata deletes metadata depending on key provided as input from media item.
func (*Media) DeleteMetadataAsync ¶
DeleteMetadataAsync calls private function deleteMetadata() with Media.client and Media.Media.HREF which deletes metadata depending on key provided as input from media item.
func (*Media) GetMetadata ¶
GetMetadata calls private function getMetadata() with Media.client and Media.Media.HREF which returns a *types.Metadata struct for provided media item input.
type MediaItem
deprecated
type MediaItem struct { MediaItem *types.MediaRecordType // contains filtered or unexported fields }
Deprecated: use MediaRecord
func NewMediaItem
deprecated
func (*MediaItem) AddMetadata ¶
AddMetadata adds metadata key/value pair provided as input. Deprecated: Use MediaRecord.AddMetadata
func (*MediaItem) AddMetadataAsync ¶
AddMetadataAsync calls private function addMetadata() with mediaItem.client and mediaItem.MediaItem.HREF which adds metadata key/value pair provided as input. Deprecated: Use MediaRecord.AddMetadataAsync
func (*MediaItem) Delete ¶
Deletes the Media Item, returning an error if the vCD call fails. Link to API call: https://code.vmware.com/apis/220/vcloud#/doc/doc/operations/DELETE-Media.html Deprecated: Use MediaRecord.Delete
func (*MediaItem) DeleteMetadata ¶
DeleteMetadata deletes metadata depending on key provided as input from media item. Deprecated: Use MediaRecord.DeleteMetadata
func (*MediaItem) DeleteMetadataAsync ¶
DeleteMetadataAsync calls private function deleteMetadata() with mediaItem.client and mediaItem.MediaItem.HREF which deletes metadata depending on key provided as input from media item. Deprecated: Use MediaRecord.DeleteMetadataAsync
func (*MediaItem) GetMetadata ¶
GetMetadata calls private function getMetadata() with mediaItem.client and mediaItem.MediaItem.HREF which returns a *types.Metadata struct for provided media item input. Deprecated: Use MediaRecord.GetMetadata
type MediaRecord ¶
type MediaRecord struct { MediaRecord *types.MediaRecordType // contains filtered or unexported fields }
func NewMediaRecord ¶
func NewMediaRecord(cli *Client) *MediaRecord
func (*MediaRecord) AddMetadata ¶
func (mediaRecord *MediaRecord) AddMetadata(key string, value string) (*MediaRecord, error)
AddMetadata adds metadata key/value pair provided as input.
func (*MediaRecord) AddMetadataAsync ¶
func (mediaRecord *MediaRecord) AddMetadataAsync(key string, value string) (Task, error)
AddMetadataAsync calls private function addMetadata() with MediaRecord.client and MediaRecord.MediaRecord.HREF which adds metadata key/value pair provided as input.
func (*MediaRecord) Delete ¶
func (mediaRecord *MediaRecord) Delete() (Task, error)
Deletes the Media Item, returning an error if the vCD call fails. Link to API call: https://code.vmware.com/apis/220/vcloud#/doc/doc/operations/DELETE-Media.html
func (*MediaRecord) DeleteMetadata ¶
func (mediaRecord *MediaRecord) DeleteMetadata(key string) error
DeleteMetadata deletes metadata depending on key provided as input from media item.
func (*MediaRecord) DeleteMetadataAsync ¶
func (mediaRecord *MediaRecord) DeleteMetadataAsync(key string) (Task, error)
DeleteMetadataAsync calls private function deleteMetadata() with MediaRecord.client and MediaRecord.MediaRecord.HREF which deletes metadata depending on key provided as input from media item.
func (*MediaRecord) GetMetadata ¶
func (mediaRecord *MediaRecord) GetMetadata() (*types.Metadata, error)
GetMetadata calls private function getMetadata() with MediaRecord.client and MediaRecord.MediaRecord.HREF which returns a *types.Metadata struct for provided media item input.
func (*MediaRecord) Refresh ¶
func (mediaRecord *MediaRecord) Refresh() error
Refresh refreshes the media information by href
type MetadataDef ¶
type MetadataDef struct { Key string // name of the field (addressed as metadata:key) Type string // Type of the field (one of SupportedMetadataTypes) Value interface{} // contents of the metadata field IsSystem bool // if true, the metadata field will be addressed as metadata@SYSTEM:key }
MetadataDef defines a metadata structure
type MetadataFilter ¶
MetadataFilter is a definition of a value used to filter metadata. It is made of a Type (such as 'STRING', 'INT', 'BOOL") and a Value, which is the value we want to search for.
type NatRule ¶
type NatRule struct { NatType string NetworkHref string ExternalIP string ExternalPort string InternalIP string InternalPort string Protocol string IcmpSubType string Description string }
Struct which covers NAT rule fields
type NsxtEdgeCluster ¶ added in v2.11.9
type NsxtEdgeCluster struct { NsxtEdgeCluster *types.NsxtEdgeCluster // contains filtered or unexported fields }
NsxtEdgeCluster is a logical grouping of NSX-T Edge virtual machines.
type NsxtEdgeGateway ¶ added in v2.11.9
type NsxtEdgeGateway struct { EdgeGateway *types.OpenAPIEdgeGateway // contains filtered or unexported fields }
NsxtEdgeGateway uses OpenAPI endpoint to operate NSX-T Edge Gateways
func (*NsxtEdgeGateway) Delete ¶ added in v2.11.9
func (egw *NsxtEdgeGateway) Delete() error
Update allows to delete NSX-T edge gateway for Org admins
func (*NsxtEdgeGateway) Update ¶ added in v2.11.9
func (egw *NsxtEdgeGateway) Update(edgeGatewayConfig *types.OpenAPIEdgeGateway) (*NsxtEdgeGateway, error)
Update allows to update NSX-T edge gateway for Org admins
type NsxtTier0Router ¶
type NsxtTier0Router struct { NsxtTier0Router *types.NsxtTier0Router // contains filtered or unexported fields }
NsxtTier0Router
type Org ¶
type Org struct { Org *types.Org // contains filtered or unexported fields }
func GetOrgByName ¶
If user specifies a valid organization name, then this returns a organization object. If no valid org is found, it returns an empty org and no error. Otherwise it returns an error and an empty Org object Deprecated: Use vcdClient.GetOrgByName instead
func (*Org) CreateCatalog ¶
CreateCatalog creates a catalog with given name and description under the given organization. Returns an Catalog that contains a creation task. API Documentation: https://code.vmware.com/apis/220/vcloud#/doc/doc/operations/POST-CreateCatalog.html
func (*Org) CreateCatalogWithStorageProfile ¶ added in v2.11.9
func (org *Org) CreateCatalogWithStorageProfile(name, description string, storageProfiles *types.CatalogStorageProfiles) (*Catalog, error)
CreateCatalogWithStorageProfile is like CreateCatalog but additionally allows to specify storage profiles
func (*Org) FindCatalog ¶
Given a valid catalog name, FindCatalog returns a Catalog object. If no catalog is found, then returns an empty catalog and no error. Otherwise it returns an error. Deprecated: use org.GetCatalogByName instead
func (*Org) GetAllNsxtEdgeGateways ¶ added in v2.11.9
func (org *Org) GetAllNsxtEdgeGateways(queryParameters url.Values) ([]*NsxtEdgeGateway, error)
GetAllNsxtEdgeGateways allows to retrieve all NSX-T edge gateways for Org users
func (*Org) GetAllVdcComputePolicies ¶
func (org *Org) GetAllVdcComputePolicies(queryParameters url.Values) ([]*VdcComputePolicy, error)
GetAllVdcComputePolicies retrieves all VDC compute policies using OpenAPI endpoint. Query parameters can be supplied to perform additional filtering
func (*Org) GetCatalogAccessControl ¶
func (org *Org) GetCatalogAccessControl(catalogIdentifier string, useTenantContext bool) (*types.ControlAccessParams, error)
GetCatalogAccessControl is a convenience method to retrieve access control for a catalog from an organization. The input variable catalogIdentifier can be either the catalog name or its ID
func (*Org) GetCatalogByHref ¶
GetCatalogByHref finds a Catalog by HREF On success, returns a pointer to the Catalog structure and a nil error On failure, returns a nil pointer and an error
func (*Org) GetCatalogById ¶
GetCatalogById finds a Catalog by ID On success, returns a pointer to the Catalog structure and a nil error On failure, returns a nil pointer and an error
func (*Org) GetCatalogByName ¶
GetCatalogByName finds a Catalog by Name On success, returns a pointer to the Catalog structure and a nil error On failure, returns a nil pointer and an error
func (*Org) GetCatalogByNameOrId ¶
GetCatalogByNameOrId finds a Catalog by name or ID On success, returns a pointer to the Catalog structure and a nil error On failure, returns a nil pointer and an error
func (*Org) GetNsxtEdgeGatewayById ¶ added in v2.11.9
func (org *Org) GetNsxtEdgeGatewayById(id string) (*NsxtEdgeGateway, error)
GetNsxtEdgeGatewayById allows to retrieve NSX-T edge gateway by ID for Org users
func (*Org) GetNsxtEdgeGatewayByName ¶ added in v2.11.9
func (org *Org) GetNsxtEdgeGatewayByName(name string) (*NsxtEdgeGateway, error)
GetNsxtEdgeGatewayByName allows to retrieve NSX-T edge gateway by Name for Org admins
func (*Org) GetTaskList ¶
GetTaskList returns Tasks for Organization and error.
func (*Org) GetVDCByHref ¶
GetVDCByHref finds a VDC by HREF On success, returns a pointer to the VDC structure and a nil error On failure, returns a nil pointer and an error
func (*Org) GetVDCById ¶
GetVDCById finds a VDC by ID On success, returns a pointer to the VDC structure and a nil error On failure, returns a nil pointer and an error
func (*Org) GetVDCByName ¶
GetVDCByName finds a VDC by Name On success, returns a pointer to the VDC structure and a nil error On failure, returns a nil pointer and an error
func (*Org) GetVDCByNameOrId ¶
GetVDCByNameOrId finds a VDC by name or ID On success, returns a pointer to the VDC structure and a nil error On failure, returns a nil pointer and an error
func (*Org) GetVdcByName ¶
GetVdcByName if user specifies valid vdc name then this returns a vdc object. If no vdc is found, then it returns an empty vdc and no error. Otherwise it returns an empty vdc and an error. Deprecated: use org.GetVDCByName instead
func (*Org) GetVdcComputePolicyById ¶
func (org *Org) GetVdcComputePolicyById(id string) (*VdcComputePolicy, error)
GetVdcComputePolicyById retrieves VDC compute policy by given ID
func (*Org) QueryCatalogList ¶
QueryCatalogList returns a list of catalogs for this organization
func (*Org) Refresh ¶
Given an org with a valid HREF, the function refetches the org and updates the user's org data. Otherwise if the function fails, it returns an error. Users should use refresh whenever they have a stale org due to the creation/update/deletion of a resource within the org or the org itself.
type OrgGroup ¶
type OrgGroup struct { Group *types.Group AdminOrg *AdminOrg // needed to be able to update, as the list of roles is found in the Org // contains filtered or unexported fields }
OrgGroup defines group structure
type OrgUser ¶
type OrgUser struct { User *types.User AdminOrg *AdminOrg // needed to be able to update, as the list of roles is found in the Org // contains filtered or unexported fields }
Definition of an OrgUser
func (*OrgUser) ChangePassword ¶
ChangePassword changes user's password Constraints: the password must be non-empty, with a minimum of 6 characters
func (*OrgUser) ChangeRole ¶
ChangeRole changes a user's role Fails is we try to set the same role as the current one. Also fails if the provided role name is not found.
func (*OrgUser) Delete ¶
Delete removes the user, returning an error if the call fails. if requested, it will attempt to take ownership before the removal. API Documentation: https://code.vmware.com/apis/442/vcloud-director#/doc/doc/operations/DELETE-User.html Note: in the GUI we need to disable the user before deleting. There is no such constraint with the API.
Expected behaviour: with takeOwnership = true, all entities owned by the user being deleted will be transferred to the caller. with takeOwnership = false, if the user own catalogs, networks, or running VMs/vApps, the call will fail.
If the user owns only powered-off VMs/vApps, the call will succeeds and the VMs/vApps will be removed.
func (*OrgUser) GetRoleName ¶
GetRoleName retrieves the name of the role currently assigned to the user
func (*OrgUser) TakeOwnership ¶
TakeOwnership takes ownership of the user's objects. Ownership is transferred to the caller. This is a call to make before deleting. Calling user.DeleteTakeOwnership() will run TakeOwnership before the actual user removal. API Documentation: https://code.vmware.com/apis/442/vcloud-director#/doc/doc/operations/POST-TakeOwnership.html
func (*OrgUser) Unlock ¶
Unlock unlocks a user that was locked out by the system. Note that there is no procedure to LOCK a user: it is locked by the system when it exceeds the number of unauthorized access attempts
func (*OrgUser) Update ¶
Update updates the user, using its own configuration data returning an error if the call fails. API Documentation: https://code.vmware.com/apis/442/vcloud-director#/doc/doc/operations/PUT-User.html
func (*OrgUser) UpdateSimple ¶
func (user *OrgUser) UpdateSimple(userData OrgUserConfiguration) error
UpdateSimple updates the user, using ALL the fields in userData structure returning an error if the call fails. Careful: DeployedVmQuota and StoredVmQuota use a `0` value to mean "unlimited"
type OrgUserConfiguration ¶
type OrgUserConfiguration struct { Name string // Mandatory Password string // Mandatory RoleName string // Mandatory ProviderType string // Optional: defaults to "INTEGRATED" IsEnabled bool // Optional: defaults to false IsLocked bool // Only used for updates DeployedVmQuota int // Optional: 0 means "unlimited" StoredVmQuota int // Optional: 0 means "unlimited" FullName string // Optional Description string // Optional EmailAddress string // Optional Telephone string // Optional IM string // Optional }
Simplified structure to insert or modify an organization user
type OrgVDCNetwork ¶
type OrgVDCNetwork struct { OrgVDCNetwork *types.OrgVDCNetwork // contains filtered or unexported fields }
OrgVDCNetwork an org vdc network client
func NewOrgVDCNetwork ¶
func NewOrgVDCNetwork(cli *Client) *OrgVDCNetwork
NewOrgVDCNetwork creates an org vdc network client
func (*OrgVDCNetwork) Delete ¶
func (orgVdcNet *OrgVDCNetwork) Delete() (Task, error)
Delete a network. Fails if the network is busy. Returns a task to monitor the deletion.
func (*OrgVDCNetwork) Refresh ¶
func (orgVdcNet *OrgVDCNetwork) Refresh() error
func (*OrgVDCNetwork) Rename ¶
func (orgVdcNet *OrgVDCNetwork) Rename(newName string) error
Rename is a wrapper around Update(), where we only change the name of the network Since the purpose is explicitly changing the name, the function will fail if the new name is not different from the existing one
func (*OrgVDCNetwork) Update ¶
func (orgVdcNet *OrgVDCNetwork) Update() error
Update is a wrapper around UpdateAsync, where we explicitly wait for the task to finish. The pointer receiver is refreshed after update
func (*OrgVDCNetwork) UpdateAsync ¶
func (orgVdcNet *OrgVDCNetwork) UpdateAsync() (Task, error)
UpdateAsync will change the contents of a network using the information in the receiver data structure.
type QueryAdminCatalog ¶
type QueryAdminCatalog types.AdminCatalogRecord
func (QueryAdminCatalog) GetDate ¶
func (catalog QueryAdminCatalog) GetDate() string
func (QueryAdminCatalog) GetHref ¶
func (catalog QueryAdminCatalog) GetHref() string
func (QueryAdminCatalog) GetIp ¶
func (catalog QueryAdminCatalog) GetIp() string
func (QueryAdminCatalog) GetMetadataValue ¶
func (catalog QueryAdminCatalog) GetMetadataValue(key string) string
func (QueryAdminCatalog) GetName ¶
func (catalog QueryAdminCatalog) GetName() string
func (QueryAdminCatalog) GetParentId ¶
func (catalog QueryAdminCatalog) GetParentId() string
func (QueryAdminCatalog) GetParentName ¶
func (catalog QueryAdminCatalog) GetParentName() string
func (QueryAdminCatalog) GetType ¶
func (catalog QueryAdminCatalog) GetType() string
type QueryCatalog ¶
type QueryCatalog types.CatalogRecord
func (QueryCatalog) GetDate ¶
func (catalog QueryCatalog) GetDate() string
func (QueryCatalog) GetHref ¶
func (catalog QueryCatalog) GetHref() string
-------------------------------------------------------------- catalog --------------------------------------------------------------
func (QueryCatalog) GetIp ¶
func (catalog QueryCatalog) GetIp() string
func (QueryCatalog) GetMetadataValue ¶
func (catalog QueryCatalog) GetMetadataValue(key string) string
func (QueryCatalog) GetName ¶
func (catalog QueryCatalog) GetName() string
func (QueryCatalog) GetParentId ¶
func (catalog QueryCatalog) GetParentId() string
func (QueryCatalog) GetParentName ¶
func (catalog QueryCatalog) GetParentName() string
func (QueryCatalog) GetType ¶
func (catalog QueryCatalog) GetType() string
type QueryCatalogItem ¶
type QueryCatalogItem types.QueryResultCatalogItemType
func (QueryCatalogItem) GetDate ¶
func (catItem QueryCatalogItem) GetDate() string
func (QueryCatalogItem) GetHref ¶
func (catItem QueryCatalogItem) GetHref() string
-------------------------------------------------------------- catalog item --------------------------------------------------------------
func (QueryCatalogItem) GetIp ¶
func (catItem QueryCatalogItem) GetIp() string
func (QueryCatalogItem) GetMetadataValue ¶
func (catItem QueryCatalogItem) GetMetadataValue(key string) string
func (QueryCatalogItem) GetName ¶
func (catItem QueryCatalogItem) GetName() string
func (QueryCatalogItem) GetParentId ¶
func (catItem QueryCatalogItem) GetParentId() string
func (QueryCatalogItem) GetParentName ¶
func (catItem QueryCatalogItem) GetParentName() string
func (QueryCatalogItem) GetType ¶
func (catItem QueryCatalogItem) GetType() string
type QueryEdgeGateway ¶
type QueryEdgeGateway types.QueryResultEdgeGatewayRecordType
func (QueryEdgeGateway) GetDate ¶
func (egw QueryEdgeGateway) GetDate() string
func (QueryEdgeGateway) GetHref ¶
func (egw QueryEdgeGateway) GetHref() string
-------------------------------------------------------------- edge gateway --------------------------------------------------------------
func (QueryEdgeGateway) GetIp ¶
func (egw QueryEdgeGateway) GetIp() string
func (QueryEdgeGateway) GetMetadataValue ¶
func (egw QueryEdgeGateway) GetMetadataValue(key string) string
func (QueryEdgeGateway) GetName ¶
func (egw QueryEdgeGateway) GetName() string
func (QueryEdgeGateway) GetParentId ¶
func (egw QueryEdgeGateway) GetParentId() string
func (QueryEdgeGateway) GetParentName ¶
func (egw QueryEdgeGateway) GetParentName() string
func (QueryEdgeGateway) GetType ¶
func (egw QueryEdgeGateway) GetType() string
type QueryItem ¶
type QueryItem interface { GetDate() string GetName() string GetType() string GetIp() string GetMetadataValue(key string) string GetParentName() string GetParentId() string GetHref() string }
QueryItem is an entity that is used to evaluate a Condition
type QueryMedia ¶
type QueryMedia types.MediaRecordType
func (QueryMedia) GetDate ¶
func (media QueryMedia) GetDate() string
func (QueryMedia) GetHref ¶
func (media QueryMedia) GetHref() string
-------------------------------------------------------------- media item --------------------------------------------------------------
func (QueryMedia) GetIp ¶
func (media QueryMedia) GetIp() string
func (QueryMedia) GetMetadataValue ¶
func (media QueryMedia) GetMetadataValue(key string) string
func (QueryMedia) GetName ¶
func (media QueryMedia) GetName() string
func (QueryMedia) GetParentId ¶
func (media QueryMedia) GetParentId() string
func (QueryMedia) GetParentName ¶
func (media QueryMedia) GetParentName() string
func (QueryMedia) GetType ¶
func (media QueryMedia) GetType() string
type QueryOrgVdcNetwork ¶
type QueryOrgVdcNetwork types.QueryResultOrgVdcNetworkRecordType
func (QueryOrgVdcNetwork) GetDate ¶
func (network QueryOrgVdcNetwork) GetDate() string
func (QueryOrgVdcNetwork) GetHref ¶
func (network QueryOrgVdcNetwork) GetHref() string
-------------------------------------------------------------- Org VDC network --------------------------------------------------------------
func (QueryOrgVdcNetwork) GetIp ¶
func (network QueryOrgVdcNetwork) GetIp() string
func (QueryOrgVdcNetwork) GetMetadataValue ¶
func (network QueryOrgVdcNetwork) GetMetadataValue(key string) string
func (QueryOrgVdcNetwork) GetName ¶
func (network QueryOrgVdcNetwork) GetName() string
func (QueryOrgVdcNetwork) GetParentId ¶
func (network QueryOrgVdcNetwork) GetParentId() string
func (QueryOrgVdcNetwork) GetParentName ¶
func (network QueryOrgVdcNetwork) GetParentName() string
func (QueryOrgVdcNetwork) GetType ¶
func (network QueryOrgVdcNetwork) GetType() string
type QueryVAppTemplate ¶
type QueryVAppTemplate types.QueryResultVappTemplateType
All the Query* types are localizations of Query records that can be returned from a query. Each one of these implements the QueryItem interface
func (QueryVAppTemplate) GetDate ¶
func (vappTemplate QueryVAppTemplate) GetDate() string
func (QueryVAppTemplate) GetHref ¶
func (vappTemplate QueryVAppTemplate) GetHref() string
-------------------------------------------------------------- vApp template --------------------------------------------------------------
func (QueryVAppTemplate) GetIp ¶
func (vappTemplate QueryVAppTemplate) GetIp() string
func (QueryVAppTemplate) GetMetadataValue ¶
func (vappTemplate QueryVAppTemplate) GetMetadataValue(key string) string
func (QueryVAppTemplate) GetName ¶
func (vappTemplate QueryVAppTemplate) GetName() string
func (QueryVAppTemplate) GetParentId ¶
func (vappTemplate QueryVAppTemplate) GetParentId() string
func (QueryVAppTemplate) GetParentName ¶
func (vappTemplate QueryVAppTemplate) GetParentName() string
func (QueryVAppTemplate) GetType ¶
func (vappTemplate QueryVAppTemplate) GetType() string
type QueryVapp ¶
type QueryVapp types.QueryResultVAppRecordType
func (QueryVapp) GetHref ¶
-------------------------------------------------------------- vApp --------------------------------------------------------------
func (QueryVapp) GetMetadataValue ¶
func (QueryVapp) GetParentId ¶
func (QueryVapp) GetParentName ¶
type QueryVm ¶
type QueryVm types.QueryResultVMRecordType
func (QueryVm) GetHref ¶
-------------------------------------------------------------- VM --------------------------------------------------------------
func (QueryVm) GetMetadataValue ¶
func (QueryVm) GetParentId ¶
func (QueryVm) GetParentName ¶
type Results ¶
type Results struct { Results *types.QueryResultRecordsType // contains filtered or unexported fields }
func NewResults ¶
type Role ¶
type Role struct { Role *types.Role // contains filtered or unexported fields }
Role uses OpenAPI endpoint to operate user roles
type SimpleNetworkIdentifier ¶
Simplified structure used to list networks connected to an edge gateway
type SupportedVersions ¶
type SupportedVersions struct {
VersionInfos `xml:"VersionInfo"`
}
type Task ¶
type Task struct { Task *types.Task // contains filtered or unexported fields }
func CreateAndConfigureEdgeGatewayAsync ¶
func CreateAndConfigureEdgeGatewayAsync(vcdClient *VCDClient, orgName, vdcName, egwName string, egwConfiguration *types.EdgeGateway) (Task, error)
CreateAndConfigureEdgeGatewayAsync creates an edge gateway using a full configuration structure
func CreateEdgeGatewayAsync ¶
func CreateEdgeGatewayAsync(vcdClient *VCDClient, egwc EdgeGatewayCreation) (Task, error)
CreateEdgeGatewayAsync creates an edge gateway using a simplified configuration structure https://code.vmware.com/apis/442/vcloud-director/doc/doc/operations/POST-CreateEdgeGateway.html
Note. This function does not allow to pick exact subnet in external network to use for edge gateway. It will pick first one instead.
func CreateExternalNetwork ¶
func CreateExternalNetwork(vcdClient *VCDClient, externalNetworkData *types.ExternalNetwork) (Task, error)
CreateExternalNetwork allows create external network and returns Task or error. types.ExternalNetwork struct is general and used for various types of networks. But for external network fence mode is always isolated, isInherited is false, parentNetwork is empty.
func CreateOrg ¶
func CreateOrg(vcdClient *VCDClient, name string, fullName string, description string, settings *types.OrgSettings, isEnabled bool) (Task, error)
Creates an Admin Organization based on settings, description, and org name. The Organization created will have these settings specified in the settings parameter. The settings variable is defined in types.go. Method will fail unless user has an admin token. API Documentation: https://code.vmware.com/apis/220/vcloud#/doc/doc/operations/POST-CreateOrganization.html Organization creation in vCD has two bugs BZ 2177355, BZ 2228936 (fixes are in 9.1.0.3 and 9.5.0.2) which require organization settings to be provided as workarounds. At least one element among DelayAfterPowerOnSeconds, DeployedVMQuota, StoredVmQuota, UseServerBootSequence, getVdcQuota should be set when providing generalOrgSettings. If either VAppLeaseSettings or VAppTemplateLeaseSettings is provided then all elements need to have values, otherwise don't provide them at all. Overall elements must be in the correct order.
func (*Task) CancelTask ¶
func (*Task) GetTaskProgress ¶
func (*Task) WaitInspectTaskCompletion ¶
func (task *Task) WaitInspectTaskCompletion(inspectionFunc InspectionFunc, delay time.Duration) error
Customizable version of WaitTaskCompletion. Users can define the sleeping duration and an optional callback function for extra monitoring.
func (*Task) WaitTaskCompletion ¶
Checks the status of the task every 3 seconds and returns when the task is either completed or failed
type UploadTask ¶
type UploadTask struct { *Task // contains filtered or unexported fields }
func NewUploadTask ¶
func NewUploadTask(task *Task, uploadProgress *mutexedProgress, uploadError *error) *UploadTask
Creates wrapped Task which is dedicated for upload functionality and provides additional functionality to monitor upload progress.
func (*UploadTask) GetUploadError ¶
func (uploadTask *UploadTask) GetUploadError() error
func (*UploadTask) GetUploadProgress ¶
func (uploadTask *UploadTask) GetUploadProgress() string
func (*UploadTask) ShowUploadProgress ¶
func (uploadTask *UploadTask) ShowUploadProgress() error
type VApp ¶
type VApp struct { VApp *types.VApp // contains filtered or unexported fields }
func (*VApp) AddEmptyVm ¶
AddEmptyVm adds an empty VM (without template) to vApp and returns the new created VM or an error.
func (*VApp) AddEmptyVmAsync ¶
func (vapp *VApp) AddEmptyVmAsync(reComposeVAppParams *types.RecomposeVAppParamsForEmptyVm) (Task, error)
AddEmptyVmAsync adds an empty VM (without template) to the vApp and returns a Task and an error.
func (*VApp) AddIsolatedNetwork ¶
func (vapp *VApp) AddIsolatedNetwork(newIsolatedNetworkSettings *VappNetworkSettings) (Task, error)
Function allows to create isolated network for vApp. This is equivalent to vCD UI function - vApp network creation. Deprecated: in favor of vapp.CreateVappNetwork
func (*VApp) AddMetadata ¶
AddMetadata calls private function addMetadata() with vapp.client and vapp.VApp.HREF which adds metadata key/value pair provided as input
func (*VApp) AddNewVM ¶
func (vapp *VApp) AddNewVM(name string, vappTemplate VAppTemplate, network *types.NetworkConnectionSection, acceptAllEulas bool) (Task, error)
AddNewVM adds VM from vApp template with custom NetworkConnectionSection
func (*VApp) AddNewVMWithComputePolicy ¶
func (vapp *VApp) AddNewVMWithComputePolicy(name string, vappTemplate VAppTemplate, network *types.NetworkConnectionSection, storageProfileRef *types.Reference, computePolicy *types.VdcComputePolicy, acceptAllEulas bool) (Task, error)
AddNewVMWithComputePolicy adds VM from vApp template with custom NetworkConnectionSection and optional storage profile and compute policy
func (*VApp) AddNewVMWithStorageProfile ¶
func (vapp *VApp) AddNewVMWithStorageProfile(name string, vappTemplate VAppTemplate, network *types.NetworkConnectionSection, storageProfileRef *types.Reference, acceptAllEulas bool) (Task, error)
AddNewVMWithStorageProfile adds VM from vApp template with custom NetworkConnectionSection and optional storage profile
func (*VApp) AddOrgNetwork ¶
func (vapp *VApp) AddOrgNetwork(newNetworkSettings *VappNetworkSettings, orgNetwork *types.OrgVDCNetwork, isFenced bool) (*types.NetworkConfigSection, error)
AddOrgNetwork adds Org VDC network as vApp network. Returns pointer to types.NetworkConfigSection or error
func (*VApp) AddOrgNetworkAsync ¶
func (vapp *VApp) AddOrgNetworkAsync(newNetworkSettings *VappNetworkSettings, orgNetwork *types.OrgVDCNetwork, isFenced bool) (Task, error)
AddOrgNetworkAsync adds asynchronously Org VDC network as vApp network. Returns Task or error
func (*VApp) AddRAWNetworkConfig ¶
AddRAWNetworkConfig adds existing VDC network to vApp Deprecated: in favor of vapp.AddOrgNetwork
func (*VApp) AddVM
deprecated
func (vapp *VApp) AddVM(orgVdcNetworks []*types.OrgVDCNetwork, vappNetworkName string, vappTemplate VAppTemplate, name string, acceptAllEulas bool) (Task, error)
AddVM create vm in vApp using vApp template orgVdcNetworks - adds org VDC networks to be available for vApp. Can be empty. vappNetworkName - adds vApp network to be available for vApp. Can be empty. vappTemplate - vApp Template which will be used for VM creation. name - name for VM. acceptAllEulas - setting allows to automatically accept or not Eulas.
Deprecated: Use vapp.AddNewVM instead for more sophisticated network handling
func (*VApp) BlockWhileStatus ¶
BlockWhileStatus blocks until the status of vApp exits unwantedStatus. It sleeps 200 milliseconds between iterations and times out after timeOutAfterSeconds of seconds.
func (*VApp) ChangeCPUCount ¶
Sets number of available virtual logical processors (i.e. CPUs x cores per socket) https://communities.vmware.com/thread/576209 Deprecated: Use vm.ChangeCPUcount()
func (*VApp) ChangeCPUCountWithCore ¶
Sets number of available virtual logical processors (i.e. CPUs x cores per socket) and cores per socket. Socket count is a result of: virtual logical processors/cores per socket https://communities.vmware.com/thread/576209 Deprecated: Use vm.ChangeCPUCountWithCore()
func (*VApp) ChangeMemorySize ¶
Deprecated as it changes only first VM's memory
func (*VApp) ChangeNetworkConfig ¶
func (*VApp) ChangeStorageProfile ¶
func (*VApp) ChangeVMName ¶
Deprecated as it changes only first VM's name
func (*VApp) CreateVappNetwork ¶
func (vapp *VApp) CreateVappNetwork(newNetworkSettings *VappNetworkSettings, orgNetwork *types.OrgVDCNetwork) (*types.NetworkConfigSection, error)
CreateVappNetwork creates isolated or nat routed(connected to Org VDC network) network for vApp. Returns pointer to types.NetworkConfigSection or error If orgNetwork is nil, then isolated network created.
func (*VApp) CreateVappNetworkAsync ¶
func (vapp *VApp) CreateVappNetworkAsync(newNetworkSettings *VappNetworkSettings, orgNetwork *types.OrgVDCNetwork) (Task, error)
CreateVappNetworkAsync creates asynchronously isolated or nat routed network for vApp. Returns Task or error If orgNetwork is nil, then isolated network created.
func (*VApp) DeleteMetadata ¶
DeleteMetadata() function calls private function deleteMetadata() with vapp.client and vapp.VApp.HREF which deletes metadata depending on key provided as input from vApp.
func (VApp) GetAccessControl ¶
GetAccessControl retrieves the access control information for this vApp
func (*VApp) GetMetadata ¶
GetMetadata calls private function getMetadata() with vapp.client and vapp.VApp.HREF which returns a *types.Metadata struct for provided vapp input.
func (*VApp) GetNetworkConfig ¶
func (*VApp) GetNetworkConnectionSection ¶
func (*VApp) GetProductSectionList ¶
GetProductSectionList retrieves product section for a vApp. It allows to read vApp guest properties.
The slice of properties "ProductSectionList.ProductSection.Property" is not necessarily ordered or returned as set before
func (*VApp) GetVMById ¶
GetVMById returns a VM reference if the VM ID matches an existing one. If no valid VM is found, it returns a nil VM reference and an error
func (*VApp) GetVMByName ¶
GetVMByName returns a VM reference if the VM name matches an existing one. If no valid VM is found, it returns a nil VM reference and an error
func (*VApp) GetVMByNameOrId ¶
GetVMByNameOrId returns a VM reference if either the VM name or ID matches an existing one. If no valid VM is found, it returns a nil VM reference and an error
func (*VApp) GetVappNetworkById ¶
GetVappNetworkById returns a VApp network reference if the vApp network ID matches an existing one. If no valid VApp network is found, it returns a nil VApp network reference and an error
func (*VApp) GetVappNetworkByName ¶
func (vapp *VApp) GetVappNetworkByName(vappNetworkName string, refresh bool) (*types.VAppNetwork, error)
GetVappNetworkByName returns a VAppNetwork reference if the vApp network name matches an existing one. If no valid vApp network is found, it returns a nil VAppNetwork reference and an error
func (*VApp) GetVappNetworkByNameOrId ¶
func (vapp *VApp) GetVappNetworkByNameOrId(identifier string, refresh bool) (*types.VAppNetwork, error)
GetVappNetworkByNameOrId returns a types.VAppNetwork reference if either the vApp network name or ID matches an existing one. If no valid vApp network is found, it returns a nil types.VAppNetwork reference and an error
func (VApp) IsShared ¶
IsShared shows whether a vApp is shared or not, regardless of the number of subjects sharing it
func (VApp) RemoveAccessControl ¶
RemoveAccessControl is a shortcut to SetAccessControl with all access disabled
func (*VApp) RemoveAllNetworkFirewallRules ¶
RemoveAllNetworkFirewallRules removes all network firewall rules from a vApp network. Returns error
func (*VApp) RemoveAllNetworkNatRules ¶
RemoveAllNetworkNatRules removes all NAT rules from a vApp network Returns error
func (*VApp) RemoveAllNetworkStaticRoutes ¶
RemoveAllNetworkStaticRoutes removes all static routes from a vApp network Returns error
func (*VApp) RemoveAllNetworks ¶
RemoveAllNetworks detaches all networks from vApp
func (*VApp) RemoveIsolatedNetwork ¶
Removes vApp isolated network Deprecated: in favor vapp.RemoveNetwork
func (*VApp) RemoveNetwork ¶
RemoveNetwork removes any network (be it isolated or connected to an Org Network) from vApp Returns pointer to types.NetworkConfigSection or error
func (*VApp) RemoveNetworkAsync ¶
RemoveNetworkAsync asynchronously removes any network (be it isolated or connected to an Org Network) from vApp Accepts network ID or name
func (*VApp) RemoveVM ¶
========================= issue#252 ================================== TODO: To be refactored, handling networks better. See issue#252 for details https://github.com/vmware/go-vcloud-director/issues/252 ======================================================================
func (*VApp) RunCustomizationScript ¶
func (VApp) SetAccessControl ¶
func (vapp VApp) SetAccessControl(accessControl *types.ControlAccessParams, useTenantContext bool) error
SetAccessControl changes the access control information for this vApp
func (*VApp) SetProductSectionList ¶
func (vapp *VApp) SetProductSectionList(productSection *types.ProductSectionList) (*types.ProductSectionList, error)
SetProductSectionList sets product section for a vApp. It allows to change vApp guest properties.
The slice of properties "ProductSectionList.ProductSection.Property" is not necessarily ordered or returned as set before
func (*VApp) UpdateNetwork ¶
func (vapp *VApp) UpdateNetwork(newNetworkSettings *VappNetworkSettings, orgNetwork *types.OrgVDCNetwork) (*types.NetworkConfigSection, error)
UpdateNetwork updates vApp networks (isolated or connected to Org VDC network) Returns pointer to types.NetworkConfigSection or error
func (*VApp) UpdateNetworkAsync ¶
func (vapp *VApp) UpdateNetworkAsync(networkSettingsToUpdate *VappNetworkSettings, orgNetwork *types.OrgVDCNetwork) (Task, error)
UpdateNetworkAsync asynchronously updates vApp networks (isolated or connected to Org VDC network). Returns task or error
func (*VApp) UpdateNetworkFirewallRules ¶
func (vapp *VApp) UpdateNetworkFirewallRules(networkId string, firewallRules []*types.FirewallRule, enabled bool, defaultAction string, logDefaultAction bool) (*types.VAppNetwork, error)
UpdateNetworkFirewallRules updates vApp networks firewall rules. It will overwrite existing ones as there is no 100% way to identify them separately. Returns pointer to types.VAppNetwork or error
func (*VApp) UpdateNetworkFirewallRulesAsync ¶
func (vapp *VApp) UpdateNetworkFirewallRulesAsync(networkId string, firewallRules []*types.FirewallRule, enabled bool, defaultAction string, logDefaultAction bool) (Task, error)
UpdateNetworkFirewallRulesAsync asynchronously updates vApp networks firewall rules. It will overwrite existing ones as there is no 100% way to identify them separately. Returns task or error
func (*VApp) UpdateNetworkNatRules ¶
func (vapp *VApp) UpdateNetworkNatRules(networkId string, natRules []*types.NatRule, enabled bool, natType, policy string) (*types.VAppNetwork, error)
UpdateNetworkNatRules updates vApp networks NAT rules. Returns pointer to types.VAppNetwork or error
func (*VApp) UpdateNetworkNatRulesAsync ¶
func (vapp *VApp) UpdateNetworkNatRulesAsync(networkId string, natRules []*types.NatRule, enabled bool, natType, policy string) (Task, error)
UpdateNetworkNatRulesAsync asynchronously updates vApp NAT rules. Returns task or error
func (*VApp) UpdateNetworkStaticRouting ¶
func (vapp *VApp) UpdateNetworkStaticRouting(networkId string, staticRoutes []*types.StaticRoute, enabled bool) (*types.VAppNetwork, error)
UpdateNetworkStaticRouting updates vApp network static routes. Returns pointer to types.VAppNetwork or error
func (*VApp) UpdateNetworkStaticRoutingAsync ¶
func (vapp *VApp) UpdateNetworkStaticRoutingAsync(networkId string, staticRoutes []*types.StaticRoute, enabled bool) (Task, error)
UpdateNetworkStaticRoutingAsync asynchronously updates vApp network static routes. Returns task or error
func (*VApp) UpdateOrgNetwork ¶
func (vapp *VApp) UpdateOrgNetwork(newNetworkSettings *VappNetworkSettings, isFenced bool) (*types.NetworkConfigSection, error)
UpdateOrgNetwork updates Org VDC network which is part of a vApp Returns pointer to types.NetworkConfigSection or error
func (*VApp) UpdateOrgNetworkAsync ¶
func (vapp *VApp) UpdateOrgNetworkAsync(networkSettingsToUpdate *VappNetworkSettings, isFenced bool) (Task, error)
UpdateOrgNetworkAsync asynchronously updates Org VDC network which is part of a vApp Returns task or error
type VAppTemplate ¶
type VAppTemplate struct { VAppTemplate *types.VAppTemplate // contains filtered or unexported fields }
func NewVAppTemplate ¶
func NewVAppTemplate(cli *Client) *VAppTemplate
func (*VAppTemplate) AddMetadata ¶
func (vAppTemplate *VAppTemplate) AddMetadata(key string, value string) (*VAppTemplate, error)
AddMetadata adds metadata key/value pair provided as input and returned update VAppTemplate
func (*VAppTemplate) AddMetadataAsync ¶
func (vAppTemplate *VAppTemplate) AddMetadataAsync(key string, value string) (Task, error)
AddMetadataAsync calls private function addMetadata() with vAppTemplate.client and vAppTemplate.VAppTemplate.HREF which adds metadata key/value pair provided as input.
func (*VAppTemplate) DeleteMetadata ¶
func (vAppTemplate *VAppTemplate) DeleteMetadata(key string) error
DeleteMetadata deletes metadata depending on key provided as input from media item.
func (*VAppTemplate) DeleteMetadataAsync ¶
func (vAppTemplate *VAppTemplate) DeleteMetadataAsync(key string) (Task, error)
DeleteMetadataAsync calls private function deleteMetadata() with vAppTemplate.client and vAppTemplate.VAppTemplate.HREF which deletes metadata depending on key provided as input from catalog item.
func (*VAppTemplate) GetMetadata ¶
func (vAppTemplate *VAppTemplate) GetMetadata() (*types.Metadata, error)
GetMetadata calls private function getMetadata() with catalogItem.client and catalogItem.CatalogItem.HREF which returns a *types.Metadata struct for provided catalog item input.
func (*VAppTemplate) Refresh ¶
func (vAppTemplate *VAppTemplate) Refresh() error
Refresh refreshes the vApp template item information by href
type VCDClient ¶
type VCDClient struct { Client Client // Client for the underlying VCD instance QueryHREF url.URL // HREF for the query API // contains filtered or unexported fields }
func NewVCDClient ¶
func NewVCDClient(vcdEndpoint url.URL, insecure bool, options ...VCDClientOption) *VCDClient
NewVCDClient initializes VMware vCloud Director client with reasonable defaults. It accepts functions of type VCDClientOption for adjusting defaults.
func (*VCDClient) Authenticate ¶
Authenticate is a helper function that performs a login in vCloud Director.
func (*VCDClient) Disconnect ¶
Disconnect performs a disconnection from the vCloud Director API endpoint.
func (*VCDClient) GetAdminOrgById ¶
GetAdminOrgById finds an Admin Organization by ID On success, returns a pointer to the Admin Org structure and a nil error On failure, returns a nil pointer and an error
func (*VCDClient) GetAdminOrgByName ¶
GetAdminOrgByName finds an Admin Organization by name On success, returns a pointer to the Admin Org structure and a nil error On failure, returns a nil pointer and an error
func (*VCDClient) GetAdminOrgByNameOrId ¶
GetAdminOrgByNameOrId finds an Admin Organization by name or ID On success, returns a pointer to the Admin Org structure and a nil error On failure, returns a nil pointer and an error
func (*VCDClient) GetAllImportableNsxtTier0Routers ¶
func (vcdCli *VCDClient) GetAllImportableNsxtTier0Routers(nsxtManagerId string, queryParameters url.Values) ([]*NsxtTier0Router, error)
GetAllImportableNsxtTier0Routers retrieves all NSX-T Tier-0 routers using OpenAPI endpoint. Query parameters can be supplied to perform additional filtering. By default it injects FIQL filter _context==nsxtManagerId (e.g. _context==urn:vcloud:nsxtmanager:09722307-aee0-4623-af95-7f8e577c9ebc) because it is mandatory to list child Tier-0 routers.
Warning. The API returns only unused Tier-0 routers (the ones that are not used in external networks yet)
Note. IDs of Tier-0 routers do not have a standard and may look as strings when they are created using UI or as UUIDs when they are created using API
func (*VCDClient) GetAuthResponse ¶
GetAuthResponse performs authentication and returns the full HTTP response The purpose of this function is to preserve information that is useful for token-based authentication
func (*VCDClient) GetExternalNetworkById ¶
func (vcdClient *VCDClient) GetExternalNetworkById(id string) (*ExternalNetwork, error)
GetExternalNetworkById returns an ExternalNetwork reference if the network ID matches an existing one. If no valid external network is found, it returns a nil ExternalNetwork reference and an error
func (*VCDClient) GetExternalNetworkByName ¶
func (vcdClient *VCDClient) GetExternalNetworkByName(networkName string) (*ExternalNetwork, error)
GetExternalNetworkByName returns an ExternalNetwork reference if the network name matches an existing one. If no valid external network is found, it returns a nil ExternalNetwork reference and an error
func (*VCDClient) GetExternalNetworkByNameOrId ¶
func (vcdClient *VCDClient) GetExternalNetworkByNameOrId(identifier string) (*ExternalNetwork, error)
GetExternalNetworkByNameOrId returns an ExternalNetwork reference if either the network name or ID matches an existing one. If no valid external network is found, it returns a nil ExternalNetwork reference and an error
func (*VCDClient) GetExternalNetworks ¶
GetExternalNetworks returns a list of available external networks
func (*VCDClient) GetImportableNsxtTier0RouterByName ¶
func (vcdCli *VCDClient) GetImportableNsxtTier0RouterByName(name, nsxtManagerId string) (*NsxtTier0Router, error)
func (*VCDClient) GetOrgById ¶
GetOrgById finds an Organization by ID On success, returns a pointer to the Org structure and a nil error On failure, returns a nil pointer and an error
func (*VCDClient) GetOrgByName ¶
GetOrgByName finds an Organization by name On success, returns a pointer to the Org structure and a nil error On failure, returns a nil pointer and an error
func (*VCDClient) GetOrgByNameOrId ¶
GetOrgByNameOrId finds an Organization by name or ID On success, returns a pointer to the Org structure and a nil error On failure, returns a nil pointer and an error
func (*VCDClient) GetOrgList ¶
GetOrgList returns the list ov available orgs
func (*VCDClient) QueryNetworkPools ¶
QueryNetworkPools gets the list of network pools
func (*VCDClient) QueryNsxtManagerByName ¶
func (vcdCli *VCDClient) QueryNsxtManagerByName(name string) ([]*types.QueryResultNsxtManagerRecordType, error)
QueryNsxtManagerByName searches for NSX-T managers available in VCD
func (*VCDClient) QueryProviderVdcStorageProfiles ¶
func (vcdClient *VCDClient) QueryProviderVdcStorageProfiles() ([]*types.QueryResultProviderVdcStorageProfileRecordType, error)
QueryProviderVdcStorageProfiles gets the list of provider VDC storage profiles
func (*VCDClient) QueryProviderVdcs ¶
func (vcdClient *VCDClient) QueryProviderVdcs() ([]*types.QueryResultVMWProviderVdcRecordType, error)
QueryProviderVdcs gets the list of available provider VDCs
func (*VCDClient) QueryWithNotEncodedParams ¶
func (*VCDClient) QueryWithNotEncodedParamsWithApiVersion ¶
func (*VCDClient) SetToken ¶
SetToken will set the authorization token in the client, without using other credentials Up to version 29, token authorization uses the the header key x-vcloud-authorization In version 30+ it also uses X-Vmware-Vcloud-Access-Token:TOKEN coupled with X-Vmware-Vcloud-Token-Type:"bearer"
type VCDClientOption ¶
VCDClientOption defines signature for customizing VCDClient using functional options pattern.
func WithAPIVersion ¶
func WithAPIVersion(version string) VCDClientOption
WithAPIVersion allows to override default API version. Please be cautious about changing the version as the default specified is the most tested.
func WithHttpTimeout ¶
func WithHttpTimeout(timeout int64) VCDClientOption
WithHttpTimeout allows to override default http timeout
func WithHttpUserAgent ¶
func WithHttpUserAgent(userAgent string) VCDClientOption
WithHttpUserAgent allows to specify HTTP user-agent which can be useful for statistics tracking. By default User-Agent is set to "go-vcloud-director". It can be unset by supplying empty value.
func WithMaxRetryTimeout ¶
func WithMaxRetryTimeout(timeoutSeconds int) VCDClientOption
WithMaxRetryTimeout allows default vCDClient MaxRetryTimeout value override
func WithSamlAdfs ¶
func WithSamlAdfs(useSaml bool, customAdfsRptId string) VCDClientOption
WithSamlAdfs specifies if SAML auth is used for authenticating to vCD instead of local login. The following conditions must be met so that SAML authentication works: * SAML IdP (Identity Provider) is Active Directory Federation Service (ADFS) * WS-Trust authentication endpoint "/adfs/services/trust/13/usernamemixed" must be enabled on ADFS server By default vCD SAML Entity ID will be used as Relaying Party Trust Identifier unless customAdfsRptId is specified
type VM ¶
type VM struct { VM *types.VM // contains filtered or unexported fields }
func (*VM) AddInternalDisk ¶
AddInternalDisk creates disk type *types.DiskSettings to the VM. Returns new disk ID and error. Runs synchronously, VM is ready for another operation after this function returns.
func (*VM) AddMetadata ¶
AddMetadata calls private function addMetadata() with vm.client and vm.VM.HREF which adds metadata key/value pair provided as input to VM.
func (*VM) AnswerQuestion ¶
Use the provide answer to existing VM question for operation which need additional response Reference: https://code.vmware.com/apis/287/vcloud#/doc/doc/operations/POST-AnswerVmPendingQuestion.html
func (*VM) AttachDisk ¶
Attach an independent disk Call attachOrDetachDisk with disk and types.RelDiskAttach to attach an independent disk. Please verify the independent disk is not connected to any VM before calling this function. If the independent disk is connected to a VM, the task will be failed. Reference: vCloud API Programming Guide for Service Providers vCloud API 30.0 PDF Page 164 - 165, https://vdc-download.vmware.com/vmwb-repository/dcr-public/1b6cf07d-adb3-4dba-8c47-9c1c92b04857/ 241956dd-e128-4fcc-8131-bf66e1edd895/vcloud_sp_api_guide_30_0.pdf
func (*VM) BlockWhileGuestCustomizationStatus ¶
func (vm *VM) BlockWhileGuestCustomizationStatus(unwantedStatus string, timeOutAfterSeconds int) error
BlockWhileGuestCustomizationStatus blocks until the customization status of VM exits unwantedStatus. It sleeps 3 seconds between iterations and times out after timeOutAfterSeconds of seconds.
timeOutAfterSeconds must be more than 4 and less than 2 hours (60s*120)
func (*VM) ChangeCPUCount ¶
Sets number of available virtual logical processors (i.e. CPUs x cores per socket) Cpu cores count is inherited from template. https://communities.vmware.com/thread/576209
func (*VM) ChangeCPUCountWithCore ¶
Sets number of available virtual logical processors (i.e. CPUs x cores per socket) and cores per socket. Socket count is a result of: virtual logical processors/cores per socket https://communities.vmware.com/thread/576209
func (*VM) ChangeNetworkConfig ¶
ChangeNetworkConfig allows to update existing VM NIC configuration.f
func (*VM) DeleteInternalDisk ¶
DeleteInternalDisk delete disk using provided disk ID. Runs synchronously, VM is ready for another operation after this function returns.
func (*VM) DeleteMetadata ¶
DeleteMetadata() function calls private function deleteMetadata() with vm.client and vm.VM.HREF which deletes metadata depending on key provided as input from VM.
func (*VM) DetachDisk ¶
Detach an independent disk Call attachOrDetachDisk with disk and types.RelDiskDetach to detach an independent disk. Please verify the independent disk is connected the VM before calling this function. If the independent disk is not connected to the VM, the task will be failed. Reference: vCloud API Programming Guide for Service Providers vCloud API 30.0 PDF Page 164 - 165, https://vdc-download.vmware.com/vmwb-repository/dcr-public/1b6cf07d-adb3-4dba-8c47-9c1c92b04857/ 241956dd-e128-4fcc-8131-bf66e1edd895/vcloud_sp_api_guide_30_0.pdf
func (*VM) EjectMedia ¶
Eject media from VM Call insertOrEjectMedia with media and types.RelMediaEjectMedia to eject media from VM. If media isn't inserted then task still will be successful.
func (*VM) GetGuestCustomizationSection ¶
GetGuestCustomizationSection retrieves guest customization section for a VM. It allows to read VM guest customization properties.
func (*VM) GetGuestCustomizationStatus ¶
GetGuestCustomizationStatus retrieves guest customization status. It can be one of "GC_PENDING", "REBOOT_PENDING", "GC_FAILED", "POST_GC_PENDING", "GC_COMPLETE"
func (*VM) GetInternalDiskById ¶
GetInternalDiskById returns a *types.DiskSettings if one exists. If it doesn't, returns nil and ErrorEntityNotFound or other err.
func (*VM) GetMetadata ¶
GetMetadata calls private function getMetadata() with vm.client and vm.VM.HREF which returns a *types.Metadata struct for provided VM input.
func (*VM) GetNetworkConnectionSection ¶
GetNetworkConnectionSection returns current networks attached to VM
The slice of NICs is not necessarily ordered by NIC index
func (*VM) GetParentVApp ¶
GetParentVApp find parent vApp for VM by checking its "up" "link".
Note. The VM has a parent vApp defined even if it was created as a standalone
func (*VM) GetParentVdc ¶
GetParentVdc returns parent VDC for VM
func (*VM) GetProductSectionList ¶
GetProductSectionList retrieves product section for a VM. It allows to read VM guest properties.
The slice of properties "ProductSectionList.ProductSection.Property" is not necessarily ordered or returned as set before
func (*VM) GetQuestion ¶
Use the get existing VM question for operation which need additional response Reference: https://code.vmware.com/apis/287/vcloud#/doc/doc/operations/GET-VmPendingQuestion.html
func (*VM) GetVirtualHardwareSection ¶
GetVirtualHardwareSection returns the virtual hardware items attached to a VM
func (*VM) HandleEjectMedia ¶
Helper function which finds media and calls EjectMedia
func (*VM) HandleEjectMediaAndAnswer ¶
func (vm *VM) HandleEjectMediaAndAnswer(org *Org, catalogName, mediaName string, answerYes bool) (*VM, error)
HandleEjectMediaAndAnswer helper function which finds media, calls EjectMedia, waits for task to complete and answer question. Also waits until VM status refreshes - this added as 9.7-10.0 vCD versions has lag in status update. answerYes - handles question risen when VM is running. True value enforces ejection.
func (*VM) HandleInsertMedia ¶
Helper function which finds media and calls InsertMedia
func (*VM) InsertMedia ¶
Insert media for VM Call insertOrEjectMedia with media and types.RelMediaInsertMedia to insert media from VM.
func (*VM) IsDeployed ¶
IsDeployed checks if the VM is deployed or not
func (*VM) PowerOnAndForceCustomization ¶
PowerOnAndForceCustomization is a synchronous function which is equivalent to the functionality one has in UI. It triggers customization which may be useful in some cases (like altering NICs)
The VM _must_ be un-deployed for this action to actually work.
func (*VM) RunCustomizationScript ¶
func (*VM) SetGuestCustomizationSection ¶
func (vm *VM) SetGuestCustomizationSection(guestCustomizationSection *types.GuestCustomizationSection) (*types.GuestCustomizationSection, error)
SetGuestCustomizationSection sets guest customization section for a VM. It allows to change VM guest customization properties.
func (*VM) SetProductSectionList ¶
func (vm *VM) SetProductSectionList(productSection *types.ProductSectionList) (*types.ProductSectionList, error)
SetProductSectionList sets product section for a VM. It allows to change VM guest properties.
The slice of properties "ProductSectionList.ProductSection.Property" is not necessarily ordered or returned as set before
func (*VM) ToggleHardwareVirtualization ¶
ToggleHardwareVirtualization allows to either enable or disable hardware assisted CPU virtualization for the VM. It can only be performed on a powered off VM and will return an error otherwise. This is mainly useful for hypervisor nesting.
func (*VM) Undeploy ¶
Undeploy triggers a VM undeploy and power off action. "Power off" action in UI behaves this way.
func (*VM) UpdateComputePolicy ¶
UpdateComputePolicy updates VM compute policy and returns refreshed VM or error.
func (*VM) UpdateComputePolicyAsync ¶
UpdateComputePolicyAsync updates VM Compute policy and returns Task and error.
func (*VM) UpdateInternalDisks ¶
func (vm *VM) UpdateInternalDisks(disksSettingToUpdate *types.VmSpecSection) (*types.VmSpecSection, error)
UpdateInternalDisks applies disks configuration for the VM. types.VmSpecSection has to have all internal disk state. Disks which don't match provided ones in types.VmSpecSection will be deleted. Matched internal disk will be updated. New internal disk description found in types.VmSpecSection will be created. Returns updated types.VmSpecSection and error. Runs synchronously, VM is ready for another operation after this function returns.
func (*VM) UpdateInternalDisksAsync ¶
UpdateInternalDisksAsync applies disks configuration for the VM. types.VmSpecSection has to have all internal disk state. Disks which don't match provided ones in types.VmSpecSection will be deleted. Matched internal disk will be updated. New internal disk description found in types.VmSpecSection will be created. Returns Task and error.
func (*VM) UpdateNetworkConnectionSection ¶
UpdateNetworkConnectionSection applies network configuration of types.NetworkConnectionSection for the VM Runs synchronously, VM is ready for another operation after this function returns.
func (*VM) UpdateStorageProfile ¶
UpdateStorageProfile updates VM storage profile and returns refreshed VM or error.
func (*VM) UpdateStorageProfileAsync ¶
UpdateStorageProfileAsync updates VM storage profile and returns Task and error.
func (*VM) UpdateVmCpuAndMemoryHotAdd ¶
UpdateVmCpuAndMemoryHotAdd updates VM Capabilities and returns refreshed VM or error.
func (*VM) UpdateVmCpuAndMemoryHotAddAsync ¶
UpdateVmCpuAndMemoryHotAddAsync updates VM Capabilities and returns Task and error.
func (*VM) UpdateVmSpecSection ¶
func (vm *VM) UpdateVmSpecSection(vmSettingsToUpdate *types.VmSpecSection, description string) (*VM, error)
UpdateVmSpecSection updates VM Spec section and returns refreshed VM or error.
func (*VM) UpdateVmSpecSectionAsync ¶
func (vm *VM) UpdateVmSpecSectionAsync(vmSettingsToUpdate *types.VmSpecSection, description string) (Task, error)
UpdateVmSpecSectionAsync updates VM Spec section and returns Task and error.
func (*VM) WaitForDhcpIpByNicIndexes ¶
func (vm *VM) WaitForDhcpIpByNicIndexes(nicIndexes []int, maxWaitSeconds int, useDhcpLeaseCheck bool) ([]string, bool, error)
WaitForDhcpIpByNicIndexes accepts a slice of NIC indexes in VM, tries to get these IPs up to maxWaitSeconds and then returns: * a list of IPs * whether the function hit timeout (some IP values may be available after timeout) * error
This function checks a slice of nicIndexes and reuses all possible API calls. It may return a partial result for IP addresses when the timeout is hit.
Getting a DHCP address is complicated because vCD (in UI and in types.NetworkConnectionSection) reports IP addresses only when guest tools are present on a VM. This function also attempts to check if VM NICs are attached to routed network on edge gateway - then there is a chance that built-in DHCP pools are used and active DHCP leases can be found.
For this function to work - at least one the following must be true: * VM has guest tools (vCD UI shows IP address). (Takes longer time) * VM DHCP interface is connected to routed Org network and is using Edge Gateway DHCP. (Takes less time, but is more constrained)
type VMRecord ¶
type VMRecord struct { VM *types.QueryResultVMRecordType // contains filtered or unexported fields }
func NewVMRecord ¶
create instance with reference to types.QueryResultVMRecordType
type VappNetworkSettings ¶
type VappNetworkSettings struct { ID string Name string Description string Gateway string NetMask string DNS1 string DNS2 string DNSSuffix string GuestVLANAllowed *bool StaticIPRanges []*types.IPRange DhcpSettings *DhcpSettings RetainIpMacEnabled *bool VappFenceEnabled *bool }
struct type used to pass information for vApp network creation
type VappTemplateData ¶
type VappTemplateData struct { Name string ItemCreationDate string VappTemplateCreationDate string Metadata StringMap Created bool }
func HelperCreateMultipleCatalogItems ¶
func HelperCreateMultipleCatalogItems(catalog *Catalog, requestData []VappTemplateData, verbose bool) ([]VappTemplateData, error)
HelperCreateMultipleCatalogItems deploys several catalog items, as defined in requestData Returns a set of VappTemplateData with what was created. If the requested objects exist already, returns updated information about the existing items.
type VcdVersion ¶
VcdVersion contains the full information about a VCD version
type Vdc ¶
type Vdc struct { Vdc *types.Vdc // contains filtered or unexported fields }
func (*Vdc) AddMetadata ¶
AddMetadata adds metadata key/value pair provided as input to VDC.
func (*Vdc) AddMetadataAsync ¶
AddMetadata adds metadata key/value pair provided as input to VDC. and returns task
func (*Vdc) ComposeRawVApp ¶
func (*Vdc) ComposeVApp ¶
func (vdc *Vdc) ComposeVApp(orgvdcnetworks []*types.OrgVDCNetwork, vapptemplate VAppTemplate, storageprofileref types.Reference, name string, description string, acceptalleulas bool) (Task, error)
ComposeVApp creates a vapp with the given template, name, and description that uses the storageprofile and networks given. If you want all eulas to be accepted set acceptalleulas to true. Returns a successful task if completed successfully, otherwise returns an error and an empty task.
func (*Vdc) CreateDisk ¶
Create an independent disk in VDC Reference: vCloud API Programming Guide for Service Providers vCloud API 30.0 PDF Page 102 - 103, https://vdc-download.vmware.com/vmwb-repository/dcr-public/1b6cf07d-adb3-4dba-8c47-9c1c92b04857/ 241956dd-e128-4fcc-8131-bf66e1edd895/vcloud_sp_api_guide_30_0.pdf
func (*Vdc) CreateNsxvIpSet ¶
CreateNsxvIpSet creates an IP set from *types.EdgeIpSet. IP set defines a group of IP addresses that you can add as the source or destination in a firewall rule or in DHCP relay configuration.
func (*Vdc) CreateOrgVDCNetwork ¶
Fine tuning network creation function. Return an error (the result of the network creation) and a task (used to monitor the network configuration) This function can create any type of Org Vdc network. The exact type is determined by the combination of properties given with the network configuration structure.
func (*Vdc) CreateOrgVDCNetworkWait ¶
A wrapper call around CreateOrgVDCNetwork. Creates a network and then uses the associated task to monitor its configuration
func (*Vdc) CreateVmAffinityRule ¶
func (vdc *Vdc) CreateVmAffinityRule(affinityRuleDef *types.VmAffinityRule) (*VmAffinityRule, error)
CreateVmAffinityRule is a wrap around CreateVmAffinityRuleAsync that handles the task and returns the finished object
func (*Vdc) CreateVmAffinityRuleAsync ¶
CreateVmAffinityRuleAsync creates a new VM affinity rule, and returns a task that handles the operation
func (*Vdc) Delete ¶
Deletes the vdc, returning an error of the vCD call fails. API Documentation: https://code.vmware.com/apis/220/vcloud#/doc/doc/operations/DELETE-Vdc.html
func (*Vdc) DeleteMetadata ¶
DeleteMetadata() function deletes metadata by key provided as input
func (*Vdc) DeleteMetadataAsync ¶
DeleteMetadata() function deletes metadata by key provided as input and returns task
func (*Vdc) DeleteNsxvIpSetById ¶
DeleteNsxvIpSetById deletes IP set by its ID which is formatted as f9daf2da-b4f9-4921-a2f4-d77a943a381c:ipset-9
func (*Vdc) DeleteNsxvIpSetByName ¶
DeleteNsxvIpSetById deletes IP set by its name
func (*Vdc) DeleteWait ¶
Deletes the vdc and waits for the asynchronous task to complete.
func (*Vdc) FindDiskByHREF ¶
Find an independent disk by disk href in VDC Deprecated: Use VDC.GetDiskByHref()
func (*Vdc) FindEdgeGateway
deprecated
func (vdc *Vdc) FindEdgeGateway(edgegateway string) (EdgeGateway, error)
Deprecated: use GetEdgeGatewayByName
func (*Vdc) FindEdgeGatewayNameByNetwork ¶
FindEdgeGatewayNameByNetwork searches the VDC for a connection between an edge gateway and a given network. On success, returns the name of the edge gateway
func (*Vdc) FindMediaImage ¶
FindMediaImage returns media image found in system using `name` as query. Can find a few of them if media with same name exist in different catalogs. Deprecated: Use catalog.GetMediaByName()
func (*Vdc) FindStorageProfileReference ¶
func (*Vdc) FindVAppByID
deprecated
func (*Vdc) FindVAppByName
deprecated
func (*Vdc) FindVDCNetwork
deprecated
func (vdc *Vdc) FindVDCNetwork(network string) (OrgVDCNetwork, error)
Deprecated: use GetOrgVdcNetworkByName
func (*Vdc) GetAllNsxtEdgeClusters ¶ added in v2.11.9
func (vdc *Vdc) GetAllNsxtEdgeClusters(queryParameters url.Values) ([]*NsxtEdgeCluster, error)
GetAllNsxtEdgeClusters retrieves all available Edge Clusters for a particular VDC
func (*Vdc) GetAllNsxtEdgeGateways ¶ added in v2.11.9
func (vdc *Vdc) GetAllNsxtEdgeGateways(queryParameters url.Values) ([]*NsxtEdgeGateway, error)
GetAllNsxtEdgeGateways allows to retrieve all NSX-T edge gateways for specific VDC
func (*Vdc) GetAllNsxvIpSets ¶
GetAllNsxvIpSets retrieves all IP sets and returns []*types.EdgeIpSet or an error of type ErrorEntityNotFound if there are no IP sets
func (*Vdc) GetAllVmAffinityRuleList ¶
GetAllVmAffinityRuleList retrieves all VM affinity and anti-affinity rules
func (*Vdc) GetDefaultStorageProfileReference ¶
func (*Vdc) GetDiskByHref ¶
GetDiskByHref finds a Disk by HREF On success, returns a pointer to the Disk structure and a nil error On failure, returns a nil pointer and an error
func (*Vdc) GetDiskById ¶
GetDiskById finds a Disk by ID On success, returns a pointer to the Disk structure and a nil error On failure, returns a nil pointer and an error
func (*Vdc) GetDisksByName ¶
GetDisksByName finds one or more Disks by Name On success, returns a pointer to the Disk list and a nil error On failure, returns a nil pointer and an error
func (*Vdc) GetEdgeGatewayByHref ¶
func (vdc *Vdc) GetEdgeGatewayByHref(href string) (*EdgeGateway, error)
GetEdgeGatewayByHref retrieves an edge gateway from VDC by querying directly its HREF. The name passed as parameter is only used for error reporting
func (*Vdc) GetEdgeGatewayById ¶
func (vdc *Vdc) GetEdgeGatewayById(id string, refresh bool) (*EdgeGateway, error)
GetEdgeGatewayById search VDC list of edge gateways for a given ID. If the id matches, it returns a pointer to an edge gateway object. On failure, it returns a nil object and an error
func (*Vdc) GetEdgeGatewayByName ¶
func (vdc *Vdc) GetEdgeGatewayByName(name string, refresh bool) (*EdgeGateway, error)
GetEdgeGatewayByName search the VDC list of edge gateways for a given name. If the name matches, it returns a pointer to an edge gateway object. On failure, it returns a nil object and an error
func (*Vdc) GetEdgeGatewayByNameOrId ¶
func (vdc *Vdc) GetEdgeGatewayByNameOrId(identifier string, refresh bool) (*EdgeGateway, error)
GetEdgeGatewayByNameOrId search the VDC list of edge gateways for a given name or ID. If the name or the ID match, it returns a pointer to an edge gateway object. On failure, it returns a nil object and an error
func (*Vdc) GetEdgeGatewayRecordsType ¶
func (vdc *Vdc) GetEdgeGatewayRecordsType(refresh bool) (*types.QueryResultEdgeGatewayRecordsType, error)
GetEdgeGatewayRecordsType retrieves a list of edge gateways from VDC
func (*Vdc) GetMetadata ¶
GetMetadata returns meta data for VDC.
func (*Vdc) GetNetworkList ¶
GetNetworkList returns a list of networks for the VDC
func (*Vdc) GetNsxtEdgeClusterByName ¶ added in v2.11.9
func (vdc *Vdc) GetNsxtEdgeClusterByName(name string) (*NsxtEdgeCluster, error)
GetNsxtEdgeClusterByName retrieves a particular NSX-T Edge Cluster by name available for that VDC Note: Multiple NSX-T Edge Clusters with the same name may exist.
func (*Vdc) GetNsxtEdgeGatewayById ¶ added in v2.11.9
func (vdc *Vdc) GetNsxtEdgeGatewayById(id string) (*NsxtEdgeGateway, error)
GetNsxtEdgeGatewayById allows to retrieve NSX-T edge gateway by ID for specific VDC
func (*Vdc) GetNsxtEdgeGatewayByName ¶ added in v2.11.9
func (vdc *Vdc) GetNsxtEdgeGatewayByName(name string) (*NsxtEdgeGateway, error)
GetNsxtEdgeGatewayByName allows to retrieve NSX-T edge gateway by Name for specific VDC
func (*Vdc) GetNsxvIpSetById ¶
GetNsxvIpSetById searches for IP set by ID. Returns ErrorEntityNotFound if an IP set is not found
func (*Vdc) GetNsxvIpSetByName ¶
GetNsxvIpSetByName searches for IP set by name. Names are unique therefore it can find only one. Returns ErrorEntityNotFound if an IP set is not found
func (*Vdc) GetNsxvIpSetByNameOrId ¶
GetNsxvIpSetByNameOrId uses the same identifier to search by name and by ID. Priority is to try and find the IP set by ID. If it is not found - then a search by name is performed.
func (*Vdc) GetOrgVdcNetworkByHref ¶
func (vdc *Vdc) GetOrgVdcNetworkByHref(href string) (*OrgVDCNetwork, error)
GetOrgVdcNetworkByHref returns an Org VDC Network reference if the network HREF matches an existing one. If no valid external network is found, it returns a nil Network reference and an error
func (*Vdc) GetOrgVdcNetworkById ¶
func (vdc *Vdc) GetOrgVdcNetworkById(id string, refresh bool) (*OrgVDCNetwork, error)
GetOrgVdcNetworkById returns an Org VDC Network reference if the network ID matches an existing one. If no valid external network is found, it returns a nil Network reference and an error
func (*Vdc) GetOrgVdcNetworkByName ¶
func (vdc *Vdc) GetOrgVdcNetworkByName(name string, refresh bool) (*OrgVDCNetwork, error)
GetOrgVdcNetworkByName returns an Org VDC Network reference if the network name matches an existing one. If no valid external network is found, it returns a nil Network reference and an error
func (*Vdc) GetOrgVdcNetworkByNameOrId ¶
func (vdc *Vdc) GetOrgVdcNetworkByNameOrId(identifier string, refresh bool) (*OrgVDCNetwork, error)
GetOrgVdcNetworkByNameOrId returns a VDC Network reference if either the network name or ID matches an existing one. If no valid external network is found, it returns a nil ExternalNetwork reference and an error
func (*Vdc) GetVAppByHref ¶
GetVappByHref returns a vApp reference by running a vCD API call If no valid vApp is found, it returns a nil VApp reference and an error
func (*Vdc) GetVAppById ¶
GetVappById returns a vApp reference if the vApp ID matches an existing one. If no valid vApp is found, it returns a nil VApp reference and an error
func (*Vdc) GetVAppByName ¶
GetVappByName returns a vApp reference if the vApp Name matches an existing one. If no valid vApp is found, it returns a nil VApp reference and an error
func (*Vdc) GetVAppByNameOrId ¶
GetVappByNameOrId returns a vApp reference if either the vApp name or ID matches an existing one. If no valid vApp is found, it returns a nil VApp reference and an error
func (*Vdc) GetVappAccessControl ¶
func (vdc *Vdc) GetVappAccessControl(vappIdentifier string, useTenantContext bool) (*types.ControlAccessParams, error)
GetVappAccessControl is a convenience method to retrieve access control for a vApp from a VDC. The input variable vappIdentifier can be either the vApp name or its ID
func (*Vdc) GetVappList ¶
func (vdc *Vdc) GetVappList() []*types.ResourceReference
GetVappList returns the list of vApps for a VDC
func (*Vdc) GetVmAffinityRuleByHref ¶
func (vdc *Vdc) GetVmAffinityRuleByHref(href string) (*VmAffinityRule, error)
GetVmAffinityRuleByHref finds a VM affinity or anti-affinity rule by HREF
func (*Vdc) GetVmAffinityRuleById ¶
func (vdc *Vdc) GetVmAffinityRuleById(id string) (*VmAffinityRule, error)
GetVmAffinityRuleById retrieves a VM affinity or anti-affinity rule by ID
func (*Vdc) GetVmAffinityRuleByNameOrId ¶
func (vdc *Vdc) GetVmAffinityRuleByNameOrId(identifier string) (*VmAffinityRule, error)
GetVmAffinityRuleByNameOrId retrieves an affinity or anti-affinity rule by name or ID Given the possibility of a name identifying multiple items, this function may also fail when the search by name returns more than one item.
func (*Vdc) GetVmAffinityRuleList ¶
GetVmAffinityRuleList retrieves VM affinity rules
func (*Vdc) GetVmAffinityRulesByName ¶
func (vdc *Vdc) GetVmAffinityRulesByName(name string, polarity string) ([]*VmAffinityRule, error)
GetVmAffinityRulesByName finds the rules with the given name Note that name does not have to be unique, so a search by name can match several items If polarity is indicated, the function retrieves only the rules with the given polarity
func (*Vdc) GetVmAntiAffinityRuleList ¶
GetVmAntiAffinityRuleList retrieves VM anti-affinity rules
func (*Vdc) InstantiateVAppTemplate ¶
func (*Vdc) QueryAllMedia ¶
func (vdc *Vdc) QueryAllMedia(mediaName string) ([]*MediaRecord, error)
QueryAllMedia returns all media images found in system using `name` as query.
func (*Vdc) QueryCatalogItemList ¶
QueryCatalogItemList returns a list of Catalog Item for the given VDC
func (*Vdc) QueryDisk ¶
func (vdc *Vdc) QueryDisk(diskName string) (DiskRecord, error)
QueryDisk find independent disk using disk name. Returns DiskRecord type
func (*Vdc) QueryDisks ¶
QueryDisks find independent disks using disk name. Returns list of DiskRecordType
func (*Vdc) QueryMediaList ¶
QueryMediaList retrieves a list of media items for the VDC
func (*Vdc) QueryVappTemplateList ¶
QueryVappTemplateList returns a list of vApp templates for the given VDC
func (*Vdc) QueryVappVmTemplate ¶
func (vdc *Vdc) QueryVappVmTemplate(catalogName, vappTemplateName, vmNameInTemplate string) (*types.QueryResultVMRecordType, error)
QueryVappVmTemplate Finds VM template using catalog name, vApp template name, VN name in template. Returns types.QueryResultVMRecordType
func (*Vdc) QueryWithNotEncodedParams ¶
func (*Vdc) QueryWithNotEncodedParamsWithApiVersion ¶
func (*Vdc) SearchByFilter ¶
func (vdc *Vdc) SearchByFilter(queryType, parentField string, criteria *FilterDef) ([]QueryItem, string, error)
SearchByFilter runs the search for a specific VDC The 'parentField' argument defines which filter will be added, depending on the items we search for:
- 'vdc' contains the VDC HREF or ID
- 'vdcName' contains the VDC name
func (*Vdc) UpdateNsxvIpSet ¶
UpdateNsxvIpSet sends all fields of ipSetConfig. Omiting a value may reset it. ID is mandatory to perform update. Because the API always requires a Revision to be sent - the update fetches latest revision number automatically and embeds into the update structure.
func (*Vdc) UploadMediaImage
deprecated
func (vdc *Vdc) UploadMediaImage(mediaName, mediaDescription, filePath string, uploadPieceSize int64) (UploadTask, error)
Uploads an ISO file as media. This method only uploads bits to vCD spool area. Returns errors if any occur during upload from vCD or upload process. On upload fail client may need to remove vCD catalog item which waits for files to be uploaded.
Deprecated: This method is broken in API V32.0+. Please use catalog.UploadMediaImage because VCD does not support uploading directly to VDC anymore.
type VdcComputePolicy ¶
type VdcComputePolicy struct { VdcComputePolicy *types.VdcComputePolicy // contains filtered or unexported fields }
In UI called VM sizing policy. In API VDC compute policy
func (*VdcComputePolicy) Delete ¶
func (vdcComputePolicy *VdcComputePolicy) Delete() error
Delete deletes VDC compute policy
func (*VdcComputePolicy) Update ¶
func (vdcComputePolicy *VdcComputePolicy) Update() (*VdcComputePolicy, error)
Update existing VDC compute policy
type VersionInfo ¶
type VersionInfos ¶
type VersionInfos []VersionInfo
type VmAffinityRule ¶
type VmAffinityRule struct { VmAffinityRule *types.VmAffinityRule // contains filtered or unexported fields }
VmAffinityRule is the govcd structure to deal with VM affinity rules
func NewVmAffinityRule ¶
func NewVmAffinityRule(cli *Client) *VmAffinityRule
NewVmAffinityRule creates a new VM affinity rule
func (*VmAffinityRule) Delete ¶
func (vmar *VmAffinityRule) Delete() error
Delete removes a VM affinity rule from vCD
func (*VmAffinityRule) Refresh ¶
func (vmar *VmAffinityRule) Refresh() error
Refresh gets a fresh copy of the VM affinity rule from vCD
func (*VmAffinityRule) SetEnabled ¶
func (vmar *VmAffinityRule) SetEnabled(value bool) error
SetEnabled is a shortcut to update only the IsEnabled property of a VM affinity rule
func (*VmAffinityRule) SetMandatory ¶
func (vmar *VmAffinityRule) SetMandatory(value bool) error
SetMandatory is a shortcut to update only the IsMandatory property of a VM affinity rule
func (*VmAffinityRule) Update ¶
func (vmar *VmAffinityRule) Update() error
Update modifies a VM affinity rule using as input the entity's internal data.
Source Files ¶
- access_control.go
- admincatalog.go
- adminorg.go
- adminorg_administration.go
- adminvdc.go
- api.go
- api_vcd.go
- api_vcd_versions.go
- catalog.go
- catalogitem.go
- disk.go
- edgegateway.go
- ejecttask.go
- entity.go
- extension.go
- external_network_v2.go
- externalnetwork.go
- filter_condition.go
- filter_engine.go
- filter_helpers.go
- filter_interface.go
- filter_util.go
- group.go
- lb.go
- lbappprofile.go
- lbapprule.go
- lbserverpool.go
- lbservicemonitor.go
- lbvirtualserver.go
- media.go
- metadata.go
- monitor.go
- nsxt_edge_cluster.go
- nsxt_edgegateway.go
- nsxt_tier0_router.go
- nsxv_dhcplease.go
- nsxv_dhcprelay.go
- nsxv_firewall.go
- nsxv_ipset.go
- nsxv_nat.go
- openapi.go
- openapi_endpoints.go
- org.go
- orgvdcnetwork.go
- productsection.go
- query.go
- query_metadata.go
- roles.go
- saml_auth.go
- system.go
- task.go
- upload.go
- uploadtask.go
- user.go
- vapp.go
- vapp_network.go
- vapptemplate.go
- vdc.go
- vdc_df.go
- vdccomputepolicy.go
- vm.go
- vm_affinity_rule.go