Skip to content

Commit

Permalink
fix a bug
Browse files Browse the repository at this point in the history
  • Loading branch information
zshongyi committed Dec 5, 2024
1 parent 8608ab2 commit 12b7c30
Show file tree
Hide file tree
Showing 846 changed files with 50,562 additions and 35,311 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ website/vendor
/.project
/terraform
/terraform
/tf-templates
/tf-templates
/.settings
31 changes: 31 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
qdist: xenial
sudo: required
services:
- docker

language: go
go:
- "1.13.x"
- "1.14.x"

#install:
# - make tools

script:
- make test
- make vet
- make website-test

branches:
only:
- master

matrix:
fast_finish: true
allow_failures:
- go: tip

env:
global:
- GOFLAGS=-mod=vendor
- GO111MODULE=on
7 changes: 3 additions & 4 deletions alibabacloudstack/connectivity/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -666,13 +666,13 @@ func (client *AlibabacloudStackClient) NewCommonRequest(product, serviceCode, sc
request.Product = product

if strings.ToUpper(product) == "SLB" {
request.QueryParams = map[string]string{"AccessKeySecret": client.SecretKey, "Product": "slb", "Department": client.Department, "ResourceGroup": client.ResourceGroup, "Version": string(apiVersion)}
request.QueryParams = map[string]string{"Product": "slb", "Department": client.Department, "ResourceGroup": client.ResourceGroup, "Version": string(apiVersion)}
}
if strings.ToUpper(product) == "ECS" {
request.QueryParams = map[string]string{"AccessKeySecret": client.SecretKey, "Product": "ecs", "Department": client.Department, "ResourceGroup": client.ResourceGroup, "Version": string(apiVersion)}
request.QueryParams = map[string]string{"Product": "ecs", "Department": client.Department, "ResourceGroup": client.ResourceGroup, "Version": string(apiVersion)}
}
if strings.ToUpper(product) == "ASCM" {
request.QueryParams = map[string]string{"AccessKeySecret": client.SecretKey, "Product": "ascm", "Department": client.Department, "ResourceGroup": client.ResourceGroup, "Version": string(apiVersion)}
request.QueryParams = map[string]string{"Product": "ascm", "Department": client.Department, "ResourceGroup": client.ResourceGroup, "Version": string(apiVersion)}
}

request.AppendUserAgent(Terraform, TerraformVersion)
Expand Down Expand Up @@ -846,7 +846,6 @@ func (client *AlibabacloudStackClient) GetCallerInfo() (*responses.BaseResponse,
request.Version = "2019-05-10" // Specify product version
request.ApiName = "GetUserInfo"
request.QueryParams = map[string]string{
"AccessKeySecret": client.Config.SecretKey,
"SecurityToken": client.Config.SecurityToken,
"Product": "ascm",
"Department": client.Config.Department,
Expand Down
1 change: 1 addition & 0 deletions alibabacloudstack/connectivity/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ type Config struct {
RamRoleSessionExpiration int

Endpoints map[string]interface{}
AsApiEndpoint string
EcsEndpoint string
RdsEndpoint string
SlbEndpoint string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func dataSourceAlibabacloudStackAdbDbClusters() *schema.Resource {
"description_regex": {
Type: schema.TypeString,
Optional: true,
ValidateFunc: validation.ValidateRegexp,
ValidateFunc: validation.StringIsValidRegExp,
ForceNew: true,
},
"descriptions": {
Expand Down
6 changes: 3 additions & 3 deletions alibabacloudstack/data_source_apsarastack_api_gateway_apis.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func dataSourceAlibabacloudStackApiGatewayApis() *schema.Resource {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
ValidateFunc: validation.ValidateRegexp,
ValidateFunc: validation.StringIsValidRegExp,
},
"output_file": {
Type: schema.TypeString,
Expand Down Expand Up @@ -91,8 +91,8 @@ func dataSourceAlibabacloudStackApigatewayApisRead(d *schema.ResourceData, meta
"RegionId": client.RegionId,
}
request.QueryParams = map[string]string{
"AccessKeySecret": client.SecretKey,
"AccessKeyId": client.AccessKey,


"Product": "CloudAPI",
"RegionId": client.RegionId,
"Department": client.Department,
Expand Down
10 changes: 5 additions & 5 deletions alibabacloudstack/data_source_apsarastack_api_gateway_apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func dataSourceAlibabacloudStackApiGatewayApps() *schema.Resource {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
ValidateFunc: validation.ValidateRegexp,
ValidateFunc: validation.StringIsValidRegExp,
},
"ids": {
Type: schema.TypeList,
Expand Down Expand Up @@ -86,8 +86,8 @@ func dataSourceAlibabacloudStackApigatewayAppsRead(d *schema.ResourceData, meta
"RegionId": client.RegionId,
}
request.QueryParams = map[string]string{
"AccessKeySecret": client.SecretKey,
"AccessKeyId": client.AccessKey,


"Product": "CloudAPI",
"RegionId": client.RegionId,
"Department": client.Department,
Expand Down Expand Up @@ -179,8 +179,8 @@ func apigatewayAppsDecriptionAttributes(d *schema.ResourceData, apps []cloudapi.
"RegionId": client.RegionId,
}
request.QueryParams = map[string]string{
"AccessKeySecret": client.SecretKey,
"AccessKeyId": client.AccessKey,


"Product": "CloudAPI",
"RegionId": client.RegionId,
"Department": client.Department,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func dataSourceAlibabacloudStackApiGatewayGroups() *schema.Resource {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
ValidateFunc: validation.ValidateRegexp,
ValidateFunc: validation.StringIsValidRegExp,
},
"ids": {
Type: schema.TypeList,
Expand Down Expand Up @@ -99,8 +99,8 @@ func dataSourceAlibabacloudStackApigatewayGroupsRead(d *schema.ResourceData, met
"RegionId": client.RegionId,
}
request.QueryParams = map[string]string{
"AccessKeySecret": client.SecretKey,
"AccessKeyId": client.AccessKey,


"Product": "CloudAPI",
"RegionId": client.RegionId,
"Department": client.Department,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ func dataSourceAlibabacloudStackEcsInstanceFamiliesRead(d *schema.ResourceData,
request.ApiName = "DescribeInstanceTypeFamilies"
request.Headers = map[string]string{"RegionId": client.RegionId}
request.QueryParams = map[string]string{
"AccessKeyId": client.AccessKey,
"AccessKeySecret": client.SecretKey,


"Product": "ascm",
"RegionId": client.RegionId,
"Department": client.Department,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func dataSourceAlibabacloudStackAscmEnvironmentServicesByProductRead(d *schema.R
request.RegionId = client.RegionId
request.ApiName = "GetEnvProducts"
request.Headers = map[string]string{"RegionId": client.RegionId}
request.QueryParams = map[string]string{"AccessKeyId": client.AccessKey, "AccessKeySecret": client.SecretKey, "Product": "ascm", "RegionId": client.RegionId, "Department": client.Department, "ResourceGroup": client.ResourceGroup, "Action": "GetEnvProducts", "Version": "2019-05-10"}
request.QueryParams = map[string]string{ "Product": "ascm", "RegionId": client.RegionId, "Department": client.Department, "ResourceGroup": client.ResourceGroup, "Action": "GetEnvProducts", "Version": "2019-05-10"}
response := EnvironmentProduct{}

for {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ func dataSourceAlibabacloudStackInstanceFamiliesRead(d *schema.ResourceData, met
request.ApiName = "DescribeSeriesIdFamilies"
request.Headers = map[string]string{"RegionId": client.RegionId}
request.QueryParams = map[string]string{
"AccessKeyId": client.AccessKey,
"AccessKeySecret": client.SecretKey,


"Department": client.Department,
"ResourceGroup": client.ResourceGroup,
"Product": "ascm",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ func dataSourceAlibabacloudStackAscmLogonPoliciesRead(d *schema.ResourceData, me
request.ApiName = "ListLoginPolicies"
request.Headers = map[string]string{"RegionId": client.RegionId}
request.QueryParams = map[string]string{
"AccessKeyId": client.AccessKey,
"AccessKeySecret": client.SecretKey,


"Product": "ascm",
"RegionId": client.RegionId,
"Action": "ListLoginPolicies",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ func dataSourceAlibabacloudstackAscmMeteringQueryEcsRead(d *schema.ResourceData,
request.ApiName = "MeteringWebQuery"
request.Headers = map[string]string{"RegionId": client.RegionId}
request.QueryParams = map[string]string{
"AccessKeyId": client.AccessKey,

"Product": "ascm",
"ProductName": "ascm",
"AccessKeySecret": client.SecretKey,

"Department": client.Department,
"resourceGroupId": client.ResourceGroup,
"RegionId": client.RegionId,
Expand Down
15 changes: 8 additions & 7 deletions alibabacloudstack/data_source_apsarastack_ascm_organizations.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ func dataSourceAlibabacloudStackAscmOrganizations() *schema.Resource {
Optional: true,
ForceNew: true,
},
"names": {
Type: schema.TypeList,
Computed: true,
Elem: &schema.Schema{Type: schema.TypeString},
},
// 未消费变量
// "names": {
// Type: schema.TypeList,
// Computed: true,
// Elem: &schema.Schema{Type: schema.TypeString},
// },
"parent_id": {
Type: schema.TypeInt,
Optional: true,
Expand Down Expand Up @@ -109,8 +110,8 @@ func dataSourceAlibabacloudStackAscmOrganizationsRead(d *schema.ResourceData, me
request.ApiName = "GetOrganizationList"
request.Headers = map[string]string{"RegionId": client.RegionId}
request.QueryParams = map[string]string{
"AccessKeyId": client.AccessKey,
"AccessKeySecret": client.SecretKey,


"Product": "ascm",
"RegionId": client.RegionId,
"Action": "GetOrganizationList",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func dataSourceAlibabacloudStackAscmPasswordPoliciesRead(d *schema.ResourceData,
request.RegionId = client.RegionId
request.ApiName = "GetPasswordPolicy"
request.Headers = map[string]string{"RegionId": client.RegionId}
request.QueryParams = map[string]string{"AccessKeyId": client.AccessKey, "AccessKeySecret": client.SecretKey, "Product": "ascm", "RegionId": client.RegionId, "Action": "GetPasswordPolicy", "Department": client.Department, "ResourceGroup": client.ResourceGroup, "Version": "2019-05-10"}
request.QueryParams = map[string]string{ "Product": "ascm", "RegionId": client.RegionId, "Action": "GetPasswordPolicy", "Department": client.Department, "ResourceGroup": client.ResourceGroup, "Version": "2019-05-10"}
response := PasswordPolicy{}

for {
Expand Down
32 changes: 17 additions & 15 deletions alibabacloudstack/data_source_apsarastack_ascm_quotas.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,17 @@ func dataSourceAlibabacloudStackQuotas() *schema.Resource {
Type: schema.TypeString,
Required: true,
},
"region": {
Type: schema.TypeString,
Computed: true,
Optional: true,
},
"cluster_name": {
Type: schema.TypeString,
Computed: true,
Optional: true,
},
// 后续不消费
// "region": {
// Type: schema.TypeString,
// Computed: true,
// Optional: true,
// },
// "cluster_name": {
// Type: schema.TypeString,
// Computed: true,
// Optional: true,
// },
"quotas": {
Type: schema.TypeList,
Computed: true,
Expand All @@ -75,10 +76,11 @@ func dataSourceAlibabacloudStackQuotas() *schema.Resource {
Type: schema.TypeString,
Computed: true,
},
"cluster_name": {
Type: schema.TypeString,
Computed: true,
},
// 后续不消费
// "cluster_name": {
// Type: schema.TypeString,
// Computed: true,
// },
"used_vip_public": {
Type: schema.TypeInt,
Computed: true,
Expand Down Expand Up @@ -186,7 +188,7 @@ func dataSourceAlibabacloudStackQuotasRead(d *schema.ResourceData, meta interfac
quotaTypeId := d.Get("quota_type_id").(string)
targetType := d.Get("target_type").(string)
request.Headers = map[string]string{"RegionId": client.RegionId}
request.QueryParams = map[string]string{"AccessKeyId": client.AccessKey, "AccessKeySecret": client.SecretKey,
request.QueryParams = map[string]string{
"Product": "ascm",
"RegionId": client.RegionId,
"Department": client.Department,
Expand Down
15 changes: 8 additions & 7 deletions alibabacloudstack/data_source_apsarastack_ascm_ram_policies.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ func dataSourceAlibabacloudStackAscmRamPolicies() *schema.Resource {
Optional: true,
ForceNew: true,
},
"names": {
Type: schema.TypeList,
Computed: true,
Elem: &schema.Schema{Type: schema.TypeString},
},
//未消费参数
// "names": {
// Type: schema.TypeList,
// Computed: true,
// Elem: &schema.Schema{Type: schema.TypeString},
// },
"output_file": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -94,8 +95,8 @@ func dataSourceAlibabacloudStackAscmRamPoliciesRead(d *schema.ResourceData, meta
request.ApiName = "ListRamPolicies"
request.Headers = map[string]string{"RegionId": client.RegionId}
request.QueryParams = map[string]string{
"AccessKeyId": client.AccessKey,
"AccessKeySecret": client.SecretKey,


"Department": client.Department,
"ResourceGroup": client.ResourceGroup,
"Product": "ascm",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ func dataSourceAlibabacloudStackAscmRamPoliciesForUserRead(d *schema.ResourceDat
request.ApiName = "ListRAMPoliciesForUser"
request.Headers = map[string]string{"RegionId": client.RegionId}
request.QueryParams = map[string]string{
"AccessKeyId": client.AccessKey,
"AccessKeySecret": client.SecretKey,


"Product": "ascm",
"Department": client.Department,
"ResourceGroup": client.ResourceGroup,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ func dataSourceAlibabacloudStackAscmRamServiceRoles() *schema.Resource {
Optional: true,
ForceNew: true,
},
"names": {
Type: schema.TypeList,
Computed: true,
Elem: &schema.Schema{Type: schema.TypeString},
},
// 后续未消费参数
// "names": {
// Type: schema.TypeList,
// Computed: true,
// Elem: &schema.Schema{Type: schema.TypeString},
// },
"description": {
Type: schema.TypeString,
Computed: true,
Expand Down Expand Up @@ -102,8 +103,8 @@ func dataSourceAlibabacloudStackAscmRamServiceRolesRead(d *schema.ResourceData,
request.ApiName = "ListRAMServiceRoles"
request.Headers = map[string]string{"RegionId": client.RegionId}
request.QueryParams = map[string]string{
"AccessKeyId": client.AccessKey,
"AccessKeySecret": client.SecretKey,


"Product": "ascm",
"Department": client.Department,
"ResourceGroup": client.ResourceGroup,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func dataSourceAlibabacloudStackRegionsByProductRead(d *schema.ResourceData, met
request.RegionId = client.RegionId
request.ApiName = "GetRegionsByProduct"
request.Headers = map[string]string{"RegionId": client.RegionId}
request.QueryParams = map[string]string{"AccessKeyId": client.AccessKey, "AccessKeySecret": client.SecretKey, "Product": "ascm", "RegionId": client.RegionId, "Department": client.Department, "ResourceGroup": client.ResourceGroup, "Action": "GetRegionsByProduct", "Version": "2019-05-10"}
request.QueryParams = map[string]string{ "Product": "ascm", "RegionId": client.RegionId, "Department": client.Department, "ResourceGroup": client.ResourceGroup, "Action": "GetRegionsByProduct", "Version": "2019-05-10"}
response := RegionsByProduct{}

for {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ func dataSourceAlibabacloudStackAscmResourceGroupsRead(d *schema.ResourceData, m
request.ApiName = "ListResourceGroup"
request.Headers = map[string]string{"RegionId": client.RegionId}
request.QueryParams = map[string]string{
"AccessKeyId": client.AccessKey,
"AccessKeySecret": client.SecretKey,


"Product": "ascm",
"RegionId": client.RegionId,
"Action": "ListResourceGroup",
Expand Down
Loading

0 comments on commit 12b7c30

Please sign in to comment.