config

package
v1.64.4 Latest Latest
Warning

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

Go to latest
Published: May 26, 2024 License: MPL-2.0 Imports: 60 Imported by: 19

Documentation

Index

Constants

View Source
const (
	InternationalSite string = "International"
)
View Source
const MAXFieldLength int = 1024

MAXFieldLength is the maximum string length of single field when logging

Variables

View Source
var MutexKV = mutexkv.NewMutexKV()

MutexKV is a global lock on all resources, it can lock the specified shared string (such as resource ID, resource Name, port, etc.) to prevent other resources from using it, for concurrency control. Usage: MutexKV.Lock({resource ID}) and MutexKV.Unlock({resource ID})

Functions

func CheckUpgrade added in v1.64.4

func CheckUpgrade(version string) diag.Diagnostics

func CheckValueInterchange added in v1.64.3

func CheckValueInterchange(d *schema.ResourceDiff, key1, key2 string) (isKey1NewEqualKey2Old bool, isKey2NewEqualKey1Old bool)

CheckValueInterchange checks if the new value of key1 is equal to the old value of key2, and the new value of key2 is equal to the old value of key1.

func FormatHeaders

func FormatHeaders(headers http.Header, seperator string) string

FormatHeaders processes a headers object plus a deliminator, returning a string

func GetServiceDerivedCatalogKeys added in v1.34.0

func GetServiceDerivedCatalogKeys(mainKey string) []string

GetServiceDerivedCatalogKeys returns the derived catalog keys of a service.

func GetServiceEndpoint added in v1.40.0

func GetServiceEndpoint(c *Config, srv, region string) string

GetServiceEndpoint try to get the endpoint from customizing map

func NewHcClient added in v1.35.0

func NewHcClient(c *Config, region, product string, isGlobal bool) (*core.HcHttpClient, error)

NewHcClient is the common client using huaweicloud-sdk-go-v3 package

func RedactHeaders

func RedactHeaders(headers http.Header) (processedHeaders []string)

RedactHeaders processes a headers object, returning a redacted list.

Types

type Config

type Config struct {
	AccessKey           string
	SecretKey           string
	CACertFile          string
	ClientCertFile      string
	ClientKeyFile       string
	DomainID            string
	DomainName          string
	IdentityEndpoint    string
	Insecure            bool
	Region              string
	TenantID            string
	TenantName          string
	Token               string
	SecurityToken       string
	AssumeRoleAgency    string
	AssumeRoleDomain    string
	AssumeRoleDomainID  string
	Cloud               string
	MaxRetries          int
	TerraformVersion    string
	RegionClient        bool
	EnterpriseProjectID string
	SharedConfigFile    string
	Profile             string

	// metadata security key expires at
	SecurityKeyExpiresAt time.Time

	HwClient     *golangsdk.ProviderClient
	DomainClient *golangsdk.ProviderClient

	// the custom endpoints used to override the default endpoint URL
	Endpoints map[string]string

	// RegionProjectIDMap is a map which stores the region-projectId pairs,
	// and region name will be the key and projectID will be the value in this map.
	RegionProjectIDMap map[string]string

	// RPLock is used to make the accessing of RegionProjectIDMap serial,
	// prevent sending duplicate query requests
	RPLock *sync.Mutex

	// SecurityKeyLock is used to make the accessing of SecurityKeyExpiresAt serial,
	// prevent sending duplicate query metadata api
	SecurityKeyLock *sync.Mutex

	// Legacy
	Username         string
	UserID           string
	Password         string
	AgencyName       string
	AgencyDomainName string
	DelegatedProject string

	// Metadata is used for extend
	Metadata any
	// contains filtered or unexported fields
}

func (*Config) AadV1Client added in v1.40.0

func (c *Config) AadV1Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) AntiDDosV1Client

func (c *Config) AntiDDosV1Client(region string) (*golangsdk.ServiceClient, error)

********** client for Security **********

func (*Config) AntiDDosV2Client added in v1.60.1

func (c *Config) AntiDDosV2Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) AomV1Client

