From 13a5e3e57e5e002dfc26603b360ee529cdb47ae6 Mon Sep 17 00:00:00 2001 From: sdk-team Date: Wed, 21 Aug 2024 09:54:26 +0000 Subject: [PATCH] Generated 2022-02-20 for ecs-workbench. --- ChangeLog.txt | 4 + services/ecs-workbench/client.go | 104 ++++++++++ .../get_instance_record_config.go | 103 ++++++++++ .../ecs-workbench/list_instance_records.go | 105 ++++++++++ services/ecs-workbench/login_instance.go | 183 ++++++++++++++++++ .../set_instance_record_config.go | 106 ++++++++++ .../struct_disposable_account.go | 22 +++ .../struct_instance_login_info_list.go | 21 ++ .../struct_instance_login_info_list_item.go | 24 +++ .../struct_instance_login_view.go | 21 ++ services/ecs-workbench/struct_record_list.go | 21 ++ .../ecs-workbench/struct_record_list_item.go | 28 +++ services/ecs-workbench/struct_root.go | 29 +++ .../ecs-workbench/struct_session_control.go | 21 ++ .../ecs-workbench/view_instance_records.go | 104 ++++++++++ 15 files changed, 896 insertions(+) create mode 100644 services/ecs-workbench/client.go create mode 100644 services/ecs-workbench/get_instance_record_config.go create mode 100644 services/ecs-workbench/list_instance_records.go create mode 100644 services/ecs-workbench/login_instance.go create mode 100644 services/ecs-workbench/set_instance_record_config.go create mode 100644 services/ecs-workbench/struct_disposable_account.go create mode 100644 services/ecs-workbench/struct_instance_login_info_list.go create mode 100644 services/ecs-workbench/struct_instance_login_info_list_item.go create mode 100644 services/ecs-workbench/struct_instance_login_view.go create mode 100644 services/ecs-workbench/struct_record_list.go create mode 100644 services/ecs-workbench/struct_record_list_item.go create mode 100644 services/ecs-workbench/struct_root.go create mode 100644 services/ecs-workbench/struct_session_control.go create mode 100644 services/ecs-workbench/view_instance_records.go diff --git a/ChangeLog.txt b/ChangeLog.txt index fe7f8d657d..2793e61d04 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,7 @@ +2024-08-21 Version: v1.63.4 +- Generated 2022-02-20 for `ecs-workbench`. +- Support record for ecs. + 2024-08-21 Version: v1.63.3 - Generated 2014-08-28 for `Ess`. - DescribeScalingGroups add SpotCapacity. diff --git a/services/ecs-workbench/client.go b/services/ecs-workbench/client.go new file mode 100644 index 0000000000..7bff566bc1 --- /dev/null +++ b/services/ecs-workbench/client.go @@ -0,0 +1,104 @@ +package ecs_workbench + +//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" + "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 +} + +// NewClient creates a sdk client with environment variables +func NewClient() (client *Client, err error) { + client = &Client{} + err = client.Init() + 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) + 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://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) + 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) + 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) + 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) + 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) + 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) + return +} diff --git a/services/ecs-workbench/get_instance_record_config.go b/services/ecs-workbench/get_instance_record_config.go new file mode 100644 index 0000000000..aa5095475a --- /dev/null +++ b/services/ecs-workbench/get_instance_record_config.go @@ -0,0 +1,103 @@ +package ecs_workbench + +//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" +) + +// GetInstanceRecordConfig invokes the ecs_workbench.GetInstanceRecordConfig API synchronously +func (client *Client) GetInstanceRecordConfig(request *GetInstanceRecordConfigRequest) (response *GetInstanceRecordConfigResponse, err error) { + response = CreateGetInstanceRecordConfigResponse() + err = client.DoAction(request, response) + return +} + +// GetInstanceRecordConfigWithChan invokes the ecs_workbench.GetInstanceRecordConfig API asynchronously +func (client *Client) GetInstanceRecordConfigWithChan(request *GetInstanceRecordConfigRequest) (<-chan *GetInstanceRecordConfigResponse, <-chan error) { + responseChan := make(chan *GetInstanceRecordConfigResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.GetInstanceRecordConfig(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// GetInstanceRecordConfigWithCallback invokes the ecs_workbench.GetInstanceRecordConfig API asynchronously +func (client *Client) GetInstanceRecordConfigWithCallback(request *GetInstanceRecordConfigRequest, callback func(response *GetInstanceRecordConfigResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *GetInstanceRecordConfigResponse + var err error + defer close(result) + response, err = client.GetInstanceRecordConfig(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// GetInstanceRecordConfigRequest is the request struct for api GetInstanceRecordConfig +type GetInstanceRecordConfigRequest struct { + *requests.RpcRequest + InstanceId string `position:"Body" name:"InstanceId"` +} + +// GetInstanceRecordConfigResponse is the response struct for api GetInstanceRecordConfig +type GetInstanceRecordConfigResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Success bool `json:"Success" xml:"Success"` + Code string `json:"Code" xml:"Code"` + Message string `json:"Message" xml:"Message"` + Root Root `json:"Root" xml:"Root"` +} + +// CreateGetInstanceRecordConfigRequest creates a request to invoke GetInstanceRecordConfig API +func CreateGetInstanceRecordConfigRequest() (request *GetInstanceRecordConfigRequest) { + request = &GetInstanceRecordConfigRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("ecs-workbench", "2022-02-20", "GetInstanceRecordConfig", "ecs-workbench", "openAPI") + request.Method = requests.POST + return +} + +// CreateGetInstanceRecordConfigResponse creates a response to parse from GetInstanceRecordConfig response +func CreateGetInstanceRecordConfigResponse() (response *GetInstanceRecordConfigResponse) { + response = &GetInstanceRecordConfigResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/services/ecs-workbench/list_instance_records.go b/services/ecs-workbench/list_instance_records.go new file mode 100644 index 0000000000..0692c247a3 --- /dev/null +++ b/services/ecs-workbench/list_instance_records.go @@ -0,0 +1,105 @@ +package ecs_workbench + +//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" +) + +// ListInstanceRecords invokes the ecs_workbench.ListInstanceRecords API synchronously +func (client *Client) ListInstanceRecords(request *ListInstanceRecordsRequest) (response *ListInstanceRecordsResponse, err error) { + response = CreateListInstanceRecordsResponse() + err = client.DoAction(request, response) + return +} + +// ListInstanceRecordsWithChan invokes the ecs_workbench.ListInstanceRecords API asynchronously +func (client *Client) ListInstanceRecordsWithChan(request *ListInstanceRecordsRequest) (<-chan *ListInstanceRecordsResponse, <-chan error) { + responseChan := make(chan *ListInstanceRecordsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ListInstanceRecords(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ListInstanceRecordsWithCallback invokes the ecs_workbench.ListInstanceRecords API asynchronously +func (client *Client) ListInstanceRecordsWithCallback(request *ListInstanceRecordsRequest, callback func(response *ListInstanceRecordsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ListInstanceRecordsResponse + var err error + defer close(result) + response, err = client.ListInstanceRecords(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ListInstanceRecordsRequest is the request struct for api ListInstanceRecords +type ListInstanceRecordsRequest struct { + *requests.RpcRequest + PageNumber requests.Integer `position:"Body" name:"PageNumber"` + InstanceId string `position:"Body" name:"InstanceId"` + PageSize requests.Integer `position:"Body" name:"PageSize"` +} + +// ListInstanceRecordsResponse is the response struct for api ListInstanceRecords +type ListInstanceRecordsResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Success bool `json:"Success" xml:"Success"` + Code string `json:"Code" xml:"Code"` + Message string `json:"Message" xml:"Message"` + Root Root `json:"Root" xml:"Root"` +} + +// CreateListInstanceRecordsRequest creates a request to invoke ListInstanceRecords API +func CreateListInstanceRecordsRequest() (request *ListInstanceRecordsRequest) { + request = &ListInstanceRecordsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("ecs-workbench", "2022-02-20", "ListInstanceRecords", "ecs-workbench", "openAPI") + request.Method = requests.POST + return +} + +// CreateListInstanceRecordsResponse creates a response to parse from ListInstanceRecords response +func CreateListInstanceRecordsResponse() (response *ListInstanceRecordsResponse) { + response = &ListInstanceRecordsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/services/ecs-workbench/login_instance.go b/services/ecs-workbench/login_instance.go new file mode 100644 index 0000000000..87d5546f30 --- /dev/null +++ b/services/ecs-workbench/login_instance.go @@ -0,0 +1,183 @@ +package ecs_workbench + +//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" +) + +// LoginInstance invokes the ecs_workbench.LoginInstance API synchronously +func (client *Client) LoginInstance(request *LoginInstanceRequest) (response *LoginInstanceResponse, err error) { + response = CreateLoginInstanceResponse() + err = client.DoAction(request, response) + return +} + +// LoginInstanceWithChan invokes the ecs_workbench.LoginInstance API asynchronously +func (client *Client) LoginInstanceWithChan(request *LoginInstanceRequest) (<-chan *LoginInstanceResponse, <-chan error) { + responseChan := make(chan *LoginInstanceResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.LoginInstance(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// LoginInstanceWithCallback invokes the ecs_workbench.LoginInstance API asynchronously +func (client *Client) LoginInstanceWithCallback(request *LoginInstanceRequest, callback func(response *LoginInstanceResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *LoginInstanceResponse + var err error + defer close(result) + response, err = client.LoginInstance(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// LoginInstanceRequest is the request struct for api LoginInstance +type LoginInstanceRequest struct { + *requests.RpcRequest + PartnerInfo LoginInstancePartnerInfo `position:"Query" name:"PartnerInfo" type:"Struct"` + InstanceLoginInfo LoginInstanceInstanceLoginInfo `position:"Query" name:"InstanceLoginInfo" type:"Struct"` + UserAccount LoginInstanceUserAccount `position:"Query" name:"UserAccount" type:"Struct"` +} + +// LoginInstancePartnerInfo is a repeated param struct in LoginInstanceRequest +type LoginInstancePartnerInfo struct { + PartnerName string `name:"PartnerName"` + PartnerId string `name:"PartnerId"` +} + +// LoginInstanceInstanceLoginInfo is a repeated param struct in LoginInstanceRequest +type LoginInstanceInstanceLoginInfo struct { + ExpireTime string `name:"ExpireTime"` + LoginByInstanceShortcut string `name:"LoginByInstanceShortcut"` + Certificate string `name:"Certificate"` + AuthenticationType string `name:"AuthenticationType"` + DockerExec string `name:"DockerExec"` + ShortcutToken string `name:"ShortcutToken"` + ResourceGroupId string `name:"ResourceGroupId"` + Protocol string `name:"Protocol"` + Password string `name:"Password"` + LoginByInstanceCredential string `name:"LoginByInstanceCredential"` + InstanceId string `name:"InstanceId"` + RegionId string `name:"RegionId"` + Port string `name:"Port"` + VpcId string `name:"VpcId"` + Host string `name:"Host"` + Options LoginInstanceInstanceLoginInfoOptions `name:"Options" type:"Struct"` + InstanceType string `name:"InstanceType"` + DockerContainerName string `name:"DockerContainerName"` + PassPhrase string `name:"PassPhrase"` + CredentialToken string `name:"CredentialToken"` + DurationSeconds string `name:"DurationSeconds"` + NetworkAccessMode string `name:"NetworkAccessMode"` + Username string `name:"Username"` +} + +// LoginInstanceUserAccount is a repeated param struct in LoginInstanceRequest +type LoginInstanceUserAccount struct { + AccountId string `name:"AccountId"` + EmpId string `name:"EmpId"` + ExpireTime string `name:"ExpireTime"` + LoginName string `name:"LoginName"` + Options LoginInstanceUserAccountOptions `name:"Options" type:"Struct"` + AccountStructure string `name:"AccountStructure"` + DurationSeconds string `name:"DurationSeconds"` + ParentId string `name:"ParentId"` + AccountPlatform string `name:"AccountPlatform"` +} + +// LoginInstanceInstanceLoginInfoOptions is a repeated param struct in LoginInstanceRequest +type LoginInstanceInstanceLoginInfoOptions struct { + OperationDisableSeconds string `name:"OperationDisableSeconds"` + NotificationRecipientUrl string `name:"NotificationRecipientUrl"` + SessionControl string `name:"SessionControl"` + VideoFreezeSeconds string `name:"VideoFreezeSeconds"` + ContainerInfo LoginInstanceInstanceLoginInfoOptionsContainerInfo `name:"ContainerInfo" type:"Struct"` + NotificationRetryIntervalSeconds string `name:"NotificationRetryIntervalSeconds"` + AudioMuteSeconds string `name:"AudioMuteSeconds"` + FixedHeight string `name:"FixedHeight"` + FixedWidth string `name:"FixedWidth"` + NotificationEventTypes string `name:"NotificationEventTypes"` + NotificationRetryLimit string `name:"NotificationRetryLimit"` +} + +// LoginInstanceUserAccountOptions is a repeated param struct in LoginInstanceRequest +type LoginInstanceUserAccountOptions struct { + LoginLimit string `name:"LoginLimit"` +} + +// LoginInstanceInstanceLoginInfoOptionsContainerInfo is a repeated param struct in LoginInstanceRequest +type LoginInstanceInstanceLoginInfoOptionsContainerInfo struct { + Headers map[string]string `name:"Headers" type:"Map"` + Endpoint string `name:"Endpoint"` + ContainerName string `name:"ContainerName"` + ClusterName string `name:"ClusterName"` + Namespace string `name:"Namespace"` + PodName string `name:"PodName"` + ClusterId string `name:"ClusterId"` + Deployment string `name:"Deployment"` +} + +// LoginInstanceResponse is the response struct for api LoginInstance +type LoginInstanceResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Success string `json:"Success" xml:"Success"` + Code string `json:"Code" xml:"Code"` + Message string `json:"Message" xml:"Message"` + Root Root `json:"Root" xml:"Root"` +} + +// CreateLoginInstanceRequest creates a request to invoke LoginInstance API +func CreateLoginInstanceRequest() (request *LoginInstanceRequest) { + request = &LoginInstanceRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("ecs-workbench", "2022-02-20", "LoginInstance", "ecs-workbench", "openAPI") + request.Method = requests.POST + return +} + +// CreateLoginInstanceResponse creates a response to parse from LoginInstance response +func CreateLoginInstanceResponse() (response *LoginInstanceResponse) { + response = &LoginInstanceResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/services/ecs-workbench/set_instance_record_config.go b/services/ecs-workbench/set_instance_record_config.go new file mode 100644 index 0000000000..f92d87e527 --- /dev/null +++ b/services/ecs-workbench/set_instance_record_config.go @@ -0,0 +1,106 @@ +package ecs_workbench + +//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" +) + +// SetInstanceRecordConfig invokes the ecs_workbench.SetInstanceRecordConfig API synchronously +func (client *Client) SetInstanceRecordConfig(request *SetInstanceRecordConfigRequest) (response *SetInstanceRecordConfigResponse, err error) { + response = CreateSetInstanceRecordConfigResponse() + err = client.DoAction(request, response) + return +} + +// SetInstanceRecordConfigWithChan invokes the ecs_workbench.SetInstanceRecordConfig API asynchronously +func (client *Client) SetInstanceRecordConfigWithChan(request *SetInstanceRecordConfigRequest) (<-chan *SetInstanceRecordConfigResponse, <-chan error) { + responseChan := make(chan *SetInstanceRecordConfigResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.SetInstanceRecordConfig(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// SetInstanceRecordConfigWithCallback invokes the ecs_workbench.SetInstanceRecordConfig API asynchronously +func (client *Client) SetInstanceRecordConfigWithCallback(request *SetInstanceRecordConfigRequest, callback func(response *SetInstanceRecordConfigResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *SetInstanceRecordConfigResponse + var err error + defer close(result) + response, err = client.SetInstanceRecordConfig(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// SetInstanceRecordConfigRequest is the request struct for api SetInstanceRecordConfig +type SetInstanceRecordConfigRequest struct { + *requests.RpcRequest + Enabled requests.Boolean `position:"Body" name:"Enabled"` + RecordStorageTarget string `position:"Body" name:"RecordStorageTarget"` + InstanceId string `position:"Body" name:"InstanceId"` + ExpirationDays requests.Integer `position:"Body" name:"ExpirationDays"` +} + +// SetInstanceRecordConfigResponse is the response struct for api SetInstanceRecordConfig +type SetInstanceRecordConfigResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Success bool `json:"Success" xml:"Success"` + Code string `json:"Code" xml:"Code"` + Root bool `json:"Root" xml:"Root"` + Message string `json:"Message" xml:"Message"` +} + +// CreateSetInstanceRecordConfigRequest creates a request to invoke SetInstanceRecordConfig API +func CreateSetInstanceRecordConfigRequest() (request *SetInstanceRecordConfigRequest) { + request = &SetInstanceRecordConfigRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("ecs-workbench", "2022-02-20", "SetInstanceRecordConfig", "ecs-workbench", "openAPI") + request.Method = requests.POST + return +} + +// CreateSetInstanceRecordConfigResponse creates a response to parse from SetInstanceRecordConfig response +func CreateSetInstanceRecordConfigResponse() (response *SetInstanceRecordConfigResponse) { + response = &SetInstanceRecordConfigResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/services/ecs-workbench/struct_disposable_account.go b/services/ecs-workbench/struct_disposable_account.go new file mode 100644 index 0000000000..58b6fe93d3 --- /dev/null +++ b/services/ecs-workbench/struct_disposable_account.go @@ -0,0 +1,22 @@ +package ecs_workbench + +//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. + +// DisposableAccount is a nested struct in ecs_workbench response +type DisposableAccount struct { + LoginUrl string `json:"LoginUrl" xml:"LoginUrl"` + LoginFormActionUrl string `json:"LoginFormActionUrl" xml:"LoginFormActionUrl"` +} diff --git a/services/ecs-workbench/struct_instance_login_info_list.go b/services/ecs-workbench/struct_instance_login_info_list.go new file mode 100644 index 0000000000..f8a7366407 --- /dev/null +++ b/services/ecs-workbench/struct_instance_login_info_list.go @@ -0,0 +1,21 @@ +package ecs_workbench + +//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. + +// InstanceLoginInfoList is a nested struct in ecs_workbench response +type InstanceLoginInfoList struct { + InstanceLoginInfoListItem []InstanceLoginInfoListItem `json:"instanceLoginInfoList" xml:"instanceLoginInfoList"` +} diff --git a/services/ecs-workbench/struct_instance_login_info_list_item.go b/services/ecs-workbench/struct_instance_login_info_list_item.go new file mode 100644 index 0000000000..2aab3a09f7 --- /dev/null +++ b/services/ecs-workbench/struct_instance_login_info_list_item.go @@ -0,0 +1,24 @@ +package ecs_workbench + +//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. + +// InstanceLoginInfoListItem is a nested struct in ecs_workbench response +type InstanceLoginInfoListItem struct { + InstanceId string `json:"InstanceId" xml:"InstanceId"` + InstanceLoginToken string `json:"InstanceLoginToken" xml:"InstanceLoginToken"` + LoginSuccess bool `json:"LoginSuccess" xml:"LoginSuccess"` + InstanceLoginView InstanceLoginView `json:"InstanceLoginView" xml:"InstanceLoginView"` +} diff --git a/services/ecs-workbench/struct_instance_login_view.go b/services/ecs-workbench/struct_instance_login_view.go new file mode 100644 index 0000000000..7cf4e65f71 --- /dev/null +++ b/services/ecs-workbench/struct_instance_login_view.go @@ -0,0 +1,21 @@ +package ecs_workbench + +//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. + +// InstanceLoginView is a nested struct in ecs_workbench response +type InstanceLoginView struct { + DefaultViewUrl string `json:"DefaultViewUrl" xml:"DefaultViewUrl"` +} diff --git a/services/ecs-workbench/struct_record_list.go b/services/ecs-workbench/struct_record_list.go new file mode 100644 index 0000000000..87ce6ed623 --- /dev/null +++ b/services/ecs-workbench/struct_record_list.go @@ -0,0 +1,21 @@ +package ecs_workbench + +//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. + +// RecordList is a nested struct in ecs_workbench response +type RecordList struct { + RecordListItem []RecordListItem `json:"RecordList" xml:"RecordList"` +} diff --git a/services/ecs-workbench/struct_record_list_item.go b/services/ecs-workbench/struct_record_list_item.go new file mode 100644 index 0000000000..cccc617463 --- /dev/null +++ b/services/ecs-workbench/struct_record_list_item.go @@ -0,0 +1,28 @@ +package ecs_workbench + +//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. + +// RecordListItem is a nested struct in ecs_workbench response +type RecordListItem struct { + GmtCreate string `json:"GmtCreate" xml:"GmtCreate"` + AccountId int64 `json:"AccountId" xml:"AccountId"` + InstanceId string `json:"InstanceId" xml:"InstanceId"` + TerminalSessionToken string `json:"TerminalSessionToken" xml:"TerminalSessionToken"` + RecordDurationMillis int64 `json:"RecordDurationMillis" xml:"RecordDurationMillis"` + Status string `json:"Status" xml:"Status"` + ExpireTime string `json:"ExpireTime" xml:"ExpireTime"` + InstanceRecordUrl string `json:"InstanceRecordUrl" xml:"InstanceRecordUrl"` +} diff --git a/services/ecs-workbench/struct_root.go b/services/ecs-workbench/struct_root.go new file mode 100644 index 0000000000..f4c6fcd951 --- /dev/null +++ b/services/ecs-workbench/struct_root.go @@ -0,0 +1,29 @@ +package ecs_workbench + +//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. + +// Root is a nested struct in ecs_workbench response +type Root struct { + ParentId string `json:"ParentId" xml:"ParentId"` + InstanceId string `json:"InstanceId" xml:"InstanceId"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + ExpirationDays int `json:"ExpirationDays" xml:"ExpirationDays"` + RecordStorageTarget string `json:"RecordStorageTarget" xml:"RecordStorageTarget"` + DisposableAccount DisposableAccount `json:"DisposableAccount" xml:"DisposableAccount"` + SessionControl SessionControl `json:"SessionControl" xml:"SessionControl"` + RecordList []RecordListItem `json:"RecordList" xml:"RecordList"` + InstanceLoginInfoList []InstanceLoginInfoListItem `json:"InstanceLoginInfoList" xml:"InstanceLoginInfoList"` +} diff --git a/services/ecs-workbench/struct_session_control.go b/services/ecs-workbench/struct_session_control.go new file mode 100644 index 0000000000..df20d693dc --- /dev/null +++ b/services/ecs-workbench/struct_session_control.go @@ -0,0 +1,21 @@ +package ecs_workbench + +//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. + +// SessionControl is a nested struct in ecs_workbench response +type SessionControl struct { + BaseUrl string `json:"BaseUrl" xml:"BaseUrl"` +} diff --git a/services/ecs-workbench/view_instance_records.go b/services/ecs-workbench/view_instance_records.go new file mode 100644 index 0000000000..2fcf50b20b --- /dev/null +++ b/services/ecs-workbench/view_instance_records.go @@ -0,0 +1,104 @@ +package ecs_workbench + +//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" +) + +// ViewInstanceRecords invokes the ecs_workbench.ViewInstanceRecords API synchronously +func (client *Client) ViewInstanceRecords(request *ViewInstanceRecordsRequest) (response *ViewInstanceRecordsResponse, err error) { + response = CreateViewInstanceRecordsResponse() + err = client.DoAction(request, response) + return +} + +// ViewInstanceRecordsWithChan invokes the ecs_workbench.ViewInstanceRecords API asynchronously +func (client *Client) ViewInstanceRecordsWithChan(request *ViewInstanceRecordsRequest) (<-chan *ViewInstanceRecordsResponse, <-chan error) { + responseChan := make(chan *ViewInstanceRecordsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ViewInstanceRecords(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ViewInstanceRecordsWithCallback invokes the ecs_workbench.ViewInstanceRecords API asynchronously +func (client *Client) ViewInstanceRecordsWithCallback(request *ViewInstanceRecordsRequest, callback func(response *ViewInstanceRecordsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ViewInstanceRecordsResponse + var err error + defer close(result) + response, err = client.ViewInstanceRecords(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ViewInstanceRecordsRequest is the request struct for api ViewInstanceRecords +type ViewInstanceRecordsRequest struct { + *requests.RpcRequest + InstanceId string `position:"Body" name:"InstanceId"` + TerminalSessionToken string `position:"Body" name:"TerminalSessionToken"` +} + +// ViewInstanceRecordsResponse is the response struct for api ViewInstanceRecords +type ViewInstanceRecordsResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Success bool `json:"Success" xml:"Success"` + Code string `json:"Code" xml:"Code"` + Root bool `json:"Root" xml:"Root"` + Message string `json:"Message" xml:"Message"` +} + +// CreateViewInstanceRecordsRequest creates a request to invoke ViewInstanceRecords API +func CreateViewInstanceRecordsRequest() (request *ViewInstanceRecordsRequest) { + request = &ViewInstanceRecordsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("ecs-workbench", "2022-02-20", "ViewInstanceRecords", "ecs-workbench", "openAPI") + request.Method = requests.POST + return +} + +// CreateViewInstanceRecordsResponse creates a response to parse from ViewInstanceRecords response +func CreateViewInstanceRecordsResponse() (response *ViewInstanceRecordsResponse) { + response = &ViewInstanceRecordsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +}