vkcs

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2022 License: MPL-2.0 Imports: 96 Imported by: 0

Documentation

Overview

This set of code handles all functions required to configure networking on an vkcs_compute_instance resource.

This is a complicated task because it's not possible to obtain all information in a single API call. In fact, it even traverses multiple OpenStack services.

The end result, from the user's point of view, is a structured set of understandable network information within the instance resource.

Index

Constants

View Source
const (
	Redis       = "redis"
	MongoDB     = "mongodb"
	PostgresPro = "postgrespro"
	Galera      = "galera_mysql"
	Postgres    = "postgresql"
	Clickhouse  = "clickhouse"
	MySQL       = "mysql"
	Tarantool   = "tarantool"
)

Datastore names

Variables

This section is empty.

Functions

func AddValueSpecs

func AddValueSpecs(body map[string]interface{}) map[string]interface{}

AddValueSpecs expands the 'value_specs' object and removes 'value_specs' from the reqeust body.

func BuildRequest

func BuildRequest(opts interface{}, parent string) (map[string]interface{}, error)

BuildRequest takes an opts struct and builds a request body for Gophercloud to execute.

func ComputeInstanceReadTags

func ComputeInstanceReadTags(d *schema.ResourceData, tags []string)

func ComputeInstanceTags

func ComputeInstanceTags(d *schema.ResourceData) []string

func ComputeInstanceUpdateTags

func ComputeInstanceUpdateTags(d *schema.ResourceData) []string

func ExtractDBs added in v0.1.1

func ExtractDBs(page pagination.Page) ([]databases.Database, error)

ExtractDBs will convert a generic pagination struct into a more relevant slice of DB structs.

func ExtractUsers added in v0.1.1

func ExtractUsers(r pagination.Page) ([]users.User, error)

ExtractUsers will convert a generic pagination struct into a more relevant slice of User structs.

func MapValueSpecs

func MapValueSpecs(d *schema.ResourceData) map[string]string

MapValueSpecs converts ResourceData into a map.

func Provider

func Provider() *schema.Provider

Provider returns a schema.Provider for VKCS.

func ServerStateRefreshFunc

func ServerStateRefreshFunc(client *gophercloud.ServiceClient, instanceID string) resource.StateRefreshFunc

ServerStateRefreshFunc returns a resource.StateRefreshFunc that is used to watch an VKCS instance.

Types

type ComputeKeyPairV2CreateOpts

type ComputeKeyPairV2CreateOpts struct {
	keypairs.CreateOpts
	ValueSpecs map[string]string `json:"value_specs,omitempty"`
}

ComputeKeyPairV2CreateOpts is a custom KeyPair struct to include the ValueSpecs field.

func (ComputeKeyPairV2CreateOpts) ToKeyPairCreateMap

func (opts ComputeKeyPairV2CreateOpts) ToKeyPairCreateMap() (map[string]interface{}, error)

ToKeyPairCreateMap casts a CreateOpts struct to a map. It overrides keypairs.ToKeyPairCreateMap to add the ValueSpecs field.

type ComputeServerGroupCreateOpts

type ComputeServerGroupCreateOpts struct {
	servergroups.CreateOpts
	ValueSpecs map[string]string `json:"value_specs,omitempty"`
}

ServerGroupCreateOpts is a custom ServerGroup struct to include the ValueSpecs field.

func (ComputeServerGroupCreateOpts) ToServerGroupCreateMap

func (opts ComputeServerGroupCreateOpts) ToServerGroupCreateMap() (map[string]interface{}, error)

ToServerGroupCreateMap casts a CreateOpts struct to a map. It overrides routers.ToServerGroupCreateMap to add the ValueSpecs field.

type ContainerClient

type ContainerClient interface {
	Get(url string, jsonResponse interface{}, opts *gophercloud.RequestOpts) (*http.Response, error)
	Post(url string, jsonBody interface{}, jsonResponse interface{}, opts *gophercloud.RequestOpts) (*http.Response, error)
	Patch(url string, jsonBody interface{}, jsonResponse interface{}, opts *gophercloud.RequestOpts) (*http.Response, error)
	Delete(url string, opts *gophercloud.RequestOpts) (*http.Response, error)
	Head(url string, opts *gophercloud.RequestOpts) (*http.Response, error)
	Put(url string, jsonBody interface{}, jsonResponse interface{}, opts *gophercloud.RequestOpts) (*http.Response, error)
	ServiceURL(parts ...string) string
}

