sdk-team 6 лет назад
Родитель
Сommit
f56b7fb35c

+ 3 - 0
ChangeLog.txt

@@ -1,3 +1,6 @@
+2019-10-09 Version: 1.60.187
+- Generated 2018-11-11 for `PTS`.
+
 2019-10-09 Version: 1.60.186
 - DescribeIntance status type modification.
 

+ 129 - 0
services/pts/client.go

@@ -0,0 +1,129 @@
+package pts
+
+//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 (
+	"reflect"
+
+	"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/credentials/provider"
+)
+
+// Client is the sdk client struct, each func corresponds to an OpenAPI
+type Client struct {
+	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
+func NewClient() (client *Client, err error) {
+	client = &Client{}
+	err = client.Init()
+	SetEndpointDataToClient(client)
+	return
+}
+
+// NewClientWithProvider creates a sdk client with providers
+// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
+func NewClientWithProvider(regionId string, providers ...provider.Provider) (client *Client, err error) {
+	client = &Client{}
+	var pc provider.Provider
+	if len(providers) == 0 {
+		pc = provider.DefaultChain
+	} else {
+		pc = provider.NewProviderChain(providers)
+	}
+	err = client.InitWithProviderChain(regionId, pc)
+	SetEndpointDataToClient(client)
+	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)
+	SetEndpointDataToClient(client)
+	return
+}
+
+// NewClientWithAccessKey is a shortcut to create sdk client with accesskey
+// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
+func NewClientWithAccessKey(regionId, accessKeyId, accessKeySecret string) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithAccessKey(regionId, accessKeyId, accessKeySecret)
+	SetEndpointDataToClient(client)
+	return
+}
+
+// NewClientWithStsToken is a shortcut to create sdk client with sts token
+// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
+func NewClientWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken string) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken)
+	SetEndpointDataToClient(client)
+	return
+}
+
+// NewClientWithRamRoleArn is a shortcut to create sdk client with ram roleArn
+// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
+func NewClientWithRamRoleArn(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithRamRoleArn(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName)
+	SetEndpointDataToClient(client)
+	return
+}
+
+// NewClientWithRamRoleArn is a shortcut to create sdk client with ram roleArn and policy
+// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
+func NewClientWithRamRoleArnAndPolicy(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName, policy string) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithRamRoleArnAndPolicy(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName, policy)
+	SetEndpointDataToClient(client)
+	return
+}
+
+// NewClientWithEcsRamRole is a shortcut to create sdk client with ecs ram role
+// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
+func NewClientWithEcsRamRole(regionId string, roleName string) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithEcsRamRole(regionId, roleName)
+	SetEndpointDataToClient(client)
+	return
+}
+
+// NewClientWithRsaKeyPair is a shortcut to create sdk client with rsa key pair
+// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
+func NewClientWithRsaKeyPair(regionId string, publicKeyId, privateKey string, sessionExpiration int) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithRsaKeyPair(regionId, publicKeyId, privateKey, sessionExpiration)
+	SetEndpointDataToClient(client)
+	return
+}

+ 20 - 0
services/pts/endpoint.go

@@ -0,0 +1,20 @@
+package pts
+
+// EndpointMap Endpoint Data
+var EndpointMap map[string]string
+
+// EndpointType regional or central
+var EndpointType = "central"
+
+// GetEndpointMap Get Endpoint Data Map
+func GetEndpointMap() map[string]string {
+	if EndpointMap == nil {
+		EndpointMap = map[string]string{}
+	}
+	return EndpointMap
+}
+
+// GetEndpointType Get Endpoint Type Value
+func GetEndpointType() string {
+	return EndpointType
+}

+ 108 - 0
services/pts/get_report.go

