vcd

package
v3.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2021 License: MPL-2.0 Imports: 28 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BuildVersion = "unset"

BuildVersion holds version which is meant to be injected at build time using ldflags (e.g. 'go build -ldflags="-X 'github.com/vmware/terraform-provider-vcd/v3/vcd.BuildVersion=v1.0.0'"')

View Source
var (

	// Separation string used for import operations
	// Can be changed usin either "import_separator" property in Provider
	// or environment variable "VCD_IMPORT_SEPARATOR"
	ImportSeparator = "."
)

Functions

func DataSources

func DataSources(nameRegexp string, includeDeprecated bool) (map[string]*schema.Resource, error)

DataSources is a public function which allows to filter and access all defined data sources When 'nameRegexp' is not empty - it will return only those matching the regexp When 'includeDeprecated' is false - it will skip out the resources which have a DeprecationMessage set

func GetVcenterHref

func GetVcenterHref(vcdClient *govcd.VCDClient, name string) (string, error)

func IsFloatAndBetween

func IsFloatAndBetween(min, max float64) schema.SchemaValidateFunc

IsFloatAndBetween returns a SchemaValidateFunc which tests if the provided value convertable to float64 and is between min and max (inclusive).

func IsIntAndAtLeast

func IsIntAndAtLeast(min int) schema.SchemaValidateFunc

IsIntAndAtLeast returns a SchemaValidateFunc which tests if the provided value string is convertable to int and is at least min (inclusive)

func Provider

func Provider() *schema.Provider

Provider returns a terraform.ResourceProvider.

func ProviderAuthenticate

func ProviderAuthenticate(client *govcd.VCDClient, user, password, token, org string) error

func Resources

func Resources(nameRegexp string, includeDeprecated bool) (map[string]*schema.Resource, error)

Resources is a public function which allows to filter and access all defined resources When 'nameRegexp' is not empty - it will return only those matching the regexp When 'includeDeprecated' is false - it will skip out the resources which have a DeprecationMessage set

Types

type Config

type Config struct {
	User            string
	Password        string
	Token           string // Token used instead of user and password
	SysOrg          string // Org used for authentication
	Org             string // Default Org used for API operations
	Vdc             string // Default (optional) VDC for API operations
	Href            string
	MaxRetryTimeout int
	InsecureFlag    bool

	// 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
}

func (*Config) Client

func (c *Config) Client() (*VCDClient, error)

type StringMap

type StringMap map[string]interface{}

Type used to simplify reading resource definitions

type VCDClient

type VCDClient struct {
	*govcd.VCDClient
	SysOrg          string
	Org             string // name of default Org
	Vdc             string // name of default VDC
	MaxRetryTimeout int
	InsecureFlag    bool
}

func (*VCDClient) GetAdminOrg

func (cli *VCDClient) GetAdminOrg(orgName string) (org *govcd.AdminOrg, err error)

GetAdminOrg finds org using the names provided in the args. If the name is empty, it will use the default org name from the provider.

func (*VCDClient) GetAdminOrgFromResource

func (cli *VCDClient) GetAdminOrgFromResource(d *schema.ResourceData) (org *govcd.AdminOrg, err error)

Same as GetOrgAndVdc, but using data from the resource, if available.

func (*VCDClient) GetEdgeGateway

func (cli *VCDClient) GetEdgeGateway(orgName, vdcName, edgeGwName string) (eg *govcd.EdgeGateway, err error)

GetEdgeGateway gets an NSX-V Edge Gateway when you don't need org or vdc for other purposes

func (*VCDClient) GetEdgeGatewayFromResource

func (cli *VCDClient) GetEdgeGatewayFromResource(d *schema.ResourceData, edgeGatewayFieldName string) (eg *govcd.EdgeGateway, err error)

Same as GetEdgeGateway, but using data from the resource, if available edgeGatewayFieldName is the name used in the resource. It is usually "edge_gateway" for all resources that *use* an edge gateway, and when the resource is vcd_edgegateway, it is "name"

func (*VCDClient) GetNsxtEdgeGateway added in v3.3.0

func (cli *VCDClient) GetNsxtEdgeGateway(orgName, vdcName, edgeGwName string) (eg *govcd.NsxtEdgeGateway, err error)

GetNsxtEdgeGateway gets an NSX-T Edge Gateway when you don't need Org or VDC for other purposes

func (*VCDClient) GetNsxtEdgeGatewayById added in v3.3.0

func (cli *VCDClient) GetNsxtEdgeGatewayById(orgName, vdcName, edgeGwId string) (eg *govcd.NsxtEdgeGateway, err error)

GetNsxtEdgeGatewayById gets an NSX-T Edge Gateway when you don't need Org or VDC for other purposes

func (*VCDClient) GetNsxtEdgeGatewayFromResourceById added in v3.3.0

func (cli *VCDClient) GetNsxtEdgeGatewayFromResourceById(d *schema.ResourceData, edgeGatewayFieldName string) (eg *govcd.NsxtEdgeGateway, err error)

GetNsxtEdgeGatewayFromResource helps to retrieve NSX-T Edge Gateway when Org org VDC are not needed. It performs a query By ID.

func (*VCDClient) GetOrg added in v3.3.0

func (cli *VCDClient) GetOrg(orgName string) (org *govcd.Org, err error)

GetOrg finds org using the names provided in the args. If the name is empty, it will use the default org name from the provider.

func (*VCDClient) GetOrgAndVdc

func (cli *VCDClient) GetOrgAndVdc(orgName, vdcName string) (org *govcd.Org, vdc *govcd.Vdc, err error)

GetOrgAndVdc finds a pair of org and vdc using the names provided in the args. If the names are empty, it will use the default org and vdc names from the provider.

func (*VCDClient) GetOrgAndVdcFromResource

func (cli *VCDClient) GetOrgAndVdcFromResource(d *schema.ResourceData) (org *govcd.Org, vdc *govcd.Vdc, err error)

Same as GetOrgAndVdc, but using data from the resource, if available.

func (*VCDClient) GetOrgFromResource added in v3.3.0

func (cli *VCDClient) GetOrgFromResource(d *schema.ResourceData) (org *govcd.Org, err error)

Same as GetOrg, but using data from the resource, if available.

Source Files

Jump to

Keyboard shortcuts

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