Browse Source

1, Add RenewBackupPlan DBS interface.

sdk-team 6 năm trước cách đây
mục cha
commit
5fef330de9

+ 3 - 0
ChangeLog.txt

@@ -1,3 +1,6 @@
+2019-06-12 Version: 1.60.40
+1, Add RenewBackupPlan DBS interface.
+
 2019-06-12 Version: 1.60.39
 1.Fix bug
 

+ 113 - 0
services/dbs/renew_backup_plan.go

@@ -0,0 +1,113 @@
+package dbs
+
+//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"
+)
+
+// RenewBackupPlan invokes the dbs.RenewBackupPlan API synchronously
+// api document: https://help.aliyun.com/api/dbs/renewbackupplan.html
+func (client *Client) RenewBackupPlan(request *RenewBackupPlanRequest) (response *RenewBackupPlanResponse, err error) {
+	response = CreateRenewBackupPlanResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// RenewBackupPlanWithChan invokes the dbs.RenewBackupPlan API asynchronously
+// api document: https://help.aliyun.com/api/dbs/renewbackupplan.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) RenewBackupPlanWithChan(request *RenewBackupPlanRequest) (<-chan *RenewBackupPlanResponse, <-chan error) {
+	responseChan := make(chan *RenewBackupPlanResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.RenewBackupPlan(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// RenewBackupPlanWithCallback invokes the dbs.RenewBackupPlan API asynchronously
+// api document: https://help.aliyun.com/api/dbs/renewbackupplan.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) RenewBackupPlanWithCallback(request *RenewBackupPlanRequest, callback func(response *RenewBackupPlanResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *RenewBackupPlanResponse
+		var err error
+		defer close(result)
+		response, err = client.RenewBackupPlan(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// RenewBackupPlanRequest is the request struct for api RenewBackupPlan
+type RenewBackupPlanRequest struct {
+	*requests.RpcRequest
+	Period       string           `position:"Query" name:"Period"`
+	ClientToken  string           `position:"Query" name:"ClientToken"`
+	BackupPlanId string           `position:"Query" name:"BackupPlanId"`
+	OwnerId      string           `position:"Query" name:"OwnerId"`
+	UsedTime     requests.Integer `position:"Query" name:"UsedTime"`
+}
+
+// RenewBackupPlanResponse is the response struct for api RenewBackupPlan
+type RenewBackupPlanResponse struct {
+	*responses.BaseResponse
+	Success        bool   `json:"Success" xml:"Success"`
+	ErrCode        string `json:"ErrCode" xml:"ErrCode"`
+	ErrMessage     string `json:"ErrMessage" xml:"ErrMessage"`
+	HttpStatusCode int    `json:"HttpStatusCode" xml:"HttpStatusCode"`
+	RequestId      string `json:"RequestId" xml:"RequestId"`
+	BackupPlanId   string `json:"BackupPlanId" xml:"BackupPlanId"`
+	OrderId        string `json:"OrderId" xml:"OrderId"`
+}
+
+// CreateRenewBackupPlanRequest creates a request to invoke RenewBackupPlan API
+func CreateRenewBackupPlanRequest() (request *RenewBackupPlanRequest) {
+	request = &RenewBackupPlanRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("Dbs", "2019-03-06", "RenewBackupPlan", "cbs", "openAPI")
+	return
+}
+
+// CreateRenewBackupPlanResponse creates a response to parse from RenewBackupPlan response
+func CreateRenewBackupPlanResponse() (response *RenewBackupPlanResponse) {
+	response = &RenewBackupPlanResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 2 - 2
services/dbs/struct_backup_gateway.go

@@ -22,8 +22,8 @@ type BackupGateway struct {
 	SourceEndpointIntranetIP string `json:"SourceEndpointIntranetIP" xml:"SourceEndpointIntranetIP"`
 	SourceEndpointHostname   string `json:"SourceEndpointHostname" xml:"SourceEndpointHostname"`
 	BackupGatewayStatus      string `json:"BackupGatewayStatus" xml:"BackupGatewayStatus"`
-	LastHeartbeatTime        int    `json:"LastHeartbeatTime" xml:"LastHeartbeatTime"`
-	BackupGatewayCreateTime  int    `json:"BackupGatewayCreateTime" xml:"BackupGatewayCreateTime"`
+	LastHeartbeatTime        int64  `json:"LastHeartbeatTime" xml:"LastHeartbeatTime"`
+	BackupGatewayCreateTime  int64  `json:"BackupGatewayCreateTime" xml:"BackupGatewayCreateTime"`
 	Region                   string `json:"Region" xml:"Region"`
 	DisplayName              string `json:"DisplayName" xml:"DisplayName"`
 	Identifier               string `json:"Identifier" xml:"Identifier"`

+ 2 - 2
services/dbs/struct_backup_plan_detail.go

@@ -25,7 +25,7 @@ type BackupPlanDetail struct {
 	SourceEndpointDatabaseName        string `json:"SourceEndpointDatabaseName" xml:"SourceEndpointDatabaseName"`
 	SourceEndpointUserName            string `json:"SourceEndpointUserName" xml:"SourceEndpointUserName"`
 	BackupObjects                     string `json:"BackupObjects" xml:"BackupObjects"`
-	BackupGatewayId                   int    `json:"BackupGatewayId" xml:"BackupGatewayId"`
+	BackupGatewayId                   int64  `json:"BackupGatewayId" xml:"BackupGatewayId"`
 	OSSBucketRegion                   string `json:"OSSBucketRegion" xml:"OSSBucketRegion"`
 	OSSBucketName                     string `json:"OSSBucketName" xml:"OSSBucketName"`
 	BackupPeriod                      string `json:"BackupPeriod" xml:"BackupPeriod"`
@@ -38,6 +38,6 @@ type BackupPlanDetail struct {
 	SourceEndpointOracleSID           string `json:"SourceEndpointOracleSID" xml:"SourceEndpointOracleSID"`
 	InstanceClass                     string `json:"InstanceClass" xml:"InstanceClass"`
 	BackupMethod                      string `json:"BackupMethod" xml:"BackupMethod"`
-	BackupPlanCreateTime              int    `json:"BackupPlanCreateTime" xml:"BackupPlanCreateTime"`
+	BackupPlanCreateTime              int64  `json:"BackupPlanCreateTime" xml:"BackupPlanCreateTime"`
 	BackupPlanStatus                  string `json:"BackupPlanStatus" xml:"BackupPlanStatus"`
 }

+ 4 - 4
services/dbs/struct_full_backup_file.go

@@ -19,11 +19,11 @@ package dbs
 type FullBackupFile struct {
 	BackupSetId          string `json:"BackupSetId" xml:"BackupSetId"`
 	SourceEndpointIpPort string `json:"SourceEndpointIpPort" xml:"SourceEndpointIpPort"`
-	StartTime            int    `json:"StartTime" xml:"StartTime"`
-	EndTime              int    `json:"EndTime" xml:"EndTime"`
+	StartTime            int64  `json:"StartTime" xml:"StartTime"`
+	EndTime              int64  `json:"EndTime" xml:"EndTime"`
 	BackupStatus         string `json:"BackupStatus" xml:"BackupStatus"`
-	BackupSetExpiredTime int    `json:"BackupSetExpiredTime" xml:"BackupSetExpiredTime"`
-	BackupSize           int    `json:"BackupSize" xml:"BackupSize"`
+	BackupSetExpiredTime int64  `json:"BackupSetExpiredTime" xml:"BackupSetExpiredTime"`
+	BackupSize           int64  `json:"BackupSize" xml:"BackupSize"`
 	StorageMethod        string `json:"StorageMethod" xml:"StorageMethod"`
 	ErrMessage           string `json:"ErrMessage" xml:"ErrMessage"`
 }

+ 4 - 4
services/dbs/struct_increment_backup_file.go

@@ -19,10 +19,10 @@ package dbs
 type IncrementBackupFile struct {
 	BackupSetId          string `json:"BackupSetId" xml:"BackupSetId"`
 	SourceEndpointIpPort string `json:"SourceEndpointIpPort" xml:"SourceEndpointIpPort"`
-	StartTime            int    `json:"StartTime" xml:"StartTime"`
-	EndTime              int    `json:"EndTime" xml:"EndTime"`
+	StartTime            int64  `json:"StartTime" xml:"StartTime"`
+	EndTime              int64  `json:"EndTime" xml:"EndTime"`
 	BackupStatus         string `json:"BackupStatus" xml:"BackupStatus"`
-	BackupSetExpiredTime int    `json:"BackupSetExpiredTime" xml:"BackupSetExpiredTime"`
-	BackupSize           int    `json:"BackupSize" xml:"BackupSize"`
+	BackupSetExpiredTime int64  `json:"BackupSetExpiredTime" xml:"BackupSetExpiredTime"`
+	BackupSize           int64  `json:"BackupSize" xml:"BackupSize"`
 	StorageMethod        string `json:"StorageMethod" xml:"StorageMethod"`
 }

+ 3 - 3
services/dbs/struct_restore_task_detail.go

@@ -26,12 +26,12 @@ type RestoreTaskDetail struct {
 	DestinationEndpointUserName     string `json:"DestinationEndpointUserName" xml:"DestinationEndpointUserName"`
 	DestinationEndpointOracleSID    string `json:"DestinationEndpointOracleSID" xml:"DestinationEndpointOracleSID"`
 	RestoreObjects                  string `json:"RestoreObjects" xml:"RestoreObjects"`
-	BackupGatewayId                 int    `json:"BackupGatewayId" xml:"BackupGatewayId"`
+	BackupGatewayId                 int64  `json:"BackupGatewayId" xml:"BackupGatewayId"`
 	RestoreDir                      string `json:"RestoreDir" xml:"RestoreDir"`
 	RestoreTaskName                 string `json:"RestoreTaskName" xml:"RestoreTaskName"`
 	BackupSetId                     string `json:"BackupSetId" xml:"BackupSetId"`
-	RestoreTime                     int    `json:"RestoreTime" xml:"RestoreTime"`
-	RestoreTaskCreateTime           int    `json:"RestoreTaskCreateTime" xml:"RestoreTaskCreateTime"`
+	RestoreTime                     int64  `json:"RestoreTime" xml:"RestoreTime"`
+	RestoreTaskCreateTime           int64  `json:"RestoreTaskCreateTime" xml:"RestoreTaskCreateTime"`
 	RestoreStatus                   string `json:"RestoreStatus" xml:"RestoreStatus"`
 	RestoreTaskId                   string `json:"RestoreTaskId" xml:"RestoreTaskId"`
 	FullStruforeRestoreProgress     int    `json:"FullStruforeRestoreProgress" xml:"FullStruforeRestoreProgress"`