func (c *Config) AomV1Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) AosV1Client added in v1.43.0

func (c *Config) AosV1Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) ApiGatewayV1Client

func (c *Config) ApiGatewayV1Client(region string) (*golangsdk.ServiceClient, error)

********** client for Application **********

func (*Config) ApigV2Client added in v1.26.0

func (c *Config) ApigV2Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) AutoscalingV1Client

func (c *Config) AutoscalingV1Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) BcsV2Client

func (c *Config) BcsV2Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) BlockStorageV1Client added in v1.32.0

func (c *Config) BlockStorageV1Client(region string) (*golangsdk.ServiceClient, error)

********** client for Storage **********

func (*Config) BlockStorageV21Client added in v1.32.0

func (c *Config) BlockStorageV21Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) BlockStorageV2Client

func (c *Config) BlockStorageV2Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) BlockStorageV5Client added in v1.61.0

func (c *Config) BlockStorageV5Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) BmsV1Client

func (c *Config) BmsV1Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) BssV1Client

func (c *Config) BssV1Client(region string) (*golangsdk.ServiceClient, error)

********** client for Others **********

func (*Config) BssV2Client

func (c *Config) BssV2Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) CbrV3Client

func (c *Config) CbrV3Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) CceAddonV3Client

func (c *Config) CceAddonV3Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) CceV1Client added in v1.29.0

func (c *Config) CceV1Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) CceV3Client

func (c *Config) CceV3Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) CciV1BetaClient added in v1.25.0

func (c *Config) CciV1BetaClient(region string) (*golangsdk.ServiceClient, error)

func (*Config) CciV1Client

func (c *Config) CciV1Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) CdmV11Client

func (c *Config) CdmV11Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) CdnV1Client

func (c *Config) CdnV1Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) CesV1Client

func (c *Config) CesV1Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) CesV2Client added in v1.45.1

func (c *Config) CesV2Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) CloudStreamV1Client

func (c *Config) CloudStreamV1Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) CloudtableV2Client

func (c *Config) CloudtableV2Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) ComputeV11Client

func (c *Config) ComputeV11Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) ComputeV1Client

func (c *Config) ComputeV1Client(region string) (*golangsdk.ServiceClient, error)

********** client for Compute **********

func (*Config) ComputeV2Client

func (c *Config) ComputeV2Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) CsbsV1Client

func (c *Config) CsbsV1Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) CseV2Client added in v1.37.0

func (c *Config) CseV2Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) CssV1Client

func (c *Config) CssV1Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) CtsV1Client

func (c *Config) CtsV1Client(region string) (*golangsdk.ServiceClient, error)

********** client for Management **********

func (*Config) DNSV21Client added in v1.58.0

func (c *Config) DNSV21Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) DataArtsV1Client added in v1.42.0

func (c *Config) DataArtsV1Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) DataGetEnterpriseProjectID added in v1.34.0

func (c *Config) DataGetEnterpriseProjectID(d *schema.ResourceData) string

DataGetEnterpriseProjectID returns the enterprise_project_id that was specified in the data source. 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 HW_ENTERPRISE_PROJECT_ID. If the provider-level value is also not set, `all_granted_eps` will be returned.

func (*Config) DcV3Client added in v1.44.0

func (c *Config) DcV3Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) DcsV1Client

func (c *Config) DcsV1Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) DcsV2Client

func (c *Config) DcsV2Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) DdsV3Client

func (c *Config) DdsV3Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) DisV2Client

func (c *Config) DisV2Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) DisV3Client added in v1.30.0

func (c *Config) DisV3Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) DliV1Client

func (c *Config) DliV1Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) DliV2Client added in v1.30.0

func (c *Config) DliV2Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) DliV3Client added in v1.62.0

func (c *Config) DliV3Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) DmsV1Client

func (c *Config) DmsV1Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) DmsV2Client

func (c *Config) DmsV2Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) DnsV2Client

func (c *Config) DnsV2Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) DnsWithRegionClient

func (c *Config) DnsWithRegionClient(region string) (*golangsdk.ServiceClient, error)

func (*Config) DrsV3Client added in v1.34.0