@@ -0,0 +1,108 @@
+package pts
+
+//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"
+)
+
+// GetReport invokes the pts.GetReport API synchronously
+// api document: https://help.aliyun.com/api/pts/getreport.html
+func (client *Client) GetReport(request *GetReportRequest) (response *GetReportResponse, err error) {
+	response = CreateGetReportResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// GetReportWithChan invokes the pts.GetReport API asynchronously
+// api document: https://help.aliyun.com/api/pts/getreport.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) GetReportWithChan(request *GetReportRequest) (<-chan *GetReportResponse, <-chan error) {
+	responseChan := make(chan *GetReportResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.GetReport(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// GetReportWithCallback invokes the pts.GetReport API asynchronously
+// api document: https://help.aliyun.com/api/pts/getreport.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) GetReportWithCallback(request *GetReportRequest, callback func(response *GetReportResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *GetReportResponse
+		var err error
+		defer close(result)
+		response, err = client.GetReport(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// GetReportRequest is the request struct for api GetReport
+type GetReportRequest struct {
+	*requests.RpcRequest
+	ReportId requests.Integer `position:"Query" name:"ReportId"`
+}
+
+// GetReportResponse is the response struct for api GetReport
+type GetReportResponse struct {
+	*responses.BaseResponse
+	RequestId string `json:"RequestId" xml:"RequestId"`
+	Code      string `json:"Code" xml:"Code"`
+	Message   string `json:"Message" xml:"Message"`
+	Success   bool   `json:"Success" xml:"Success"`
+	Snapshot  string `json:"Snapshot" xml:"Snapshot"`
+	Summary   string `json:"Summary" xml:"Summary"`
+}
+
+// CreateGetReportRequest creates a request to invoke GetReport API
+func CreateGetReportRequest() (request *GetReportRequest) {
+	request = &GetReportRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("PTS", "2018-11-11", "GetReport", "1.0.0", "openAPI")
+	return
+}
+
+// CreateGetReportResponse creates a response to parse from GetReport response
+func CreateGetReportResponse() (response *GetReportResponse) {
+	response = &GetReportResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 127 - 0
services/pts/query_plan_status.go

@@ -0,0 +1,127 @@
+package pts
+
+//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"
+)
+
+// QueryPlanStatus invokes the pts.QueryPlanStatus API synchronously
+// api document: https://help.aliyun.com/api/pts/queryplanstatus.html
+func (client *Client) QueryPlanStatus(request *QueryPlanStatusRequest) (response *QueryPlanStatusResponse, err error) {
+	response = CreateQueryPlanStatusResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// QueryPlanStatusWithChan invokes the pts.QueryPlanStatus API asynchronously
+// api document: https://help.aliyun.com/api/pts/queryplanstatus.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) QueryPlanStatusWithChan(request *QueryPlanStatusRequest) (<-chan *QueryPlanStatusResponse, <-chan error) {
+	responseChan := make(chan *QueryPlanStatusResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.QueryPlanStatus(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// QueryPlanStatusWithCallback invokes the pts.QueryPlanStatus API asynchronously
+// api document: https://help.aliyun.com/api/pts/queryplanstatus.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) QueryPlanStatusWithCallback(request *QueryPlanStatusRequest, callback func(response *QueryPlanStatusResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *QueryPlanStatusResponse
+		var err error
+		defer close(result)
+		response, err = client.QueryPlanStatus(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// QueryPlanStatusRequest is the request struct for api QueryPlanStatus
+type QueryPlanStatusRequest struct {
+	*requests.RpcRequest
+	ReportId requests.Integer `position:"Query" name:"ReportId"`
+	SceneId  requests.Integer `position:"Query" name:"SceneId"`
+}
+
+// QueryPlanStatusResponse is the response struct for api QueryPlanStatus
+type QueryPlanStatusResponse struct {
+	*responses.BaseResponse
+	RequestId           string         `json:"RequestId" xml:"RequestId"`
+	Code                string         `json:"Code" xml:"Code"`
+	Message             string         `json:"Message" xml:"Message"`
+	Success             bool           `json:"Success" xml:"Success"`
+	Tips                string         `json:"Tips" xml:"Tips"`
+	RequestCount        string         `json:"RequestCount" xml:"RequestCount"`
+	Vum                 int            `json:"Vum" xml:"Vum"`
+	BpsRequest          string         `json:"BpsRequest" xml:"BpsRequest"`
+	BpsResponse         string         `json:"BpsResponse" xml:"BpsResponse"`
+	FailedRequestCount  int            `json:"FailedRequestCount" xml:"FailedRequestCount"`
+	FailedBusinessCount int            `json:"FailedBusinessCount" xml:"FailedBusinessCount"`
+	Concurrency         int            `json:"Concurrency" xml:"Concurrency"`
+	ConcurrencyLimit    int            `json:"ConcurrencyLimit" xml:"ConcurrencyLimit"`
+	Tps                 int            `json:"Tps" xml:"Tps"`
+	TpsLimit            int            `json:"TpsLimit" xml:"TpsLimit"`
+	AliveAgentCount     int            `json:"AliveAgentCount" xml:"AliveAgentCount"`
+	TotalAgentCount     int            `json:"TotalAgentCount" xml:"TotalAgentCount"`
+	Seg90Rt             int            `json:"Seg90Rt" xml:"Seg90Rt"`
+	AverageRt           int            `json:"AverageRt" xml:"AverageRt"`
+	ReportId            int64          `json:"ReportId" xml:"ReportId"`
+	StartTime           int64          `json:"StartTime" xml:"StartTime"`
+	CurrentTime         int64          `json:"CurrentTime" xml:"CurrentTime"`
+	MonitorData         MonitorData    `json:"MonitorData" xml:"MonitorData"`
+	AgentLocations      AgentLocations `json:"AgentLocations" xml:"AgentLocations"`
+}
+
+// CreateQueryPlanStatusRequest creates a request to invoke QueryPlanStatus API
+func CreateQueryPlanStatusRequest() (request *QueryPlanStatusRequest) {
+	request = &QueryPlanStatusRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("PTS", "2018-11-11", "QueryPlanStatus", "1.0.0", "openAPI")
+	return
+}
+
+// CreateQueryPlanStatusResponse creates a response to parse from QueryPlanStatus response
+func CreateQueryPlanStatusResponse() (response *QueryPlanStatusResponse) {
+	response = &QueryPlanStatusResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 107 - 0
services/pts/start_scene.go

@@ -0,0 +1,107 @@
+package pts
+
+//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"
+)
+
+// StartScene invokes the pts.StartScene API synchronously
+// api document: https://help.aliyun.com/api/pts/startscene.html
+func (client *Client) StartScene(request *StartSceneRequest) (response *StartSceneResponse, err error) {
+	response = CreateStartSceneResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// StartSceneWithChan invokes the pts.StartScene API asynchronously
+// api document: https://help.aliyun.com/api/pts/startscene.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) StartSceneWithChan(request *StartSceneRequest) (<-chan *StartSceneResponse, <-chan error) {
+	responseChan := make(chan *StartSceneResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.StartScene(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// StartSceneWithCallback invokes the pts.StartScene API asynchronously
+// api document: https://help.aliyun.com/api/pts/startscene.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) StartSceneWithCallback(request *StartSceneRequest, callback func(response *StartSceneResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *StartSceneResponse
+		var err error
+		defer close(result)
+		response, err = client.StartScene(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// StartSceneRequest is the request struct for api StartScene
+type StartSceneRequest struct {
+	*requests.RpcRequest
+	SceneId requests.Integer `position:"Query" name:"SceneId"`
+}
+
+// StartSceneResponse is the response struct for api StartScene
+type StartSceneResponse struct {
+	*responses.BaseResponse
+	RequestId string `json:"RequestId" xml:"RequestId"`
+	Code      string `json:"Code" xml:"Code"`
+	Message   string `json:"Message" xml:"Message"`
+	Success   bool   `json:"Success" xml:"Success"`
+	ReportId  int64  `json:"ReportId" xml:"ReportId"`
+}
+
+// CreateStartSceneRequest creates a request to invoke StartScene API
+func CreateStartSceneRequest() (request *StartSceneRequest) {
+	request = &StartSceneRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("PTS", "2018-11-11", "StartScene", "1.0.0", "openAPI")
+	return
+}
+
+// CreateStartSceneResponse creates a response to parse from StartScene response
+func CreateStartSceneResponse() (response *StartSceneResponse) {
+	response = &StartSceneResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 21 - 0
services/pts/struct_agent_locations.go

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

+ 21 - 0
services/pts/struct_monitor_data.go

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