common

package
v1.36.19 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AlternativeProviderAlias           = "opentelekomcloud.alternative"
	AlternativeProviderWithRegionAlias = "opentelekomcloud.region"
)
View Source
const DataSourceSecGroupDefault = `
data "opentelekomcloud_networking_secgroup_v2" "default_secgroup" {
  name = "default"
}
`

DataSourceSecGroupDefault can be referred as `data.opentelekomcloud_networking_secgroup_v2.default_secgroup`

Variables

View Source
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")
)
View Source
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`

View Source
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`

View Source
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`

View Source
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`

View Source
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

func GenerateRandomDomain(count, strLen int) []string

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

func Reverse(s string) string

Reverse is a function that used to reverse the order of the characters in the given string.

func TestAccPreCheck

func TestAccPreCheck(t *testing.T)

func TestAccPreCheckAdminOnly

func TestAccPreCheckAdminOnly(t *testing.T)

func TestAccPreCheckComponentDeployment added in v1.36.7

func TestAccPreCheckComponentDeployment(t *testing.T)

func TestAccPreCheckFgsAgency added in v1.36.10

func TestAccPreCheckFgsAgency(t *testing.T)

func TestAccPreCheckImageUrlUpdated added in v1.36.7

func TestAccPreCheckImageUrlUpdated(t *testing.T)

func TestAccPreCheckReplication added in v1.36.19

func TestAccPreCheckReplication(t *testing.T)

func TestAccPreCheckRequiredEnvVars

func TestAccPreCheckRequiredEnvVars(t *testing.T)

func TestAccPreCheckServiceAvailability added in v1.32.0

func TestAccPreCheckServiceAvailability(t *testing.T, service string, regions []string) diag.Diagnostics

func TestAccVBSBackupShareCheck

func TestAccVBSBackupShareCheck(t *testing.T)

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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