func (c *Config) DrsV3Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) DrsV5Client added in v1.62.1

func (c *Config) DrsV5Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) DwsV1Client

func (c *Config) DwsV1Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) DwsV2Client added in v1.30.0

func (c *Config) DwsV2Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) EgV1Client added in v1.56.0

func (c *Config) EgV1Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) ElbV2Client

func (c *Config) ElbV2Client(region string) (*golangsdk.ServiceClient, error)

ElbV2Client is the client for elb v2.0 (openstack) api

func (*Config) ElbV3Client added in v1.24.1

func (c *Config) ElbV3Client(region string) (*golangsdk.ServiceClient, error)

ElbV3Client is the client for elb v3 api

func (*Config) EnterpriseProjectClient

func (c *Config) EnterpriseProjectClient(region string) (*golangsdk.ServiceClient, error)

func (*Config) ErV3Client added in v1.43.0

func (c *Config) ErV3Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) FgsV2Client

func (c *Config) FgsV2Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) FwV2Client

func (c *Config) FwV2Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) GaussdbV3Client

func (c *Config) GaussdbV3Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) GeminiDBV31Client added in v1.30.0

func (c *Config) GeminiDBV31Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) GeminiDBV3Client

func (c *Config) GeminiDBV3Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) GesV1Client

func (c *Config) GesV1Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) GetEnterpriseProjectID added in v1.24.1

func (c *Config) GetEnterpriseProjectID(d *schema.ResourceData) 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 HW_ENTERPRISE_PROJECT_ID.

func (*Config) GetProjectID added in v1.40.0

func (c *Config) GetProjectID(region string) string

GetProjectID is used to get the project ID for services

func (*Config) GetRegion added in v1.24.1

func (c *Config) GetRegion(d *schema.ResourceData) 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 HW_REGION_NAME.

func (*Config) GetWebsiteType added in v1.62.0

func (c *Config) GetWebsiteType() string

func (*Config) HcAomV2Client added in v1.36.0

func (c *Config) HcAomV2Client(region string) (*aomv2.AomClient, error)

HcAomV2Client is the AOM service client using huaweicloud-sdk-go-v3 package

func (*Config) HcCceV3Client added in v1.60.0

func (c *Config) HcCceV3Client(region string) (*ccev3.CceClient, error)

HcCceV3Client is the CCE service client using huaweicloud-sdk-go-v3 package

func (*Config) HcCdnV1Client added in v1.39.0

func (c *Config) HcCdnV1Client(region string) (*cdnv1.CdnClient, error)

HcCdnV1Client is the CDN service client using huaweicloud-sdk-go-v3 package

func (*Config) HcCdnV2Client added in v1.63.0

func (c *Config) HcCdnV2Client(region string) (*cdnv2.CdnClient, error)

HcCdnV2Client is the CDN service client using huaweicloud-sdk-go-v3 package

func (*Config) HcCptsV1Client added in v1.36.0

func (c *Config) HcCptsV1Client(region string) (*cptsv1.CptsClient, error)

HcCptsV1Client is the CPTS service client using huaweicloud-sdk-go-v3 package

func (*Config) HcCssV1Client added in v1.41.0

func (c *Config) HcCssV1Client(region string) (*cssv1.CssClient, error)

HcCssV1Client is the css service client using huaweicloud-sdk-go-v3 package

func (*Config) HcCssV2Client added in v1.41.0

func (c *Config) HcCssV2Client(region string) (*cssv2.CssClient, error)

HcCssV2Client is the css service client using huaweicloud-sdk-go-v3 package

func (*Config) HcCtsV3Client added in v1.35.0

func (c *Config) HcCtsV3Client(region string) (*ctsv3.CtsClient, error)

HcCtsV3Client is the CTS service client using huaweicloud-sdk-go-v3 package

func (*Config) HcDmsV2Client added in v1.41.0

func (c *Config) HcDmsV2Client(region string) (*dmsv2.KafkaClient, error)

HcDmsV2Client is the DMS service client using huaweicloud-sdk-go-v3 package

