浏览代码

CreateInstance add toen.

sdk-team 6 年之前
父节点
当前提交
1f8d527658

+ 4 - 0
ChangeLog.txt

@@ -1,3 +1,7 @@
+2019-09-09 Version: 1.60.154
+- CreateInstance add toen.
+- UpdateInstance add toen.
+
 2019-09-09 Version: 1.60.153
 2019-09-09 Version: 1.60.153
 - Generated 2017-05-25 for `Dysmsapi`.
 - Generated 2017-05-25 for `Dysmsapi`.
 
 

+ 25 - 0
services/elasticsearch/client.go

@@ -16,6 +16,8 @@ package elasticsearch
 // Changes may cause incorrect behavior and will be lost if the code is regenerated.
 // Changes may cause incorrect behavior and will be lost if the code is regenerated.
 
 
 import (
 import (
+	"reflect"
+
 	"github.com/aliyun/alibaba-cloud-sdk-go/sdk"
 	"github.com/aliyun/alibaba-cloud-sdk-go/sdk"
 	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth"
 	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth"
 	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider"
 	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider"
@@ -26,10 +28,25 @@ type Client struct {
 	sdk.Client
 	sdk.Client
 }
 }
 
 
+// SetClientProperty Set Property by Reflect
+func SetClientProperty(client *Client, propertyName string, propertyValue interface{}) {
+	v := reflect.ValueOf(client).Elem()
+	if v.FieldByName(propertyName).IsValid() && v.FieldByName(propertyName).CanSet() {
+		v.FieldByName(propertyName).Set(reflect.ValueOf(propertyValue))
+	}
+}
+
+// SetEndpointDataToClient Set EndpointMap and ENdpointType
+func SetEndpointDataToClient(client *Client) {
+	SetClientProperty(client, "EndpointMap", GetEndpointMap())
+	SetClientProperty(client, "EndpointType", GetEndpointType())
+}
+
 // NewClient creates a sdk client with environment variables
 // NewClient creates a sdk client with environment variables
 func NewClient() (client *Client, err error) {
 func NewClient() (client *Client, err error) {
 	client = &Client{}
 	client = &Client{}
 	err = client.Init()
 	err = client.Init()
+	SetEndpointDataToClient(client)
 	return
 	return
 }
 }
 
 
@@ -44,6 +61,7 @@ func NewClientWithProvider(regionId string, providers ...provider.Provider) (cli
 		pc = provider.NewProviderChain(providers)
 		pc = provider.NewProviderChain(providers)
 	}
 	}
 	err = client.InitWithProviderChain(regionId, pc)
 	err = client.InitWithProviderChain(regionId, pc)
+	SetEndpointDataToClient(client)
 	return
 	return
 }
 }
 
 
@@ -52,6 +70,7 @@ func NewClientWithProvider(regionId string, providers ...provider.Provider) (cli
 func NewClientWithOptions(regionId string, config *sdk.Config, credential auth.Credential) (client *Client, err error) {
 func NewClientWithOptions(regionId string, config *sdk.Config, credential auth.Credential) (client *Client, err error) {
 	client = &Client{}
 	client = &Client{}
 	err = client.InitWithOptions(regionId, config, credential)
 	err = client.InitWithOptions(regionId, config, credential)
+	SetEndpointDataToClient(client)
 	return
 	return
 }
 }
 
 
@@ -60,6 +79,7 @@ func NewClientWithOptions(regionId string, config *sdk.Config, credential auth.C
 func NewClientWithAccessKey(regionId, accessKeyId, accessKeySecret string) (client *Client, err error) {
 func NewClientWithAccessKey(regionId, accessKeyId, accessKeySecret string) (client *Client, err error) {
 	client = &Client{}
 	client = &Client{}
 	err = client.InitWithAccessKey(regionId, accessKeyId, accessKeySecret)
 	err = client.InitWithAccessKey(regionId, accessKeyId, accessKeySecret)
+	SetEndpointDataToClient(client)
 	return
 	return
 }
 }
 
 
@@ -68,6 +88,7 @@ func NewClientWithAccessKey(regionId, accessKeyId, accessKeySecret string) (clie
 func NewClientWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken string) (client *Client, err error) {
 func NewClientWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken string) (client *Client, err error) {
 	client = &Client{}
 	client = &Client{}
 	err = client.InitWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken)
 	err = client.InitWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken)
+	SetEndpointDataToClient(client)
 	return
 	return
 }
 }
 
 
