Documentation ¶
Index ¶
- Variables
- func CheckDeleted(d *schema.ResourceData, err error, msg string) error
- func GetEnterpriseProjectID(d *schema.ResourceData, config *config.Config) string
- func GetRegion(d *schema.ResourceData, config *config.Config) string
- func InitDataSourceCheck(sourceName string) *resourceCheck
- func InitResourceCheck(resourceName string, resourceObject interface{}, getResourceFunc ServiceFunc) *resourceCheck
- func RandomAccResourceName() string
- func RandomAccResourceNameWithDash() string
- func RandomCidr() string
- func RandomCidrAndGatewayIp() (string, string)
- func ReplaceVarsForTest(rs *terraform.ResourceState, linkTmpl string) (string, error)
- func TestAccPreCheck(t *testing.T)
- func TestAccPreCheckAdminOnly(t *testing.T)
- func TestAccPreCheckDeprecated(t *testing.T)
- func TestAccPreCheckEpsID(t *testing.T)
- func TestAccPreCheckFgsTrigger(t *testing.T)
- func TestAccPreCheckOBS(t *testing.T)
- func TestAccPreCheckOBSBucket(t *testing.T)
- func TestAccPreCheckProject(t *testing.T)
- func TestAccPreCheckSWRDomian(t *testing.T)
- func TestBaseComputeResources(name string) string
- func TestBaseNetwork(name string) string
- func TestCheckResourceAttrWithVariable(resourceName, key, varStr string) resource.TestCheckFunc
- func TestSecGroup(name string) string
- func TestVpc(name string) string
- func UnsubscribePrePaidResource(d *schema.ResourceData, config *config.Config, resourceIDs []string) error
- type ResourceCheck
- type ServiceFunc
Constants ¶
This section is empty.
Variables ¶
var ( SBC_REGION_NAME = os.Getenv("SBC_REGION_NAME") SBC_ENTERPRISE_PROJECT_ID = os.Getenv("SBC_ENTERPRISE_PROJECT_ID") SBC_ENTERPRISE_PROJECT_ID_TEST = os.Getenv("SBC_ENTERPRISE_PROJECT_ID_TEST") SBC_PROJECT_ID = os.Getenv("SBC_PROJECT_ID") SBC_DEPRECATED_ENVIRONMENT = os.Getenv("SBC_DEPRECATED_ENVIRONMENT") SBC_ADMIN = os.Getenv("SBC_ADMIN") SBC_DOMAIN_ID = os.Getenv("SBC_DOMAIN_ID") SBC_DOMAIN_NAME = os.Getenv("SBC_DOMAIN_NAME") SBC_ACCESS_KEY = os.Getenv("SBC_ACCESS_KEY") SBC_SECRET_KEY = os.Getenv("SBC_SECRET_KEY") SBC_DLI_FLINK_JAR_OBS_PATH = os.Getenv("SBC_DLI_FLINK_JAR_OBS_PATH") SBC_SWR_SHARING_ACCOUNT = os.Getenv("SBC_SWR_SHARING_ACCOUNT") SBC_FGS_TRIGGER_LTS_AGENCY = os.Getenv("SBC_FGS_TRIGGER_LTS_AGENCY") SBC_OBS_BUCKET_NAME = os.Getenv("SBC_OBS_BUCKET_NAME") )
var TestAccProvider *schema.Provider
TestAccProvider is the "main" provider instance
var TestAccProviderFactories map[string]func() (*schema.Provider, error)
TestAccProviderFactories is a static map containing only the main provider instance
Functions ¶
func CheckDeleted ¶ added in v1.11.0
func CheckDeleted(d *schema.ResourceData, err error, msg string) error
CheckDeleted checks the error to see if it's a 404 (Not Found) and, if so, sets the resource ID to the empty string instead of throwing an error.
func GetEnterpriseProjectID ¶ added in v1.11.0
func GetEnterpriseProjectID(d *schema.ResourceData, config *config.Config) string
GetEnterpriseProjectID returns the enterprise_project_id that was specified in the resource. If it was not set, the provider-level value is checked. The provider-level value can either be set by the `enterprise_project_id` argument or by SBC_ENTERPRISE_PROJECT_ID.
func GetRegion ¶ added in v1.11.0
func GetRegion(d *schema.ResourceData, config *config.Config) string
GetRegion returns the region that was specified in the resource. If a region was not set, the provider-level region is checked. The provider-level region can either be set by the region argument or by SBC_REGION_NAME.
func InitDataSourceCheck ¶
func InitDataSourceCheck(sourceName string) *resourceCheck
InitDataSourceCheck build a 'resourceCheck' object. Only used to check datasource attributes.
Parameters: resourceName: The resource name is used to check in the terraform.State.e.g. : sbercloud_waf_domain.domain_1. Return: *resourceCheck: resourceCheck object
func InitResourceCheck ¶
func InitResourceCheck(resourceName string, resourceObject interface{}, getResourceFunc ServiceFunc) *resourceCheck
InitResourceCheck build a 'resourceCheck' object. The common test methods are provided in 'resourceCheck'.
Parameters: resourceName: The resource name is used to check in the terraform.State.e.g. : sbercloud_waf_domain.domain_1. resourceObject: Resource object, used to check whether the resource exists in SberCloud. getResourceFunc: The function used to get the resource object. Return: *resourceCheck: resourceCheck object
func RandomAccResourceName ¶
func RandomAccResourceName() string
func RandomAccResourceNameWithDash ¶
func RandomAccResourceNameWithDash() string
func RandomCidr ¶
func RandomCidr() string
func RandomCidrAndGatewayIp ¶
func ReplaceVarsForTest ¶ added in v1.11.2
func ReplaceVarsForTest(rs *terraform.ResourceState, linkTmpl string) (string, error)
func TestAccPreCheck ¶
func TestAccPreCheckEpsID ¶
func TestAccPreCheckFgsTrigger ¶ added in v1.11.0
lintignore:AT003
func TestAccPreCheckOBS ¶ added in v1.10.0
func TestAccPreCheckOBSBucket ¶ added in v1.11.0
func TestAccPreCheckProject ¶
func TestAccPreCheckSWRDomian ¶ added in v1.11.0
lintignore:AT003
func TestBaseComputeResources ¶ added in v1.11.4
TestBaseComputeResources vpc, subnet, security group, availability zone, keypair, image, flavor
func TestBaseNetwork ¶ added in v1.11.0
func TestCheckResourceAttrWithVariable ¶
func TestCheckResourceAttrWithVariable(resourceName, key, varStr string) resource.TestCheckFunc
TestCheckResourceAttrWithVariable validates the variable in state for the given name/key combination.
Parameters: resourceName: The resource name is used to check in the terraform.State. key: The field name of the resource. variable: The variable name of the value to be checked. variable such like ${sbercloud_waf_certificate.certificate_1.id} or ${data.sbercloud_waf_policies.policies_2.policies.0.id}
func TestSecGroup ¶ added in v1.11.0
TestSecGroup can be referred as `sbercloud_networking_secgroup.test`
func TestVpc ¶ added in v1.11.0
TestVpc can be referred as `sbercloud_vpc.test` and `sbercloud_vpc_subnet.test`
func UnsubscribePrePaidResource ¶ added in v1.11.0
func UnsubscribePrePaidResource(d *schema.ResourceData, config *config.Config, resourceIDs []string) error
UnsubscribePrePaidResource impl the action of unsubscribe resource
Types ¶
type ResourceCheck ¶ added in v1.11.4
type ResourceCheck struct {
// contains filtered or unexported fields
}
ResourceCheck resource check object
func (*ResourceCheck) CheckMultiResourcesExists ¶ added in v1.11.4
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.11.4
func (rc *ResourceCheck) CheckResourceDestroy() resource.TestCheckFunc
CheckResourceDestroy check whether resources destroyed
func (*ResourceCheck) CheckResourceExists ¶ added in v1.11.4
func (rc *ResourceCheck) CheckResourceExists() resource.TestCheckFunc
CheckResourceExists check whether resources exist
type ServiceFunc ¶
type ServiceFunc func(*config.Config, *terraform.ResourceState) (interface{}, error)
ServiceFunc the SberCloud resource query functions.