Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateRandomDomain(count, strLen int) []string
- func Reverse(s string) string
- func TestAccPreCheck(t *testing.T)
- func TestAccPreCheckAdminOnly(t *testing.T)
- func TestAccPreCheckComponentDeployment(t *testing.T)
- func TestAccPreCheckFgsAgency(t *testing.T)
- func TestAccPreCheckImageUrlUpdated(t *testing.T)
- func TestAccPreCheckReplication(t *testing.T)
- func TestAccPreCheckRequiredEnvVars(t *testing.T)
- func TestAccPreCheckServiceAvailability(t *testing.T, service string, regions []string) diag.Diagnostics
- func TestAccVBSBackupShareCheck(t *testing.T)
- type ResourceCheck
- type ServiceFunc
Constants ¶
const ( AlternativeProviderAlias = "opentelekomcloud.alternative" AlternativeProviderWithRegionAlias = "opentelekomcloud.region" )
const DataSourceSecGroupDefault = `
data "opentelekomcloud_networking_secgroup_v2" "default_secgroup" {
name = "default"
}
`
DataSourceSecGroupDefault can be referred as `data.opentelekomcloud_networking_secgroup_v2.default_secgroup`
Variables ¶
var ( TestAccProviderFactories map[string]func() (*schema.Provider, error) TestAccProvider *schema.Provider AlternativeProviderConfig = fmt.Sprintf(` provider opentelekomcloud { alias = "alternative" cloud = "%s" tenant_id = "%s" tenant_name = "%s" } `, altCloud, altProjectID, altProjectName) AlternativeProviderWithRegionConfig string OTC_BUILD_IMAGE_URL = os.Getenv("OTC_BUILD_IMAGE_URL") OTC_BUILD_IMAGE_URL_UPDATED = os.Getenv("OTC_BUILD_IMAGE_URL_UPDATED") OS_FGS_AGENCY_NAME = os.Getenv("OS_FGS_AGENCY_NAME") )
var DataSourceExtNetwork = fmt.Sprintf(` data "opentelekomcloud_networking_network_v2" "ext_network" { name = "%s" } `, env.OsExtNetworkName)
DataSourceExtNetwork can be referred as `data.opentelekomcloud_networking_network_v2.ext_network`
var DataSourceImage = fmt.Sprintf(` data "opentelekomcloud_images_image_v2" "latest_image" { name = "%s" most_recent = true } `, env.OsImageName)
DataSourceImage can be referred as `data.opentelekomcloud_images_image_v2.latest_image`
var DataSourceKMSKey = fmt.Sprintf(` data "opentelekomcloud_kms_key_v1" "default_key" { key_alias = "%s" } `, env.OsKmsName)
DataSourceKMSKey can be referred as `data.opentelekomcloud_kms_key_v1.default_key`
var DataSourceProject = fmt.Sprintf(` data "opentelekomcloud_identity_project_v3" "project" { name = "%s" } `, env.OS_TENANT_NAME)
DataSourceProject can be referred as `data.opentelekomcloud_identity_project_v3.project`
var DataSourceSubnet = fmt.Sprintf(` data "opentelekomcloud_vpc_subnet_v1" "shared_subnet" { name = "%s" } `, env.OsSubnetName)
DataSourceSubnet can be referred as `data.opentelekomcloud_vpc_subnet_v1.shared_subnet`
Functions ¶
func GenerateRandomDomain ¶ added in v1.36.8
GenerateRandomDomain is a method Used to generate the domain names and the domain IDs, which cannot start with a digit. All elements' length are the same.
func Reverse ¶ added in v1.36.8
Reverse is a function that used to reverse the order of the characters in the given string.
func TestAccPreCheck ¶
func TestAccPreCheckComponentDeployment ¶ added in v1.36.7
func TestAccPreCheckFgsAgency ¶ added in v1.36.10
func TestAccPreCheckImageUrlUpdated ¶ added in v1.36.7
func TestAccPreCheckReplication ¶ added in v1.36.19
func TestAccPreCheckServiceAvailability ¶ added in v1.32.0
Types ¶
type ResourceCheck ¶ added in v1.36.7
type ResourceCheck struct {
// contains filtered or unexported fields
}
ResourceCheck resource check object
func InitDataSourceCheck ¶ added in v1.36.7
func InitDataSourceCheck(dName string) *ResourceCheck
InitDataSourceCheck build a 'ResourceCheck' object. Only used to check datasource attributes.
Parameters: dName: The data source name is used to check in the terraform.State. e.g. data.opentelekomcloud_vpc_v1.vpc Return: *ResourceCheck: ResourceCheck object
func InitResourceCheck ¶ added in v1.36.7
func InitResourceCheck(rName string, rObject interface{}, getResourceFunc ServiceFunc) *ResourceCheck
InitResourceCheck build a 'ResourceCheck' object. The common test methods are provided in 'ResourceCheck'.
Parameters: rName: The resource name is used to check in the terraform.State. e.g. opentelekomcloud_vpc_v1.vpc rObject: Resource object pointer, used to check whether the resource exists getResourceFunc: The function used to get the resource object. Return: *ResourceCheck: ResourceCheck object
func (*ResourceCheck) CheckMultiResourcesExists ¶ added in v1.36.7
func (rc *ResourceCheck) CheckMultiResourcesExists(count int) resource.TestCheckFunc
CheckMultiResourcesExists checks whether multiple resources created by count are both existed.
Parameters: count: the expected number of resources that will be created.
func (*ResourceCheck) CheckResourceDestroy ¶ added in v1.36.7
func (rc *ResourceCheck) CheckResourceDestroy() resource.TestCheckFunc
CheckResourceDestroy check whether resources destroyed
func (*ResourceCheck) CheckResourceExists ¶ added in v1.36.7
func (rc *ResourceCheck) CheckResourceExists() resource.TestCheckFunc
CheckResourceExists check whether resources exist
type ServiceFunc ¶ added in v1.36.7
type ServiceFunc func(*cfg.Config, *terraform.ResourceState) (interface{}, error)
ServiceFunc the resource query functions