Pārlūkot izejas kodu

ECS SDK Auto Released By shaoyi.qusy,Version:1.56.10

Signed-off-by: haowei.yao <haowei.yao@alibaba-inc.com>
haowei.yao 6 gadi atpakaļ
vecāks
revīzija
e981ef715b

+ 3 - 0
ChangeLog.txt

@@ -1,3 +1,6 @@
+2019-04-18 Version: 1.56.10
+1, add ReservedInstance API.
+
 2019-04-17 Version: 1.56.9
 1, Add DescribeRestoreTaskList DBS interface.
 2, Add DescribeNodeCidrList DBS interface.

+ 121 - 0
services/ecs/describe_reserved_instances.go

@@ -0,0 +1,121 @@
+package ecs
+
+//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"
+)
+
+// DescribeReservedInstances invokes the ecs.DescribeReservedInstances API synchronously
+// api document: https://help.aliyun.com/api/ecs/describereservedinstances.html
+func (client *Client) DescribeReservedInstances(request *DescribeReservedInstancesRequest) (response *DescribeReservedInstancesResponse, err error) {
+	response = CreateDescribeReservedInstancesResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// DescribeReservedInstancesWithChan invokes the ecs.DescribeReservedInstances API asynchronously
+// api document: https://help.aliyun.com/api/ecs/describereservedinstances.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeReservedInstancesWithChan(request *DescribeReservedInstancesRequest) (<-chan *DescribeReservedInstancesResponse, <-chan error) {
+	responseChan := make(chan *DescribeReservedInstancesResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.DescribeReservedInstances(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// DescribeReservedInstancesWithCallback invokes the ecs.DescribeReservedInstances API asynchronously
+// api document: https://help.aliyun.com/api/ecs/describereservedinstances.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeReservedInstancesWithCallback(request *DescribeReservedInstancesRequest, callback func(response *DescribeReservedInstancesResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *DescribeReservedInstancesResponse
+		var err error
+		defer close(result)
+		response, err = client.DescribeReservedInstances(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// DescribeReservedInstancesRequest is the request struct for api DescribeReservedInstances
+type DescribeReservedInstancesRequest struct {
+	*requests.RpcRequest
+	ResourceOwnerId      requests.Integer `position:"Query" name:"ResourceOwnerId"`
+	PageNumber           requests.Integer `position:"Query" name:"PageNumber"`
+	LockReason           string           `position:"Query" name:"LockReason"`
+	Scope                string           `position:"Query" name:"Scope"`
+	PageSize             requests.Integer `position:"Query" name:"PageSize"`
+	InstanceType         string           `position:"Query" name:"InstanceType"`
+	ResourceOwnerAccount string           `position:"Query" name:"ResourceOwnerAccount"`
+	OwnerAccount         string           `position:"Query" name:"OwnerAccount"`
+	InstanceTypeFamily   string           `position:"Query" name:"InstanceTypeFamily"`
+	OwnerId              requests.Integer `position:"Query" name:"OwnerId"`
+	ReservedInstanceId   *[]string        `position:"Query" name:"ReservedInstanceId"  type:"Repeated"`
+	OfferingType         string           `position:"Query" name:"OfferingType"`
+	ZoneId               string           `position:"Query" name:"ZoneId"`
+	ReservedInstanceName string           `position:"Query" name:"ReservedInstanceName"`
+	Status               *[]string        `position:"Query" name:"Status"  type:"Repeated"`
+}
+
+// DescribeReservedInstancesResponse is the response struct for api DescribeReservedInstances
+type DescribeReservedInstancesResponse struct {
+	*responses.BaseResponse
+	RequestId         string            `json:"RequestId" xml:"RequestId"`
+	TotalCount        int               `json:"TotalCount" xml:"TotalCount"`
+	PageNumber        int               `json:"PageNumber" xml:"PageNumber"`
+	PageSize          int               `json:"PageSize" xml:"PageSize"`
+	ReservedInstances ReservedInstances `json:"ReservedInstances" xml:"ReservedInstances"`
+}
+
+// CreateDescribeReservedInstancesRequest creates a request to invoke DescribeReservedInstances API
+func CreateDescribeReservedInstancesRequest() (request *DescribeReservedInstancesRequest) {
+	request = &DescribeReservedInstancesRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeReservedInstances", "ecs", "openAPI")
+	return
+}
+
+// CreateDescribeReservedInstancesResponse creates a response to parse from DescribeReservedInstances response
+func CreateDescribeReservedInstancesResponse() (response *DescribeReservedInstancesResponse) {
+	response = &DescribeReservedInstancesResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 118 - 0
services/ecs/modify_reserved_instances.go

@@ -0,0 +1,118 @@
+package ecs
+
+//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"
+)
+
+// ModifyReservedInstances invokes the ecs.ModifyReservedInstances API synchronously
+// api document: https://help.aliyun.com/api/ecs/modifyreservedinstances.html
+func (client *Client) ModifyReservedInstances(request *ModifyReservedInstancesRequest) (response *ModifyReservedInstancesResponse, err error) {
+	response = CreateModifyReservedInstancesResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// ModifyReservedInstancesWithChan invokes the ecs.ModifyReservedInstances API asynchronously
+// api document: https://help.aliyun.com/api/ecs/modifyreservedinstances.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) ModifyReservedInstancesWithChan(request *ModifyReservedInstancesRequest) (<-chan *ModifyReservedInstancesResponse, <-chan error) {
+	responseChan := make(chan *ModifyReservedInstancesResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.ModifyReservedInstances(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// ModifyReservedInstancesWithCallback invokes the ecs.ModifyReservedInstances API asynchronously
+// api document: https://help.aliyun.com/api/ecs/modifyreservedinstances.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) ModifyReservedInstancesWithCallback(request *ModifyReservedInstancesRequest, callback func(response *ModifyReservedInstancesResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *ModifyReservedInstancesResponse
+		var err error
+		defer close(result)
+		response, err = client.ModifyReservedInstances(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// ModifyReservedInstancesRequest is the request struct for api ModifyReservedInstances
+type ModifyReservedInstancesRequest struct {
+	*requests.RpcRequest
+	ResourceOwnerId      requests.Integer                        `position:"Query" name:"ResourceOwnerId"`
+	Configuration        *[]ModifyReservedInstancesConfiguration `position:"Query" name:"Configuration"  type:"Repeated"`
+	ResourceOwnerAccount string                                  `position:"Query" name:"ResourceOwnerAccount"`
+	OwnerAccount         string                                  `position:"Query" name:"OwnerAccount"`
+	OwnerId              requests.Integer                        `position:"Query" name:"OwnerId"`
+	ReservedInstanceId   *[]string                               `position:"Query" name:"ReservedInstanceId"  type:"Repeated"`
+}
+
+// ModifyReservedInstancesConfiguration is a repeated param struct in ModifyReservedInstancesRequest
+type ModifyReservedInstancesConfiguration struct {
+	ZoneId               string `name:"ZoneId"`
+	ReservedInstanceName string `name:"ReservedInstanceName"`
+	InstanceType         string `name:"InstanceType"`
+	Scope                string `name:"Scope"`
+	InstanceAmount       string `name:"InstanceAmount"`
+}
+
+// ModifyReservedInstancesResponse is the response struct for api ModifyReservedInstances
+type ModifyReservedInstancesResponse struct {
+	*responses.BaseResponse
+	RequestId              string                                          `json:"RequestId" xml:"RequestId"`
+	ReservedInstanceIdSets ReservedInstanceIdSetsInModifyReservedInstances `json:"ReservedInstanceIdSets" xml:"ReservedInstanceIdSets"`
+}
+
+// CreateModifyReservedInstancesRequest creates a request to invoke ModifyReservedInstances API
+func CreateModifyReservedInstancesRequest() (request *ModifyReservedInstancesRequest) {
+	request = &ModifyReservedInstancesRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyReservedInstances", "ecs", "openAPI")
+	return
+}
+
+// CreateModifyReservedInstancesResponse creates a response to parse from ModifyReservedInstances response
+func CreateModifyReservedInstancesResponse() (response *ModifyReservedInstancesResponse) {
+	response = &ModifyReservedInstancesResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 118 - 0
services/ecs/purchase_reserved_instances_offering.go

@@ -0,0 +1,118 @@
+package ecs
+
+//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"
+)
+
+// PurchaseReservedInstancesOffering invokes the ecs.PurchaseReservedInstancesOffering API synchronously
+// api document: https://help.aliyun.com/api/ecs/purchasereservedinstancesoffering.html
+func (client *Client) PurchaseReservedInstancesOffering(request *PurchaseReservedInstancesOfferingRequest) (response *PurchaseReservedInstancesOfferingResponse, err error) {
+	response = CreatePurchaseReservedInstancesOfferingResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// PurchaseReservedInstancesOfferingWithChan invokes the ecs.PurchaseReservedInstancesOffering API asynchronously
+// api document: https://help.aliyun.com/api/ecs/purchasereservedinstancesoffering.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) PurchaseReservedInstancesOfferingWithChan(request *PurchaseReservedInstancesOfferingRequest) (<-chan *PurchaseReservedInstancesOfferingResponse, <-chan error) {
+	responseChan := make(chan *PurchaseReservedInstancesOfferingResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.PurchaseReservedInstancesOffering(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// PurchaseReservedInstancesOfferingWithCallback invokes the ecs.PurchaseReservedInstancesOffering API asynchronously
+// api document: https://help.aliyun.com/api/ecs/purchasereservedinstancesoffering.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) PurchaseReservedInstancesOfferingWithCallback(request *PurchaseReservedInstancesOfferingRequest, callback func(response *PurchaseReservedInstancesOfferingResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *PurchaseReservedInstancesOfferingResponse
+		var err error
+		defer close(result)
+		response, err = client.PurchaseReservedInstancesOffering(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// PurchaseReservedInstancesOfferingRequest is the request struct for api PurchaseReservedInstancesOffering
+type PurchaseReservedInstancesOfferingRequest struct {
+	*requests.RpcRequest
+	ResourceOwnerId      requests.Integer `position:"Query" name:"ResourceOwnerId"`
+	ClientToken          string           `position:"Query" name:"ClientToken"`
+	Description          string           `position:"Query" name:"Description"`
+	ResourceGroupId      string           `position:"Query" name:"ResourceGroupId"`
+	Scope                string           `position:"Query" name:"Scope"`
+	InstanceType         string           `position:"Query" name:"InstanceType"`
+	Period               requests.Integer `position:"Query" name:"Period"`
+	ResourceOwnerAccount string           `position:"Query" name:"ResourceOwnerAccount"`
+	OwnerAccount         string           `position:"Query" name:"OwnerAccount"`
+	OwnerId              requests.Integer `position:"Query" name:"OwnerId"`
+	PeriodUnit           string           `position:"Query" name:"PeriodUnit"`
+	OfferingType         string           `position:"Query" name:"OfferingType"`
+	ZoneId               string           `position:"Query" name:"ZoneId"`
+	ReservedInstanceName string           `position:"Query" name:"ReservedInstanceName"`
+	InstanceAmount       requests.Integer `position:"Query" name:"InstanceAmount"`
+}
+
+// PurchaseReservedInstancesOfferingResponse is the response struct for api PurchaseReservedInstancesOffering
+type PurchaseReservedInstancesOfferingResponse struct {
+	*responses.BaseResponse
+	RequestId              string                                                    `json:"RequestId" xml:"RequestId"`
+	ReservedInstanceIdSets ReservedInstanceIdSetsInPurchaseReservedInstancesOffering `json:"ReservedInstanceIdSets" xml:"ReservedInstanceIdSets"`
+}
+
+// CreatePurchaseReservedInstancesOfferingRequest creates a request to invoke PurchaseReservedInstancesOffering API
+func CreatePurchaseReservedInstancesOfferingRequest() (request *PurchaseReservedInstancesOfferingRequest) {
+	request = &PurchaseReservedInstancesOfferingRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("Ecs", "2014-05-26", "PurchaseReservedInstancesOffering", "ecs", "openAPI")
+	return
+}
+
+// CreatePurchaseReservedInstancesOfferingResponse creates a response to parse from PurchaseReservedInstancesOffering response
+func CreatePurchaseReservedInstancesOfferingResponse() (response *PurchaseReservedInstancesOfferingResponse) {
+	response = &PurchaseReservedInstancesOfferingResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 21 - 0
services/ecs/struct_operation_locks_in_describe_reserved_instances.go

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

+ 35 - 0
services/ecs/struct_reserved_instance.go

@@ -0,0 +1,35 @@
+package ecs
+
+//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.
+
+// ReservedInstance is a nested struct in ecs response
+type ReservedInstance struct {
+	ReservedInstanceId   string                                    `json:"ReservedInstanceId" xml:"ReservedInstanceId"`
+	RegionId             string                                    `json:"RegionId" xml:"RegionId"`
+	ZoneId               string                                    `json:"ZoneId" xml:"ZoneId"`
+	ReservedInstanceName string                                    `json:"ReservedInstanceName" xml:"ReservedInstanceName"`
+	Description          string                                    `json:"Description" xml:"Description"`
+	InstanceType         string                                    `json:"InstanceType" xml:"InstanceType"`
+	Scope                string                                    `json:"Scope" xml:"Scope"`
+	OfferingType         string                                    `json:"OfferingType" xml:"OfferingType"`
+	InstanceAmount       int                                       `json:"InstanceAmount" xml:"InstanceAmount"`
+	Status               string                                    `json:"Status" xml:"Status"`
+	CreationTime         string                                    `json:"CreationTime" xml:"CreationTime"`
+	ExpiredTime          string                                    `json:"ExpiredTime" xml:"ExpiredTime"`
+	StartTime            string                                    `json:"StartTime" xml:"StartTime"`
+	ResourceGroupId      string                                    `json:"ResourceGroupId" xml:"ResourceGroupId"`
+	OperationLocks       OperationLocksInDescribeReservedInstances `json:"OperationLocks" xml:"OperationLocks"`
+}

+ 21 - 0
services/ecs/struct_reserved_instance_id_sets_in_modify_reserved_instances.go

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

+ 21 - 0
services/ecs/struct_reserved_instance_id_sets_in_purchase_reserved_instances_offering.go

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

+ 21 - 0
services/ecs/struct_reserved_instances.go

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