func (*Config) HcHssV5Client added in v1.44.0

func (c *Config) HcHssV5Client(region string) (*hssv5.HssClient, error)

HcHssV5Client is the HSS service client using huaweicloud-sdk-go-v3 package

func (*Config) HcIamV3Client added in v1.35.0

func (c *Config) HcIamV3Client(region string) (*iamv3.IamClient, error)

HcIamV3Client is the IAM service client using huaweicloud-sdk-go-v3 package

func (*Config) HcIoTdaV5Client added in v1.37.0

func (c *Config) HcIoTdaV5Client(region string, isDerived bool) (*iotdav5.IoTDAClient, error)

HcIoTdaV5Client is the IoTDA service client using huaweicloud-sdk-go-v3 package

func (*Config) HcKmsV3Client added in v1.35.0

func (c *Config) HcKmsV3Client(region string) (*kpsv3.KpsClient, error)

HcKmsV3Client is the KMS service client using huaweicloud-sdk-go-v3 package

func (*Config) HcLiveV1Client added in v1.37.0

func (c *Config) HcLiveV1Client(region string) (*livev1.LiveClient, error)

HcLiveV1Client is the live service client using huaweicloud-sdk-go-v3 package

func (*Config) HcMpcV1Client added in v1.37.0

func (c *Config) HcMpcV1Client(region string) (*mpcv1.MpcClient, error)

HcMpcV1Client is the MPC service client using huaweicloud-sdk-go-v3 package

func (*Config) HcOmsV2Client added in v1.38.0

func (c *Config) HcOmsV2Client(region string) (*omsv2.OmsClient, error)

HcMpcV1Client is the MPC service client using huaweicloud-sdk-go-v3 package

func (*Config) HcRdsV3Client added in v1.35.2

func (c *Config) HcRdsV3Client(region string) (*rdsv3.RdsClient, error)

HcRdsV3Client is the RDS service client using huaweicloud-sdk-go-v3 package

func (*Config) HcTmsV1Client added in v1.35.0

func (c *Config) HcTmsV1Client(region string) (*tmsv1.TmsClient, error)

HcTmsV1Client is the TMS service client using huaweicloud-sdk-go-v3 package

func (*Config) HcVodV1Client added in v1.37.0

func (c *Config) HcVodV1Client(region string) (*vodv1.VodClient, error)

HcVodV1Client is the AOM service client using huaweicloud-sdk-go-v3 package

func (*Config) HcVpcV3Client added in v1.35.0

func (c *Config) HcVpcV3Client(region string) (*vpcv3.VpcClient, error)

HcVpcV3Client is the VPC service client using huaweicloud-sdk-go-v3 package

func (*Config) IAMNoVersionClient added in v1.31.1

func (c *Config) IAMNoVersionClient(region string) (*golangsdk.ServiceClient, error)

func (*Config) IAMV3Client

func (c *Config) IAMV3Client(region string) (*golangsdk.ServiceClient, error)

********** client for Global Service **********

func (*Config) IECV1Client

func (c *Config) IECV1Client(region string) (*golangsdk.ServiceClient, error)

IECV1Client returns a ServiceClient for IEC Endpoint APIs

func (*Config) IdentityV3Client

func (c *Config) IdentityV3Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) IdentityV3ExtClient added in v1.61.1

func (c *Config) IdentityV3ExtClient(region string) (*golangsdk.ServiceClient, error)

func (*Config) ImageV1Client added in v1.47.0

func (c *Config) ImageV1Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) ImageV2Client

func (c *Config) ImageV2Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) KmsKeyV1Client

func (c *Config) KmsKeyV1Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) KmsV1Client added in v1.33.0

func (c *Config) KmsV1Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) KmsV3Client added in v1.42.0

func (c *Config) KmsV3Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) KooGalleryV1Client added in v1.56.0

func (c *Config) KooGalleryV1Client(region string) (*golangsdk.ServiceClient, error)

KooGalleryV1Client has the endpoint: https://mkt.{{cloud}}/v1/

