vmc

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2020 License: MPL-2.0 Imports: 31 Imported by: 0

Documentation

Overview

Package vmc provides helper methods that provides client.Connector, required to call VMC APIs.

Index

Constants

View Source
const (
	// DefaultVMCServer defines the default VMC server.
	DefaultVMCServer string = "https://vmc.vmware.com"

	// DefaultCSPUrl defines the default URL for CSP.
	DefaultCSPUrl string = "https://console.cloud.vmware.com"

	// CSPRefreshUrlSuffix defines the CSP Refresh API endpoint.
	CSPRefreshUrlSuffix string = "/csp/gateway/am/api/auth/api-tokens/authorize"

	// sksNSXTManager to be stripped from nsxt reverse proxy url for public IP resource
	SksNSXTManager string = "/sks-nsxt-manager"

	// ESX Host instance types supported for SDDC creation.
	HostInstancetypeI3 string = "I3_METAL"
	HostInstancetypeR5 string = "R5_METAL"

	// Availability Zones
	SingleAvailabilityZone string = "SingleAZ"
	MultiAvailabilityZone  string = "MultiAZ"
	MinMultiAZHosts        int    = 6

	ClusterIdFieldName = "clusterId"

	// Env variables used in acceptance tests
	APIToken            string = "API_TOKEN"
	OrgID               string = "ORG_ID"
	OrgDisplayName      string = "ORG_DISPLAY_NAME"
	TestSDDCId          string = "TEST_SDDC_ID"
	AWSAccountNumber    string = "AWS_ACCOUNT_NUMBER"
	NSXTReverseProxyUrl string = "NSXT_REVERSE_PROXY_URL"
)

Variables

This section is empty.

Functions

func ConvertStorageCapacitytoInt added in v1.3.0

func ConvertStorageCapacitytoInt(s string) int64

func GetSDDC added in v1.3.0

func GetSDDC(connector client.Connector, orgID string, sddcID string) (model.Sddc, error)

func HandleCreateError added in v1.3.0

func HandleCreateError(resourceType string, err error) error

func HandleDataSourceReadError added in v1.3.0

func HandleDataSourceReadError(d *schema.ResourceData, resourceType string, err error) error

func HandleDeleteError added in v1.3.0

func HandleDeleteError(resourceType string, resourceID string, err error) error

func HandleListError added in v1.3.0

func HandleListError(resourceType string, err error) error

func HandleReadError added in v1.3.0

func HandleReadError(d *schema.ResourceData, resourceType string, resourceID string, err error) error

func HandleUpdateError added in v1.3.0

func HandleUpdateError(resourceType string, err error) error

func NewClientConnectorByRefreshToken

func NewClientConnectorByRefreshToken(refreshToken, serviceUrl, cspURL string,
	httpClient http.Client) (client.Connector, error)

NewClientConnectorByRefreshToken returns client connector to any VMC service by using OAuth authentication using Refresh Token.

func Provider

func Provider() terraform.ResourceProvider

Provider for VMware VMC Console APIs. Returns terraform.ResourceProvider

func SecurityContextByRefreshToken

func SecurityContextByRefreshToken(refreshToken string, cspURL string) (core.SecurityContext, error)

SecurityContextByRefreshToken returns Security Context with access token that is received from Cloud Service Provider using Refresh Token by OAuth authentication scheme.

Types

type ConnectorWrapper

type ConnectorWrapper struct {
	client.Connector
	RefreshToken string
	OrgID        string
	VmcURL       string
	CspURL       string
}

Jump to

Keyboard shortcuts

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