瀏覽代碼

由鸿逸发起的HSM SDK自动发布, 版本号:1.10.1

Signed-off-by: haowei.yao <haowei.yao@alibaba-inc.com>
haowei.yao 7 年之前
父節點
當前提交
52b7d7cd6a

+ 4 - 0
ChangeLog.txt

@@ -1,3 +1,7 @@
+2018-04-27 Version: 1.10.1
+1, release hsm open api
+2, hsm open api includes DescribeRegions, DescribeInstances, ModityInstance, ConfigNetwork, ConfigWhiteList
+
 2018-04-26 Version: 1.10.0
 1, Add apis for domain group.
 3, Add fields for QueryDomainList.

+ 81 - 0
services/hsm/client.go

@@ -0,0 +1,81 @@
+package hsm
+
+//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.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth"
+)
+
+// Client is the sdk client struct, each func corresponds to an OpenAPI
+type Client struct {
+	sdk.Client
+}
+
+// NewClient creates a sdk client with environment variables
+func NewClient() (client *Client, err error) {
+	client = &Client{}
+	err = client.Init()
+	return
+}
+
+// NewClientWithOptions creates a sdk client with regionId/sdkConfig/credential
+// this is the common api to create a sdk client
+func NewClientWithOptions(regionId string, config *sdk.Config, credential auth.Credential) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithOptions(regionId, config, credential)
+	return
+}
+
+// NewClientWithAccessKey is a shortcut to create sdk client with accesskey
+// usage: https://help.aliyun.com/document_detail/66217.html
+func NewClientWithAccessKey(regionId, accessKeyId, accessKeySecret string) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithAccessKey(regionId, accessKeyId, accessKeySecret)
+	return
+}
+
+// NewClientWithStsToken is a shortcut to create sdk client with sts token
+// usage: https://help.aliyun.com/document_detail/66222.html
+func NewClientWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken string) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken)
+	return
+}
+
+// NewClientWithRamRoleArn is a shortcut to create sdk client with ram roleArn
+// usage: https://help.aliyun.com/document_detail/66222.html
+func NewClientWithRamRoleArn(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithRamRoleArn(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName)
+	return
+}
+
+// NewClientWithEcsRamRole is a shortcut to create sdk client with ecs ram role
+// usage: https://help.aliyun.com/document_detail/66223.html
+func NewClientWithEcsRamRole(regionId string, roleName string) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithEcsRamRole(regionId, roleName)
+	return
+}
+
+// NewClientWithRsaKeyPair is a shortcut to create sdk client with rsa key pair
+// attention: rsa key pair auth is only Japan regions available
+func NewClientWithRsaKeyPair(regionId string, publicKeyId, privateKey string, sessionExpiration int) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithRsaKeyPair(regionId, publicKeyId, privateKey, sessionExpiration)
+	return
+}

+ 108 - 0
services/hsm/config_network.go

