| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152 |
- 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"
- )
- func (client *Client) CreateInstance(request *CreateInstanceRequest) (response *CreateInstanceResponse, err error) {
- response = CreateCreateInstanceResponse()
- err = client.DoAction(request, response)
- return
- }
- func (client *Client) CreateInstanceWithChan(request *CreateInstanceRequest) (<-chan *CreateInstanceResponse, <-chan error) {
- responseChan := make(chan *CreateInstanceResponse, 1)
- errChan := make(chan error, 1)
- err := client.AddAsyncTask(func() {
- defer close(responseChan)
- defer close(errChan)
- response, err := client.CreateInstance(request)
- responseChan <- response
- errChan <- err
- })
- if err != nil {
- errChan <- err
- close(responseChan)
- close(errChan)
- }
- return responseChan, errChan
- }
- func (client *Client) CreateInstanceWithCallback(request *CreateInstanceRequest, callback func(response *CreateInstanceResponse, err error)) <-chan int {
- result := make(chan int, 1)
- err := client.AddAsyncTask(func() {
- var response *CreateInstanceResponse
- var err error
- defer close(result)
- response, err = client.CreateInstance(request)
- callback(response, err)
- result <- 1
- })
- if err != nil {
- defer close(result)
- callback(nil, err)
- result <- 0
- }
- return result
- }
- type CreateInstanceRequest struct {
- *requests.RpcRequest
- Tag4Value string `position:"Query" name:"Tag.4.Value"`
- ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"`
- Tag2Key string `position:"Query" name:"Tag.2.Key"`
- HpcClusterId string `position:"Query" name:"HpcClusterId"`
- Tag3Key string `position:"Query" name:"Tag.3.Key"`
- SecurityEnhancementStrategy string `position:"Query" name:"SecurityEnhancementStrategy"`
- KeyPairName string `position:"Query" name:"KeyPairName"`
- SpotPriceLimit requests.Float `position:"Query" name:"SpotPriceLimit"`
- Tag1Value string `position:"Query" name:"Tag.1.Value"`
- ResourceGroupId string `position:"Query" name:"ResourceGroupId"`
- HostName string `position:"Query" name:"HostName"`
- Password string `position:"Query" name:"Password"`
- AutoRenewPeriod requests.Integer `position:"Query" name:"AutoRenewPeriod"`
- NodeControllerId string `position:"Query" name:"NodeControllerId"`
- Period requests.Integer `position:"Query" name:"Period"`
- Tag5Key string `position:"Query" name:"Tag.5.Key"`
- OwnerId requests.Integer `position:"Query" name:"OwnerId"`
- VSwitchId string `position:"Query" name:"VSwitchId"`
- PrivateIpAddress string `position:"Query" name:"PrivateIpAddress"`
- SpotStrategy string `position:"Query" name:"SpotStrategy"`
- PeriodUnit string `position:"Query" name:"PeriodUnit"`
- InstanceName string `position:"Query" name:"InstanceName"`
- AutoRenew requests.Boolean `position:"Query" name:"AutoRenew"`
- InternetChargeType string `position:"Query" name:"InternetChargeType"`
- ZoneId string `position:"Query" name:"ZoneId"`
- Tag4Key string `position:"Query" name:"Tag.4.Key"`
- InternetMaxBandwidthIn requests.Integer `position:"Query" name:"InternetMaxBandwidthIn"`
- UseAdditionalService requests.Boolean `position:"Query" name:"UseAdditionalService"`
- ImageId string `position:"Query" name:"ImageId"`
- ClientToken string `position:"Query" name:"ClientToken"`
- VlanId string `position:"Query" name:"VlanId"`
- IoOptimized string `position:"Query" name:"IoOptimized"`
- SecurityGroupId string `position:"Query" name:"SecurityGroupId"`
- InternetMaxBandwidthOut requests.Integer `position:"Query" name:"InternetMaxBandwidthOut"`
- Description string `position:"Query" name:"Description"`
- SystemDiskCategory string `position:"Query" name:"SystemDisk.Category"`
- UserData string `position:"Query" name:"UserData"`
- InstanceType string `position:"Query" name:"InstanceType"`
- InstanceChargeType string `position:"Query" name:"InstanceChargeType"`
- Tag3Value string `position:"Query" name:"Tag.3.Value"`
- DeploymentSetId string `position:"Query" name:"DeploymentSetId"`
- InnerIpAddress string `position:"Query" name:"InnerIpAddress"`
- ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"`
- OwnerAccount string `position:"Query" name:"OwnerAccount"`
- SystemDiskDiskName string `position:"Query" name:"SystemDisk.DiskName"`
- RamRoleName string `position:"Query" name:"RamRoleName"`
- ClusterId string `position:"Query" name:"ClusterId"`
- DataDisk *[]CreateInstanceDataDisk `position:"Query" name:"DataDisk" type:"Repeated"`
- Tag5Value string `position:"Query" name:"Tag.5.Value"`
- Tag1Key string `position:"Query" name:"Tag.1.Key"`
- SystemDiskSize requests.Integer `position:"Query" name:"SystemDisk.Size"`
- Tag2Value string `position:"Query" name:"Tag.2.Value"`
- SystemDiskDescription string `position:"Query" name:"SystemDisk.Description"`
- }
- type CreateInstanceDataDisk struct {
- Size string `name:"Size"`
- SnapshotId string `name:"SnapshotId"`
- Category string `name:"Category"`
- DiskName string `name:"DiskName"`
- Description string `name:"Description"`
- Device string `name:"Device"`
- DeleteWithInstance string `name:"DeleteWithInstance"`
- Encrypted string `name:"Encrypted"`
- }
- type CreateInstanceResponse struct {
- *responses.BaseResponse
- RequestId string `json:"RequestId" xml:"RequestId"`
- InstanceId string `json:"InstanceId" xml:"InstanceId"`
- }
- func CreateCreateInstanceRequest() (request *CreateInstanceRequest) {
- request = &CreateInstanceRequest{
- RpcRequest: &requests.RpcRequest{},
- }
- request.InitWithApiInfo("Ecs", "2014-05-26", "CreateInstance", "ecs", "openAPI")
- return
- }
- func CreateCreateInstanceResponse() (response *CreateInstanceResponse) {
- response = &CreateInstanceResponse{
- BaseResponse: &responses.BaseResponse{},
- }
- return
- }
|