config

package
v1.24.1-0...-4a156ac Latest Latest
Warning

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

Go to latest
Published: May 6, 2021 License: MPL-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var REDACT_HEADERS = []string{
	"x-auth-token", "x-security-token", "x-service-token",
	"x-subject-token", "x-storage-token", "authorization",
}

REDACT_HEADERS is a list of headers that need to be redacted

Functions

func FormatHeaders

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

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

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
	Password            string
	Region              string
	TenantID            string
	TenantName          string
	Token               string
	SecurityToken       string
	Username            string
	UserID              string
	AgencyName          string
	AgencyDomainName    string
	DelegatedProject    string
	Cloud               string
	MaxRetries          int
	TerraformVersion    string
	RegionClient        bool
	EnterpriseProjectID string

	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
}

func (*Config) AntiDDosV1Client

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

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

func (*Config) AomV1Client

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

func (*Config) ApiGatewayV1Client

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

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

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) BlockStorageV2Client

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

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

func (*Config) BlockStorageV3Client

func (c *Config) BlockStorageV3Client(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) CceV3Client

func (c *Config) CceV3Client(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) 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) 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) 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) DliV1Client

func (c *Config) DliV1Client(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) DwsV1Client

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

func (*Config) ElasticLBClient

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

func (*Config) ElbV2Client

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

client for v2.0 api

func (*Config) EnterpriseProjectClient

func (c *Config) EnterpriseProjectClient(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) 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

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) GetRegion

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) 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) ImageV2Client

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

func (*Config) KmsKeyV1Client

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

func (*Config) LoadAndValidate

func (c *Config) LoadAndValidate() error

func (*Config) LoadBalancerClient

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

client for 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)

func (*Config) MrsV1Client

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

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

func (*Config) NatGatewayClient

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

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) 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) OrchestrationV1Client

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

func (*Config) RdsV1Client

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

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

func (*Config) RdsV3Client

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

func (*Config) SecurityGroupV1Client

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

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) SwrV2Client

func (c *Config) SwrV2Client(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)

type LogRoundTripper

type LogRoundTripper struct {
	Rt         http.RoundTripper
	OsDebug    bool
	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 ServiceCatalog

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

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

Jump to

Keyboard shortcuts

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