@@ -0,0 +1,108 @@
+package hsm
+
+//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.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// ConfigNetwork invokes the hsm.ConfigNetwork API synchronously
+// api document: https://help.aliyun.com/api/hsm/confignetwork.html
+func (client *Client) ConfigNetwork(request *ConfigNetworkRequest) (response *ConfigNetworkResponse, err error) {
+	response = CreateConfigNetworkResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// ConfigNetworkWithChan invokes the hsm.ConfigNetwork API asynchronously
+// api document: https://help.aliyun.com/api/hsm/confignetwork.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) ConfigNetworkWithChan(request *ConfigNetworkRequest) (<-chan *ConfigNetworkResponse, <-chan error) {
+	responseChan := make(chan *ConfigNetworkResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.ConfigNetwork(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// ConfigNetworkWithCallback invokes the hsm.ConfigNetwork API asynchronously
+// api document: https://help.aliyun.com/api/hsm/confignetwork.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) ConfigNetworkWithCallback(request *ConfigNetworkRequest, callback func(response *ConfigNetworkResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *ConfigNetworkResponse
+		var err error
+		defer close(result)
+		response, err = client.ConfigNetwork(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// ConfigNetworkRequest is the request struct for api ConfigNetwork
+type ConfigNetworkRequest struct {
+	*requests.RpcRequest
+	SourceIp        string           `position:"Query" name:"SourceIp"`
+	ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"`
+	InstanceId      string           `position:"Query" name:"InstanceId"`
+	VpcId           string           `position:"Query" name:"VpcId"`
+	VSwitchId       string           `position:"Query" name:"VSwitchId"`
+	Ip              string           `position:"Query" name:"Ip"`
+}
+
+// ConfigNetworkResponse is the response struct for api ConfigNetwork
+type ConfigNetworkResponse struct {
+	*responses.BaseResponse
+	RequestId string `json:"RequestId" xml:"RequestId"`
+}
+
+// CreateConfigNetworkRequest creates a request to invoke ConfigNetwork API
+func CreateConfigNetworkRequest() (request *ConfigNetworkRequest) {
+	request = &ConfigNetworkRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("hsm", "2018-01-11", "ConfigNetwork", "hsm", "openAPI")
+	return
+}
+
+// CreateConfigNetworkResponse creates a response to parse from ConfigNetwork response
+func CreateConfigNetworkResponse() (response *ConfigNetworkResponse) {
+	response = &ConfigNetworkResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 106 - 0
services/hsm/config_white_list.go

@@ -0,0 +1,106 @@
+package hsm
+
+//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.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// ConfigWhiteList invokes the hsm.ConfigWhiteList API synchronously
+// api document: https://help.aliyun.com/api/hsm/configwhitelist.html
+func (client *Client) ConfigWhiteList(request *ConfigWhiteListRequest) (response *ConfigWhiteListResponse, err error) {
+	response = CreateConfigWhiteListResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// ConfigWhiteListWithChan invokes the hsm.ConfigWhiteList API asynchronously
+// api document: https://help.aliyun.com/api/hsm/configwhitelist.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) ConfigWhiteListWithChan(request *ConfigWhiteListRequest) (<-chan *ConfigWhiteListResponse, <-chan error) {
+	responseChan := make(chan *ConfigWhiteListResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.ConfigWhiteList(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// ConfigWhiteListWithCallback invokes the hsm.ConfigWhiteList API asynchronously
+// api document: https://help.aliyun.com/api/hsm/configwhitelist.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) ConfigWhiteListWithCallback(request *ConfigWhiteListRequest, callback func(response *ConfigWhiteListResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *ConfigWhiteListResponse
+		var err error
+		defer close(result)
+		response, err = client.ConfigWhiteList(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// ConfigWhiteListRequest is the request struct for api ConfigWhiteList
+type ConfigWhiteListRequest struct {
+	*requests.RpcRequest
+	SourceIp        string           `position:"Query" name:"SourceIp"`
+	ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"`
+	InstanceId      string           `position:"Query" name:"InstanceId"`
+	WhiteList       string           `position:"Query" name:"WhiteList"`
+}
+
+// ConfigWhiteListResponse is the response struct for api ConfigWhiteList
+type ConfigWhiteListResponse struct {
+	*responses.BaseResponse
+	RequestId string `json:"RequestId" xml:"RequestId"`
+}
+
+// CreateConfigWhiteListRequest creates a request to invoke ConfigWhiteList API
+func CreateConfigWhiteListRequest() (request *ConfigWhiteListRequest) {
+	request = &ConfigWhiteListRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("hsm", "2018-01-11", "ConfigWhiteList", "hsm", "openAPI")
+	return
+}
+
+// CreateConfigWhiteListResponse creates a response to parse from ConfigWhiteList response
+func CreateConfigWhiteListResponse() (response *ConfigWhiteListResponse) {
+	response = &ConfigWhiteListResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 111 - 0
services/hsm/create_instance.go

@@ -0,0 +1,111 @@
+package hsm
+
+//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.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// CreateInstance invokes the hsm.CreateInstance API synchronously
+// api document: https://help.aliyun.com/api/hsm/createinstance.html
+func (client *Client) CreateInstance(request *CreateInstanceRequest) (response *CreateInstanceResponse, err error) {
+	response = CreateCreateInstanceResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// CreateInstanceWithChan invokes the hsm.CreateInstance API asynchronously
+// api document: https://help.aliyun.com/api/hsm/createinstance.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) CreateInstanceWithChan(request *CreateInstanceRequest) (<-chan *CreateInstanceResponse, <-chan error) {
+	responseChan := make(chan *CreateInstanceResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.CreateInstance(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// CreateInstanceWithCallback invokes the hsm.CreateInstance API asynchronously
+// api document: https://help.aliyun.com/api/hsm/createinstance.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) CreateInstanceWithCallback(request *CreateInstanceRequest, callback func(response *CreateInstanceResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *CreateInstanceResponse
+		var err error
+		defer close(result)
+		response, err = client.CreateInstance(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// CreateInstanceRequest is the request struct for api CreateInstance
+type CreateInstanceRequest struct {
+	*requests.RpcRequest
+	ClientToken     string           `position:"Query" name:"ClientToken"`
+	Period          requests.Integer `position:"Query" name:"Period"`
+	PeriodUnit      string           `position:"Query" name:"PeriodUnit"`
+	HsmDeviceType   string           `position:"Query" name:"HsmDeviceType"`
+	HsmOem          string           `position:"Query" name:"HsmOem"`
+	ZoneId          string           `position:"Query" name:"ZoneId"`
+	Quantity        requests.Integer `position:"Query" name:"Quantity"`
+	ResourceOwnerId string           `position:"Query" name:"ResourceOwnerId"`
+}
+
+// CreateInstanceResponse is the response struct for api CreateInstance
+type CreateInstanceResponse struct {
+	*responses.BaseResponse
+	RequestId   string   `json:"RequestId" xml:"RequestId"`
+	InstanceIds []string `json:"InstanceIds" xml:"InstanceIds"`
+}
+
+// CreateCreateInstanceRequest creates a request to invoke CreateInstance API
+func CreateCreateInstanceRequest() (request *CreateInstanceRequest) {
+	request = &CreateInstanceRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("hsm", "2018-01-11", "CreateInstance", "hsm", "openAPI")
+	return
+}
+
+// CreateCreateInstanceResponse creates a response to parse from CreateInstance response
+func CreateCreateInstanceResponse() (response *CreateInstanceResponse) {
+	response = &CreateInstanceResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 110 - 0
services/hsm/describe_instances.go

@@ -0,0 +1,110 @@
+package hsm
+
+//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.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// DescribeInstances invokes the hsm.DescribeInstances API synchronously
+// api document: https://help.aliyun.com/api/hsm/describeinstances.html
+func (client *Client) DescribeInstances(request *DescribeInstancesRequest) (response *DescribeInstancesResponse, err error) {
+	response = CreateDescribeInstancesResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// DescribeInstancesWithChan invokes the hsm.DescribeInstances API asynchronously
+// api document: https://help.aliyun.com/api/hsm/describeinstances.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeInstancesWithChan(request *DescribeInstancesRequest) (<-chan *DescribeInstancesResponse, <-chan error) {
+	responseChan := make(chan *DescribeInstancesResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.DescribeInstances(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// DescribeInstancesWithCallback invokes the hsm.DescribeInstances API asynchronously
+// api document: https://help.aliyun.com/api/hsm/describeinstances.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeInstancesWithCallback(request *DescribeInstancesRequest, callback func(response *DescribeInstancesResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *DescribeInstancesResponse
+		var err error
+		defer close(result)
+		response, err = client.DescribeInstances(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// DescribeInstancesRequest is the request struct for api DescribeInstances
+type DescribeInstancesRequest struct {
+	*requests.RpcRequest
+	SourceIp        string           `position:"Query" name:"SourceIp"`
+	ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"`
+	PageSize        requests.Integer `position:"Query" name:"PageSize"`
+	CurrentPage     requests.Integer `position:"Query" name:"CurrentPage"`
+	HsmStatus       requests.Integer `position:"Query" name:"HsmStatus"`
+	InstanceId      string           `position:"Query" name:"InstanceId"`
+}
+
+// DescribeInstancesResponse is the response struct for api DescribeInstances
+type DescribeInstancesResponse struct {
+	*responses.BaseResponse
+	RequestId  string     `json:"RequestId" xml:"RequestId"`
+	TotalCount int        `json:"TotalCount" xml:"TotalCount"`
+	Instances  []Instance `json:"Instances" xml:"Instances"`
+}
+
+// CreateDescribeInstancesRequest creates a request to invoke DescribeInstances API
+func CreateDescribeInstancesRequest() (request *DescribeInstancesRequest) {
+	request = &DescribeInstancesRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("hsm", "2018-01-11", "DescribeInstances", "hsm", "openAPI")
+	return
+}
+
+// CreateDescribeInstancesResponse creates a response to parse from DescribeInstances response
+func CreateDescribeInstancesResponse() (response *DescribeInstancesResponse) {
+	response = &DescribeInstancesResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 105 - 0
services/hsm/describe_regions.go

@@ -0,0 +1,105 @@
+package hsm
+
+//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.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// DescribeRegions invokes the hsm.DescribeRegions API synchronously
+// api document: https://help.aliyun.com/api/hsm/describeregions.html
+func (client *Client) DescribeRegions(request *DescribeRegionsRequest) (response *DescribeRegionsResponse, err error) {
+	response = CreateDescribeRegionsResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// DescribeRegionsWithChan invokes the hsm.DescribeRegions API asynchronously
+// api document: https://help.aliyun.com/api/hsm/describeregions.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeRegionsWithChan(request *DescribeRegionsRequest) (<-chan *DescribeRegionsResponse, <-chan error) {
+	responseChan := make(chan *DescribeRegionsResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.DescribeRegions(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// DescribeRegionsWithCallback invokes the hsm.DescribeRegions API asynchronously
+// api document: https://help.aliyun.com/api/hsm/describeregions.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeRegionsWithCallback(request *DescribeRegionsRequest, callback func(response *DescribeRegionsResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *DescribeRegionsResponse
+		var err error
+		defer close(result)
+		response, err = client.DescribeRegions(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// DescribeRegionsRequest is the request struct for api DescribeRegions
+type DescribeRegionsRequest struct {
+	*requests.RpcRequest
+	SourceIp        string           `position:"Query" name:"SourceIp"`
+	ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"`
+}
+
+// DescribeRegionsResponse is the response struct for api DescribeRegions
+type DescribeRegionsResponse struct {
+	*responses.BaseResponse
+	RequestId string   `json:"RequestId" xml:"RequestId"`
+	Regions   []Region `json:"Regions" xml:"Regions"`
+}
+
+// CreateDescribeRegionsRequest creates a request to invoke DescribeRegions API
+func CreateDescribeRegionsRequest() (request *DescribeRegionsRequest) {
+	request = &DescribeRegionsRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("hsm", "2018-01-11", "DescribeRegions", "hsm", "openAPI")
+	return
+}
+
+// CreateDescribeRegionsResponse creates a response to parse from DescribeRegions response
+func CreateDescribeRegionsResponse() (response *DescribeRegionsResponse) {
+	response = &DescribeRegionsResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 106 - 0
services/hsm/modify_instance.go

@@ -0,0 +1,106 @@
+package hsm
+
+//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.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// ModifyInstance invokes the hsm.ModifyInstance API synchronously
+// api document: https://help.aliyun.com/api/hsm/modifyinstance.html
+func (client *Client) ModifyInstance(request *ModifyInstanceRequest) (response *ModifyInstanceResponse, err error) {
+	response = CreateModifyInstanceResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// ModifyInstanceWithChan invokes the hsm.ModifyInstance API asynchronously
+// api document: https://help.aliyun.com/api/hsm/modifyinstance.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) ModifyInstanceWithChan(request *ModifyInstanceRequest) (<-chan *ModifyInstanceResponse, <-chan error) {
+	responseChan := make(chan *ModifyInstanceResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.ModifyInstance(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// ModifyInstanceWithCallback invokes the hsm.ModifyInstance API asynchronously
+// api document: https://help.aliyun.com/api/hsm/modifyinstance.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) ModifyInstanceWithCallback(request *ModifyInstanceRequest, callback func(response *ModifyInstanceResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *ModifyInstanceResponse
+		var err error
+		defer close(result)
+		response, err = client.ModifyInstance(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// ModifyInstanceRequest is the request struct for api ModifyInstance
+type ModifyInstanceRequest struct {
+	*requests.RpcRequest
+	SourceIp        string           `position:"Query" name:"SourceIp"`
+	ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"`
+	InstanceId      string           `position:"Query" name:"InstanceId"`
+	Remark          string           `position:"Query" name:"Remark"`
+}
+
+// ModifyInstanceResponse is the response struct for api ModifyInstance
+type ModifyInstanceResponse struct {
+	*responses.BaseResponse
+	RequestId string `json:"RequestId" xml:"RequestId"`
+}
+
+// CreateModifyInstanceRequest creates a request to invoke ModifyInstance API
+func CreateModifyInstanceRequest() (request *ModifyInstanceRequest) {
+	request = &ModifyInstanceRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("hsm", "2018-01-11", "ModifyInstance", "hsm", "openAPI")
+	return
+}
+
+// CreateModifyInstanceResponse creates a response to parse from ModifyInstance response
+func CreateModifyInstanceResponse() (response *ModifyInstanceResponse) {
+	response = &ModifyInstanceResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 104 - 0
services/hsm/release_instance.go

@@ -0,0 +1,104 @@
+package hsm
+
+//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.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// ReleaseInstance invokes the hsm.ReleaseInstance API synchronously
+// api document: https://help.aliyun.com/api/hsm/releaseinstance.html
+func (client *Client) ReleaseInstance(request *ReleaseInstanceRequest) (response *ReleaseInstanceResponse, err error) {
+	response = CreateReleaseInstanceResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// ReleaseInstanceWithChan invokes the hsm.ReleaseInstance API asynchronously
+// api document: https://help.aliyun.com/api/hsm/releaseinstance.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) ReleaseInstanceWithChan(request *ReleaseInstanceRequest) (<-chan *ReleaseInstanceResponse, <-chan error) {
+	responseChan := make(chan *ReleaseInstanceResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.ReleaseInstance(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// ReleaseInstanceWithCallback invokes the hsm.ReleaseInstance API asynchronously
+// api document: https://help.aliyun.com/api/hsm/releaseinstance.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) ReleaseInstanceWithCallback(request *ReleaseInstanceRequest, callback func(response *ReleaseInstanceResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *ReleaseInstanceResponse
+		var err error
+		defer close(result)
+		response, err = client.ReleaseInstance(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// ReleaseInstanceRequest is the request struct for api ReleaseInstance
+type ReleaseInstanceRequest struct {
+	*requests.RpcRequest
+	InstanceId      string `position:"Query" name:"InstanceId"`
+	ResourceOwnerId string `position:"Query" name:"ResourceOwnerId"`
+}
+
+// ReleaseInstanceResponse is the response struct for api ReleaseInstance
+type ReleaseInstanceResponse struct {
+	*responses.BaseResponse
+	RequestId string `json:"RequestId" xml:"RequestId"`
+}
+
+// CreateReleaseInstanceRequest creates a request to invoke ReleaseInstance API
+func CreateReleaseInstanceRequest() (request *ReleaseInstanceRequest) {
+	request = &ReleaseInstanceRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("hsm", "2018-01-11", "ReleaseInstance", "hsm", "openAPI")
+	return
+}
+
+// CreateReleaseInstanceResponse creates a response to parse from ReleaseInstance response
+func CreateReleaseInstanceResponse() (response *ReleaseInstanceResponse) {
+	response = &ReleaseInstanceResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 107 - 0
services/hsm/renew_instance.go

@@ -0,0 +1,107 @@
+package hsm
+
+//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.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// RenewInstance invokes the hsm.RenewInstance API synchronously
+// api document: https://help.aliyun.com/api/hsm/renewinstance.html
+func (client *Client) RenewInstance(request *RenewInstanceRequest) (response *RenewInstanceResponse, err error) {
+	response = CreateRenewInstanceResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// RenewInstanceWithChan invokes the hsm.RenewInstance API asynchronously
+// api document: https://help.aliyun.com/api/hsm/renewinstance.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) RenewInstanceWithChan(request *RenewInstanceRequest) (<-chan *RenewInstanceResponse, <-chan error) {
+	responseChan := make(chan *RenewInstanceResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.RenewInstance(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// RenewInstanceWithCallback invokes the hsm.RenewInstance API asynchronously
+// api document: https://help.aliyun.com/api/hsm/renewinstance.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) RenewInstanceWithCallback(request *RenewInstanceRequest, callback func(response *RenewInstanceResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *RenewInstanceResponse
+		var err error
+		defer close(result)
+		response, err = client.RenewInstance(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// RenewInstanceRequest is the request struct for api RenewInstance
+type RenewInstanceRequest struct {
+	*requests.RpcRequest
+	ClientToken     string           `position:"Query" name:"ClientToken"`
+	Period          requests.Integer `position:"Query" name:"Period"`
+	PeriodUnit      string           `position:"Query" name:"PeriodUnit"`
+	InstanceId      string           `position:"Query" name:"InstanceId"`
+	ResourceOwnerId string           `position:"Query" name:"ResourceOwnerId"`
+}
+
+// RenewInstanceResponse is the response struct for api RenewInstance
+type RenewInstanceResponse struct {
+	*responses.BaseResponse
+	RequestId string `json:"RequestId" xml:"RequestId"`
+}
+
+// CreateRenewInstanceRequest creates a request to invoke RenewInstance API
+func CreateRenewInstanceRequest() (request *RenewInstanceRequest) {
+	request = &RenewInstanceRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("hsm", "2018-01-11", "RenewInstance", "hsm", "openAPI")
+	return
+}
+
+// CreateRenewInstanceResponse creates a response to parse from RenewInstance response
+func CreateRenewInstanceResponse() (response *RenewInstanceResponse) {
+	response = &RenewInstanceResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 33 - 0
services/hsm/struct_instance.go

@@ -0,0 +1,33 @@
+package hsm
+
+//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.
+
+// Instance is a nested struct in hsm response
+type Instance struct {
+	InstanceId    string   `json:"InstanceId" xml:"InstanceId"`
+	RegionId      string   `json:"RegionId" xml:"RegionId"`
+	ZoneId        string   `json:"ZoneId" xml:"ZoneId"`
+	HsmStatus     int      `json:"HsmStatus" xml:"HsmStatus"`
+	HsmOem        string   `json:"HsmOem" xml:"HsmOem"`
+	HsmDeviceType string   `json:"HsmDeviceType" xml:"HsmDeviceType"`
+	VpcId         string   `json:"VpcId" xml:"VpcId"`
+	VswitchId     string   `json:"VswitchId" xml:"VswitchId"`
+	Ip            string   `json:"Ip" xml:"Ip"`
+	Remark        string   `json:"Remark" xml:"Remark"`
+	ExpiredTime   int      `json:"ExpiredTime" xml:"ExpiredTime"`
+	CreateTime    int      `json:"CreateTime" xml:"CreateTime"`
+	WhiteList     []string `json:"WhiteList" xml:"WhiteList"`
+}

+ 21 - 0
services/hsm/struct_instance_ids.go

@@ -0,0 +1,21 @@
+package hsm
+
+//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.
+
+// InstanceIds is a nested struct in hsm response
+type InstanceIds struct {
+	InstanceId []string `json:"InstanceId" xml:"InstanceId"`
+}

+ 21 - 0
services/hsm/struct_instances.go

@@ -0,0 +1,21 @@
+package hsm
+
+//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.
+
+// Instances is a nested struct in hsm response
+type Instances struct {
+	Instance []Instance `json:"Instance" xml:"Instance"`
+}

+ 22 - 0
services/hsm/struct_region.go

@@ -0,0 +1,22 @@
+package hsm
+
+//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.
+
+// Region is a nested struct in hsm response
+type Region struct {
+	RegionId string `json:"RegionId" xml:"RegionId"`
+	Zones    []Zone `json:"Zones" xml:"Zones"`
+}

+ 21 - 0
services/hsm/struct_regions.go

@@ -0,0 +1,21 @@
+package hsm
+
+//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.
+
+// Regions is a nested struct in hsm response
+type Regions struct {
+	Region []Region `json:"Region" xml:"Region"`
+}

+ 21 - 0
services/hsm/struct_white_list.go

@@ -0,0 +1,21 @@
+package hsm
+
+//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.
+
+// WhiteList is a nested struct in hsm response
+type WhiteList struct {
+	WhiteListItem []string `json:"WhiteListItem" xml:"WhiteListItem"`
+}

+ 21 - 0
services/hsm/struct_zone.go

@@ -0,0 +1,21 @@
+package hsm
+
+//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.
+
+// Zone is a nested struct in hsm response
+type Zone struct {
+	ZoneId string `json:"ZoneId" xml:"ZoneId"`
+}

+ 21 - 0
services/hsm/struct_zones.go

@@ -0,0 +1,21 @@
+package hsm
+
+//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.
+
+// Zones is a nested struct in hsm response
+type Zones struct {
+	Zone []Zone `json:"Zone" xml:"Zone"`
+}