func (*Config) LoadAndValidate

func (c *Config) LoadAndValidate() error

func (*Config) LoadBalancerClient

func (c *Config) LoadBalancerClient(region string) (*golangsdk.ServiceClient, error)

LoadBalancerClient is the client for elb v2 api

func (*Config) LtsV2Client

func (c *Config) LtsV2Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) MaasV1Client

func (c *Config) MaasV1Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) MlsV1Client

func (c *Config) MlsV1Client(region string) (*golangsdk.ServiceClient, error)

MlsV1Client has the endpoint: https://mls.{{region}}/{{cloud}}/v1.0/{{project_id}}

func (*Config) ModelArtsV1Client added in v1.34.0

func (c *Config) ModelArtsV1Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) ModelArtsV2Client added in v1.35.0

func (c *Config) ModelArtsV2Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) MrsV1Client

func (c *Config) MrsV1Client(region string) (*golangsdk.ServiceClient, error)

********** client for Enterprise Intelligence **********

func (*Config) MrsV2Client added in v1.27.1

func (c *Config) MrsV2Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) NatGatewayClient

func (c *Config) NatGatewayClient(region string) (*golangsdk.ServiceClient, error)

func (*Config) NatV2Client added in v1.35.0

func (c *Config) NatV2Client(region string) (*golangsdk.ServiceClient, error)

NatV2Client has the endpoint: https://nat.{{region}}/{{cloud}}/v2.0/

func (*Config) NatV3Client added in v1.46.0

func (c *Config) NatV3Client(region string) (*golangsdk.ServiceClient, error)

NatV3Client has the endpoint: https://nat.{{region}}/{{cloud}}/v3/

func (*Config) NetworkingV1Client

func (c *Config) NetworkingV1Client(region string) (*golangsdk.ServiceClient, error)

********** client for Network **********

func (*Config) NetworkingV2Client

func (c *Config) NetworkingV2Client(region string) (*golangsdk.ServiceClient, error)

NetworkingV2Client returns a ServiceClient for neutron APIs the endpoint likes: https://vpc.{region}.myhuaweicloud.com/v2.0/

func (*Config) NetworkingV3Client added in v1.34.0

func (c *Config) NetworkingV3Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) NewServiceClient

func (c *Config) NewServiceClient(srv, region string) (*golangsdk.ServiceClient, error)

NewServiceClient create a ServiceClient which was assembled from ServiceCatalog. If you want to add new ServiceClient, please make sure the catalog was already in allServiceCatalog. the endpoint likes https://{Name}.{Region}.myhuaweicloud.com/{Version}/{project_id}/{ResourceBase}

func (*Config) ObjectStorageClient

func (c *Config) ObjectStorageClient(region string) (*obs.ObsClient, error)

func (*Config) ObjectStorageClientWithSignature

func (c *Config) ObjectStorageClientWithSignature(region string) (*obs.ObsClient, error)

func (*Config) OpenGaussV3Client

func (c *Config) OpenGaussV3Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) RdsV1Client

func (c *Config) RdsV1Client(region string) (*golangsdk.ServiceClient, error)

********** client for Database **********

func (*Config) RdsV31Client added in v1.62.0

func (c *Config) RdsV31Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) RdsV3Client

func (c *Config) RdsV3Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) RmsV1Client added in v1.45.0

func (c *Config) RmsV1Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) ScmV3Client added in v1.25.1

func (c *Config) ScmV3Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) SdrsV1Client added in v1.51.0

func (c *Config) SdrsV1Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) ServiceStageV1Client added in v1.35.2

func (c *Config) ServiceStageV1Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) ServiceStageV2Client added in v1.36.0

func (c *Config) ServiceStageV2Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) SetServiceEndpoint added in v1.62.0

func (c *Config) SetServiceEndpoint(service, endpoint string)

func (*Config) SetWebsiteType added in v1.62.0

func (c *Config) SetWebsiteType() error

SetWebsiteType will update WebsiteType field by a probe API. we will get status code 403 and the following response body in International website with https://bss.myhuaweicloud.com