ContainerClient is interface to work with gophercloud requests

type ContainerClientFixture

type ContainerClientFixture struct {
	mock.Mock
}

ContainerClientFixture ...

func (*ContainerClientFixture) Delete

Delete ...

func (*ContainerClientFixture) Get

func (c *ContainerClientFixture) Get(url string, jsonResponse interface{}, opts *gophercloud.RequestOpts) (*http.Response, error)

Get ...

func (*ContainerClientFixture) Head

Head ...

func (*ContainerClientFixture) Patch

func (c *ContainerClientFixture) Patch(url string, jsonBody interface{}, jsonResponse interface{}, opts *gophercloud.RequestOpts) (*http.Response, error)

Patch ...

func (*ContainerClientFixture) Post

func (c *ContainerClientFixture) Post(url string, jsonBody interface{}, jsonResponse interface{}, opts *gophercloud.RequestOpts) (*http.Response, error)

Post ...

func (*ContainerClientFixture) Put

func (c *ContainerClientFixture) Put(url string, jsonBody interface{}, jsonResponse interface{}, opts *gophercloud.RequestOpts) (*http.Response, error)

Put ...

func (*ContainerClientFixture) ServiceURL

func (c *ContainerClientFixture) ServiceURL(parts ...string) string

ServiceURL ...

type DBPage added in v0.1.1

type DBPage struct {
	pagination.LinkedPageBase
}

Custom type implementation of gophercloud/database.DBPage

func (DBPage) IsEmpty added in v0.1.1

func (page DBPage) IsEmpty() (bool, error)

IsEmpty checks to see whether the collection is empty.

func (DBPage) NextPageURL added in v0.1.1

func (page DBPage) NextPageURL() (string, error)

NextPageURL will retrieve the next page URL.

type DBUserPage added in v0.1.1

type DBUserPage struct {
	pagination.LinkedPageBase
}

Custom type implementation of gophercloud/users.UserPage

func (DBUserPage) IsEmpty added in v0.1.1

func (page DBUserPage) IsEmpty() (bool, error)

IsEmpty checks to see whether the collection is empty.

func (DBUserPage) NextPageURL added in v0.1.1

func (page DBUserPage) NextPageURL() (string, error)

NextPageURL will retrieve the next page URL.

type EndpointGroupCreateOpts

type EndpointGroupCreateOpts struct {
	endpointgroups.CreateOpts
}

EndpointGroupCreateOpts represents the attributes used when creating a new endpoint group.

type FakeBody

type FakeBody struct {
	// contains filtered or unexported fields
}

FakeBody is struct that implements ReadCloser interface; use it for http.Response.Body mock

func (*FakeBody) Close

func (f *FakeBody) Close() (err error)

Close ...

func (*FakeBody) Read

func (f *FakeBody) Read(p []byte) (n int, err error)

Read ...

type FloatingIPCreateOpts

type FloatingIPCreateOpts struct {
	*floatingips.CreateOpts
	ValueSpecs map[string]string `json:"value_specs,omitempty"`
}

FloatingIPCreateOpts represents the attributes used when creating a new floating ip.

func (FloatingIPCreateOpts) ToFloatingIPCreateMap

func (opts FloatingIPCreateOpts) ToFloatingIPCreateMap() (map[string]interface{}, error)

ToFloatingIPCreateMap casts a CreateOpts struct to a map. It overrides floatingips.ToFloatingIPCreateMap to add the ValueSpecs field.

type IKEPolicyCreateOpts

type IKEPolicyCreateOpts struct {
	ikepolicies.CreateOpts
}

IKEPolicyCreateOpts represents the attributes used when creating a new IKE policy.

type IPSecPolicyCreateOpts

type IPSecPolicyCreateOpts struct {
	ipsecpolicies.CreateOpts
}

IPSecPolicyCreateOpts represents the attributes used when creating a new IPSec policy.

type InstanceAddresses

type InstanceAddresses struct {
	NetworkName  string
	InstanceNICs []InstanceNIC
}

InstanceAddresses is a collection of InstanceNICs, grouped by the network name. An instance/server could have multiple NICs on the same network.

