Documentation ¶
Index ¶
- Constants
- Variables
- func AllowedNetworkTypes() []string
- func CheckL7ListenerProtocol(ctx context.Context, client *edgecloudV2.Client, listenerID string) diag.Diagnostics
- func CreateClient(provider *edgecloud.ProviderClient, d *schema.ResourceData, endpoint string, ...) (*edgecloud.ServiceClient, error)
- func ExtractHostAndPath(uri string) (string, string, error)
- func GetLBL7Policy(ctx context.Context, client *edgecloudV2.Client, ...) (*edgecloudV2.L7Policy, error)
- func GetListenerL7PolicyUUIDS(ctx context.Context, client *edgecloudV2.Client, listenerID string) ([]string, error)
- func GetProject(provider *edgecloud.ProviderClient, projectID int, projectName string) (int, error)
- func GetProjectV2(ctx context.Context, client *edgecloudV2.Client, projectID int, ...) (int, error)
- func GetRegion(provider *edgecloud.ProviderClient, regionID int, regionName string) (int, error)
- func GetRegionIDandProjectID(ctx context.Context, client *edgecloudV2.Client, d *schema.ResourceData) (regionID, projectID int, err error)
- func GetRegionLegacy(provider *edgecloud.ProviderClient, regionID int, regionName string) (int, error)
- func GetRegionV2(ctx context.Context, client *edgecloudV2.Client, regionID int, ...) (int, error)
- func ImportStringParser(infoStr string) (projectID int, regionID int, id3 string, err error)
- func ImportStringParserExtended(infoStr string) (projectID int, regionID int, id3 string, id4 string, err error)
- func IndexFunc[E any](s []E, f func(E) bool) int
- func InitCloudClient(ctx context.Context, d *schema.ResourceData, m interface{}) (*edgecloudV2.Client, error)
- func MapInterfaceToMapString(mapInterface interface{}) (*map[string]string, error)
- func MapStructureDecoder(strct interface{}, v *map[string]interface{}, ...) error
- func PrepareMetadata(apiMetadataRaw interface{}) (map[string]string, []map[string]interface{})
- func PrepareMetadataReadonly(apiMetadataRaw interface{}) []map[string]interface{}
- func Provider() *schema.Provider
- func ServerV2StateRefreshFuncV2(ctx context.Context, client *edgecloudV2.Client, instanceID string) retry.StateRefreshFunc
- func StringToNetHookFunc() mapstructure.DecodeHookFuncType
- func StringToNetHookFuncV2() mapstructure.DecodeHookFuncType
- func StructToMap(obj interface{}) (map[string]interface{}, error)
- type Config
- type InstanceInterfaceWithIPAddress
- type InstancePortSecurityOpts
- type K8sConfig
- type OrderedInterfaceOpts
Constants ¶
const ( ProviderOptPermanentToken = "permanent_api_token" ProviderOptSkipCredsAuthErr = "ignore_creds_auth_error" // nolint: gosec ProviderOptSingleAPIEndpoint = "api_endpoint" RegionIDField = "region_id" RegionNameField = "region_name" ProjectIDField = "project_id" ProjectNameField = "project_name" CreatedAtField = "created_at" UpdatedAtField = "updated_at" IDField = "id" NameField = "name" TagsField = "tags" TypeField = "type" KeyField = "key" OperatingStatusField = "operating_status" ProvisioningStatusField = "provisioning_status" LifecyclePolicyResource = "edgecenter_lifecyclepolicy" )
const ( BmInstanceDeletingTimeout int = 1200 BmInstanceCreatingTimeout int = 3600 BmInstancePoint = "bminstances" )
const ( DNSZoneResource = "edgecenter_dns_zone" DNSZoneSchemaName = "name" )
const ( DNSZoneRecordResource = "edgecenter_dns_zone_record" DNSZoneRecordSchemaZone = "zone" DNSZoneRecordSchemaDomain = "domain" DNSZoneRecordSchemaType = "type" DNSZoneRecordSchemaTTL = "ttl" DNSZoneRecordSchemaRRSetMeta = "meta" DNSZoneRecordSchemaFailover = "failover" DNSZoneRecordSchemaFilter = "filter" DNSZoneRecordSchemaFailoverProtocol = "protocol" DNSZoneRecordSchemaFailoverFrequency = "frequency" DNSZoneRecordSchemaFailoverHost = "host" DNSZoneRecordSchemaFailoverHTTPStatusCode = "http_status_code" DNSZoneRecordSchemaFailoverMethod = "method" DNSZoneRecordSchemaFailoverPort = "port" DNSZoneRecordSchemaFailoverRegexp = "regexp" DNSZoneRecordSchemaFailoverTimeout = "timeout" DNSZoneRecordSchemaFailoverTLS = "tls" DNSZoneRecordSchemaFailoverURL = "url" DNSZoneRecordSchemaFailoverVerify = "verify" DNSZoneRecordSchemaFilterLimit = "limit" DNSZoneRecordSchemaFilterType = "type" DNSZoneRecordSchemaFilterStrict = "strict" DNSZoneRecordSchemaResourceRecord = "resource_record" DNSZoneRecordSchemaContent = "content" DNSZoneRecordSchemaEnabled = "enabled" DNSZoneRecordSchemaMeta = "meta" DNSZoneRecordSchemaMetaAsn = "asn" DNSZoneRecordSchemaMetaIP = "ip" DNSZoneRecordSchemaMetaCountries = "countries" DNSZoneRecordSchemaMetaContinents = "continents" DNSZoneRecordSchemaMetaLatLong = "latlong" DNSZoneRecordSchemaMetaNotes = "notes" DNSZoneRecordSchemaMetaDefault = "default" )
const ( FloatingIPsPoint = "floatingips" FloatingIPCreateTimeout = 1200 * time.Second FloatingIPDeleteTimeout = 1200 * time.Second )
const ( InstanceCreateTimeout = 1200 * time.Second InstanceDeleteTimeout = 1200 * time.Second InstanceUpdateTimeout = 1200 * time.Second InstancePoint = "instances" InstanceVMStateActive = "active" InstanceVMStateStopped = "stopped" )
const ( K8sPoint = "k8s/clusters" K8sCreateTimeout = 3600 )
const ( LBL7PolicyCreateTimeout = 2400 * time.Second LBL7PolicyUpdateTimeout = 2400 * time.Second LBL7PolicyDeleteTimeout = 2400 * time.Second LBL7PolicyRedirectHTTPCodeField = "redirect_http_code" LBL7PolicyRedirectPrefixField = "redirect_prefix" LBL7PolicyRedirectURLField = "redirect_url" LBL7PolicyRedirectPoolIDField = "redirect_pool_id" LBL7PolicyTagsField = "tags" LBL7PolicyRulesField = "rules" LBL7PolicyPositionField = "position" LBL7PolicyActionField = "action" LBL7PolicyListenerIDField = "listener_id" LBL7PolicyNameField = "name" LBL7OperatingStatusField = "operating_status" LBL7ProvisioningStatusField = "provisioning_status" )
const ( LB7RuleCompareTypeField = "compare_type" LBL7RuleL7PolicyIDField = "l7policy_id" LBL7RuleValueField = "value" LBL7RuleInvertField = "invert" LBL7RuleCreateTimeout = 10 * time.Minute LBL7RuleUpdateTimeout = 10 * time.Minute LBL7RuleDeleteTimeout = 10 * time.Minute )
const ( LBListenersPoint = "lblisteners" LBListenerCreateTimeout = 2400 * time.Second LBListenerUpdateTimeout = 2400 * time.Second LBListenerDeleteTimeout = 2400 * time.Second )
const ( LBMemberCreateTimeout = 2400 * time.Second LBMemberUpdateTimeout = 2400 * time.Second LBMemberDeleteTimeout = 2400 * time.Second )
const ( LBPoolsPoint = "lbpools" LBPoolsCreateTimeout = 2400 * time.Second LBPoolsUpdateTimeout = 2400 * time.Second LBPoolsDeleteTimeout = 2400 * time.Second )
const ( LoadBalancersPoint = "loadbalancers" LoadBalancerCreateTimeout = 2400 * time.Second LoadBalancerDeleteTimeout = 2400 * time.Second LoadBalancerUpdateTimeout = 2400 * time.Second )
const ( NetworkDeletingTimeout = 1200 * time.Second NetworkCreatingTimeout = 1200 * time.Second NetworksPoint = "networks" )
const ( ReservedFixedIPsPoint = "reserved_fixed_ips" ReservedFixedIPCreateTimeout = 1200 * time.Second ReservedFixedIPDeleteTimeout = 1200 * time.Second )
const ( RouterPoint = "routers" RouterDeletingTimeout = 1200 * time.Second RouterCreatingTimeout = 1200 * time.Second )
const ( SecretDeletingTimeout = 1200 * time.Second SecretCreatingTimeout = 1200 * time.Second SecretPoint = "secrets" // RFC3339NoZ is the time format used in Heat (Orchestration). RFC3339NoZ = "2006-01-02T15:04:05" RFC3339WithTimeZone = "2006-01-02T15:04:05+00:00" )
const ( StorageS3SchemaGenerateAccessKey = "generated_access_key" StorageS3SchemaGenerateSecretKey = "generated_secret_key" StorageSchemaGenerateHTTPEndpoint = "generated_http_endpoint" StorageSchemaGenerateS3Endpoint = "generated_s3_endpoint" StorageSchemaGenerateEndpoint = "generated_endpoint" StorageSchemaLocation = "location" StorageSchemaName = "name" StorageSchemaID = "storage_id" StorageSchemaClientID = "client_id" )
const ( StorageS3BucketSchemaName = "name" StorageS3BucketSchemaStorageID = "storage_id" )
const ( SubnetCreatingTimeout = 1200 * time.Second SubnetPoint = "subnets" )
const ( VolumeCreatingTimeout = 1200 * time.Second VolumesPoint = "volumes" )
const ( VersionPointV1 = "v1" VersionPointV2 = "v2" ProjectPoint = "projects" RegionPoint = "regions" )
const KeypairsPoint = "keypairs"
const LBL7RuleL7PolicyNameField = "l7policy_name"
const (
LifecyclePolicyPoint = "lifecycle_policies"
)
const ReservedFixedIPVIPDisabledPortSecurityErrMsg = "Port Security must be enabled in order to have allowed address pairs on a port"
const (
SecurityGroupPoint = "securitygroups"
)
const (
ServerGroupsPoint = "servergroups"
)
const (
SnapshotsPoint = "snapshots"
)
Variables ¶
var ErrCannotDeleteSGRule = errors.New("error when deleting security group rule")
Functions ¶
func AllowedNetworkTypes ¶ added in v0.5.0
func AllowedNetworkTypes() []string
func CheckL7ListenerProtocol ¶ added in v0.5.0
func CheckL7ListenerProtocol(ctx context.Context, client *edgecloudV2.Client, listenerID string) diag.Diagnostics
func CreateClient ¶
func CreateClient(provider *edgecloud.ProviderClient, d *schema.ResourceData, endpoint string, version string) (*edgecloud.ServiceClient, error)
CreateClient creates a new edgecloud.ServiceClient.
func ExtractHostAndPath ¶
ExtractHostAndPath splits a given URI into the host and path components.
func GetLBL7Policy ¶ added in v0.5.0
func GetLBL7Policy(ctx context.Context, client *edgecloudV2.Client, l7PolicyID, l7PolicyName string) (*edgecloudV2.L7Policy, error)
func GetListenerL7PolicyUUIDS ¶ added in v0.5.0
func GetProject ¶
GetProject returns a valid project ID for a resource. If the projectID is provided, it will be returned directly. If projectName is provided instead, the function will search for the project by name and return its ID. Returns an error if the project is not found or there is an issue with the client. ToDo Remove after migrate to Edgecenterclient-go V2.
func GetProjectV2 ¶ added in v0.2.0
func GetProjectV2(ctx context.Context, client *edgecloudV2.Client, projectID int, projectName string) (int, error)
GetProjectV2 returns a valid project ID for a resource. Use new version Edgecenterclient-go V2. If the projectID is provided, it will be returned directly. If projectName is provided instead, the function will search for the project by name and return its ID. Returns an error if the project is not found or there is an issue with the client.
func GetRegion ¶
GetRegion returns a valid region ID for a resource. If the regionID is provided, it will be returned directly. If regionName is provided instead, the function will search for the region by name and return its ID. Returns an error if the region is not found or there is an issue with the client. ToDo Remove after migrate to Edgecenterclient-go V2.
func GetRegionIDandProjectID ¶ added in v0.2.0
func GetRegionIDandProjectID(ctx context.Context, client *edgecloudV2.Client, d *schema.ResourceData) (regionID, projectID int, err error)
GetRegionIDandProjectID search for project ID and region ID by name or return project ID and region ID if they exist in the terraform configuration. Use new version Edgecenterclient-go V2. nolint: nonamedreturns
func GetRegionLegacy ¶ added in v0.2.0
func GetRegionLegacy(provider *edgecloud.ProviderClient, regionID int, regionName string) (int, error)
GetRegionLegacy to support backwards compatibility.
func GetRegionV2 ¶ added in v0.2.0
func GetRegionV2(ctx context.Context, client *edgecloudV2.Client, regionID int, regionName string) (int, error)
GetRegionV2 returns a valid region ID for a resource. Use new version Edgecenterclient-go V2. If the regionID is provided, it will be returned directly. If regionName is provided instead, the function will search for the region by name and return its ID. Returns an error if the region is not found or there is an issue with the client.
func ImportStringParser ¶
ImportStringParser parses a string containing project ID, region ID, and another field, and returns them as separate values along with any error encountered.
func ImportStringParserExtended ¶
func ImportStringParserExtended(infoStr string) (projectID int, regionID int, id3 string, id4 string, err error)
ImportStringParserExtended parses a string containing project ID, region ID, and two other fields, and returns them as separate values along with any error encountered.
func IndexFunc ¶ added in v0.5.0
IndexFunc returns the first index i satisfying f(s[i]), or -1 if none do. TODO remove when upgrading to a new version - https://tracker.yandex.ru/CLOUDDEV-456.
func InitCloudClient ¶ added in v0.4.0
func InitCloudClient(ctx context.Context, d *schema.ResourceData, m interface{}) (*edgecloudV2.Client, error)
func MapInterfaceToMapString ¶ added in v0.2.0
func MapStructureDecoder ¶
func MapStructureDecoder(strct interface{}, v *map[string]interface{}, config *mapstructure.DecoderConfig) error
MapStructureDecoder decodes the given map into the provided structure using the specified decoder configuration.
func PrepareMetadata ¶ added in v0.1.11
func PrepareMetadataReadonly ¶ added in v0.1.11
func PrepareMetadataReadonly(apiMetadataRaw interface{}) []map[string]interface{}
func ServerV2StateRefreshFuncV2 ¶ added in v0.2.0
func ServerV2StateRefreshFuncV2(ctx context.Context, client *edgecloudV2.Client, instanceID string) retry.StateRefreshFunc
ServerV2StateRefreshFuncV2 returns a StateRefreshFunc to track the state of an instance using its instanceID.
func StringToNetHookFunc ¶
func StringToNetHookFunc() mapstructure.DecodeHookFuncType
StringToNetHookFunc returns a DecodeHookFunc for the mapstructure package to handle the custom conversion of string values to net.IP and edgecloud.CIDR types.
func StringToNetHookFuncV2 ¶ added in v0.2.0
func StringToNetHookFuncV2() mapstructure.DecodeHookFuncType
StringToNetHookFuncV2 returns a DecodeHookFunc for the mapstructure package to handle the custom conversion of string values to net.IP and edgecloudV2.CIDR types.
func StructToMap ¶
StructToMap converts the struct to map[string]interface{}. Returns an error if the conversion fails.
Types ¶
type Config ¶
type Config struct { Provider *edgecloud.ProviderClient CloudClient *edgecloudV2.Client CDNClient cdn.ClientService StorageClient *storageSDK.SDK DNSClient *dnsSDK.Client }
type InstanceInterfaceWithIPAddress ¶ added in v0.2.0
type InstanceInterfaceWithIPAddress struct { InstanceInterface edgecloudV2.InstanceInterface IPAddress string }
type InstancePortSecurityOpts ¶ added in v0.1.31
type K8sConfig ¶ added in v0.1.17
type K8sConfig struct { APIVersion string `yaml:"apiVersion"` Kind string `yaml:"kind"` CurrentContext string `yaml:"current-context"` // nolint: tagliatelle Preferences struct{} `yaml:"preferences"` Clusters []struct { Name string `yaml:"name"` Cluster struct { CertificateAuthorityData string `yaml:"certificate-authority-data"` // nolint: tagliatelle Server string `yaml:"server"` } `yaml:"cluster"` } `yaml:"clusters"` Contexts []struct { Name string `yaml:"name"` Context struct { Cluster string `yaml:"cluster"` User string `yaml:"user"` } `yaml:"context"` } `yaml:"contexts"` Users []struct { Name string `yaml:"name"` User struct { ClientCertificateData string `yaml:"client-certificate-data"` // nolint: tagliatelle ClientKeyData string `yaml:"client-key-data"` // nolint: tagliatelle } `yaml:"user"` } `yaml:"users"` }
type OrderedInterfaceOpts ¶
type OrderedInterfaceOpts struct { InstanceInterfaceWithIPAddress Order int }
Source Files ¶
- config.go
- data_source_edgecenter_floatingip.go
- data_source_edgecenter_image.go
- data_source_edgecenter_instance.go
- data_source_edgecenter_k8s.go
- data_source_edgecenter_k8s_client_config.go
- data_source_edgecenter_k8s_pool.go
- data_source_edgecenter_lb_l7policy.go
- data_source_edgecenter_lb_l7rule.go
- data_source_edgecenter_lblistener.go
- data_source_edgecenter_lbpool.go
- data_source_edgecenter_loadbalancer.go
- data_source_edgecenter_loadbalancerv2.go
- data_source_edgecenter_network.go
- data_source_edgecenter_project.go
- data_source_edgecenter_region.go
- data_source_edgecenter_reservedfixedip.go
- data_source_edgecenter_router.go
- data_source_edgecenter_secret.go
- data_source_edgecenter_securitygroup.go
- data_source_edgecenter_servergroup.go
- data_source_edgecenter_snapshot.go
- data_source_edgecenter_storage_s3.go
- data_source_edgecenter_storage_s3_bucket.go
- data_source_edgecenter_subnet.go
- data_source_edgecenter_volume.go
- metadata.go
- provider.go
- resource_edgecenter_baremetal.go
- resource_edgecenter_cdn_origin_group.go
- resource_edgecenter_cdn_resource.go
- resource_edgecenter_cdn_rule.go
- resource_edgecenter_cdn_sslcerts.go
- resource_edgecenter_dns_zone.go
- resource_edgecenter_dns_zone_record.go
- resource_edgecenter_floatingip.go
- resource_edgecenter_instance.go
- resource_edgecenter_k8s.go
- resource_edgecenter_k8s_pool.go
- resource_edgecenter_keypair.go
- resource_edgecenter_lb_l7policy.go
- resource_edgecenter_lb_l7rule.go
- resource_edgecenter_lblistener.go
- resource_edgecenter_lbmember.go
- resource_edgecenter_lbpool.go
- resource_edgecenter_lifecyclepolicy.go
- resource_edgecenter_loadbalancer.go
- resource_edgecenter_loadbalancerv2.go
- resource_edgecenter_network.go
- resource_edgecenter_reservedfixedip.go
- resource_edgecenter_router.go
- resource_edgecenter_secret.go
- resource_edgecenter_securitygroup.go
- resource_edgecenter_servergroup.go
- resource_edgecenter_snapshot.go
- resource_edgecenter_storage_s3.go
- resource_edgecenter_storage_s3_bucket.go
- resource_edgecenter_subnet.go
- resource_edgecenter_volume.go
- utils.go
- utils_instance.go
- utils_k8s.go
- utils_lb_l7policy.go
- utils_lb_l7rule.go
- utils_lb_listener.go
- utils_loadbalancer.go
- utils_network.go
- utils_project.go
- utils_region.go
- utils_reservedfixedip.go
- utils_router.go
- utils_securitygroup.go