@@ -76,6 +97,7 @@ func NewClientWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToke
 func NewClientWithRamRoleArn(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (client *Client, err error) {
 func NewClientWithRamRoleArn(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (client *Client, err error) {
 	client = &Client{}
 	client = &Client{}
 	err = client.InitWithRamRoleArn(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName)
 	err = client.InitWithRamRoleArn(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName)
+	SetEndpointDataToClient(client)
 	return
 	return
 }
 }
 
 
@@ -84,6 +106,7 @@ func NewClientWithRamRoleArn(regionId string, accessKeyId, accessKeySecret, role
 func NewClientWithRamRoleArnAndPolicy(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName, policy string) (client *Client, err error) {
 func NewClientWithRamRoleArnAndPolicy(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName, policy string) (client *Client, err error) {
 	client = &Client{}
 	client = &Client{}
 	err = client.InitWithRamRoleArnAndPolicy(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName, policy)
 	err = client.InitWithRamRoleArnAndPolicy(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName, policy)
+	SetEndpointDataToClient(client)
 	return
 	return
 }
 }
 
 
@@ -92,6 +115,7 @@ func NewClientWithRamRoleArnAndPolicy(regionId string, accessKeyId, accessKeySec
 func NewClientWithEcsRamRole(regionId string, roleName string) (client *Client, err error) {
 func NewClientWithEcsRamRole(regionId string, roleName string) (client *Client, err error) {
 	client = &Client{}
 	client = &Client{}
 	err = client.InitWithEcsRamRole(regionId, roleName)
 	err = client.InitWithEcsRamRole(regionId, roleName)
+	SetEndpointDataToClient(client)
 	return
 	return
 }
 }
 
 
@@ -100,5 +124,6 @@ func NewClientWithEcsRamRole(regionId string, roleName string) (client *Client,
 func NewClientWithRsaKeyPair(regionId string, publicKeyId, privateKey string, sessionExpiration int) (client *Client, err error) {
 func NewClientWithRsaKeyPair(regionId string, publicKeyId, privateKey string, sessionExpiration int) (client *Client, err error) {
 	client = &Client{}
 	client = &Client{}
 	err = client.InitWithRsaKeyPair(regionId, publicKeyId, privateKey, sessionExpiration)
 	err = client.InitWithRsaKeyPair(regionId, publicKeyId, privateKey, sessionExpiration)
+	SetEndpointDataToClient(client)
 	return
 	return
 }
 }

+ 1 - 0
services/elasticsearch/create_instance.go

@@ -76,6 +76,7 @@ func (client *Client) CreateInstanceWithCallback(request *CreateInstanceRequest,
 // CreateInstanceRequest is the request struct for api CreateInstance
 // CreateInstanceRequest is the request struct for api CreateInstance
 type CreateInstanceRequest struct {
 type CreateInstanceRequest struct {
 	*requests.RoaRequest
 	*requests.RoaRequest
+	ClientToken string `position:"Query" name:"clientToken"`
 }
 }
 
 
 // CreateInstanceResponse is the response struct for api CreateInstance
 // CreateInstanceResponse is the response struct for api CreateInstance

+ 58 - 0
services/elasticsearch/endpoint.go

@@ -0,0 +1,58 @@
+package elasticsearch
+
+// EndpointMap Endpoint Data
+var EndpointMap map[string]string
+
+// EndpointType regional or central
+var EndpointType = "regional"
+
+// GetEndpointMap Get Endpoint Data Map
+func GetEndpointMap() map[string]string {
+	if EndpointMap == nil {
+		EndpointMap = map[string]string{
+			"cn-shanghai-internal-test-1": "elasticsearch.aliyuncs.com",
+			"cn-beijing-gov-1":            "elasticsearch.aliyuncs.com",
+			"cn-shenzhen-su18-b01":        "elasticsearch.aliyuncs.com",
+			"cn-shanghai-inner":           "elasticsearch.aliyuncs.com",
+			"cn-shenzhen-st4-d01":         "elasticsearch.aliyuncs.com",
+			"cn-haidian-cm12-c01":         "elasticsearch.aliyuncs.com",
+			"cn-hangzhou-internal-prod-1": "elasticsearch.aliyuncs.com",
+			"cn-north-2-gov-1":            "elasticsearch.aliyuncs.com",
+			"cn-yushanfang":               "elasticsearch.aliyuncs.com",
+			"cn-hongkong-finance-pop":     "elasticsearch.aliyuncs.com",
+			"cn-qingdao-nebula":           "elasticsearch.aliyuncs.com",
+			"cn-beijing-finance-pop":      "elasticsearch.aliyuncs.com",
+			"cn-wuhan":                    "elasticsearch.aliyuncs.com",
+			"cn-zhengzhou-nebula-1":       "elasticsearch.aliyuncs.com",
+			"rus-west-1-pop":              "elasticsearch.ap-northeast-1.aliyuncs.com",
+			"cn-shanghai-et15-b01":        "elasticsearch.aliyuncs.com",
+			"cn-hangzhou-bj-b01":          "elasticsearch.aliyuncs.com",
+			"eu-west-1":                   "elasticsearch.ap-northeast-1.aliyuncs.com",
+			"cn-hangzhou-internal-test-1": "elasticsearch.aliyuncs.com",
+			"eu-west-1-oxs":               "elasticsearch.ap-northeast-1.aliyuncs.com",
+			"cn-zhangbei-na61-b01":        "elasticsearch.aliyuncs.com",
+			"cn-beijing-finance-1":        "elasticsearch.aliyuncs.com",
+			"cn-hangzhou-internal-test-3": "elasticsearch.aliyuncs.com",
+			"cn-hangzhou-internal-test-2": "elasticsearch.aliyuncs.com",
+			"cn-shenzhen-finance-1":       "elasticsearch.aliyuncs.com",
+			"me-east-1":                   "elasticsearch.ap-northeast-1.aliyuncs.com",
+			"cn-chengdu":                  "elasticsearch.aliyuncs.com",
+			"cn-hangzhou-test-306":        "elasticsearch.aliyuncs.com",
+			"cn-shanghai-et2-b01":         "elasticsearch.aliyuncs.com",
+			"cn-beijing-nu16-b01":         "elasticsearch.aliyuncs.com",
+			"cn-edge-1":                   "elasticsearch.aliyuncs.com",
+			"cn-huhehaote":                "elasticsearch.aliyuncs.com",
+			"cn-fujian":                   "elasticsearch.aliyuncs.com",
+			"us-east-1":                   "elasticsearch.ap-northeast-1.aliyuncs.com",
+			"ap-northeast-2-pop":          "elasticsearch.ap-northeast-1.aliyuncs.com",
+			"cn-shenzhen-inner":           "elasticsearch.aliyuncs.com",
+			"cn-zhangjiakou-na62-a01":     "elasticsearch.aliyuncs.com",
+		}
+	}
+	return EndpointMap
+}
+
+// GetEndpointType Get Endpoint Type Value
+func GetEndpointType() string {
+	return EndpointType
+}

+ 21 - 0
services/elasticsearch/struct_dict_list_in_update_instance.go

@@ -0,0 +1,21 @@
+package elasticsearch
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+// DictListInUpdateInstance is a nested struct in elasticsearch response
+type DictListInUpdateInstance struct {
+	DictListItem []DictListItem `json:"dictListItem" xml:"dictListItem"`
+}

+ 2 - 2
services/elasticsearch/struct_dict_list_item.go

@@ -17,8 +17,8 @@ package elasticsearch
 
 
 // DictListItem is a nested struct in elasticsearch response
 // DictListItem is a nested struct in elasticsearch response
 type DictListItem struct {
 type DictListItem struct {
-	Name       string `json:"name" xml:"name"`
-	FileSize   int64  `json:"fileSize" xml:"fileSize"`
 	Type       string `json:"type" xml:"type"`
 	Type       string `json:"type" xml:"type"`
+	FileSize   int64  `json:"fileSize" xml:"fileSize"`
 	SourceType string `json:"sourceType" xml:"sourceType"`
 	SourceType string `json:"sourceType" xml:"sourceType"`
+	Name       string `json:"name" xml:"name"`
 }
 }

+ 21 - 0
services/elasticsearch/struct_synonyms_dicts_in_update_instance.go

@@ -0,0 +1,21 @@
+package elasticsearch
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+// SynonymsDictsInUpdateInstance is a nested struct in elasticsearch response
+type SynonymsDictsInUpdateInstance struct {
+	SynonymsDictsItem []SynonymsDictsItem `json:"synonymsDictsItem" xml:"synonymsDictsItem"`
+}

+ 2 - 2
services/elasticsearch/struct_synonyms_dicts_item.go

@@ -17,8 +17,8 @@ package elasticsearch
 
 
 // SynonymsDictsItem is a nested struct in elasticsearch response
 // SynonymsDictsItem is a nested struct in elasticsearch response
 type SynonymsDictsItem struct {
 type SynonymsDictsItem struct {
-	Name       string `json:"name" xml:"name"`
-	FileSize   int64  `json:"fileSize" xml:"fileSize"`
 	Type       string `json:"type" xml:"type"`
 	Type       string `json:"type" xml:"type"`
+	FileSize   int64  `json:"fileSize" xml:"fileSize"`
 	SourceType string `json:"sourceType" xml:"sourceType"`
 	SourceType string `json:"sourceType" xml:"sourceType"`
+	Name       string `json:"name" xml:"name"`
 }
 }

+ 2 - 1
services/elasticsearch/update_instance.go

@@ -76,7 +76,8 @@ func (client *Client) UpdateInstanceWithCallback(request *UpdateInstanceRequest,
 // UpdateInstanceRequest is the request struct for api UpdateInstance
 // UpdateInstanceRequest is the request struct for api UpdateInstance
 type UpdateInstanceRequest struct {
 type UpdateInstanceRequest struct {
 	*requests.RoaRequest
 	*requests.RoaRequest
-	InstanceId string `position:"Path" name:"InstanceId"`
+	InstanceId  string `position:"Path" name:"InstanceId"`
+	ClientToken string `position:"Query" name:"clientToken"`
 }
 }
 
 
 // UpdateInstanceResponse is the response struct for api UpdateInstance
 // UpdateInstanceResponse is the response struct for api UpdateInstance