type InstanceNIC

type InstanceNIC struct {
	FixedIPv4 string
	FixedIPv6 string
	MAC       string
}

InstanceNIC is a structured representation of a Gophercloud servers.Server virtual NIC.

type InstanceNetwork

type InstanceNetwork struct {
	UUID          string
	Name          string
	Port          string
	FixedIP       string
	AccessNetwork bool
}

InstanceNetwork represents a collection of network information that a Terraform instance needs to satisfy all network information requirements.

type NetworkCreateOpts

type NetworkCreateOpts struct {
	networks.CreateOpts
	ValueSpecs       map[string]string `json:"value_specs,omitempty"`
	PrivateDNSDomain string            `json:"private_dns_domain,omitempty"`
	ServicesAccess   bool              `json:"enable_shadow_port,omitempty"`
}

NetworkCreateOpts represents the attributes used when creating a new network.

func (NetworkCreateOpts) ToNetworkCreateMap

func (opts NetworkCreateOpts) ToNetworkCreateMap() (map[string]interface{}, error)

ToNetworkCreateMap casts a CreateOpts struct to a map. It overrides networks.ToNetworkCreateMap to add the ValueSpecs field.

type NetworkUpdateOpts

type NetworkUpdateOpts struct {
	networks.UpdateOpts
	ServicesAccess *bool `json:"enable_shadow_port,omitempty"`
}

NetworkUpdateOpts represents the attributes used when updating a network.

func (NetworkUpdateOpts) ToNetworkUpdateMap

func (opts NetworkUpdateOpts) ToNetworkUpdateMap() (map[string]interface{}, error)

ToNetworkUpdateMap casts a UpdateOpts struct to a map. It overrides networks.ToNetworkUpdateMap to add the ServicesAccess field.

type PortCreateOpts

type PortCreateOpts struct {
	ports.CreateOpts
	ValueSpecs map[string]string `json:"value_specs,omitempty"`
}

PortCreateOpts represents the attributes used when creating a new port.

func (PortCreateOpts) ToPortCreateMap

func (opts PortCreateOpts) ToPortCreateMap() (map[string]interface{}, error)

ToPortCreateMap casts a CreateOpts struct to a map. It overrides ports.ToPortCreateMap to add the ValueSpecs field.

type PrivateDNSDomainExt

type PrivateDNSDomainExt struct {
	PrivateDNSDomain string `json:"private_dns_domain,omitempty"`
}

type RouterCreateOpts

type RouterCreateOpts struct {
	routers.CreateOpts
	ValueSpecs map[string]string `json:"value_specs,omitempty"`
}

RouterCreateOpts represents the attributes used when creating a new router.

func (RouterCreateOpts) ToRouterCreateMap

func (opts RouterCreateOpts) ToRouterCreateMap() (map[string]interface{}, error)

ToRouterCreateMap casts a CreateOpts struct to a map. It overrides routers.ToRouterCreateMap to add the ValueSpecs field.

type ServiceCreateOpts

type ServiceCreateOpts struct {
	services.CreateOpts
}

ServiceCreateOpts represents the attributes used when creating a new VPN service.

type ServicesAccessExt

type ServicesAccessExt struct {
	ServicesAccess *bool `json:"enable_shadow_port,omitempty"`
}

type SiteConnectionCreateOpts

type SiteConnectionCreateOpts struct {
	siteconnections.CreateOpts
}

SiteConnectionCreateOpts represents the attributes used when creating a new IPSec site connection.

type SubnetCreateOpts

type SubnetCreateOpts struct {
	subnets.CreateOpts
	ValueSpecs map[string]string `json:"value_specs,omitempty"`
}

SubnetCreateOpts represents the attributes used when creating a new subnet.

func (SubnetCreateOpts) ToSubnetCreateMap

func (opts SubnetCreateOpts) ToSubnetCreateMap() (map[string]interface{}, error)

ToSubnetCreateMap casts a CreateOpts struct to a map. It overrides subnets.ToSubnetCreateMap to add the ValueSpecs field.

Source Files

Directories

Path Synopsis
internal
pathorcontents
Helpers for dealing with file paths and their contents
Helpers for dealing with file paths and their contents

Jump to

Keyboard shortcuts

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