{
  "error_code": "CBC.0150",
  "error_msg": "Access denied. The customer does not belong to the website you are now at."
}

we can call the probe API and parse the response body to decide whether the account belongs to International website or not. we select https://support.huaweicloud.com/intl/zh-cn/api-oce/zh-cn_topic_0000001256679455.html as the probe API.

func (*Config) SfsV1Client

func (c *Config) SfsV1Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) SfsV2Client

func (c *Config) SfsV2Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) SmnV2Client

func (c *Config) SmnV2Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) SmnV2TagClient added in v1.36.0

func (c *Config) SmnV2TagClient(region string) (*golangsdk.ServiceClient, error)

func (*Config) SmsV3Client added in v1.37.0

func (c *Config) SmsV3Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) SwrV2Client

func (c *Config) SwrV2Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) TmsV1Client added in v1.57.0

func (c *Config) TmsV1Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) TmsV2Client added in v1.57.0

func (c *Config) TmsV2Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) VPCEPClient

func (c *Config) VPCEPClient(region string) (*golangsdk.ServiceClient, error)

VPCEPClient returns a ServiceClient for VPC Endpoint APIs the endpoint likes: https://vpcep.{region}.myhuaweicloud.com/v1/{project_id}/

func (*Config) VbsV2Client

func (c *Config) VbsV2Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) VpnV5Client added in v1.58.0

func (c *Config) VpnV5Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) WafDedicatedV1Client added in v1.27.2

func (c *Config) WafDedicatedV1Client(region string) (*golangsdk.ServiceClient, error)

func (*Config) WafV1Client added in v1.25.1

func (c *Config) WafV1Client(region string) (*golangsdk.ServiceClient, error)

WafV1Client is not avaliable in HuaweiCloud, will be imported by other clouds

func (*Config) WorkspaceV2Client added in v1.41.1

func (c *Config) WorkspaceV2Client(region string) (*golangsdk.ServiceClient, error)

type LogRoundTripper

type LogRoundTripper struct {
	Rt         http.RoundTripper
	MaxRetries int
}

LogRoundTripper satisfies the http.RoundTripper interface and is used to customize the default http client RoundTripper to allow for logging.

func (*LogRoundTripper) RoundTrip

func (lrt *LogRoundTripper) RoundTrip(request *http.Request) (*http.Response, error)

RoundTrip performs a round-trip HTTP request and logs relevant information about it.

type Profile added in v1.35.0

type Profile struct {
	Name             string `json:"name"`
	Mode             string `json:"mode"`
	AccessKeyId      string `json:"accessKeyId"`
	SecretAccessKey  string `json:"secretAccessKey"`
	SecurityToken    string `json:"securityToken"`
	Region           string `json:"region"`
	ProjectId        string `json:"projectId"`
	DomainId         string `json:"domainId"`
	AgencyDomainId   string `json:"agencyDomainId"`
	AgencyDomainName string `json:"agencyDomainName"`
	AgencyName       string `json:"agencyName"`
}

type ServiceCatalog

type ServiceCatalog struct {
	Name             string
	Version          string
	Scope            string
	Admin            bool
	ResourceBase     string
	WithOutProjectID bool
	Product          string
}

ServiceCatalog defines a struct which was used to generate a service client for huaweicloud. the endpoint likes https://{Name}.{Region}.myhuaweicloud.com/{Version}/{project_id}/{ResourceBase} For more information, please refer to Config.NewServiceClient

func GetServiceCatalog added in v1.41.1

func GetServiceCatalog(service string) *ServiceCatalog

GetServiceCatalog returns the catalog object of a service

type SharedConfig added in v1.35.0

type SharedConfig struct {
	Current  string    `json:"current"`
	Profiles []Profile `json:"profiles"`
}

CLI Shared Config

type VersionConfig added in v1.64.4

type VersionConfig struct {
	Latest  string            `json:"latest"`
	Version map[string]string `json:"version"`
	Warning string            `json:"warning"`
	Message string            `json:"message"`
}

Jump to

Keyboard shortcuts

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