diff --git a/builder/alicloud/ecs/access_config.go b/builder/alicloud/ecs/access_config.go index b49bd0bbf..8bb06393f 100644 --- a/builder/alicloud/ecs/access_config.go +++ b/builder/alicloud/ecs/access_config.go @@ -2,11 +2,11 @@ package ecs import ( "fmt" - "os" - - "github.com/denverdino/aliyungo/common" - "github.com/denverdino/aliyungo/ecs" + "github.com/aliyun/alibaba-cloud-sdk-go/services/ecs" "github.com/hashicorp/packer/template/interpolate" + "github.com/hashicorp/packer/version" + "os" + "time" ) // Config of alicloud @@ -16,24 +16,33 @@ type AlicloudAccessConfig struct { AlicloudRegion string `mapstructure:"region"` AlicloudSkipValidation bool `mapstructure:"skip_region_validation"` SecurityToken string `mapstructure:"security_token"` + + client *ClientWrapper } +const Packer = "HashiCorp-Packer" +const DefaultRequestReadTimeout = 10 * time.Second + // Client for AlicloudClient -func (c *AlicloudAccessConfig) Client() (*ecs.Client, error) { - if err := c.loadAndValidate(); err != nil { - return nil, err +func (c *AlicloudAccessConfig) Client() (*ClientWrapper, error) { + if c.client != nil { + return c.client, nil } if c.SecurityToken == "" { c.SecurityToken = os.Getenv("SECURITY_TOKEN") } - client := ecs.NewECSClientWithSecurityToken(c.AlicloudAccessKey, c.AlicloudSecretKey, - c.SecurityToken, common.Region(c.AlicloudRegion)) - client.SetBusinessInfo("Packer") - if _, err := client.DescribeRegions(); err != nil { + client, err := ecs.NewClientWithStsToken(c.AlicloudRegion, c.AlicloudAccessKey, + c.AlicloudSecretKey, c.SecurityToken) + if err != nil { return nil, err } - return client, nil + + client.AppendUserAgent(Packer, version.FormattedVersion()) + client.SetReadTimeout(DefaultRequestReadTimeout) + c.client = &ClientWrapper{client} + + return c.client, nil } func (c *AlicloudAccessConfig) Prepare(ctx *interpolate.Context) []error { @@ -42,10 +51,12 @@ func (c *AlicloudAccessConfig) Prepare(ctx *interpolate.Context) []error { errs = append(errs, err) } - if c.AlicloudRegion != "" && !c.AlicloudSkipValidation { - if c.validateRegion() != nil { - errs = append(errs, fmt.Errorf("Unknown alicloud region: %s", c.AlicloudRegion)) - } + if c.AlicloudRegion == "" { + c.AlicloudRegion = os.Getenv("ALICLOUD_REGION") + } + + if c.AlicloudRegion == "" { + errs = append(errs, fmt.Errorf("region option or ALICLOUD_REGION must be provided in template file or environment variables.")) } if len(errs) > 0 { @@ -69,21 +80,38 @@ func (c *AlicloudAccessConfig) Config() error { } -func (c *AlicloudAccessConfig) loadAndValidate() error { - if err := c.validateRegion(); err != nil { +func (c *AlicloudAccessConfig) ValidateRegion(region string) error { + + supportedRegions, err := c.getSupportedRegions() + if err != nil { return err } - return nil -} - -func (c *AlicloudAccessConfig) validateRegion() error { - - for _, valid := range common.ValidRegions { - if c.AlicloudRegion == string(valid) { + for _, supportedRegion := range supportedRegions { + if region == supportedRegion { return nil } } - return fmt.Errorf("Not a valid alicloud region: %s", c.AlicloudRegion) + return fmt.Errorf("Not a valid alicloud region: %s", region) +} + +func (c *AlicloudAccessConfig) getSupportedRegions() ([]string, error) { + client, err := c.Client() + if err != nil { + return nil, err + } + + regionsRequest := ecs.CreateDescribeRegionsRequest() + regionsResponse, err := client.DescribeRegions(regionsRequest) + if err != nil { + return nil, err + } + + validRegions := make([]string, len(regionsResponse.Regions.Region)) + for _, valid := range regionsResponse.Regions.Region { + validRegions = append(validRegions, valid.RegionId) + } + + return validRegions, nil } diff --git a/builder/alicloud/ecs/access_config_test.go b/builder/alicloud/ecs/access_config_test.go index 23b0c9b50..053d50a16 100644 --- a/builder/alicloud/ecs/access_config_test.go +++ b/builder/alicloud/ecs/access_config_test.go @@ -1,6 +1,7 @@ package ecs import ( + "os" "testing" ) @@ -14,14 +15,10 @@ func testAlicloudAccessConfig() *AlicloudAccessConfig { func TestAlicloudAccessConfigPrepareRegion(t *testing.T) { c := testAlicloudAccessConfig() - c.AlicloudRegion = "" - if err := c.Prepare(nil); err != nil { - t.Fatalf("shouldn't have err: %s", err) - } - c.AlicloudRegion = "cn-beijing-3" + c.AlicloudRegion = "" if err := c.Prepare(nil); err == nil { - t.Fatal("should have error") + t.Fatalf("should have err") } c.AlicloudRegion = "cn-beijing" @@ -29,16 +26,11 @@ func TestAlicloudAccessConfigPrepareRegion(t *testing.T) { t.Fatalf("shouldn't have err: %s", err) } - c.AlicloudRegion = "unknown" - if err := c.Prepare(nil); err == nil { - t.Fatalf("should have err") - } - - c.AlicloudRegion = "unknown" - c.AlicloudSkipValidation = true + os.Setenv("ALICLOUD_REGION", "cn-hangzhou") + c.AlicloudRegion = "" if err := c.Prepare(nil); err != nil { t.Fatalf("shouldn't have err: %s", err) } - c.AlicloudSkipValidation = false + c.AlicloudSkipValidation = false } diff --git a/builder/alicloud/ecs/artifact.go b/builder/alicloud/ecs/artifact.go index f22735e3f..67ee3a72c 100644 --- a/builder/alicloud/ecs/artifact.go +++ b/builder/alicloud/ecs/artifact.go @@ -6,8 +6,7 @@ import ( "sort" "strings" - "github.com/denverdino/aliyungo/common" - "github.com/denverdino/aliyungo/ecs" + "github.com/aliyun/alibaba-cloud-sdk-go/services/ecs" "github.com/hashicorp/packer/packer" ) @@ -19,7 +18,7 @@ type Artifact struct { BuilderIdValue string // Alcloud connection for performing API stuff. - Client *ecs.Client + Client *ClientWrapper } func (a *Artifact) BuilderId() string { @@ -64,53 +63,73 @@ func (a *Artifact) State(name string) interface{} { func (a *Artifact) Destroy() error { errors := make([]error, 0) - for region, imageId := range a.AlicloudImages { - log.Printf("Delete alicloud image ID (%s) from region (%s)", imageId, region) - - // Get alicloud image metadata - images, _, err := a.Client.DescribeImages(&ecs.DescribeImagesArgs{ - RegionId: common.Region(region), - ImageId: imageId}) + copyingImages := make(map[string]string, len(a.AlicloudImages)) + sourceImage := make(map[string]*ecs.Image, 1) + for regionId, imageId := range a.AlicloudImages { + describeImagesRequest := ecs.CreateDescribeImagesRequest() + describeImagesRequest.RegionId = regionId + describeImagesRequest.ImageId = imageId + describeImagesRequest.Status = ImageStatusQueried + imagesResponse, err := a.Client.DescribeImages(describeImagesRequest) if err != nil { errors = append(errors, err) } + + images := imagesResponse.Images.Image if len(images) == 0 { err := fmt.Errorf("Error retrieving details for alicloud image(%s), no alicloud images found", imageId) errors = append(errors, err) continue } - //Unshared the shared account before destroy - sharePermissions, err := a.Client.DescribeImageSharePermission(&ecs.ModifyImageSharePermissionArgs{RegionId: common.Region(region), ImageId: imageId}) - if err != nil { + + if images[0].IsCopied { + copyingImages[regionId] = imageId + } else { + sourceImage[regionId] = &images[0] + } + } + + for regionId, imageId := range copyingImages { + log.Printf("Cancel copying alicloud image (%s) from region (%s)", imageId, regionId) + + errs := a.unsharedAccountsOnImages(regionId, imageId) + if errs != nil { + errors = append(errors, errs...) + } + + cancelImageCopyRequest := ecs.CreateCancelCopyImageRequest() + cancelImageCopyRequest.RegionId = regionId + cancelImageCopyRequest.ImageId = imageId + if _, err := a.Client.CancelCopyImage(cancelImageCopyRequest); err != nil { errors = append(errors, err) } - accountsNumber := len(sharePermissions.Accounts.Account) - if accountsNumber > 0 { - accounts := make([]string, accountsNumber) - for index, account := range sharePermissions.Accounts.Account { - accounts[index] = account.AliyunId - } - err := a.Client.ModifyImageSharePermission(&ecs.ModifyImageSharePermissionArgs{ + } - RegionId: common.Region(region), - ImageId: imageId, - RemoveAccount: accounts, - }) + for regionId, image := range sourceImage { + imageId := image.ImageId + log.Printf("Delete alicloud image (%s) from region (%s)", imageId, regionId) + + errs := a.unsharedAccountsOnImages(regionId, imageId) + if errs != nil { + errors = append(errors, errs...) + } + + deleteImageRequest := ecs.CreateDeleteImageRequest() + deleteImageRequest.RegionId = regionId + deleteImageRequest.ImageId = imageId + if _, err := a.Client.DeleteImage(deleteImageRequest); err != nil { + errors = append(errors, err) + } + + //Delete the snapshot of this images + for _, diskDevices := range image.DiskDeviceMappings.DiskDeviceMapping { + deleteSnapshotRequest := ecs.CreateDeleteSnapshotRequest() + deleteSnapshotRequest.SnapshotId = diskDevices.SnapshotId + _, err := a.Client.DeleteSnapshot(deleteSnapshotRequest) if err != nil { errors = append(errors, err) } } - // Delete alicloud images - if err := a.Client.DeleteImage(common.Region(region), imageId); err != nil { - errors = append(errors, err) - } - //Delete the snapshot of this images - for _, diskDevices := range images[0].DiskDeviceMappings.DiskDeviceMapping { - if err := a.Client.DeleteSnapshot(diskDevices.SnapshotId); err != nil { - errors = append(errors, err) - } - } - } if len(errors) > 0 { @@ -124,6 +143,38 @@ func (a *Artifact) Destroy() error { return nil } +func (a *Artifact) unsharedAccountsOnImages(regionId string, imageId string) []error { + var errors []error + + describeImageShareRequest := ecs.CreateDescribeImageSharePermissionRequest() + describeImageShareRequest.RegionId = regionId + describeImageShareRequest.ImageId = imageId + imageShareResponse, err := a.Client.DescribeImageSharePermission(describeImageShareRequest) + if err != nil { + errors = append(errors, err) + return errors + } + + accountsNumber := len(imageShareResponse.Accounts.Account) + if accountsNumber > 0 { + accounts := make([]string, accountsNumber) + for index, account := range imageShareResponse.Accounts.Account { + accounts[index] = account.AliyunId + } + + modifyImageShareRequest := ecs.CreateModifyImageSharePermissionRequest() + modifyImageShareRequest.RegionId = regionId + modifyImageShareRequest.ImageId = imageId + modifyImageShareRequest.RemoveAccount = &accounts + _, err := a.Client.ModifyImageSharePermission(modifyImageShareRequest) + if err != nil { + errors = append(errors, err) + } + } + + return errors +} + func (a *Artifact) stateAtlasMetadata() interface{} { metadata := make(map[string]string) for region, imageId := range a.AlicloudImages { diff --git a/builder/alicloud/ecs/builder.go b/builder/alicloud/ecs/builder.go index ec38ba38d..4c050b57e 100644 --- a/builder/alicloud/ecs/builder.go +++ b/builder/alicloud/ecs/builder.go @@ -34,8 +34,6 @@ type Builder struct { type InstanceNetWork string const ( - ClassicNet = InstanceNetWork("classic") - VpcNet = InstanceNetWork("vpc") ALICLOUD_DEFAULT_SHORT_TIMEOUT = 180 ALICLOUD_DEFAULT_TIMEOUT = 1800 ALICLOUD_DEFAULT_LONG_TIMEOUT = 3600 @@ -105,7 +103,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack RegionId: b.config.AlicloudRegion, }, } - if b.chooseNetworkType() == VpcNet { + if b.chooseNetworkType() == InstanceNetworkVpc { steps = append(steps, &stepConfigAlicloudVPC{ VpcId: b.config.VpcId, @@ -136,7 +134,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack InstanceName: b.config.InstanceName, ZoneId: b.config.ZoneId, }) - if b.chooseNetworkType() == VpcNet { + if b.chooseNetworkType() == InstanceNetworkVpc { steps = append(steps, &stepConfigAlicloudEIP{ AssociatePublicIpAddress: b.config.AssociatePublicIpAddress, RegionId: b.config.AlicloudRegion, @@ -153,7 +151,6 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack steps = append(steps, &stepAttachKeyPair{}, &stepRunAlicloudInstance{}, - &stepMountAlicloudDisk{}, &communicator.StepConnect{ Config: &b.config.RunConfig.Comm, Host: SSHHost( @@ -228,9 +225,9 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack func (b *Builder) chooseNetworkType() InstanceNetWork { if b.isVpcNetRequired() { - return VpcNet + return InstanceNetworkVpc } else { - return ClassicNet + return InstanceNetworkClassic } } diff --git a/builder/alicloud/ecs/builder_acc_test.go b/builder/alicloud/ecs/builder_acc_test.go index d266033ac..a0c22dff0 100644 --- a/builder/alicloud/ecs/builder_acc_test.go +++ b/builder/alicloud/ecs/builder_acc_test.go @@ -1,18 +1,47 @@ package ecs import ( - "os" - "testing" - + "encoding/json" "fmt" - - "github.com/denverdino/aliyungo/common" - "github.com/denverdino/aliyungo/ecs" + "github.com/aliyun/alibaba-cloud-sdk-go/services/ecs" builderT "github.com/hashicorp/packer/helper/builder/testing" "github.com/hashicorp/packer/packer" + "os" + "strings" + "testing" ) +const defaultTestRegion = "cn-beijing" + +func TestBuilderAcc_validateRegion(t *testing.T) { + t.Parallel() + + if os.Getenv(builderT.TestEnvVar) == "" { + t.Skip(fmt.Sprintf("Acceptance tests skipped unless env '%s' set", builderT.TestEnvVar)) + return + } + + testAccPreCheck(t) + + access := &AlicloudAccessConfig{AlicloudRegion: "cn-beijing"} + err := access.Config() + if err != nil { + t.Fatalf("init AlicloudAccessConfig failed: %s", err) + } + + err = access.ValidateRegion("cn-hangzhou") + if err != nil { + t.Fatalf("Expect pass with valid region id but failed: %s", err) + } + + err = access.ValidateRegion("invalidRegionId") + if err == nil { + t.Fatal("Expect failure due to invalid region id but passed") + } +} + func TestBuilderAcc_basic(t *testing.T) { + t.Parallel() builderT.Test(t, builderT.TestCase{ PreCheck: func() { testAccPreCheck(t) @@ -22,127 +51,58 @@ func TestBuilderAcc_basic(t *testing.T) { }) } -//func TestBuilderAcc_windows(t *testing.T) { -// builderT.Test(t, builderT.TestCase{ -// PreCheck: func() { -// testAccPreCheck(t) -// }, -// Builder: &Builder{}, -// Template: testBuilderAccWindows, -// }) -//} - -//func TestBuilderAcc_regionCopy(t *testing.T) { -// builderT.Test(t, builderT.TestCase{ -// PreCheck: func() { -// testAccPreCheck(t) -// }, -// Builder: &Builder{}, -// Template: testBuilderAccRegionCopy, -// Check: checkRegionCopy([]string{"cn-hangzhou", "cn-shenzhen"}), -// }) -//} - -func TestBuilderAcc_forceDelete(t *testing.T) { - // Build the same alicloud image twice, with ecs_image_force_delete on the second run - builderT.Test(t, builderT.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - }, - Builder: &Builder{}, - Template: buildForceDeregisterConfig("false", "delete"), - SkipArtifactTeardown: true, - }) +const testBuilderAccBasic = ` +{ "builders": [{ + "type": "test", + "region": "cn-beijing", + "instance_type": "ecs.n1.tiny", + "source_image":"ubuntu_18_04_64_20G_alibase_20190223.vhd", + "io_optimized":"true", + "ssh_username":"root", + "image_name": "packer-test-basic_{{timestamp}}" + }] +}` +func TestBuilderAcc_withDiskSettings(t *testing.T) { + t.Parallel() builderT.Test(t, builderT.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Builder: &Builder{}, - Template: buildForceDeregisterConfig("true", "delete"), + Template: testBuilderAccWithDiskSettings, + Check: checkImageDisksSettings(), }) } -func TestBuilderAcc_ECSImageSharing(t *testing.T) { - builderT.Test(t, builderT.TestCase{ - PreCheck: func() { - testAccPreCheck(t) +const testBuilderAccWithDiskSettings = ` +{ "builders": [{ + "type": "test", + "region": "cn-beijing", + "instance_type": "ecs.n1.tiny", + "source_image":"ubuntu_18_04_64_20G_alibase_20190223.vhd", + "io_optimized":"true", + "ssh_username":"root", + "image_name": "packer-test-withDiskSettings_{{timestamp}}", + "system_disk_mapping": { + "disk_size": 60 }, - Builder: &Builder{}, - Template: testBuilderAccSharing, - Check: checkECSImageSharing("1309208528360047"), - }) -} + "image_disk_mappings": [ + { + "disk_name": "datadisk1", + "disk_size": 25, + "disk_delete_with_instance": true + }, + { + "disk_name": "datadisk2", + "disk_size": 25, + "disk_delete_with_instance": true + } + ] + }] +}` -func TestBuilderAcc_forceDeleteSnapshot(t *testing.T) { - destImageName := "delete" - - // Build the same alicloud image name twice, with force_delete_snapshot on the second run - builderT.Test(t, builderT.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - }, - Builder: &Builder{}, - Template: buildForceDeleteSnapshotConfig("false", destImageName), - SkipArtifactTeardown: true, - }) - - // Get image data by image image name - client, _ := testAliyunClient() - images, _, _ := client.DescribeImages(&ecs.DescribeImagesArgs{ - ImageName: "packer-test-" + destImageName, - RegionId: common.Region("cn-beijing")}) - - image := images[0] - - // Get snapshot ids for image - snapshotIds := []string{} - for _, device := range image.DiskDeviceMappings.DiskDeviceMapping { - if device.Device != "" && device.SnapshotId != "" { - snapshotIds = append(snapshotIds, device.SnapshotId) - } - } - - builderT.Test(t, builderT.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - }, - Builder: &Builder{}, - Template: buildForceDeleteSnapshotConfig("true", destImageName), - Check: checkSnapshotsDeleted(snapshotIds), - }) -} - -func TestBuilderAcc_imageTags(t *testing.T) { - builderT.Test(t, builderT.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - }, - Builder: &Builder{}, - Template: testBuilderAccImageTags, - Check: checkImageTags(), - }) -} - -func checkSnapshotsDeleted(snapshotIds []string) builderT.TestCheckFunc { - return func(artifacts []packer.Artifact) error { - // Verify the snapshots are gone - client, _ := testAliyunClient() - snapshotResp, _, err := client.DescribeSnapshots( - &ecs.DescribeSnapshotsArgs{RegionId: common.Region("cn-beijing"), SnapshotIds: snapshotIds}, - ) - if err != nil { - return fmt.Errorf("Query snapshot failed %v", err) - } - if len(snapshotResp) > 0 { - return fmt.Errorf("Snapshots weren't successfully deleted by " + - "`ecs_image_force_delete_snapshots`") - } - return nil - } -} - -func checkECSImageSharing(uid string) builderT.TestCheckFunc { +func checkImageDisksSettings() builderT.TestCheckFunc { return func(artifacts []packer.Artifact) error { if len(artifacts) > 1 { return fmt.Errorf("more than 1 artifact") @@ -154,30 +114,135 @@ func checkECSImageSharing(uid string) builderT.TestCheckFunc { if !ok { return fmt.Errorf("unknown artifact: %#v", artifactRaw) } + imageId := artifact.AlicloudImages[defaultTestRegion] // describe the image, get block devices with a snapshot client, _ := testAliyunClient() - imageSharePermissionResponse, err := client.DescribeImageSharePermission( - &ecs.ModifyImageSharePermissionArgs{ - RegionId: "cn-beijing", - ImageId: artifact.AlicloudImages["cn-beijing"], - }) + describeImagesRequest := ecs.CreateDescribeImagesRequest() + describeImagesRequest.RegionId = defaultTestRegion + describeImagesRequest.ImageId = imageId + imagesResponse, err := client.DescribeImages(describeImagesRequest) if err != nil { - return fmt.Errorf("Error retrieving Image Attributes for ECS Image Artifact (%#v) "+ - "in ECS Image Sharing Test: %s", artifact, err) + return fmt.Errorf("describe images failed due to %s", err) } - if len(imageSharePermissionResponse.Accounts.Account) != 1 && - imageSharePermissionResponse.Accounts.Account[0].AliyunId != uid { - return fmt.Errorf("share account is incorrect %d", - len(imageSharePermissionResponse.Accounts.Account)) + if len(imagesResponse.Images.Image) == 0 { + return fmt.Errorf("image %s generated can not be found", imageId) + } + + image := imagesResponse.Images.Image[0] + if image.Size != 60 { + return fmt.Errorf("the size of image %s should be equal to 60G but got %dG", imageId, image.Size) + } + if len(image.DiskDeviceMappings.DiskDeviceMapping) != 3 { + return fmt.Errorf("image %s should contains 3 disks", imageId) + } + + var snapshotIds []string + for _, mapping := range image.DiskDeviceMappings.DiskDeviceMapping { + if mapping.Type == DiskTypeSystem { + if mapping.Size != "60" { + return fmt.Errorf("the system snapshot size of image %s should be equal to 60G but got %sG", imageId, mapping.Size) + } + } else { + if mapping.Size != "25" { + return fmt.Errorf("the data disk size of image %s should be equal to 25G but got %sG", imageId, mapping.Size) + } + + snapshotIds = append(snapshotIds, mapping.SnapshotId) + } + } + + data, _ := json.Marshal(snapshotIds) + + describeSnapshotRequest := ecs.CreateDescribeSnapshotsRequest() + describeSnapshotRequest.RegionId = defaultTestRegion + describeSnapshotRequest.SnapshotIds = string(data) + describeSnapshotsResponse, err := client.DescribeSnapshots(describeSnapshotRequest) + if err != nil { + return fmt.Errorf("describe data snapshots failed due to %s", err) + } + if len(describeSnapshotsResponse.Snapshots.Snapshot) != 2 { + return fmt.Errorf("expect %d data snapshots but got %d", len(snapshotIds), len(describeSnapshotsResponse.Snapshots.Snapshot)) + } + + var dataDiskIds []string + for _, snapshot := range describeSnapshotsResponse.Snapshots.Snapshot { + dataDiskIds = append(dataDiskIds, snapshot.SourceDiskId) + } + data, _ = json.Marshal(dataDiskIds) + + describeDisksRequest := ecs.CreateDescribeDisksRequest() + describeDisksRequest.RegionId = defaultTestRegion + describeDisksRequest.DiskIds = string(data) + describeDisksResponse, err := client.DescribeDisks(describeDisksRequest) + if err != nil { + return fmt.Errorf("describe snapshots failed due to %s", err) + } + if len(describeDisksResponse.Disks.Disk) != 0 { + return fmt.Errorf("data disks should be deleted but %d left", len(describeDisksResponse.Disks.Disk)) } return nil } } +func TestBuilderAcc_windows(t *testing.T) { + t.Parallel() + builderT.Test(t, builderT.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + }, + Builder: &Builder{}, + Template: testBuilderAccWindows, + }) +} + +const testBuilderAccWindows = ` +{ "builders": [{ + "type": "test", + "region": "cn-beijing", + "instance_type": "ecs.n1.tiny", + "source_image":"winsvr_64_dtcC_1809_en-us_40G_alibase_20190318.vhd", + "io_optimized":"true", + "communicator": "winrm", + "winrm_port": 5985, + "winrm_username": "Administrator", + "winrm_password": "Test1234", + "image_name": "packer-test-windows_{{timestamp}}", + "user_data_file": "../../../examples/alicloud/basic/winrm_enable_userdata.ps1" + }] +}` + +func TestBuilderAcc_regionCopy(t *testing.T) { + t.Parallel() + builderT.Test(t, builderT.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + }, + Builder: &Builder{}, + Template: testBuilderAccRegionCopy, + Check: checkRegionCopy([]string{"cn-hangzhou", "cn-shenzhen"}), + }) +} + +const testBuilderAccRegionCopy = ` +{ + "builders": [{ + "type": "test", + "region": "cn-beijing", + "instance_type": "ecs.n1.tiny", + "source_image":"ubuntu_18_04_64_20G_alibase_20190223.vhd", + "io_optimized":"true", + "ssh_username":"root", + "image_name": "packer-test-regionCopy_{{timestamp}}", + "image_copy_regions": ["cn-hangzhou", "cn-shenzhen"], + "image_copy_names": ["packer-copy-test-hz_{{timestamp}}", "packer-copy-test-sz_{{timestamp}}"] + }] +} +` + func checkRegionCopy(regions []string) builderT.TestCheckFunc { return func(artifacts []packer.Artifact) error { if len(artifacts) > 1 { @@ -196,124 +261,76 @@ func checkRegionCopy(regions []string) builderT.TestCheckFunc { for _, r := range regions { regionSet[r] = struct{}{} } + for r := range artifact.AlicloudImages { if r == "cn-beijing" { delete(regionSet, r) continue } + if _, ok := regionSet[r]; !ok { - return fmt.Errorf("unknown region: %s", r) + return fmt.Errorf("region %s is not the target region but found in artifacts", r) } delete(regionSet, r) } - if len(regionSet) > 0 { - return fmt.Errorf("didn't copy to: %#v", regionSet) - } - client, _ := testAliyunClient() - for key, value := range artifact.AlicloudImages { - client.WaitForImageReady(common.Region(key), value, 1800) - } - return nil - } -} -func checkImageTags() builderT.TestCheckFunc { - return func(artifacts []packer.Artifact) error { - if len(artifacts) > 1 { - return fmt.Errorf("more than 1 artifact") + if len(regionSet) > 0 { + return fmt.Errorf("following region(s) should be the copying targets but corresponding artifact(s) not found: %#v", regionSet) } - // Get the actual *Artifact pointer so we can access the AMIs directly - artifactRaw := artifacts[0] - artifact, ok := artifactRaw.(*Artifact) - if !ok { - return fmt.Errorf("unknown artifact: %#v", artifactRaw) - } - // describe the image, get block devices with a snapshot + client, _ := testAliyunClient() - tags, _, err := client.DescribeTags( - &ecs.DescribeTagsArgs{ - RegionId: "cn-beijing", - ResourceType: ecs.TagResourceImage, - ResourceId: artifact.AlicloudImages["cn-beijing"], - }) - if err != nil { - return fmt.Errorf("Error retrieving Image Attributes for ECS Image Artifact (%#v) "+ - "in ECS Image Tags Test: %s", artifact, err) - } - failed := false - if len(tags) != 2 { - failed = true - } - if !failed { - for i := 0; i < len(tags); i++ { - if tags[i].TagKey == "TagKey1" && tags[i].TagValue != "TagValue1" { - failed = true - } else if tags[i].TagKey == "TagKey2" && tags[i].TagValue != "TagValue2" { - failed = true - } else if tags[i].TagKey != "TagKey1" && tags[i].TagKey != "TagKey2" { - failed = true - } + for regionId, imageId := range artifact.AlicloudImages { + describeImagesRequest := ecs.CreateDescribeImagesRequest() + describeImagesRequest.RegionId = regionId + describeImagesRequest.ImageId = imageId + describeImagesRequest.Status = ImageStatusQueried + describeImagesResponse, err := client.DescribeImages(describeImagesRequest) + if err != nil { + return fmt.Errorf("describe generated image %s failed due to %s", imageId, err) + } + if len(describeImagesResponse.Images.Image) == 0 { + return fmt.Errorf("image %s in artifacts can not be found", imageId) + } + + image := describeImagesResponse.Images.Image[0] + if image.IsCopied && regionId == "cn-hangzhou" && !strings.HasPrefix(image.ImageName, "packer-copy-test-hz") { + return fmt.Errorf("the name of image %s in artifacts should begin with %s but got %s", imageId, "packer-copy-test-hz", image.ImageName) + } + if image.IsCopied && regionId == "cn-shenzhen" && !strings.HasPrefix(image.ImageName, "packer-copy-test-sz") { + return fmt.Errorf("the name of image %s in artifacts should begin with %s but got %s", imageId, "packer-copy-test-sz", image.ImageName) } } - if failed { - return fmt.Errorf("tags is not correctly set %#v", tags) - } + return nil } } -func testAccPreCheck(t *testing.T) { - if v := os.Getenv("ALICLOUD_ACCESS_KEY"); v == "" { - t.Fatal("ALICLOUD_ACCESS_KEY must be set for acceptance tests") - } +func TestBuilderAcc_forceDelete(t *testing.T) { + t.Parallel() + // Build the same alicloud image twice, with ecs_image_force_delete on the second run + builderT.Test(t, builderT.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + }, + Builder: &Builder{}, + Template: buildForceDeregisterConfig("false", "delete"), + SkipArtifactTeardown: true, + }) - if v := os.Getenv("ALICLOUD_SECRET_KEY"); v == "" { - t.Fatal("ALICLOUD_SECRET_KEY must be set for acceptance tests") - } + builderT.Test(t, builderT.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + }, + Builder: &Builder{}, + Template: buildForceDeregisterConfig("true", "delete"), + }) } -func testAliyunClient() (*ecs.Client, error) { - access := &AlicloudAccessConfig{AlicloudRegion: "cn-beijing"} - err := access.Config() - if err != nil { - return nil, err - } - client, err := access.Client() - if err != nil { - return nil, err - } - - return client, nil +func buildForceDeregisterConfig(val, name string) string { + return fmt.Sprintf(testBuilderAccForceDelete, val, name) } -const testBuilderAccBasic = ` -{ "builders": [{ - "type": "test", - "region": "cn-beijing", - "instance_type": "ecs.n1.tiny", - "source_image":"ubuntu_18_04_64_20G_alibase_20190223.vhd", - "io_optimized":"true", - "ssh_username":"root", - "image_name": "packer-test_{{timestamp}}" - }] -}` - -const testBuilderAccRegionCopy = ` -{ - "builders": [{ - "type": "test", - "region": "cn-beijing", - "instance_type": "ecs.n1.tiny", - "source_image":"ubuntu_18_04_64_20G_alibase_20190223.vhd", - "io_optimized":"true", - "ssh_username":"root", - "image_name": "packer-test_{{timestamp}}", - "image_copy_regions": ["cn-hangzhou", "cn-shenzhen"] - }] -} -` - const testBuilderAccForceDelete = ` { "builders": [{ @@ -324,11 +341,119 @@ const testBuilderAccForceDelete = ` "io_optimized":"true", "ssh_username":"root", "image_force_delete": "%s", - "image_name": "packer-test_%s" + "image_name": "packer-test-forceDelete_%s" }] } ` +func TestBuilderAcc_ECSImageSharing(t *testing.T) { + t.Parallel() + builderT.Test(t, builderT.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + }, + Builder: &Builder{}, + Template: testBuilderAccSharing, + Check: checkECSImageSharing("1309208528360047"), + }) +} + +// share with catsby +const testBuilderAccSharing = ` +{ + "builders": [{ + "type": "test", + "region": "cn-beijing", + "instance_type": "ecs.n1.tiny", + "source_image":"ubuntu_18_04_64_20G_alibase_20190223.vhd", + "io_optimized":"true", + "ssh_username":"root", + "image_name": "packer-test-ECSImageSharing_{{timestamp}}", + "image_share_account":["1309208528360047"] + }] +} +` + +func checkECSImageSharing(uid string) builderT.TestCheckFunc { + return func(artifacts []packer.Artifact) error { + if len(artifacts) > 1 { + return fmt.Errorf("more than 1 artifact") + } + + // Get the actual *Artifact pointer so we can access the AMIs directly + artifactRaw := artifacts[0] + artifact, ok := artifactRaw.(*Artifact) + if !ok { + return fmt.Errorf("unknown artifact: %#v", artifactRaw) + } + + // describe the image, get block devices with a snapshot + client, _ := testAliyunClient() + + describeImageShareRequest := ecs.CreateDescribeImageSharePermissionRequest() + describeImageShareRequest.RegionId = "cn-beijing" + describeImageShareRequest.ImageId = artifact.AlicloudImages["cn-beijing"] + imageShareResponse, err := client.DescribeImageSharePermission(describeImageShareRequest) + + if err != nil { + return fmt.Errorf("Error retrieving Image Attributes for ECS Image Artifact (%#v) "+ + "in ECS Image Sharing Test: %s", artifact, err) + } + + if len(imageShareResponse.Accounts.Account) != 1 && imageShareResponse.Accounts.Account[0].AliyunId != uid { + return fmt.Errorf("share account is incorrect %d", len(imageShareResponse.Accounts.Account)) + } + + return nil + } +} + +func TestBuilderAcc_forceDeleteSnapshot(t *testing.T) { + t.Parallel() + destImageName := "delete" + + // Build the same alicloud image name twice, with force_delete_snapshot on the second run + builderT.Test(t, builderT.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + }, + Builder: &Builder{}, + Template: buildForceDeleteSnapshotConfig("false", destImageName), + SkipArtifactTeardown: true, + }) + + // Get image data by image image name + client, _ := testAliyunClient() + + describeImagesRequest := ecs.CreateDescribeImagesRequest() + describeImagesRequest.RegionId = "cn-beijing" + describeImagesRequest.ImageName = "packer-test-" + destImageName + images, _ := client.DescribeImages(describeImagesRequest) + + image := images.Images.Image[0] + + // Get snapshot ids for image + snapshotIds := []string{} + for _, device := range image.DiskDeviceMappings.DiskDeviceMapping { + if device.Device != "" && device.SnapshotId != "" { + snapshotIds = append(snapshotIds, device.SnapshotId) + } + } + + builderT.Test(t, builderT.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + }, + Builder: &Builder{}, + Template: buildForceDeleteSnapshotConfig("true", destImageName), + Check: checkSnapshotsDeleted(snapshotIds), + }) +} + +func buildForceDeleteSnapshotConfig(val, name string) string { + return fmt.Sprintf(testBuilderAccForceDeleteSnapshot, val, val, name) +} + const testBuilderAccForceDeleteSnapshot = ` { "builders": [{ @@ -345,21 +470,42 @@ const testBuilderAccForceDeleteSnapshot = ` } ` -// share with catsby -const testBuilderAccSharing = ` -{ - "builders": [{ - "type": "test", - "region": "cn-beijing", - "instance_type": "ecs.n1.tiny", - "source_image":"ubuntu_18_04_64_20G_alibase_20190223.vhd", - "io_optimized":"true", - "ssh_username":"root", - "image_name": "packer-test_{{timestamp}}", - "image_share_account":["1309208528360047"] - }] +func checkSnapshotsDeleted(snapshotIds []string) builderT.TestCheckFunc { + return func(artifacts []packer.Artifact) error { + // Verify the snapshots are gone + client, _ := testAliyunClient() + data, err := json.Marshal(snapshotIds) + if err != nil { + return fmt.Errorf("Marshal snapshotIds array failed %v", err) + } + + describeSnapshotsRequest := ecs.CreateDescribeSnapshotsRequest() + describeSnapshotsRequest.RegionId = "cn-beijing" + describeSnapshotsRequest.SnapshotIds = string(data) + snapshotResp, err := client.DescribeSnapshots(describeSnapshotsRequest) + if err != nil { + return fmt.Errorf("Query snapshot failed %v", err) + } + snapshots := snapshotResp.Snapshots.Snapshot + if len(snapshots) > 0 { + return fmt.Errorf("Snapshots weren't successfully deleted by " + + "`ecs_image_force_delete_snapshots`") + } + return nil + } +} + +func TestBuilderAcc_imageTags(t *testing.T) { + t.Parallel() + builderT.Test(t, builderT.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + }, + Builder: &Builder{}, + Template: testBuilderAccImageTags, + Check: checkImageTags(), + }) } -` const testBuilderAccImageTags = ` { "builders": [{ @@ -369,34 +515,120 @@ const testBuilderAccImageTags = ` "source_image":"ubuntu_18_04_64_20G_alibase_20190223.vhd", "ssh_username": "root", "io_optimized":"true", - "image_name": "packer-test_{{timestamp}}", + "image_name": "packer-test-imageTags_{{timestamp}}", "tags": { "TagKey1": "TagValue1", "TagKey2": "TagValue2" - } + } }] }` -func buildForceDeregisterConfig(val, name string) string { - return fmt.Sprintf(testBuilderAccForceDelete, val, name) +func checkImageTags() builderT.TestCheckFunc { + return func(artifacts []packer.Artifact) error { + if len(artifacts) > 1 { + return fmt.Errorf("more than 1 artifact") + } + // Get the actual *Artifact pointer so we can access the AMIs directly + artifactRaw := artifacts[0] + artifact, ok := artifactRaw.(*Artifact) + if !ok { + return fmt.Errorf("unknown artifact: %#v", artifactRaw) + } + imageId := artifact.AlicloudImages[defaultTestRegion] + + // describe the image, get block devices with a snapshot + client, _ := testAliyunClient() + + describeImageTagsRequest := ecs.CreateDescribeTagsRequest() + describeImageTagsRequest.RegionId = defaultTestRegion + describeImageTagsRequest.ResourceType = TagResourceImage + describeImageTagsRequest.ResourceId = imageId + imageTagsResponse, err := client.DescribeTags(describeImageTagsRequest) + if err != nil { + return fmt.Errorf("Error retrieving Image Attributes for ECS Image Artifact (%#v) "+ + "in ECS Image Tags Test: %s", artifact, err) + } + + if len(imageTagsResponse.Tags.Tag) != 2 { + return fmt.Errorf("expect 2 tags set on image %s but got %d", imageId, len(imageTagsResponse.Tags.Tag)) + } + + for _, tag := range imageTagsResponse.Tags.Tag { + if tag.TagKey != "TagKey1" && tag.TagKey != "TagKey2" { + return fmt.Errorf("tags on image %s should be within the list of TagKey1 and TagKey2 but got %s", imageId, tag.TagKey) + } + + if tag.TagKey == "TagKey1" && tag.TagValue != "TagValue1" { + return fmt.Errorf("the value for tag %s on image %s should be TagValue1 but got %s", tag.TagKey, imageId, tag.TagValue) + } else if tag.TagKey == "TagKey2" && tag.TagValue != "TagValue2" { + return fmt.Errorf("the value for tag %s on image %s should be TagValue2 but got %s", tag.TagKey, imageId, tag.TagValue) + } + } + + describeImagesRequest := ecs.CreateDescribeImagesRequest() + describeImagesRequest.RegionId = defaultTestRegion + describeImagesRequest.ImageId = imageId + imagesResponse, err := client.DescribeImages(describeImagesRequest) + if err != nil { + return fmt.Errorf("describe images failed due to %s", err) + } + + if len(imagesResponse.Images.Image) == 0 { + return fmt.Errorf("image %s generated can not be found", imageId) + } + + image := imagesResponse.Images.Image[0] + for _, mapping := range image.DiskDeviceMappings.DiskDeviceMapping { + describeSnapshotTagsRequest := ecs.CreateDescribeTagsRequest() + describeSnapshotTagsRequest.RegionId = defaultTestRegion + describeSnapshotTagsRequest.ResourceType = TagResourceSnapshot + describeSnapshotTagsRequest.ResourceId = mapping.SnapshotId + snapshotTagsResponse, err := client.DescribeTags(describeSnapshotTagsRequest) + if err != nil { + return fmt.Errorf("failed to get snapshot tags due to %s", err) + } + + if len(snapshotTagsResponse.Tags.Tag) != 2 { + return fmt.Errorf("expect 2 tags set on snapshot %s but got %d", mapping.SnapshotId, len(snapshotTagsResponse.Tags.Tag)) + } + + for _, tag := range snapshotTagsResponse.Tags.Tag { + if tag.TagKey != "TagKey1" && tag.TagKey != "TagKey2" { + return fmt.Errorf("tags on snapshot %s should be within the list of TagKey1 and TagKey2 but got %s", mapping.SnapshotId, tag.TagKey) + } + + if tag.TagKey == "TagKey1" && tag.TagValue != "TagValue1" { + return fmt.Errorf("the value for tag %s on snapshot %s should be TagValue1 but got %s", tag.TagKey, mapping.SnapshotId, tag.TagValue) + } else if tag.TagKey == "TagKey2" && tag.TagValue != "TagValue2" { + return fmt.Errorf("the value for tag %s on snapshot %s should be TagValue2 but got %s", tag.TagKey, mapping.SnapshotId, tag.TagValue) + } + } + } + + return nil + } } -func buildForceDeleteSnapshotConfig(val, name string) string { - return fmt.Sprintf(testBuilderAccForceDeleteSnapshot, val, val, name) +func testAccPreCheck(t *testing.T) { + if v := os.Getenv("ALICLOUD_ACCESS_KEY"); v == "" { + t.Fatal("ALICLOUD_ACCESS_KEY must be set for acceptance tests") + } + + if v := os.Getenv("ALICLOUD_SECRET_KEY"); v == "" { + t.Fatal("ALICLOUD_SECRET_KEY must be set for acceptance tests") + } } -const testBuilderAccWindows = ` -{ "builders": [{ - "type": "test", - "region": "cn-beijing", - "instance_type": "ecs.n1.tiny", - "source_image":"win2008_64_ent_r2_zh-cn_40G_alibase_20170301.vhd", - "io_optimized":"true", - "image_force_delete":"true", - "communicator": "winrm", - "winrm_port": 5985, - "winrm_username": "Administrator", - "winrm_password": "Test1234", - "image_name": "packer-test_{{timestamp}}" - }] -}` +func testAliyunClient() (*ClientWrapper, error) { + access := &AlicloudAccessConfig{AlicloudRegion: "cn-beijing"} + err := access.Config() + if err != nil { + return nil, err + } + client, err := access.Client() + if err != nil { + return nil, err + } + + return client, nil +} diff --git a/builder/alicloud/ecs/client.go b/builder/alicloud/ecs/client.go new file mode 100644 index 000000000..ef9613757 --- /dev/null +++ b/builder/alicloud/ecs/client.go @@ -0,0 +1,277 @@ +package ecs + +import ( + "fmt" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" + "github.com/aliyun/alibaba-cloud-sdk-go/services/ecs" + "time" +) + +type ClientWrapper struct { + *ecs.Client +} + +const ( + InstanceStatusRunning = "Running" + InstanceStatusStarting = "Starting" + InstanceStatusStopped = "Stopped" + InstanceStatusStopping = "Stopping" +) + +const ( + ImageStatusWaiting = "Waiting" + ImageStatusCreating = "Creating" + ImageStatusCreateFailed = "CreateFailed" + ImageStatusAvailable = "Available" +) + +var ImageStatusQueried = fmt.Sprintf("%s,%s,%s,%s", ImageStatusWaiting, ImageStatusCreating, ImageStatusCreateFailed, ImageStatusAvailable) + +const ( + SnapshotStatusAll = "all" + SnapshotStatusProgressing = "progressing" + SnapshotStatusAccomplished = "accomplished" + SnapshotStatusFailed = "failed" +) + +const ( + DiskStatusInUse = "In_use" + DiskStatusAvailable = "Available" + DiskStatusAttaching = "Attaching" + DiskStatusDetaching = "Detaching" + DiskStatusCreating = "Creating" + DiskStatusReIniting = "ReIniting" +) + +const ( + VpcStatusPending = "Pending" + VpcStatusAvailable = "Available" +) + +const ( + VSwitchStatusPending = "Pending" + VSwitchStatusAvailable = "Available" +) + +const ( + EipStatusAssociating = "Associating" + EipStatusUnassociating = "Unassociating" + EipStatusInUse = "InUse" + EipStatusAvailable = "Available" +) + +const ( + ImageOwnerSystem = "system" + ImageOwnerSelf = "self" + ImageOwnerOthers = "others" + ImageOwnerMarketplace = "marketplace" +) + +const ( + IOOptimizedNone = "none" + IOOptimizedOptimized = "optimized" +) + +const ( + InstanceNetworkClassic = "classic" + InstanceNetworkVpc = "vpc" +) + +const ( + DiskTypeSystem = "system" + DiskTypeData = "data" +) + +const ( + TagResourceImage = "image" + TagResourceInstance = "instance" + TagResourceSnapshot = "snapshot" + TagResourceDisk = "disk" +) + +const ( + IpProtocolAll = "all" + IpProtocolTCP = "tcp" + IpProtocolUDP = "udp" + IpProtocolICMP = "icmp" + IpProtocolGRE = "gre" +) + +const ( + NicTypeInternet = "internet" + NicTypeIntranet = "intranet" +) + +const ( + DefaultPortRange = "-1/-1" + DefaultCidrIp = "0.0.0.0/0" + DefaultCidrBlock = "172.16.0.0/24" +) + +const ( + defaultRetryInterval = 5 * time.Second + defaultRetryTimes = 12 + shortRetryTimes = 36 + mediumRetryTimes = 360 + longRetryTimes = 720 +) + +type WaitForExpectEvalResult struct { + evalPass bool + stopRetry bool +} + +var ( + WaitForExpectSuccess = WaitForExpectEvalResult{ + evalPass: true, + stopRetry: true, + } + + WaitForExpectToRetry = WaitForExpectEvalResult{ + evalPass: false, + stopRetry: false, + } + + WaitForExpectFailToStop = WaitForExpectEvalResult{ + evalPass: false, + stopRetry: true, + } +) + +type WaitForExpectArgs struct { + RequestFunc func() (responses.AcsResponse, error) + EvalFunc func(response responses.AcsResponse, err error) WaitForExpectEvalResult + RetryInterval time.Duration + RetryTimes int + RetryTimeout time.Duration +} + +func (c *ClientWrapper) WaitForExpected(args *WaitForExpectArgs) (responses.AcsResponse, error) { + if args.RetryInterval <= 0 { + args.RetryInterval = defaultRetryInterval + } + if args.RetryTimes <= 0 { + args.RetryTimes = defaultRetryTimes + } + + var timeoutPoint time.Time + if args.RetryTimeout > 0 { + timeoutPoint = time.Now().Add(args.RetryTimeout) + } + + var lastError error + + for i := 0; ; i++ { + if args.RetryTimeout > 0 && time.Now().After(timeoutPoint) { + break + } + + if args.RetryTimeout <= 0 && i >= args.RetryTimes { + break + } + + response, err := args.RequestFunc() + lastError = err + + evalResult := args.EvalFunc(response, err) + if evalResult.evalPass { + return response, nil + } + if evalResult.stopRetry { + return nil, err + } + + time.Sleep(args.RetryInterval) + } + + if args.RetryTimeout > 0 { + return nil, fmt.Errorf("evaluate failed after %d seconds timeout with %d seconds retry interval: %s", int(args.RetryTimeout.Seconds()), int(args.RetryInterval.Seconds()), lastError) + } + + return nil, fmt.Errorf("evaluate failed after %d times retry with %d seconds retry interval: %s", args.RetryTimes, int(args.RetryInterval.Seconds()), lastError) +} + +func (c *ClientWrapper) WaitForInstanceStatus(regionId string, instanceId string, expectedStatus string) (responses.AcsResponse, error) { + return c.WaitForExpected(&WaitForExpectArgs{ + RequestFunc: func() (responses.AcsResponse, error) { + request := ecs.CreateDescribeInstancesRequest() + request.RegionId = regionId + request.InstanceIds = fmt.Sprintf("[\"%s\"]", instanceId) + return c.DescribeInstances(request) + }, + EvalFunc: func(response responses.AcsResponse, err error) WaitForExpectEvalResult { + if err != nil { + return WaitForExpectToRetry + } + + instancesResponse := response.(*ecs.DescribeInstancesResponse) + instances := instancesResponse.Instances.Instance + for _, instance := range instances { + if instance.Status == expectedStatus { + return WaitForExpectSuccess + } + } + return WaitForExpectToRetry + }, + RetryTimes: mediumRetryTimes, + }) +} + +func (c *ClientWrapper) WaitForImageStatus(regionId string, imageId string, expectedStatus string, timeout time.Duration) (responses.AcsResponse, error) { + return c.WaitForExpected(&WaitForExpectArgs{ + RequestFunc: func() (responses.AcsResponse, error) { + request := ecs.CreateDescribeImagesRequest() + request.RegionId = regionId + request.ImageId = imageId + request.Status = ImageStatusQueried + return c.DescribeImages(request) + }, + EvalFunc: func(response responses.AcsResponse, err error) WaitForExpectEvalResult { + if err != nil { + return WaitForExpectToRetry + } + + imagesResponse := response.(*ecs.DescribeImagesResponse) + images := imagesResponse.Images.Image + for _, image := range images { + if image.Status == expectedStatus { + return WaitForExpectSuccess + } + } + + return WaitForExpectToRetry + }, + RetryTimeout: timeout, + }) +} + +type EvalErrorType bool + +const ( + EvalRetryErrorType = EvalErrorType(true) + EvalNotRetryErrorType = EvalErrorType(false) +) + +func (c *ClientWrapper) EvalCouldRetryResponse(evalErrors []string, evalErrorType EvalErrorType) func(response responses.AcsResponse, err error) WaitForExpectEvalResult { + return func(response responses.AcsResponse, err error) WaitForExpectEvalResult { + if err == nil { + return WaitForExpectSuccess + } + + e, ok := err.(errors.Error) + if !ok { + return WaitForExpectToRetry + } + + if evalErrorType == EvalRetryErrorType && !ContainsInArray(evalErrors, e.ErrorCode()) { + return WaitForExpectFailToStop + } + + if evalErrorType == EvalNotRetryErrorType && ContainsInArray(evalErrors, e.ErrorCode()) { + return WaitForExpectFailToStop + } + + return WaitForExpectToRetry + } +} diff --git a/builder/alicloud/ecs/client_test.go b/builder/alicloud/ecs/client_test.go new file mode 100644 index 000000000..9ea8f25c2 --- /dev/null +++ b/builder/alicloud/ecs/client_test.go @@ -0,0 +1,82 @@ +package ecs + +import ( + "fmt" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" + "testing" + "time" +) + +func TestWaitForExpectedExceedRetryTimes(t *testing.T) { + c := ClientWrapper{} + + iter := 0 + waitDone := make(chan bool, 1) + + go func() { + _, _ = c.WaitForExpected(&WaitForExpectArgs{ + RequestFunc: func() (responses.AcsResponse, error) { + iter++ + return nil, fmt.Errorf("test: let iteration %d failed", iter) + }, + EvalFunc: func(response responses.AcsResponse, err error) WaitForExpectEvalResult { + if err != nil { + fmt.Printf("need retry: %s\n", err) + return WaitForExpectToRetry + } + + return WaitForExpectSuccess + }, + }) + + waitDone <- true + }() + + timeTolerance := 1 * time.Second + select { + case <-waitDone: + if iter != defaultRetryTimes { + t.Fatalf("WaitForExpected should terminate at the %d iterations", defaultRetryTimes) + } + case <-time.After(defaultRetryTimes*defaultRetryInterval + timeTolerance): + t.Fatalf("WaitForExpected should terminate within %f seconds", (defaultRetryTimes*defaultRetryInterval + timeTolerance).Seconds()) + } +} + +func TestWaitForExpectedExceedRetryTimeout(t *testing.T) { + c := ClientWrapper{} + + expectTimeout := 10 * time.Second + iter := 0 + waitDone := make(chan bool, 1) + + go func() { + _, _ = c.WaitForExpected(&WaitForExpectArgs{ + RequestFunc: func() (responses.AcsResponse, error) { + iter++ + return nil, fmt.Errorf("test: let iteration %d failed", iter) + }, + EvalFunc: func(response responses.AcsResponse, err error) WaitForExpectEvalResult { + if err != nil { + fmt.Printf("need retry: %s\n", err) + return WaitForExpectToRetry + } + + return WaitForExpectSuccess + }, + RetryTimeout: expectTimeout, + }) + + waitDone <- true + }() + + timeTolerance := 1 * time.Second + select { + case <-waitDone: + if iter > int(expectTimeout/defaultRetryInterval) { + t.Fatalf("WaitForExpected should terminate before the %d iterations", int(expectTimeout/defaultRetryInterval)) + } + case <-time.After(expectTimeout + timeTolerance): + t.Fatalf("WaitForExpected should terminate within %f seconds", (expectTimeout + timeTolerance).Seconds()) + } +} diff --git a/builder/alicloud/ecs/image_config.go b/builder/alicloud/ecs/image_config.go index c9fa7d5b1..06cc43d38 100644 --- a/builder/alicloud/ecs/image_config.go +++ b/builder/alicloud/ecs/image_config.go @@ -2,11 +2,9 @@ package ecs import ( "fmt" - "regexp" "strings" - "github.com/denverdino/aliyungo/common" "github.com/hashicorp/packer/template/interpolate" ) @@ -69,15 +67,6 @@ func (c *AlicloudImageConfig) Prepare(ctx *interpolate.Context) []error { // Mark that we saw the region regionSet[region] = struct{}{} - - if !c.AlicloudImageSkipRegionValidation { - // Verify the region is real - if valid := validateRegion(region); valid != nil { - errs = append(errs, fmt.Errorf("Unknown region: %s", region)) - continue - } - } - regions = append(regions, region) } @@ -90,14 +79,3 @@ func (c *AlicloudImageConfig) Prepare(ctx *interpolate.Context) []error { return nil } - -func validateRegion(region string) error { - - for _, valid := range common.ValidRegions { - if region == string(valid) { - return nil - } - } - - return fmt.Errorf("Not a valid alicloud region: %s", region) -} diff --git a/builder/alicloud/ecs/image_config_test.go b/builder/alicloud/ecs/image_config_test.go index 949511ef0..133c0a409 100644 --- a/builder/alicloud/ecs/image_config_test.go +++ b/builder/alicloud/ecs/image_config_test.go @@ -2,8 +2,6 @@ package ecs import ( "testing" - - "github.com/denverdino/aliyungo/common" ) func testAlicloudImageConfig() *AlicloudImageConfig { @@ -31,28 +29,17 @@ func TestAMIConfigPrepare_regions(t *testing.T) { t.Fatalf("shouldn't have err: %s", err) } - c.AlicloudImageDestinationRegions = regionsToString() - if err := c.Prepare(nil); err != nil { - t.Fatalf("shouldn't have err: %s", err) - } - - c.AlicloudImageDestinationRegions = []string{"foo"} - if err := c.Prepare(nil); err == nil { - t.Fatal("should have error") - } - c.AlicloudImageDestinationRegions = []string{"cn-beijing", "cn-hangzhou", "eu-central-1"} if err := c.Prepare(nil); err != nil { t.Fatalf("bad: %s", err) } - c.AlicloudImageDestinationRegions = []string{"unknow"} + c.AlicloudImageDestinationRegions = nil c.AlicloudImageSkipRegionValidation = true if err := c.Prepare(nil); err != nil { t.Fatal("shouldn't have error") } c.AlicloudImageSkipRegionValidation = false - } func TestECSImageConfigPrepare_imageTags(t *testing.T) { @@ -72,11 +59,3 @@ func TestECSImageConfigPrepare_imageTags(t *testing.T) { }, c.AlicloudImageTags) } } - -func regionsToString() []string { - var regions []string - for _, region := range common.ValidRegions { - regions = append(regions, string(region)) - } - return regions -} diff --git a/builder/alicloud/ecs/packer_helper.go b/builder/alicloud/ecs/packer_helper.go index 4b54953c1..5ea704278 100644 --- a/builder/alicloud/ecs/packer_helper.go +++ b/builder/alicloud/ecs/packer_helper.go @@ -2,12 +2,13 @@ package ecs import ( "fmt" + "strconv" "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" ) -func message(state multistep.StateBag, module string) { +func cleanUpMessage(state multistep.StateBag, module string) { _, cancelled := state.GetOk(multistep.StateCancelled) _, halted := state.GetOk(multistep.StateHalted) @@ -18,7 +19,6 @@ func message(state multistep.StateBag, module string) { } else { ui.Say(fmt.Sprintf("Cleaning up '%s'", module)) } - } func halt(state multistep.StateBag, err error, prefix string) multistep.StepAction { @@ -32,3 +32,21 @@ func halt(state multistep.StateBag, err error, prefix string) multistep.StepActi ui.Error(err.Error()) return multistep.ActionHalt } + +func convertNumber(value int) string { + if value <= 0 { + return "" + } + + return strconv.Itoa(value) +} + +func ContainsInArray(arr []string, value string) bool { + for _, item := range arr { + if item == value { + return true + } + } + + return false +} diff --git a/builder/alicloud/ecs/step_attach_keypair.go b/builder/alicloud/ecs/step_attach_keypair.go index fb6c26bfb..6ded785fd 100644 --- a/builder/alicloud/ecs/step_attach_keypair.go +++ b/builder/alicloud/ecs/step_attach_keypair.go @@ -3,11 +3,8 @@ package ecs import ( "context" "fmt" - - "time" - - "github.com/denverdino/aliyungo/common" - "github.com/denverdino/aliyungo/ecs" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" + "github.com/aliyun/alibaba-cloud-sdk-go/services/ecs" "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" ) @@ -15,53 +12,57 @@ import ( type stepAttachKeyPair struct { } +var attachKeyPairNotRetryErrors = []string{ + "MissingParameter", + "DependencyViolation.WindowsInstance", + "InvalidKeyPairName.NotFound", + "InvalidRegionId.NotFound", +} + func (s *stepAttachKeyPair) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) - client := state.Get("client").(*ecs.Client) + client := state.Get("client").(*ClientWrapper) config := state.Get("config").(*Config) - instance := state.Get("instance").(*ecs.InstanceAttributesType) - timeoutPoint := time.Now().Add(120 * time.Second) + instance := state.Get("instance").(*ecs.Instance) keyPairName := config.Comm.SSHKeyPairName if keyPairName == "" { return multistep.ActionContinue } - for { - err := client.AttachKeyPair(&ecs.AttachKeyPairArgs{RegionId: common.Region(config.AlicloudRegion), - KeyPairName: keyPairName, InstanceIds: "[\"" + instance.InstanceId + "\"]"}) - if err != nil { - e, _ := err.(*common.Error) - if (!(e.Code == "MissingParameter" || e.Code == "DependencyViolation.WindowsInstance" || - e.Code == "InvalidKeyPairName.NotFound" || e.Code == "InvalidRegionId.NotFound")) && - time.Now().Before(timeoutPoint) { - time.Sleep(5 * time.Second) - continue - } - err := fmt.Errorf("Error attaching keypair %s to instance %s : %s", - keyPairName, instance.InstanceId, err) - state.Put("error", err) - ui.Error(err.Error()) - return multistep.ActionHalt - } - break + + _, err := client.WaitForExpected(&WaitForExpectArgs{ + RequestFunc: func() (responses.AcsResponse, error) { + request := ecs.CreateAttachKeyPairRequest() + request.RegionId = config.AlicloudRegion + request.KeyPairName = keyPairName + request.InstanceIds = "[\"" + instance.InstanceId + "\"]" + return client.AttachKeyPair(request) + }, + EvalFunc: client.EvalCouldRetryResponse(attachKeyPairNotRetryErrors, EvalNotRetryErrorType), + }) + + if err != nil { + return halt(state, err, fmt.Sprintf("Error attaching keypair %s to instance %s", keyPairName, instance.InstanceId)) } ui.Message(fmt.Sprintf("Attach keypair %s to instance: %s", keyPairName, instance.InstanceId)) - return multistep.ActionContinue } func (s *stepAttachKeyPair) Cleanup(state multistep.StateBag) { - client := state.Get("client").(*ecs.Client) + client := state.Get("client").(*ClientWrapper) config := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) - instance := state.Get("instance").(*ecs.InstanceAttributesType) + instance := state.Get("instance").(*ecs.Instance) keyPairName := config.Comm.SSHKeyPairName if keyPairName == "" { return } - err := client.DetachKeyPair(&ecs.DetachKeyPairArgs{RegionId: common.Region(config.AlicloudRegion), - KeyPairName: keyPairName, InstanceIds: "[\"" + instance.InstanceId + "\"]"}) + detachKeyPairRequest := ecs.CreateDetachKeyPairRequest() + detachKeyPairRequest.RegionId = config.AlicloudRegion + detachKeyPairRequest.KeyPairName = keyPairName + detachKeyPairRequest.InstanceIds = fmt.Sprintf("[\"%s\"]", instance.InstanceId) + _, err := client.DetachKeyPair(detachKeyPairRequest) if err != nil { err := fmt.Errorf("Error Detaching keypair %s to instance %s : %s", keyPairName, instance.InstanceId, err) diff --git a/builder/alicloud/ecs/step_check_source_image.go b/builder/alicloud/ecs/step_check_source_image.go index 0f7f31314..5e89c4d32 100644 --- a/builder/alicloud/ecs/step_check_source_image.go +++ b/builder/alicloud/ecs/step_check_source_image.go @@ -3,9 +3,7 @@ package ecs import ( "context" "fmt" - - "github.com/denverdino/aliyungo/common" - "github.com/denverdino/aliyungo/ecs" + "github.com/aliyun/alibaba-cloud-sdk-go/services/ecs" "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" ) @@ -15,40 +13,35 @@ type stepCheckAlicloudSourceImage struct { } func (s *stepCheckAlicloudSourceImage) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { - client := state.Get("client").(*ecs.Client) + client := state.Get("client").(*ClientWrapper) config := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) - args := &ecs.DescribeImagesArgs{ - RegionId: common.Region(config.AlicloudRegion), - ImageId: config.AlicloudSourceImage, - } - args.PageSize = 50 - images, _, err := client.DescribeImages(args) + + describeImagesRequest := ecs.CreateDescribeImagesRequest() + describeImagesRequest.RegionId = config.AlicloudRegion + describeImagesRequest.ImageId = config.AlicloudSourceImage + imagesResponse, err := client.DescribeImages(describeImagesRequest) if err != nil { - err := fmt.Errorf("Error querying alicloud image: %s", err) - state.Put("error", err) - ui.Error(err.Error()) - return multistep.ActionHalt + return halt(state, err, "Error querying alicloud image") } + images := imagesResponse.Images.Image + // Describe markerplace image - args.ImageOwnerAlias = ecs.ImageOwnerMarketplace - imageMarkets, _, err := client.DescribeImages(args) + describeImagesRequest.ImageOwnerAlias = "marketplace" + marketImagesResponse, err := client.DescribeImages(describeImagesRequest) if err != nil { - err := fmt.Errorf("Error querying alicloud marketplace image: %s", err) - state.Put("error", err) - ui.Error(err.Error()) - return multistep.ActionHalt + return halt(state, err, "Error querying alicloud marketplace image") } - if len(imageMarkets) > 0 { - images = append(images, imageMarkets...) + + marketImages := marketImagesResponse.Images.Image + if len(marketImages) > 0 { + images = append(images, marketImages...) } if len(images) == 0 { err := fmt.Errorf("No alicloud image was found matching filters: %v", config.AlicloudSourceImage) - state.Put("error", err) - ui.Error(err.Error()) - return multistep.ActionHalt + return halt(state, err, "") } ui.Message(fmt.Sprintf("Found image ID: %s", images[0].ImageId)) diff --git a/builder/alicloud/ecs/step_config_eip.go b/builder/alicloud/ecs/step_config_eip.go index 669beec93..5efe1273c 100644 --- a/builder/alicloud/ecs/step_config_eip.go +++ b/builder/alicloud/ecs/step_config_eip.go @@ -3,9 +3,11 @@ package ecs import ( "context" "fmt" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors" + "github.com/hashicorp/packer/common/uuid" - "github.com/denverdino/aliyungo/common" - "github.com/denverdino/aliyungo/ecs" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" + "github.com/aliyun/alibaba-cloud-sdk-go/services/ecs" "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" ) @@ -19,10 +21,14 @@ type stepConfigAlicloudEIP struct { SSHPrivateIp bool } +var allocateEipAddressRetryErrors = []string{ + "LastTokenProcessing", +} + func (s *stepConfigAlicloudEIP) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { - client := state.Get("client").(*ecs.Client) + client := state.Get("client").(*ClientWrapper) ui := state.Get("ui").(packer.Ui) - instance := state.Get("instance").(*ecs.InstanceAttributesType) + instance := state.Get("instance").(*ecs.Instance) if s.SSHPrivateIp { ipaddress := instance.VpcAttributes.PrivateIpAddress.IpAddress @@ -34,37 +40,48 @@ func (s *stepConfigAlicloudEIP) Run(ctx context.Context, state multistep.StateBa return multistep.ActionContinue } - ui.Say("Allocating eip") - ipaddress, allocateId, err := client.AllocateEipAddress(&ecs.AllocateEipAddressArgs{ - RegionId: common.Region(s.RegionId), InternetChargeType: common.InternetChargeType(s.InternetChargeType), - Bandwidth: s.InternetMaxBandwidthOut, + ui.Say("Allocating eip...") + + allocateEipAddressRequest := s.buildAllocateEipAddressRequest(state) + allocateEipAddressResponse, err := client.WaitForExpected(&WaitForExpectArgs{ + RequestFunc: func() (responses.AcsResponse, error) { + return client.AllocateEipAddress(allocateEipAddressRequest) + }, + EvalFunc: client.EvalCouldRetryResponse(allocateEipAddressRetryErrors, EvalRetryErrorType), }) + if err != nil { - state.Put("error", err) - ui.Say(fmt.Sprintf("Error allocating eip: %s", err)) - return multistep.ActionHalt + return halt(state, err, "Error allocating eip") } + + ipaddress := allocateEipAddressResponse.(*ecs.AllocateEipAddressResponse).EipAddress + ui.Message(fmt.Sprintf("Allocated eip: %s", ipaddress)) + + allocateId := allocateEipAddressResponse.(*ecs.AllocateEipAddressResponse).AllocationId s.allocatedId = allocateId - if err = client.WaitForEip(common.Region(s.RegionId), allocateId, - ecs.EipStatusAvailable, ALICLOUD_DEFAULT_SHORT_TIMEOUT); err != nil { - state.Put("error", err) - ui.Say(fmt.Sprintf("Error allocating eip: %s", err)) - return multistep.ActionHalt + + err = s.waitForEipStatus(client, instance.RegionId, s.allocatedId, EipStatusAvailable) + if err != nil { + return halt(state, err, "Error wait eip available timeout") } - if err = client.AssociateEipAddress(allocateId, instance.InstanceId); err != nil { - state.Put("error", err) - ui.Say(fmt.Sprintf("Error binding eip: %s", err)) - return multistep.ActionHalt + associateEipAddressRequest := ecs.CreateAssociateEipAddressRequest() + associateEipAddressRequest.AllocationId = allocateId + associateEipAddressRequest.InstanceId = instance.InstanceId + if _, err := client.AssociateEipAddress(associateEipAddressRequest); err != nil { + e, ok := err.(errors.Error) + if !ok || e.ErrorCode() != "TaskConflict" { + return halt(state, err, "Error associating eip") + } + + ui.Error(fmt.Sprintf("Error associate eip: %s", err)) } - if err = client.WaitForEip(common.Region(s.RegionId), allocateId, - ecs.EipStatusInUse, ALICLOUD_DEFAULT_SHORT_TIMEOUT); err != nil { - state.Put("error", err) - ui.Say(fmt.Sprintf("Error associating eip: %s", err)) - return multistep.ActionHalt + err = s.waitForEipStatus(client, instance.RegionId, s.allocatedId, EipStatusInUse) + if err != nil { + return halt(state, err, "Error wait eip associated timeout") } - ui.Say(fmt.Sprintf("Allocated eip %s", ipaddress)) + state.Put("ipaddress", ipaddress) return multistep.ActionContinue } @@ -74,21 +91,74 @@ func (s *stepConfigAlicloudEIP) Cleanup(state multistep.StateBag) { return } - client := state.Get("client").(*ecs.Client) - instance := state.Get("instance").(*ecs.InstanceAttributesType) + cleanUpMessage(state, "EIP") + + client := state.Get("client").(*ClientWrapper) + instance := state.Get("instance").(*ecs.Instance) ui := state.Get("ui").(packer.Ui) - message(state, "EIP") - - if err := client.UnassociateEipAddress(s.allocatedId, instance.InstanceId); err != nil { - ui.Say(fmt.Sprintf("Failed to unassociate eip.")) + unassociateEipAddressRequest := ecs.CreateUnassociateEipAddressRequest() + unassociateEipAddressRequest.AllocationId = s.allocatedId + unassociateEipAddressRequest.InstanceId = instance.InstanceId + if _, err := client.UnassociateEipAddress(unassociateEipAddressRequest); err != nil { + ui.Say(fmt.Sprintf("Failed to unassociate eip: %s", err)) } - if err := client.WaitForEip(common.Region(s.RegionId), s.allocatedId, ecs.EipStatusAvailable, ALICLOUD_DEFAULT_SHORT_TIMEOUT); err != nil { - ui.Say(fmt.Sprintf("Timeout while unassociating eip.")) - } - if err := client.ReleaseEipAddress(s.allocatedId); err != nil { - ui.Say(fmt.Sprintf("Failed to release eip.")) + if err := s.waitForEipStatus(client, instance.RegionId, s.allocatedId, EipStatusAvailable); err != nil { + ui.Say(fmt.Sprintf("Timeout while unassociating eip: %s", err)) } + releaseEipAddressRequest := ecs.CreateReleaseEipAddressRequest() + releaseEipAddressRequest.AllocationId = s.allocatedId + if _, err := client.ReleaseEipAddress(releaseEipAddressRequest); err != nil { + ui.Say(fmt.Sprintf("Failed to release eip: %s", err)) + } +} + +func (s *stepConfigAlicloudEIP) waitForEipStatus(client *ClientWrapper, regionId string, allocationId string, expectedStatus string) error { + describeEipAddressesRequest := ecs.CreateDescribeEipAddressesRequest() + describeEipAddressesRequest.RegionId = regionId + describeEipAddressesRequest.AllocationId = s.allocatedId + + _, err := client.WaitForExpected(&WaitForExpectArgs{ + RequestFunc: func() (responses.AcsResponse, error) { + response, err := client.DescribeEipAddresses(describeEipAddressesRequest) + if err == nil && len(response.EipAddresses.EipAddress) == 0 { + err = fmt.Errorf("eip allocated is not find") + } + + return response, err + }, + EvalFunc: func(response responses.AcsResponse, err error) WaitForExpectEvalResult { + if err != nil { + return WaitForExpectToRetry + } + + eipAddressesResponse := response.(*ecs.DescribeEipAddressesResponse) + eipAddresses := eipAddressesResponse.EipAddresses.EipAddress + + for _, eipAddress := range eipAddresses { + if eipAddress.Status == expectedStatus { + return WaitForExpectSuccess + } + } + + return WaitForExpectToRetry + }, + RetryTimes: shortRetryTimes, + }) + + return err +} + +func (s *stepConfigAlicloudEIP) buildAllocateEipAddressRequest(state multistep.StateBag) *ecs.AllocateEipAddressRequest { + instance := state.Get("instance").(*ecs.Instance) + + request := ecs.CreateAllocateEipAddressRequest() + request.ClientToken = uuid.TimeOrderedUUID() + request.RegionId = instance.RegionId + request.InternetChargeType = s.InternetChargeType + request.Bandwidth = string(convertNumber(s.InternetMaxBandwidthOut)) + + return request } diff --git a/builder/alicloud/ecs/step_config_key_pair.go b/builder/alicloud/ecs/step_config_key_pair.go index d1085306a..767c50aa1 100644 --- a/builder/alicloud/ecs/step_config_key_pair.go +++ b/builder/alicloud/ecs/step_config_key_pair.go @@ -6,8 +6,7 @@ import ( "os" "runtime" - "github.com/denverdino/aliyungo/common" - "github.com/denverdino/aliyungo/ecs" + "github.com/aliyun/alibaba-cloud-sdk-go/services/ecs" "github.com/hashicorp/packer/helper/communicator" "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" @@ -34,7 +33,6 @@ func (s *stepConfigAlicloudKeyPair) Run(ctx context.Context, state multistep.Sta } s.Comm.SSHPrivateKey = privateKeyBytes - return multistep.ActionContinue } @@ -54,16 +52,15 @@ func (s *stepConfigAlicloudKeyPair) Run(ctx context.Context, state multistep.Sta return multistep.ActionContinue } - client := state.Get("client").(*ecs.Client) - + client := state.Get("client").(*ClientWrapper) ui.Say(fmt.Sprintf("Creating temporary keypair: %s", s.Comm.SSHTemporaryKeyPairName)) - keyResp, err := client.CreateKeyPair(&ecs.CreateKeyPairArgs{ - KeyPairName: s.Comm.SSHTemporaryKeyPairName, - RegionId: common.Region(s.RegionId), - }) + + createKeyPairRequest := ecs.CreateCreateKeyPairRequest() + createKeyPairRequest.RegionId = s.RegionId + createKeyPairRequest.KeyPairName = s.Comm.SSHTemporaryKeyPairName + keyResp, err := client.CreateKeyPair(createKeyPairRequest) if err != nil { - state.Put("error", fmt.Errorf("Error creating temporary keypair: %s", err)) - return multistep.ActionHalt + return halt(state, err, "Error creating temporary keypair") } // Set the keyname so we know to delete it later @@ -110,15 +107,16 @@ func (s *stepConfigAlicloudKeyPair) Cleanup(state multistep.StateBag) { return } - client := state.Get("client").(*ecs.Client) + client := state.Get("client").(*ClientWrapper) ui := state.Get("ui").(packer.Ui) // Remove the keypair ui.Say("Deleting temporary keypair...") - err := client.DeleteKeyPairs(&ecs.DeleteKeyPairsArgs{ - RegionId: common.Region(s.RegionId), - KeyPairNames: "[\"" + s.keyName + "\"]", - }) + + deleteKeyPairsRequest := ecs.CreateDeleteKeyPairsRequest() + deleteKeyPairsRequest.RegionId = s.RegionId + deleteKeyPairsRequest.KeyPairNames = fmt.Sprintf("[\"%s\"]", s.keyName) + _, err := client.DeleteKeyPairs(deleteKeyPairsRequest) if err != nil { ui.Error(fmt.Sprintf( "Error cleaning up keypair. Please delete the key manually: %s", s.keyName)) diff --git a/builder/alicloud/ecs/step_config_public_ip.go b/builder/alicloud/ecs/step_config_public_ip.go index ac005f1a2..a83b55115 100644 --- a/builder/alicloud/ecs/step_config_public_ip.go +++ b/builder/alicloud/ecs/step_config_public_ip.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/denverdino/aliyungo/ecs" + "github.com/aliyun/alibaba-cloud-sdk-go/services/ecs" "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" ) @@ -16,9 +16,9 @@ type stepConfigAlicloudPublicIP struct { } func (s *stepConfigAlicloudPublicIP) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { - client := state.Get("client").(*ecs.Client) + client := state.Get("client").(*ClientWrapper) ui := state.Get("ui").(packer.Ui) - instance := state.Get("instance").(*ecs.InstanceAttributesType) + instance := state.Get("instance").(*ecs.Instance) if s.SSHPrivateIp { ipaddress := instance.InnerIpAddress.IpAddress @@ -30,15 +30,16 @@ func (s *stepConfigAlicloudPublicIP) Run(ctx context.Context, state multistep.St return multistep.ActionContinue } - ipaddress, err := client.AllocatePublicIpAddress(instance.InstanceId) + allocatePublicIpAddressRequest := ecs.CreateAllocatePublicIpAddressRequest() + allocatePublicIpAddressRequest.InstanceId = instance.InstanceId + ipaddress, err := client.AllocatePublicIpAddress(allocatePublicIpAddressRequest) if err != nil { - state.Put("error", err) - ui.Say(fmt.Sprintf("Error allocating public ip: %s", err)) - return multistep.ActionHalt + return halt(state, err, "Error allocating public ip") } - s.publicIPAddress = ipaddress - ui.Say(fmt.Sprintf("Allocated public ip address %s.", ipaddress)) - state.Put("ipaddress", ipaddress) + + s.publicIPAddress = ipaddress.IpAddress + ui.Say(fmt.Sprintf("Allocated public ip address %s.", ipaddress.IpAddress)) + state.Put("ipaddress", ipaddress.IpAddress) return multistep.ActionContinue } diff --git a/builder/alicloud/ecs/step_config_security_group.go b/builder/alicloud/ecs/step_config_security_group.go index 3d70558bd..29abe8087 100644 --- a/builder/alicloud/ecs/step_config_security_group.go +++ b/builder/alicloud/ecs/step_config_security_group.go @@ -2,12 +2,10 @@ package ecs import ( "context" - "errors" "fmt" - "time" - - "github.com/denverdino/aliyungo/common" - "github.com/denverdino/aliyungo/ecs" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" + "github.com/aliyun/alibaba-cloud-sdk-go/services/ecs" + "github.com/hashicorp/packer/common/uuid" "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" ) @@ -21,31 +19,34 @@ type stepConfigAlicloudSecurityGroup struct { isCreate bool } +var createSecurityGroupRetryErrors = []string{ + "IdempotentProcessing", +} + +var deleteSecurityGroupRetryErrors = []string{ + "DependencyViolation", +} + func (s *stepConfigAlicloudSecurityGroup) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { - client := state.Get("client").(*ecs.Client) + client := state.Get("client").(*ClientWrapper) ui := state.Get("ui").(packer.Ui) networkType := state.Get("networktype").(InstanceNetWork) - var securityGroupItems []ecs.SecurityGroupItemType - var err error if len(s.SecurityGroupId) != 0 { - if networkType == VpcNet { + describeSecurityGroupsRequest := ecs.CreateDescribeSecurityGroupsRequest() + describeSecurityGroupsRequest.RegionId = s.RegionId + + if networkType == InstanceNetworkVpc { vpcId := state.Get("vpcid").(string) - securityGroupItems, _, err = client.DescribeSecurityGroups(&ecs.DescribeSecurityGroupsArgs{ - VpcId: vpcId, - RegionId: common.Region(s.RegionId), - }) - } else { - securityGroupItems, _, err = client.DescribeSecurityGroups(&ecs.DescribeSecurityGroupsArgs{ - RegionId: common.Region(s.RegionId), - }) + describeSecurityGroupsRequest.VpcId = vpcId } + securityGroupsResponse, err := client.DescribeSecurityGroups(describeSecurityGroupsRequest) if err != nil { - ui.Say(fmt.Sprintf("Failed querying security group: %s", err)) - state.Put("error", err) - return multistep.ActionHalt + return halt(state, err, "Failed querying security group") } + + securityGroupItems := securityGroupsResponse.SecurityGroups.SecurityGroup for _, securityGroupItem := range securityGroupItems { if securityGroupItem.SecurityGroupId == s.SecurityGroupId { state.Put("securitygroupid", s.SecurityGroupId) @@ -53,61 +54,55 @@ func (s *stepConfigAlicloudSecurityGroup) Run(ctx context.Context, state multist return multistep.ActionContinue } } - s.isCreate = false - message := fmt.Sprintf("The specified security group {%s} doesn't exist.", s.SecurityGroupId) - state.Put("error", errors.New(message)) - ui.Say(message) - return multistep.ActionHalt + s.isCreate = false + err = fmt.Errorf("The specified security group {%s} doesn't exist.", s.SecurityGroupId) + return halt(state, err, "") } - var securityGroupId string - ui.Say("Creating security groups...") - if networkType == VpcNet { - vpcId := state.Get("vpcid").(string) - securityGroupId, err = client.CreateSecurityGroup(&ecs.CreateSecurityGroupArgs{ - RegionId: common.Region(s.RegionId), - SecurityGroupName: s.SecurityGroupName, - VpcId: vpcId, - }) - } else { - securityGroupId, err = client.CreateSecurityGroup(&ecs.CreateSecurityGroupArgs{ - RegionId: common.Region(s.RegionId), - SecurityGroupName: s.SecurityGroupName, - }) - } + + ui.Say("Creating security group...") + + createSecurityGroupRequest := s.buildCreateSecurityGroupRequest(state) + securityGroupResponse, err := client.WaitForExpected(&WaitForExpectArgs{ + RequestFunc: func() (responses.AcsResponse, error) { + return client.CreateSecurityGroup(createSecurityGroupRequest) + }, + EvalFunc: client.EvalCouldRetryResponse(createSecurityGroupRetryErrors, EvalRetryErrorType), + }) + if err != nil { - state.Put("error", err) - ui.Say(fmt.Sprintf("Failed creating security group %s.", err)) - return multistep.ActionHalt + return halt(state, err, "Failed creating security group") } + + securityGroupId := securityGroupResponse.(*ecs.CreateSecurityGroupResponse).SecurityGroupId + + ui.Message(fmt.Sprintf("Created security group: %s", securityGroupId)) state.Put("securitygroupid", securityGroupId) s.isCreate = true s.SecurityGroupId = securityGroupId - err = client.AuthorizeSecurityGroupEgress(&ecs.AuthorizeSecurityGroupEgressArgs{ - SecurityGroupId: securityGroupId, - RegionId: common.Region(s.RegionId), - IpProtocol: ecs.IpProtocolAll, - PortRange: "-1/-1", - NicType: ecs.NicTypeInternet, - DestCidrIp: "0.0.0.0/0", //The input parameter "DestGroupId" or "DestCidrIp" cannot be both blank. - }) - if err != nil { - state.Put("error", err) - ui.Say(fmt.Sprintf("Failed authorizing security group: %s", err)) - return multistep.ActionHalt + + authorizeSecurityGroupEgressRequest := ecs.CreateAuthorizeSecurityGroupEgressRequest() + authorizeSecurityGroupEgressRequest.SecurityGroupId = securityGroupId + authorizeSecurityGroupEgressRequest.RegionId = s.RegionId + authorizeSecurityGroupEgressRequest.IpProtocol = IpProtocolAll + authorizeSecurityGroupEgressRequest.PortRange = DefaultPortRange + authorizeSecurityGroupEgressRequest.NicType = NicTypeInternet + authorizeSecurityGroupEgressRequest.DestCidrIp = DefaultCidrIp + + if _, err := client.AuthorizeSecurityGroupEgress(authorizeSecurityGroupEgressRequest); err != nil { + return halt(state, err, "Failed authorizing security group") } - err = client.AuthorizeSecurityGroup(&ecs.AuthorizeSecurityGroupArgs{ - SecurityGroupId: securityGroupId, - RegionId: common.Region(s.RegionId), - IpProtocol: ecs.IpProtocolAll, - PortRange: "-1/-1", - NicType: ecs.NicTypeInternet, - SourceCidrIp: "0.0.0.0/0", //The input parameter "SourceGroupId" or "SourceCidrIp" cannot be both blank. - }) - if err != nil { - state.Put("error", err) - ui.Say(fmt.Sprintf("Failed authorizing security group: %s", err)) - return multistep.ActionHalt + + authorizeSecurityGroupRequest := ecs.CreateAuthorizeSecurityGroupRequest() + authorizeSecurityGroupRequest.SecurityGroupId = securityGroupId + authorizeSecurityGroupRequest.RegionId = s.RegionId + authorizeSecurityGroupRequest.IpProtocol = IpProtocolAll + authorizeSecurityGroupRequest.PortRange = DefaultPortRange + authorizeSecurityGroupRequest.NicType = NicTypeInternet + authorizeSecurityGroupRequest.SourceCidrIp = DefaultCidrIp + + if _, err := client.AuthorizeSecurityGroup(authorizeSecurityGroupRequest); err != nil { + return halt(state, err, "Failed authorizing security group") } return multistep.ActionContinue @@ -118,21 +113,39 @@ func (s *stepConfigAlicloudSecurityGroup) Cleanup(state multistep.StateBag) { return } - client := state.Get("client").(*ecs.Client) + cleanUpMessage(state, "security group") + + client := state.Get("client").(*ClientWrapper) ui := state.Get("ui").(packer.Ui) - message(state, "security group") - timeoutPoint := time.Now().Add(120 * time.Second) - for { - if err := client.DeleteSecurityGroup(common.Region(s.RegionId), s.SecurityGroupId); err != nil { - e, _ := err.(*common.Error) - if e.Code == "DependencyViolation" && time.Now().Before(timeoutPoint) { - time.Sleep(5 * time.Second) - continue - } - ui.Error(fmt.Sprintf("Failed to delete security group, it may still be around: %s", err)) - return - } - break + _, err := client.WaitForExpected(&WaitForExpectArgs{ + RequestFunc: func() (responses.AcsResponse, error) { + request := ecs.CreateDeleteSecurityGroupRequest() + request.RegionId = s.RegionId + request.SecurityGroupId = s.SecurityGroupId + return client.DeleteSecurityGroup(request) + }, + EvalFunc: client.EvalCouldRetryResponse(deleteSecurityGroupRetryErrors, EvalRetryErrorType), + RetryTimes: shortRetryTimes, + }) + + if err != nil { + ui.Error(fmt.Sprintf("Failed to delete security group, it may still be around: %s", err)) } } + +func (s *stepConfigAlicloudSecurityGroup) buildCreateSecurityGroupRequest(state multistep.StateBag) *ecs.CreateSecurityGroupRequest { + networkType := state.Get("networktype").(InstanceNetWork) + + request := ecs.CreateCreateSecurityGroupRequest() + request.ClientToken = uuid.TimeOrderedUUID() + request.RegionId = s.RegionId + request.SecurityGroupName = s.SecurityGroupName + + if networkType == InstanceNetworkVpc { + vpcId := state.Get("vpcid").(string) + request.VpcId = vpcId + } + + return request +} diff --git a/builder/alicloud/ecs/step_config_vpc.go b/builder/alicloud/ecs/step_config_vpc.go index 5bcd703a6..f8fc26a19 100644 --- a/builder/alicloud/ecs/step_config_vpc.go +++ b/builder/alicloud/ecs/step_config_vpc.go @@ -2,12 +2,11 @@ package ecs import ( "context" - "errors" + errorsNew "errors" "fmt" - "time" - - "github.com/denverdino/aliyungo/common" - "github.com/denverdino/aliyungo/ecs" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" + "github.com/aliyun/alibaba-cloud-sdk-go/services/ecs" + "github.com/hashicorp/packer/common/uuid" "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" ) @@ -19,54 +18,94 @@ type stepConfigAlicloudVPC struct { isCreate bool } +var createVpcRetryErrors = []string{ + "TOKEN_PROCESSING", +} + +var deleteVpcRetryErrors = []string{ + "DependencyViolation.Instance", + "DependencyViolation.RouteEntry", + "DependencyViolation.VSwitch", + "DependencyViolation.SecurityGroup", + "Forbbiden", + "TaskConflict", +} + func (s *stepConfigAlicloudVPC) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) - client := state.Get("client").(*ecs.Client) + client := state.Get("client").(*ClientWrapper) ui := state.Get("ui").(packer.Ui) if len(s.VpcId) != 0 { - vpcs, _, err := client.DescribeVpcs(&ecs.DescribeVpcsArgs{ - VpcId: s.VpcId, - RegionId: common.Region(config.AlicloudRegion), - }) + describeVpcsRequest := ecs.CreateDescribeVpcsRequest() + describeVpcsRequest.VpcId = s.VpcId + describeVpcsRequest.RegionId = config.AlicloudRegion + + vpcsResponse, err := client.DescribeVpcs(describeVpcsRequest) if err != nil { - ui.Say(fmt.Sprintf("Failed querying vpcs: %s", err)) - state.Put("error", err) - return multistep.ActionHalt + return halt(state, err, "Failed querying vpcs") } + + vpcs := vpcsResponse.Vpcs.Vpc if len(vpcs) > 0 { - vpc := vpcs[0] - state.Put("vpcid", vpc.VpcId) + state.Put("vpcid", vpcs[0].VpcId) s.isCreate = false return multistep.ActionContinue } - message := fmt.Sprintf("The specified vpc {%s} doesn't exist.", s.VpcId) - state.Put("error", errors.New(message)) - ui.Say(message) - return multistep.ActionHalt + message := fmt.Sprintf("The specified vpc {%s} doesn't exist.", s.VpcId) + return halt(state, errorsNew.New(message), "") } - ui.Say("Creating vpc") - vpc, err := client.CreateVpc(&ecs.CreateVpcArgs{ - RegionId: common.Region(config.AlicloudRegion), - CidrBlock: s.CidrBlock, - VpcName: s.VpcName, + + ui.Say("Creating vpc...") + + createVpcRequest := s.buildCreateVpcRequest(state) + createVpcResponse, err := client.WaitForExpected(&WaitForExpectArgs{ + RequestFunc: func() (responses.AcsResponse, error) { + return client.CreateVpc(createVpcRequest) + }, + EvalFunc: client.EvalCouldRetryResponse(createVpcRetryErrors, EvalRetryErrorType), }) if err != nil { - state.Put("error", err) - ui.Say(fmt.Sprintf("Failed creating vpc: %s", err)) - return multistep.ActionHalt - } - err = client.WaitForVpcAvailable(common.Region(config.AlicloudRegion), vpc.VpcId, ALICLOUD_DEFAULT_SHORT_TIMEOUT) - if err != nil { - state.Put("error", err) - ui.Say(fmt.Sprintf("Failed waiting for vpc to become available: %s", err)) - return multistep.ActionHalt + return halt(state, err, "Failed creating vpc") } - state.Put("vpcid", vpc.VpcId) + vpcId := createVpcResponse.(*ecs.CreateVpcResponse).VpcId + _, err = client.WaitForExpected(&WaitForExpectArgs{ + RequestFunc: func() (responses.AcsResponse, error) { + request := ecs.CreateDescribeVpcsRequest() + request.RegionId = config.AlicloudRegion + request.VpcId = vpcId + return client.DescribeVpcs(request) + }, + EvalFunc: func(response responses.AcsResponse, err error) WaitForExpectEvalResult { + if err != nil { + return WaitForExpectToRetry + } + + vpcsResponse := response.(*ecs.DescribeVpcsResponse) + vpcs := vpcsResponse.Vpcs.Vpc + if len(vpcs) > 0 { + for _, vpc := range vpcs { + if vpc.Status == VpcStatusAvailable { + return WaitForExpectSuccess + } + } + } + + return WaitForExpectToRetry + }, + RetryTimes: shortRetryTimes, + }) + + if err != nil { + return halt(state, err, "Failed waiting for vpc to become available") + } + + ui.Message(fmt.Sprintf("Created vpc: %s", vpcId)) + state.Put("vpcid", vpcId) s.isCreate = true - s.VpcId = vpc.VpcId + s.VpcId = vpcId return multistep.ActionContinue } @@ -75,24 +114,34 @@ func (s *stepConfigAlicloudVPC) Cleanup(state multistep.StateBag) { return } - client := state.Get("client").(*ecs.Client) + cleanUpMessage(state, "VPC") + + client := state.Get("client").(*ClientWrapper) ui := state.Get("ui").(packer.Ui) - message(state, "VPC") - timeoutPoint := time.Now().Add(60 * time.Second) - for { - if err := client.DeleteVpc(s.VpcId); err != nil { - e, _ := err.(*common.Error) - if (e.Code == "DependencyViolation.Instance" || e.Code == "DependencyViolation.RouteEntry" || - e.Code == "DependencyViolation.VSwitch" || - e.Code == "DependencyViolation.SecurityGroup" || - e.Code == "Forbbiden") && time.Now().Before(timeoutPoint) { - time.Sleep(1 * time.Second) - continue - } - ui.Error(fmt.Sprintf("Error deleting vpc, it may still be around: %s", err)) - return - } - break + _, err := client.WaitForExpected(&WaitForExpectArgs{ + RequestFunc: func() (responses.AcsResponse, error) { + request := ecs.CreateDeleteVpcRequest() + request.VpcId = s.VpcId + return client.DeleteVpc(request) + }, + EvalFunc: client.EvalCouldRetryResponse(deleteVpcRetryErrors, EvalRetryErrorType), + RetryTimes: shortRetryTimes, + }) + + if err != nil { + ui.Error(fmt.Sprintf("Error deleting vpc, it may still be around: %s", err)) } } + +func (s *stepConfigAlicloudVPC) buildCreateVpcRequest(state multistep.StateBag) *ecs.CreateVpcRequest { + config := state.Get("config").(*Config) + + request := ecs.CreateCreateVpcRequest() + request.ClientToken = uuid.TimeOrderedUUID() + request.RegionId = config.AlicloudRegion + request.CidrBlock = s.CidrBlock + request.VpcName = s.VpcName + + return request +} diff --git a/builder/alicloud/ecs/step_config_vswitch.go b/builder/alicloud/ecs/step_config_vswitch.go index 8025c30ec..d14759d5f 100644 --- a/builder/alicloud/ecs/step_config_vswitch.go +++ b/builder/alicloud/ecs/step_config_vswitch.go @@ -2,12 +2,10 @@ package ecs import ( "context" - "errors" "fmt" - "time" - - "github.com/denverdino/aliyungo/common" - "github.com/denverdino/aliyungo/ecs" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" + "github.com/aliyun/alibaba-cloud-sdk-go/services/ecs" + "github.com/hashicorp/packer/common/uuid" "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" ) @@ -20,52 +18,65 @@ type stepConfigAlicloudVSwitch struct { VSwitchName string } +var createVSwitchRetryErrors = []string{ + "TOKEN_PROCESSING", +} + +var deleteVSwitchRetryErrors = []string{ + "IncorrectVSwitchStatus", + "DependencyViolation", + "DependencyViolation.HaVip", + "IncorrectRouteEntryStatus", + "TaskConflict", +} + func (s *stepConfigAlicloudVSwitch) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { - client := state.Get("client").(*ecs.Client) + client := state.Get("client").(*ClientWrapper) ui := state.Get("ui").(packer.Ui) vpcId := state.Get("vpcid").(string) config := state.Get("config").(*Config) if len(s.VSwitchId) != 0 { - vswitchs, _, err := client.DescribeVSwitches(&ecs.DescribeVSwitchesArgs{ - VpcId: vpcId, - VSwitchId: s.VSwitchId, - ZoneId: s.ZoneId, - }) + describeVSwitchesRequest := ecs.CreateDescribeVSwitchesRequest() + describeVSwitchesRequest.VpcId = vpcId + describeVSwitchesRequest.VSwitchId = s.VSwitchId + describeVSwitchesRequest.ZoneId = s.ZoneId + + vswitchesResponse, err := client.DescribeVSwitches(describeVSwitchesRequest) if err != nil { - ui.Say(fmt.Sprintf("Failed querying vswitch: %s", err)) - state.Put("error", err) - return multistep.ActionHalt + return halt(state, err, "Failed querying vswitch") } - if len(vswitchs) > 0 { - vswitch := vswitchs[0] - state.Put("vswitchid", vswitch.VSwitchId) + + vswitch := vswitchesResponse.VSwitches.VSwitch + if len(vswitch) > 0 { + state.Put("vswitchid", vswitch[0].VSwitchId) s.isCreate = false return multistep.ActionContinue } + s.isCreate = false - message := fmt.Sprintf("The specified vswitch {%s} doesn't exist.", s.VSwitchId) - state.Put("error", errors.New(message)) - ui.Say(message) - return multistep.ActionHalt - + return halt(state, fmt.Errorf("The specified vswitch {%s} doesn't exist.", s.VSwitchId), "") } - if s.ZoneId == "" { - zones, err := client.DescribeZones(common.Region(config.AlicloudRegion)) + if s.ZoneId == "" { + describeZonesRequest := ecs.CreateDescribeZonesRequest() + describeZonesRequest.RegionId = config.AlicloudRegion + + zonesResponse, err := client.DescribeZones(describeZonesRequest) if err != nil { - ui.Say(fmt.Sprintf("Query for available zones failed: %s", err)) - state.Put("error", err) - return multistep.ActionHalt + return halt(state, err, "Query for available zones failed") } + var instanceTypes []string + zones := zonesResponse.Zones.Zone for _, zone := range zones { isVSwitchSupported := false for _, resourceType := range zone.AvailableResourceCreation.ResourceTypes { - if resourceType == ecs.ResourceTypeVSwitch { + if resourceType == "VSwitch" { isVSwitchSupported = true } } + if isVSwitchSupported { for _, instanceType := range zone.AvailableInstanceTypes.InstanceTypes { if instanceType == config.InstanceType { @@ -97,29 +108,62 @@ func (s *stepConfigAlicloudVSwitch) Run(ctx context.Context, state multistep.Sta } } } + if config.CidrBlock == "" { - s.CidrBlock = "172.16.0.0/24" //use the default CirdBlock + s.CidrBlock = DefaultCidrBlock //use the default CirdBlock } + ui.Say("Creating vswitch...") - vswitchId, err := client.CreateVSwitch(&ecs.CreateVSwitchArgs{ - CidrBlock: s.CidrBlock, - ZoneId: s.ZoneId, - VpcId: vpcId, - VSwitchName: s.VSwitchName, + + createVSwitchRequest := s.buildCreateVSwitchRequest(state) + createVSwitchResponse, err := client.WaitForExpected(&WaitForExpectArgs{ + RequestFunc: func() (responses.AcsResponse, error) { + return client.CreateVSwitch(createVSwitchRequest) + }, + EvalFunc: client.EvalCouldRetryResponse(createVSwitchRetryErrors, EvalRetryErrorType), }) if err != nil { - state.Put("error", err) - ui.Say(fmt.Sprintf("Create vswitch failed %v", err)) - return multistep.ActionHalt + return halt(state, err, "Error Creating vswitch") } - if err := client.WaitForVSwitchAvailable(vpcId, s.VSwitchId, ALICLOUD_DEFAULT_TIMEOUT); err != nil { - state.Put("error", err) - ui.Error(fmt.Sprintf("Timeout waiting for vswitch to become available: %v", err)) - return multistep.ActionHalt + + vSwitchId := createVSwitchResponse.(*ecs.CreateVSwitchResponse).VSwitchId + + describeVSwitchesRequest := ecs.CreateDescribeVSwitchesRequest() + describeVSwitchesRequest.VpcId = vpcId + describeVSwitchesRequest.VSwitchId = vSwitchId + + _, err = client.WaitForExpected(&WaitForExpectArgs{ + RequestFunc: func() (responses.AcsResponse, error) { + return client.DescribeVSwitches(describeVSwitchesRequest) + }, + EvalFunc: func(response responses.AcsResponse, err error) WaitForExpectEvalResult { + if err != nil { + return WaitForExpectToRetry + } + + vSwitchesResponse := response.(*ecs.DescribeVSwitchesResponse) + vSwitches := vSwitchesResponse.VSwitches.VSwitch + if len(vSwitches) > 0 { + for _, vSwitch := range vSwitches { + if vSwitch.Status == VSwitchStatusAvailable { + return WaitForExpectSuccess + } + } + } + + return WaitForExpectToRetry + }, + RetryTimes: shortRetryTimes, + }) + + if err != nil { + return halt(state, err, "Timeout waiting for vswitch to become available") } - state.Put("vswitchid", vswitchId) + + ui.Message(fmt.Sprintf("Created vswitch: %s", vSwitchId)) + state.Put("vswitchid", vSwitchId) s.isCreate = true - s.VSwitchId = vswitchId + s.VSwitchId = vSwitchId return multistep.ActionContinue } @@ -128,22 +172,35 @@ func (s *stepConfigAlicloudVSwitch) Cleanup(state multistep.StateBag) { return } - client := state.Get("client").(*ecs.Client) + cleanUpMessage(state, "vSwitch") + + client := state.Get("client").(*ClientWrapper) ui := state.Get("ui").(packer.Ui) - message(state, "vSwitch") - timeoutPoint := time.Now().Add(10 * time.Second) - for { - if err := client.DeleteVSwitch(s.VSwitchId); err != nil { - e, _ := err.(*common.Error) - if (e.Code == "IncorrectVSwitchStatus" || e.Code == "DependencyViolation" || - e.Code == "DependencyViolation.HaVip" || - e.Code == "IncorrectRouteEntryStatus") && time.Now().Before(timeoutPoint) { - time.Sleep(1 * time.Second) - continue - } - ui.Error(fmt.Sprintf("Error deleting vswitch, it may still be around: %s", err)) - return - } - break + + _, err := client.WaitForExpected(&WaitForExpectArgs{ + RequestFunc: func() (responses.AcsResponse, error) { + request := ecs.CreateDeleteVSwitchRequest() + request.VSwitchId = s.VSwitchId + return client.DeleteVSwitch(request) + }, + EvalFunc: client.EvalCouldRetryResponse(deleteVSwitchRetryErrors, EvalRetryErrorType), + RetryTimes: shortRetryTimes, + }) + + if err != nil { + ui.Error(fmt.Sprintf("Error deleting vswitch, it may still be around: %s", err)) } } + +func (s *stepConfigAlicloudVSwitch) buildCreateVSwitchRequest(state multistep.StateBag) *ecs.CreateVSwitchRequest { + vpcId := state.Get("vpcid").(string) + + request := ecs.CreateCreateVSwitchRequest() + request.ClientToken = uuid.TimeOrderedUUID() + request.CidrBlock = s.CidrBlock + request.ZoneId = s.ZoneId + request.VpcId = vpcId + request.VSwitchName = s.VSwitchName + + return request +} diff --git a/builder/alicloud/ecs/step_create_image.go b/builder/alicloud/ecs/step_create_image.go index 9be398958..4c41bb6f1 100644 --- a/builder/alicloud/ecs/step_create_image.go +++ b/builder/alicloud/ecs/step_create_image.go @@ -3,69 +3,67 @@ package ecs import ( "context" "fmt" - - "github.com/denverdino/aliyungo/common" - "github.com/denverdino/aliyungo/ecs" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" + "github.com/aliyun/alibaba-cloud-sdk-go/services/ecs" + "github.com/hashicorp/packer/common/uuid" "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" + "time" ) type stepCreateAlicloudImage struct { AlicloudImageIgnoreDataDisks bool WaitSnapshotReadyTimeout int - image *ecs.ImageType + image *ecs.Image +} + +var createImageRetryErrors = []string{ + "IdempotentProcessing", } func (s *stepCreateAlicloudImage) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) - client := state.Get("client").(*ecs.Client) + client := state.Get("client").(*ClientWrapper) ui := state.Get("ui").(packer.Ui) // Create the alicloud image ui.Say(fmt.Sprintf("Creating image: %s", config.AlicloudImageName)) - var imageId string - var err error - if s.AlicloudImageIgnoreDataDisks { - snapshotId := state.Get("alicloudsnapshot").(string) - imageId, err = client.CreateImage(&ecs.CreateImageArgs{ - RegionId: common.Region(config.AlicloudRegion), - SnapshotId: snapshotId, - ImageName: config.AlicloudImageName, - ImageVersion: config.AlicloudImageVersion, - Description: config.AlicloudImageDescription}) - } else { - instance := state.Get("instance").(*ecs.InstanceAttributesType) - imageId, err = client.CreateImage(&ecs.CreateImageArgs{ - RegionId: common.Region(config.AlicloudRegion), - InstanceId: instance.InstanceId, - ImageName: config.AlicloudImageName, - ImageVersion: config.AlicloudImageVersion, - Description: config.AlicloudImageDescription}) - } + createImageRequest := s.buildCreateImageRequest(state) + createImageResponse, err := client.WaitForExpected(&WaitForExpectArgs{ + RequestFunc: func() (responses.AcsResponse, error) { + return client.CreateImage(createImageRequest) + }, + EvalFunc: client.EvalCouldRetryResponse(createImageRetryErrors, EvalRetryErrorType), + }) if err != nil { return halt(state, err, "Error creating image") } - err = client.WaitForImageReady(common.Region(config.AlicloudRegion), imageId, s.WaitSnapshotReadyTimeout) + + imageId := createImageResponse.(*ecs.CreateImageResponse).ImageId + + _, err = client.WaitForImageStatus(config.AlicloudRegion, imageId, ImageStatusAvailable, time.Duration(s.WaitSnapshotReadyTimeout)*time.Second) if err != nil { return halt(state, err, "Timeout waiting for image to be created") } - images, _, err := client.DescribeImages(&ecs.DescribeImagesArgs{ - RegionId: common.Region(config.AlicloudRegion), - ImageId: imageId}) + describeImagesRequest := ecs.CreateDescribeImagesRequest() + describeImagesRequest.ImageId = imageId + describeImagesRequest.RegionId = config.AlicloudRegion + imagesResponse, err := client.DescribeImages(describeImagesRequest) if err != nil { - return halt(state, err, "Error querying created imaged") + return halt(state, err, "") } + images := imagesResponse.Images.Image if len(images) == 0 { return halt(state, err, "Unable to find created image") } s.image = &images[0] - var snapshotIds = []string{} + var snapshotIds []string for _, device := range images[0].DiskDeviceMappings.DiskDeviceMapping { snapshotIds = append(snapshotIds, device.SnapshotId) } @@ -84,19 +82,45 @@ func (s *stepCreateAlicloudImage) Cleanup(state multistep.StateBag) { if s.image == nil { return } + _, cancelled := state.GetOk(multistep.StateCancelled) _, halted := state.GetOk(multistep.StateHalted) if !cancelled && !halted { return } - client := state.Get("client").(*ecs.Client) + client := state.Get("client").(*ClientWrapper) ui := state.Get("ui").(packer.Ui) config := state.Get("config").(*Config) ui.Say("Deleting the image because of cancellation or error...") - if err := client.DeleteImage(common.Region(config.AlicloudRegion), s.image.ImageId); err != nil { + + deleteImageRequest := ecs.CreateDeleteImageRequest() + deleteImageRequest.RegionId = config.AlicloudRegion + deleteImageRequest.ImageId = s.image.ImageId + if _, err := client.DeleteImage(deleteImageRequest); err != nil { ui.Error(fmt.Sprintf("Error deleting image, it may still be around: %s", err)) return } } + +func (s *stepCreateAlicloudImage) buildCreateImageRequest(state multistep.StateBag) *ecs.CreateImageRequest { + config := state.Get("config").(*Config) + + request := ecs.CreateCreateImageRequest() + request.ClientToken = uuid.TimeOrderedUUID() + request.RegionId = config.AlicloudRegion + request.ImageName = config.AlicloudImageName + request.ImageVersion = config.AlicloudImageVersion + request.Description = config.AlicloudImageDescription + + if s.AlicloudImageIgnoreDataDisks { + snapshotId := state.Get("alicloudsnapshot").(string) + request.SnapshotId = snapshotId + } else { + instance := state.Get("instance").(*ecs.Instance) + request.InstanceId = instance.InstanceId + } + + return request +} diff --git a/builder/alicloud/ecs/step_create_instance.go b/builder/alicloud/ecs/step_create_instance.go index 98b3276e4..2260922ba 100644 --- a/builder/alicloud/ecs/step_create_instance.go +++ b/builder/alicloud/ecs/step_create_instance.go @@ -2,12 +2,16 @@ package ecs import ( "context" + "encoding/base64" "fmt" "io/ioutil" - "log" + "strconv" - "github.com/denverdino/aliyungo/common" - "github.com/denverdino/aliyungo/ecs" + "github.com/hashicorp/packer/common/uuid" + + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" + "github.com/aliyun/alibaba-cloud-sdk-go/services/ecs" "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" ) @@ -23,99 +27,55 @@ type stepCreateAlicloudInstance struct { InternetMaxBandwidthOut int InstanceName string ZoneId string - instance *ecs.InstanceAttributesType + instance *ecs.Instance +} + +var createInstanceRetryErrors = []string{ + "IdempotentProcessing", +} + +var deleteInstanceRetryErrors = []string{ + "IncorrectInstanceStatus.Initializing", } func (s *stepCreateAlicloudInstance) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { - client := state.Get("client").(*ecs.Client) - config := state.Get("config").(*Config) + client := state.Get("client").(*ClientWrapper) ui := state.Get("ui").(packer.Ui) - source_image := state.Get("source_image").(*ecs.ImageType) - network_type := state.Get("networktype").(InstanceNetWork) - securityGroupId := state.Get("securitygroupid").(string) - var instanceId string - var err error - ioOptimized := ecs.IoOptimizedNone - if s.IOOptimized { - ioOptimized = ecs.IoOptimizedOptimized - } - password := config.Comm.SSHPassword - if password == "" && config.Comm.WinRMPassword != "" { - password = config.Comm.WinRMPassword - } - ui.Say("Creating instance.") - if network_type == VpcNet { - userData, err := s.getUserData(state) - if err != nil { - state.Put("error", err) - ui.Error(err.Error()) - return multistep.ActionHalt - } - vswitchId := state.Get("vswitchid").(string) - instanceId, err = client.CreateInstance(&ecs.CreateInstanceArgs{ - RegionId: common.Region(s.RegionId), - ImageId: source_image.ImageId, - InstanceType: s.InstanceType, - InternetChargeType: common.InternetChargeType(s.InternetChargeType), //"PayByTraffic", - InternetMaxBandwidthOut: s.InternetMaxBandwidthOut, - UserData: userData, - IoOptimized: ioOptimized, - VSwitchId: vswitchId, - SecurityGroupId: securityGroupId, - InstanceName: s.InstanceName, - Password: password, - ZoneId: s.ZoneId, - SystemDisk: systemDeviceToDiskType(config.AlicloudImageConfig.ECSSystemDiskMapping), - DataDisk: diskDeviceToDiskType(config.AlicloudImageConfig.ECSImagesDiskMappings), - }) - if err != nil { - err := fmt.Errorf("Error creating instance: %s", err) - state.Put("error", err) - ui.Error(err.Error()) - return multistep.ActionHalt - } - } else { - if s.InstanceType == "" { - s.InstanceType = "PayByTraffic" - } - if s.InternetMaxBandwidthOut == 0 { - s.InternetMaxBandwidthOut = 5 - } - instanceId, err = client.CreateInstance(&ecs.CreateInstanceArgs{ - RegionId: common.Region(s.RegionId), - ImageId: source_image.ImageId, - InstanceType: s.InstanceType, - InternetChargeType: common.InternetChargeType(s.InternetChargeType), //"PayByTraffic", - InternetMaxBandwidthOut: s.InternetMaxBandwidthOut, - IoOptimized: ioOptimized, - SecurityGroupId: securityGroupId, - InstanceName: s.InstanceName, - Password: password, - ZoneId: s.ZoneId, - DataDisk: diskDeviceToDiskType(config.AlicloudImageConfig.ECSImagesDiskMappings), - }) - if err != nil { - err := fmt.Errorf("Error creating instance: %s", err) - state.Put("error", err) - ui.Error(err.Error()) - return multistep.ActionHalt - } - } - err = client.WaitForInstance(instanceId, ecs.Stopped, ALICLOUD_DEFAULT_TIMEOUT) + ui.Say("Creating instance...") + createInstanceRequest, err := s.buildCreateInstanceRequest(state) if err != nil { - err := fmt.Errorf("Error creating instance: %s", err) - state.Put("error", err) - ui.Error(err.Error()) - return multistep.ActionHalt + return halt(state, err, "") } - instance, err := client.DescribeInstanceAttribute(instanceId) + + createInstanceResponse, err := client.WaitForExpected(&WaitForExpectArgs{ + RequestFunc: func() (responses.AcsResponse, error) { + return client.CreateInstance(createInstanceRequest) + }, + EvalFunc: client.EvalCouldRetryResponse(createInstanceRetryErrors, EvalRetryErrorType), + }) + if err != nil { - ui.Say(err.Error()) - return multistep.ActionHalt + return halt(state, err, "Error creating instance") } - s.instance = instance - state.Put("instance", instance) + + instanceId := createInstanceResponse.(*ecs.CreateInstanceResponse).InstanceId + + _, err = client.WaitForInstanceStatus(s.RegionId, instanceId, InstanceStatusStopped) + if err != nil { + return halt(state, err, "Error waiting create instance") + } + + describeInstancesRequest := ecs.CreateDescribeInstancesRequest() + describeInstancesRequest.InstanceIds = fmt.Sprintf("[\"%s\"]", instanceId) + instances, err := client.DescribeInstances(describeInstancesRequest) + if err != nil { + return halt(state, err, "") + } + + ui.Message(fmt.Sprintf("Created instance: %s", instanceId)) + s.instance = &instances.Instances.Instance[0] + state.Put("instance", s.instance) return multistep.ActionContinue } @@ -124,51 +84,118 @@ func (s *stepCreateAlicloudInstance) Cleanup(state multistep.StateBag) { if s.instance == nil { return } - message(state, "instance") - client := state.Get("client").(*ecs.Client) - ui := state.Get("ui").(packer.Ui) - err := client.DeleteInstance(s.instance.InstanceId) - if err != nil { - ui.Say(fmt.Sprintf("Failed to clean up instance %s: %v", s.instance.InstanceId, err.Error())) - } + cleanUpMessage(state, "instance") + client := state.Get("client").(*ClientWrapper) + ui := state.Get("ui").(packer.Ui) + + _, err := client.WaitForExpected(&WaitForExpectArgs{ + RequestFunc: func() (responses.AcsResponse, error) { + request := ecs.CreateDeleteInstanceRequest() + request.InstanceId = s.instance.InstanceId + request.Force = requests.NewBoolean(true) + return client.DeleteInstance(request) + }, + EvalFunc: client.EvalCouldRetryResponse(deleteInstanceRetryErrors, EvalRetryErrorType), + RetryTimes: shortRetryTimes, + }) + + if err != nil { + ui.Say(fmt.Sprintf("Failed to clean up instance %s: %s", s.instance.InstanceId, err)) + } +} + +func (s *stepCreateAlicloudInstance) buildCreateInstanceRequest(state multistep.StateBag) (*ecs.CreateInstanceRequest, error) { + request := ecs.CreateCreateInstanceRequest() + request.ClientToken = uuid.TimeOrderedUUID() + request.RegionId = s.RegionId + request.InstanceType = s.InstanceType + request.InstanceName = s.InstanceName + request.ZoneId = s.ZoneId + + sourceImage := state.Get("source_image").(*ecs.Image) + request.ImageId = sourceImage.ImageId + + securityGroupId := state.Get("securitygroupid").(string) + request.SecurityGroupId = securityGroupId + + networkType := state.Get("networktype").(InstanceNetWork) + if networkType == InstanceNetworkVpc { + vswitchId := state.Get("vswitchid").(string) + request.VSwitchId = vswitchId + + userData, err := s.getUserData(state) + if err != nil { + return nil, err + } + + request.UserData = userData + } else { + if s.InternetChargeType == "" { + s.InternetChargeType = "PayByTraffic" + } + + if s.InternetMaxBandwidthOut == 0 { + s.InternetMaxBandwidthOut = 5 + } + } + request.InternetChargeType = s.InternetChargeType + request.InternetMaxBandwidthOut = requests.Integer(convertNumber(s.InternetMaxBandwidthOut)) + + ioOptimized := IOOptimizedNone + if s.IOOptimized { + ioOptimized = IOOptimizedOptimized + } + request.IoOptimized = ioOptimized + + config := state.Get("config").(*Config) + password := config.Comm.SSHPassword + if password == "" && config.Comm.WinRMPassword != "" { + password = config.Comm.WinRMPassword + } + request.Password = password + + systemDisk := config.AlicloudImageConfig.ECSSystemDiskMapping + request.SystemDiskDiskName = systemDisk.DiskName + request.SystemDiskCategory = systemDisk.DiskCategory + request.SystemDiskSize = requests.Integer(convertNumber(systemDisk.DiskSize)) + request.SystemDiskDescription = systemDisk.Description + + imageDisks := config.AlicloudImageConfig.ECSImagesDiskMappings + var dataDisks []ecs.CreateInstanceDataDisk + for _, imageDisk := range imageDisks { + var dataDisk ecs.CreateInstanceDataDisk + dataDisk.DiskName = imageDisk.DiskName + dataDisk.Category = imageDisk.DiskCategory + dataDisk.Size = string(convertNumber(imageDisk.DiskSize)) + dataDisk.SnapshotId = imageDisk.SnapshotId + dataDisk.Description = imageDisk.Description + dataDisk.DeleteWithInstance = strconv.FormatBool(imageDisk.DeleteWithInstance) + dataDisk.Device = imageDisk.Device + + dataDisks = append(dataDisks, dataDisk) + } + request.DataDisk = &dataDisks + + return request, nil } func (s *stepCreateAlicloudInstance) getUserData(state multistep.StateBag) (string, error) { userData := s.UserData + if s.UserDataFile != "" { data, err := ioutil.ReadFile(s.UserDataFile) if err != nil { return "", err } + userData = string(data) } - log.Printf(userData) + + if userData != "" { + userData = base64.StdEncoding.EncodeToString([]byte(userData)) + } + return userData, nil } - -func systemDeviceToDiskType(systemDisk AlicloudDiskDevice) ecs.SystemDiskType { - return ecs.SystemDiskType{ - DiskName: systemDisk.DiskName, - Category: ecs.DiskCategory(systemDisk.DiskCategory), - Size: systemDisk.DiskSize, - Description: systemDisk.Description, - } -} - -func diskDeviceToDiskType(diskDevices []AlicloudDiskDevice) []ecs.DataDiskType { - result := make([]ecs.DataDiskType, len(diskDevices)) - for _, diskDevice := range diskDevices { - result = append(result, ecs.DataDiskType{ - DiskName: diskDevice.DiskName, - Category: ecs.DiskCategory(diskDevice.DiskCategory), - Size: diskDevice.DiskSize, - SnapshotId: diskDevice.SnapshotId, - Description: diskDevice.Description, - DeleteWithInstance: diskDevice.DeleteWithInstance, - Device: diskDevice.Device, - }) - } - return result -} diff --git a/builder/alicloud/ecs/step_create_snapshot.go b/builder/alicloud/ecs/step_create_snapshot.go index bf61d641a..f99ea0d39 100644 --- a/builder/alicloud/ecs/step_create_snapshot.go +++ b/builder/alicloud/ecs/step_create_snapshot.go @@ -3,33 +3,34 @@ package ecs import ( "context" "fmt" - - "github.com/denverdino/aliyungo/common" - "github.com/denverdino/aliyungo/ecs" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" + "github.com/aliyun/alibaba-cloud-sdk-go/services/ecs" "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" + "time" ) type stepCreateAlicloudSnapshot struct { - snapshot *ecs.SnapshotType + snapshot *ecs.Snapshot WaitSnapshotReadyTimeout int } func (s *stepCreateAlicloudSnapshot) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) - client := state.Get("client").(*ecs.Client) + client := state.Get("client").(*ClientWrapper) ui := state.Get("ui").(packer.Ui) + instance := state.Get("instance").(*ecs.Instance) - instance := state.Get("instance").(*ecs.InstanceAttributesType) - disks, _, err := client.DescribeDisks(&ecs.DescribeDisksArgs{ - RegionId: common.Region(config.AlicloudRegion), - InstanceId: instance.InstanceId, - DiskType: ecs.DiskTypeAllSystem, - }) - + describeDisksRequest := ecs.CreateDescribeDisksRequest() + describeDisksRequest.RegionId = config.AlicloudRegion + describeDisksRequest.InstanceId = instance.InstanceId + describeDisksRequest.DiskType = DiskTypeSystem + disksResponse, err := client.DescribeDisks(describeDisksRequest) if err != nil { return halt(state, err, "Error describe disks") } + + disks := disksResponse.Disks.Disk if len(disks) == 0 { return halt(state, err, "Unable to find system disk of instance") } @@ -37,33 +38,57 @@ func (s *stepCreateAlicloudSnapshot) Run(ctx context.Context, state multistep.St // Create the alicloud snapshot ui.Say(fmt.Sprintf("Creating snapshot from system disk: %s", disks[0].DiskId)) - snapshotId, err := client.CreateSnapshot(&ecs.CreateSnapshotArgs{ - DiskId: disks[0].DiskId, - }) - + createSnapshotRequest := ecs.CreateCreateSnapshotRequest() + createSnapshotRequest.DiskId = disks[0].DiskId + snapshot, err := client.CreateSnapshot(createSnapshotRequest) if err != nil { return halt(state, err, "Error creating snapshot") } - err = client.WaitForSnapShotReady(common.Region(config.AlicloudRegion), snapshotId, s.WaitSnapshotReadyTimeout) + _, err = client.WaitForExpected(&WaitForExpectArgs{ + RequestFunc: func() (responses.AcsResponse, error) { + request := ecs.CreateDescribeSnapshotsRequest() + request.RegionId = config.AlicloudRegion + request.SnapshotIds = snapshot.SnapshotId + return client.DescribeSnapshots(request) + }, + EvalFunc: func(response responses.AcsResponse, err error) WaitForExpectEvalResult { + if err != nil { + return WaitForExpectToRetry + } + + snapshotsResponse := response.(*ecs.DescribeSnapshotsResponse) + snapshots := snapshotsResponse.Snapshots.Snapshot + for _, snapshot := range snapshots { + if snapshot.Status == SnapshotStatusAccomplished { + return WaitForExpectSuccess + } + } + return WaitForExpectToRetry + }, + RetryTimeout: time.Duration(s.WaitSnapshotReadyTimeout) * time.Second, + }) + if err != nil { return halt(state, err, "Timeout waiting for snapshot to be created") } - snapshots, _, err := client.DescribeSnapshots(&ecs.DescribeSnapshotsArgs{ - RegionId: common.Region(config.AlicloudRegion), - SnapshotIds: []string{snapshotId}, - }) + describeSnapshotsRequest := ecs.CreateDescribeSnapshotsRequest() + describeSnapshotsRequest.RegionId = config.AlicloudRegion + describeSnapshotsRequest.SnapshotIds = snapshot.SnapshotId + snapshotsResponse, err := client.DescribeSnapshots(describeSnapshotsRequest) if err != nil { return halt(state, err, "Error querying created snapshot") } + + snapshots := snapshotsResponse.Snapshots.Snapshot if len(snapshots) == 0 { return halt(state, err, "Unable to find created snapshot") } - s.snapshot = &snapshots[0] - state.Put("alicloudsnapshot", snapshotId) + s.snapshot = &snapshots[0] + state.Put("alicloudsnapshot", snapshot.SnapshotId) return multistep.ActionContinue } @@ -77,11 +102,14 @@ func (s *stepCreateAlicloudSnapshot) Cleanup(state multistep.StateBag) { return } - client := state.Get("client").(*ecs.Client) + client := state.Get("client").(*ClientWrapper) ui := state.Get("ui").(packer.Ui) ui.Say("Deleting the snapshot because of cancellation or error...") - if err := client.DeleteSnapshot(s.snapshot.SnapshotId); err != nil { + + deleteSnapshotRequest := ecs.CreateDeleteSnapshotRequest() + deleteSnapshotRequest.SnapshotId = s.snapshot.SnapshotId + if _, err := client.DeleteSnapshot(deleteSnapshotRequest); err != nil { ui.Error(fmt.Sprintf("Error deleting snapshot, it may still be around: %s", err)) return } diff --git a/builder/alicloud/ecs/step_create_tags.go b/builder/alicloud/ecs/step_create_tags.go index 7778a53db..fd6b2b712 100644 --- a/builder/alicloud/ecs/step_create_tags.go +++ b/builder/alicloud/ecs/step_create_tags.go @@ -4,8 +4,7 @@ import ( "context" "fmt" - "github.com/denverdino/aliyungo/common" - "github.com/denverdino/aliyungo/ecs" + "github.com/aliyun/alibaba-cloud-sdk-go/services/ecs" "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" ) @@ -16,7 +15,7 @@ type stepCreateTags struct { func (s *stepCreateTags) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) - client := state.Get("client").(*ecs.Client) + client := state.Get("client").(*ClientWrapper) ui := state.Get("ui").(packer.Ui) imageId := state.Get("alicloudimage").(string) snapshotIds := state.Get("alicloudsnapshots").([]string) @@ -24,26 +23,37 @@ func (s *stepCreateTags) Run(ctx context.Context, state multistep.StateBag) mult if len(s.Tags) == 0 { return multistep.ActionContinue } + ui.Say(fmt.Sprintf("Adding tags(%s) to image: %s", s.Tags, imageId)) - err := client.AddTags(&ecs.AddTagsArgs{ - ResourceId: imageId, - ResourceType: ecs.TagResourceImage, - RegionId: common.Region(config.AlicloudRegion), - Tag: s.Tags, - }) - if err != nil { + + var tags []ecs.AddTagsTag + for key, value := range s.Tags { + var tag ecs.AddTagsTag + tag.Key = key + tag.Value = value + tags = append(tags, tag) + } + + addTagsRequest := ecs.CreateAddTagsRequest() + addTagsRequest.RegionId = config.AlicloudRegion + addTagsRequest.ResourceId = imageId + addTagsRequest.ResourceType = TagResourceImage + addTagsRequest.Tag = &tags + + if _, err := client.AddTags(addTagsRequest); err != nil { return halt(state, err, "Error Adding tags to image") } for _, snapshotId := range snapshotIds { ui.Say(fmt.Sprintf("Adding tags(%s) to snapshot: %s", s.Tags, snapshotId)) - err = client.AddTags(&ecs.AddTagsArgs{ - ResourceId: snapshotId, - ResourceType: ecs.TagResourceSnapshot, - RegionId: common.Region(config.AlicloudRegion), - Tag: s.Tags, - }) - if err != nil { + addTagsRequest := ecs.CreateAddTagsRequest() + + addTagsRequest.RegionId = config.AlicloudRegion + addTagsRequest.ResourceId = snapshotId + addTagsRequest.ResourceType = TagResourceSnapshot + addTagsRequest.Tag = &tags + + if _, err := client.AddTags(addTagsRequest); err != nil { return halt(state, err, "Error Adding tags to snapshot") } } diff --git a/builder/alicloud/ecs/step_delete_images_snapshots.go b/builder/alicloud/ecs/step_delete_images_snapshots.go index 7ca6b3460..cd79229bd 100644 --- a/builder/alicloud/ecs/step_delete_images_snapshots.go +++ b/builder/alicloud/ecs/step_delete_images_snapshots.go @@ -5,8 +5,7 @@ import ( "fmt" "log" - "github.com/denverdino/aliyungo/common" - "github.com/denverdino/aliyungo/ecs" + "github.com/aliyun/alibaba-cloud-sdk-go/services/ecs" "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" ) @@ -54,13 +53,15 @@ func (s *stepDeleteAlicloudImageSnapshots) Run(ctx context.Context, state multis } func (s *stepDeleteAlicloudImageSnapshots) deleteImageAndSnapshots(state multistep.StateBag, imageName string, region string) error { - client := state.Get("client").(*ecs.Client) + client := state.Get("client").(*ClientWrapper) ui := state.Get("ui").(packer.Ui) - images, _, err := client.DescribeImages(&ecs.DescribeImagesArgs{ - RegionId: common.Region(region), - ImageName: imageName, - }) + describeImagesRequest := ecs.CreateDescribeImagesRequest() + describeImagesRequest.RegionId = region + describeImagesRequest.ImageName = imageName + describeImagesRequest.Status = ImageStatusQueried + imageResponse, _ := client.DescribeImages(describeImagesRequest) + images := imageResponse.Images.Image if len(images) < 1 { return nil } @@ -68,20 +69,24 @@ func (s *stepDeleteAlicloudImageSnapshots) deleteImageAndSnapshots(state multist ui.Say(fmt.Sprintf("Deleting duplicated image and snapshot in %s: %s", region, imageName)) for _, image := range images { - if image.ImageOwnerAlias != string(ecs.ImageOwnerSelf) { + if image.ImageOwnerAlias != ImageOwnerSelf { log.Printf("You can not delete non-customized images: %s ", image.ImageId) continue } - err = client.DeleteImage(common.Region(region), image.ImageId) - if err != nil { + deleteImageRequest := ecs.CreateDeleteImageRequest() + deleteImageRequest.RegionId = region + deleteImageRequest.ImageId = image.ImageId + if _, err := client.DeleteImage(deleteImageRequest); err != nil { err := fmt.Errorf("Failed to delete image: %s", err) return err } if s.AlicloudImageForceDeleteSnapshots { for _, diskDevice := range image.DiskDeviceMappings.DiskDeviceMapping { - if err := client.DeleteSnapshot(diskDevice.SnapshotId); err != nil { + deleteSnapshotRequest := ecs.CreateDeleteSnapshotRequest() + deleteSnapshotRequest.SnapshotId = diskDevice.SnapshotId + if _, err := client.DeleteSnapshot(deleteSnapshotRequest); err != nil { err := fmt.Errorf("Deleting ECS snapshot failed: %s", err) return err } diff --git a/builder/alicloud/ecs/step_mount_disk.go b/builder/alicloud/ecs/step_mount_disk.go deleted file mode 100644 index 1f330ee9f..000000000 --- a/builder/alicloud/ecs/step_mount_disk.go +++ /dev/null @@ -1,72 +0,0 @@ -package ecs - -import ( - "context" - "fmt" - - "github.com/denverdino/aliyungo/ecs" - "github.com/hashicorp/packer/helper/multistep" - "github.com/hashicorp/packer/packer" -) - -type stepMountAlicloudDisk struct { -} - -func (s *stepMountAlicloudDisk) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { - client := state.Get("client").(*ecs.Client) - config := state.Get("config").(*Config) - ui := state.Get("ui").(packer.Ui) - instance := state.Get("instance").(*ecs.InstanceAttributesType) - alicloudDiskDevices := config.ECSImagesDiskMappings - if len(config.ECSImagesDiskMappings) == 0 { - return multistep.ActionContinue - } - ui.Say("Mounting disks.") - disks, _, err := client.DescribeDisks(&ecs.DescribeDisksArgs{InstanceId: instance.InstanceId, - RegionId: instance.RegionId}) - if err != nil { - err := fmt.Errorf("Error querying disks: %s", err) - state.Put("error", err) - ui.Error(err.Error()) - return multistep.ActionHalt - } - for _, disk := range disks { - if disk.Status == ecs.DiskStatusAvailable { - if err := client.AttachDisk(&ecs.AttachDiskArgs{DiskId: disk.DiskId, - InstanceId: instance.InstanceId, - Device: getDevice(&disk, alicloudDiskDevices), - }); err != nil { - err := fmt.Errorf("Error mounting disks: %s", err) - state.Put("error", err) - ui.Error(err.Error()) - return multistep.ActionHalt - } - } - } - for _, disk := range disks { - if err := client.WaitForDisk(instance.RegionId, disk.DiskId, ecs.DiskStatusInUse, ALICLOUD_DEFAULT_SHORT_TIMEOUT); err != nil { - err := fmt.Errorf("Timeout waiting for mount: %s", err) - state.Put("error", err) - ui.Error(err.Error()) - return multistep.ActionHalt - } - } - ui.Say("Finished mounting disks.") - return multistep.ActionContinue -} - -func (s *stepMountAlicloudDisk) Cleanup(state multistep.StateBag) { - -} - -func getDevice(disk *ecs.DiskItemType, diskDevices []AlicloudDiskDevice) string { - if disk.Device != "" { - return disk.Device - } - for _, alicloudDiskDevice := range diskDevices { - if alicloudDiskDevice.DiskName == disk.DiskName || alicloudDiskDevice.SnapshotId == disk.SourceSnapshotId { - return alicloudDiskDevice.Device - } - } - return "" -} diff --git a/builder/alicloud/ecs/step_pre_validate.go b/builder/alicloud/ecs/step_pre_validate.go index 09b5b4c54..283a6b334 100644 --- a/builder/alicloud/ecs/step_pre_validate.go +++ b/builder/alicloud/ecs/step_pre_validate.go @@ -4,8 +4,7 @@ import ( "context" "fmt" - "github.com/denverdino/aliyungo/common" - "github.com/denverdino/aliyungo/ecs" + "github.com/aliyun/alibaba-cloud-sdk-go/services/ecs" "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" ) @@ -16,34 +15,73 @@ type stepPreValidate struct { } func (s *stepPreValidate) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { - ui := state.Get("ui").(packer.Ui) - if s.ForceDelete { - ui.Say("Force delete flag found, skipping prevalidating image name.") - return multistep.ActionContinue + if err := s.validateRegions(state); err != nil { + return halt(state, err, "") } - client := state.Get("client").(*ecs.Client) - config := state.Get("config").(*Config) - ui.Say("Prevalidating image name...") - images, _, err := client.DescribeImages(&ecs.DescribeImagesArgs{ - ImageName: s.AlicloudDestImageName, - RegionId: common.Region(config.AlicloudRegion)}) - - if err != nil { - err := fmt.Errorf("Error querying alicloud image: %s", err) - state.Put("error", err) - ui.Error(err.Error()) - return multistep.ActionHalt - } - - if len(images) > 0 { - err := fmt.Errorf("Error: Image Name: '%s' is used by an existing alicloud image: %s", images[0].ImageName, images[0].ImageId) - state.Put("error", err) - ui.Error(err.Error()) - return multistep.ActionHalt + if err := s.validateDestImageName(state); err != nil { + return halt(state, err, "") } return multistep.ActionContinue } +func (s *stepPreValidate) validateRegions(state multistep.StateBag) error { + ui := state.Get("ui").(packer.Ui) + config := state.Get("config").(*Config) + + if config.AlicloudSkipValidation { + ui.Say("Skip region validation flag found, skipping prevalidating source region and copied regions.") + return nil + } + + ui.Say("Prevalidating source region and copied regions...") + + var errs *packer.MultiError + if err := config.ValidateRegion(config.AlicloudRegion); err != nil { + errs = packer.MultiErrorAppend(errs, err) + } + for _, region := range config.AlicloudImageDestinationRegions { + if err := config.ValidateRegion(region); err != nil { + errs = packer.MultiErrorAppend(errs, err) + } + } + + if errs != nil && len(errs.Errors) > 0 { + return errs + } + + return nil +} + +func (s *stepPreValidate) validateDestImageName(state multistep.StateBag) error { + ui := state.Get("ui").(packer.Ui) + client := state.Get("client").(*ClientWrapper) + config := state.Get("config").(*Config) + + if s.ForceDelete { + ui.Say("Force delete flag found, skipping prevalidating image name.") + return nil + } + + ui.Say("Prevalidating image name...") + + describeImagesRequest := ecs.CreateDescribeImagesRequest() + describeImagesRequest.RegionId = config.AlicloudRegion + describeImagesRequest.ImageName = s.AlicloudDestImageName + describeImagesRequest.Status = ImageStatusQueried + + imagesResponse, err := client.DescribeImages(describeImagesRequest) + if err != nil { + return fmt.Errorf("Error querying alicloud image: %s", err) + } + + images := imagesResponse.Images.Image + if len(images) > 0 { + return fmt.Errorf("Error: Image Name: '%s' is used by an existing alicloud image: %s", images[0].ImageName, images[0].ImageId) + } + + return nil +} + func (s *stepPreValidate) Cleanup(multistep.StateBag) {} diff --git a/builder/alicloud/ecs/step_region_copy_image.go b/builder/alicloud/ecs/step_region_copy_image.go index 9349d0364..34319ee00 100644 --- a/builder/alicloud/ecs/step_region_copy_image.go +++ b/builder/alicloud/ecs/step_region_copy_image.go @@ -4,8 +4,7 @@ import ( "context" "fmt" - "github.com/denverdino/aliyungo/common" - "github.com/denverdino/aliyungo/ecs" + "github.com/aliyun/alibaba-cloud-sdk-go/services/ecs" "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" ) @@ -20,34 +19,34 @@ func (s *stepRegionCopyAlicloudImage) Run(ctx context.Context, state multistep.S if len(s.AlicloudImageDestinationRegions) == 0 { return multistep.ActionContinue } - client := state.Get("client").(*ecs.Client) - ui := state.Get("ui").(packer.Ui) + + client := state.Get("client").(*ClientWrapper) imageId := state.Get("alicloudimage").(string) alicloudImages := state.Get("alicloudimages").(map[string]string) - region := common.Region(s.RegionId) numberOfName := len(s.AlicloudImageDestinationNames) for index, destinationRegion := range s.AlicloudImageDestinationRegions { if destinationRegion == s.RegionId { continue } + ecsImageName := "" if numberOfName > 0 && index < numberOfName { ecsImageName = s.AlicloudImageDestinationNames[index] } - imageId, err := client.CopyImage( - &ecs.CopyImageArgs{ - RegionId: region, - ImageId: imageId, - DestinationRegionId: common.Region(destinationRegion), - DestinationImageName: ecsImageName, - }) + + copyImageRequest := ecs.CreateCopyImageRequest() + copyImageRequest.RegionId = s.RegionId + copyImageRequest.ImageId = imageId + copyImageRequest.DestinationRegionId = destinationRegion + copyImageRequest.DestinationImageName = ecsImageName + + image, err := client.CopyImage(copyImageRequest) if err != nil { - state.Put("error", err) - ui.Say(fmt.Sprintf("Error copying images: %s", err)) - return multistep.ActionHalt + return halt(state, err, "Error copying images") } - alicloudImages[destinationRegion] = imageId + + alicloudImages[destinationRegion] = image.ImageId } return multistep.ActionContinue } @@ -57,14 +56,18 @@ func (s *stepRegionCopyAlicloudImage) Cleanup(state multistep.StateBag) { _, halted := state.GetOk(multistep.StateHalted) if cancelled || halted { ui := state.Get("ui").(packer.Ui) - client := state.Get("client").(*ecs.Client) + client := state.Get("client").(*ClientWrapper) alicloudImages := state.Get("alicloudimages").(map[string]string) ui.Say(fmt.Sprintf("Stopping copy image because cancellation or error...")) for copiedRegionId, copiedImageId := range alicloudImages { if copiedRegionId == s.RegionId { continue } - if err := client.CancelCopyImage(common.Region(copiedRegionId), copiedImageId); err != nil { + + cancelCopyImageRequest := ecs.CreateCancelCopyImageRequest() + cancelCopyImageRequest.RegionId = copiedRegionId + cancelCopyImageRequest.ImageId = copiedImageId + if _, err := client.CancelCopyImage(cancelCopyImageRequest); err != nil { ui.Say(fmt.Sprintf("Error cancelling copy image: %v", err)) } } diff --git a/builder/alicloud/ecs/step_run_instance.go b/builder/alicloud/ecs/step_run_instance.go index 627df3ed6..559dfff63 100644 --- a/builder/alicloud/ecs/step_run_instance.go +++ b/builder/alicloud/ecs/step_run_instance.go @@ -4,7 +4,8 @@ import ( "context" "fmt" - "github.com/denverdino/aliyungo/ecs" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/services/ecs" "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" ) @@ -13,26 +14,21 @@ type stepRunAlicloudInstance struct { } func (s *stepRunAlicloudInstance) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { - client := state.Get("client").(*ecs.Client) + client := state.Get("client").(*ClientWrapper) ui := state.Get("ui").(packer.Ui) - instance := state.Get("instance").(*ecs.InstanceAttributesType) + instance := state.Get("instance").(*ecs.Instance) - err := client.StartInstance(instance.InstanceId) - if err != nil { - err := fmt.Errorf("Error starting instance: %s", err) - state.Put("error", err) - ui.Error(err.Error()) - return multistep.ActionHalt + startInstanceRequest := ecs.CreateStartInstanceRequest() + startInstanceRequest.InstanceId = instance.InstanceId + if _, err := client.StartInstance(startInstanceRequest); err != nil { + return halt(state, err, "Error starting instance") } ui.Say(fmt.Sprintf("Starting instance: %s", instance.InstanceId)) - err = client.WaitForInstance(instance.InstanceId, ecs.Running, ALICLOUD_DEFAULT_TIMEOUT) + _, err := client.WaitForInstanceStatus(instance.RegionId, instance.InstanceId, InstanceStatusRunning) if err != nil { - err := fmt.Errorf("Timeout waiting for instance to start: %s", err) - state.Put("error", err) - ui.Error(err.Error()) - return multistep.ActionHalt + return halt(state, err, "Timeout waiting for instance to start") } return multistep.ActionContinue @@ -41,19 +37,36 @@ func (s *stepRunAlicloudInstance) Run(ctx context.Context, state multistep.State func (s *stepRunAlicloudInstance) Cleanup(state multistep.StateBag) { _, cancelled := state.GetOk(multistep.StateCancelled) _, halted := state.GetOk(multistep.StateHalted) - if cancelled || halted { - ui := state.Get("ui").(packer.Ui) - client := state.Get("client").(*ecs.Client) - instance := state.Get("instance").(*ecs.InstanceAttributesType) - instanceAttribute, _ := client.DescribeInstanceAttribute(instance.InstanceId) - if instanceAttribute.Status == ecs.Starting || instanceAttribute.Status == ecs.Running { - if err := client.StopInstance(instance.InstanceId, true); err != nil { - ui.Say(fmt.Sprintf("Error stopping instance %s, it may still be around %s", instance.InstanceId, err)) - return - } - if err := client.WaitForInstance(instance.InstanceId, ecs.Stopped, ALICLOUD_DEFAULT_TIMEOUT); err != nil { - ui.Say(fmt.Sprintf("Error stopping instance %s, it may still be around %s", instance.InstanceId, err)) - } + + if !cancelled && !halted { + return + } + + ui := state.Get("ui").(packer.Ui) + client := state.Get("client").(*ClientWrapper) + instance := state.Get("instance").(*ecs.Instance) + + describeInstancesRequest := ecs.CreateDescribeInstancesRequest() + describeInstancesRequest.InstanceIds = fmt.Sprintf("[\"%s\"]", instance.InstanceId) + instancesResponse, _ := client.DescribeInstances(describeInstancesRequest) + + if len(instancesResponse.Instances.Instance) == 0 { + return + } + + instanceAttribute := instancesResponse.Instances.Instance[0] + if instanceAttribute.Status == InstanceStatusStarting || instanceAttribute.Status == InstanceStatusRunning { + stopInstanceRequest := ecs.CreateStopInstanceRequest() + stopInstanceRequest.InstanceId = instance.InstanceId + stopInstanceRequest.ForceStop = requests.NewBoolean(true) + if _, err := client.StopInstance(stopInstanceRequest); err != nil { + ui.Say(fmt.Sprintf("Error stopping instance %s, it may still be around %s", instance.InstanceId, err)) + return + } + + _, err := client.WaitForInstanceStatus(instance.RegionId, instance.InstanceId, InstanceStatusStopped) + if err != nil { + ui.Say(fmt.Sprintf("Error stopping instance %s, it may still be around %s", instance.InstanceId, err)) } } } diff --git a/builder/alicloud/ecs/step_share_image.go b/builder/alicloud/ecs/step_share_image.go index 178cf50d7..7a4f6b675 100644 --- a/builder/alicloud/ecs/step_share_image.go +++ b/builder/alicloud/ecs/step_share_image.go @@ -4,8 +4,7 @@ import ( "context" "fmt" - "github.com/denverdino/aliyungo/common" - "github.com/denverdino/aliyungo/ecs" + "github.com/aliyun/alibaba-cloud-sdk-go/services/ecs" "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" ) @@ -17,21 +16,18 @@ type stepShareAlicloudImage struct { } func (s *stepShareAlicloudImage) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { - client := state.Get("client").(*ecs.Client) - ui := state.Get("ui").(packer.Ui) + client := state.Get("client").(*ClientWrapper) alicloudImages := state.Get("alicloudimages").(map[string]string) - for copiedRegion, copiedImageId := range alicloudImages { - err := client.ModifyImageSharePermission( - &ecs.ModifyImageSharePermissionArgs{ - RegionId: common.Region(copiedRegion), - ImageId: copiedImageId, - AddAccount: s.AlicloudImageShareAccounts, - RemoveAccount: s.AlicloudImageUNShareAccounts, - }) - if err != nil { - state.Put("error", err) - ui.Say(fmt.Sprintf("Failed modifying image share permissions: %s", err)) - return multistep.ActionHalt + + for regionId, imageId := range alicloudImages { + modifyImageShareRequest := ecs.CreateModifyImageSharePermissionRequest() + modifyImageShareRequest.RegionId = regionId + modifyImageShareRequest.ImageId = imageId + modifyImageShareRequest.AddAccount = &s.AlicloudImageShareAccounts + modifyImageShareRequest.RemoveAccount = &s.AlicloudImageUNShareAccounts + + if _, err := client.ModifyImageSharePermission(modifyImageShareRequest); err != nil { + return halt(state, err, "Failed modifying image share permissions") } } return multistep.ActionContinue @@ -40,22 +36,25 @@ func (s *stepShareAlicloudImage) Run(ctx context.Context, state multistep.StateB func (s *stepShareAlicloudImage) Cleanup(state multistep.StateBag) { _, cancelled := state.GetOk(multistep.StateCancelled) _, halted := state.GetOk(multistep.StateHalted) - if cancelled || halted { - ui := state.Get("ui").(packer.Ui) - client := state.Get("client").(*ecs.Client) - alicloudImages := state.Get("alicloudimages").(map[string]string) - ui.Say("Restoring image share permission because cancellations or error...") - for copiedRegion, copiedImageId := range alicloudImages { - err := client.ModifyImageSharePermission( - &ecs.ModifyImageSharePermissionArgs{ - RegionId: common.Region(copiedRegion), - ImageId: copiedImageId, - AddAccount: s.AlicloudImageUNShareAccounts, - RemoveAccount: s.AlicloudImageShareAccounts, - }) - if err != nil { - ui.Say(fmt.Sprintf("Restoring image share permission failed: %s", err)) - } + + if !cancelled && !halted { + return + } + + ui := state.Get("ui").(packer.Ui) + client := state.Get("client").(*ClientWrapper) + alicloudImages := state.Get("alicloudimages").(map[string]string) + + ui.Say("Restoring image share permission because cancellations or error...") + + for regionId, imageId := range alicloudImages { + modifyImageShareRequest := ecs.CreateModifyImageSharePermissionRequest() + modifyImageShareRequest.RegionId = regionId + modifyImageShareRequest.ImageId = imageId + modifyImageShareRequest.AddAccount = &s.AlicloudImageUNShareAccounts + modifyImageShareRequest.RemoveAccount = &s.AlicloudImageShareAccounts + if _, err := client.ModifyImageSharePermission(modifyImageShareRequest); err != nil { + ui.Say(fmt.Sprintf("Restoring image share permission failed: %s", err)) } } } diff --git a/builder/alicloud/ecs/step_stop_instance.go b/builder/alicloud/ecs/step_stop_instance.go index 6a4a2b4f0..f7d561cf9 100644 --- a/builder/alicloud/ecs/step_stop_instance.go +++ b/builder/alicloud/ecs/step_stop_instance.go @@ -3,8 +3,11 @@ package ecs import ( "context" "fmt" + "strconv" - "github.com/denverdino/aliyungo/ecs" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + + "github.com/aliyun/alibaba-cloud-sdk-go/services/ecs" "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" ) @@ -15,29 +18,26 @@ type stepStopAlicloudInstance struct { } func (s *stepStopAlicloudInstance) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { - client := state.Get("client").(*ecs.Client) - instance := state.Get("instance").(*ecs.InstanceAttributesType) + client := state.Get("client").(*ClientWrapper) + instance := state.Get("instance").(*ecs.Instance) ui := state.Get("ui").(packer.Ui) if !s.DisableStop { ui.Say(fmt.Sprintf("Stopping instance: %s", instance.InstanceId)) - err := client.StopInstance(instance.InstanceId, s.ForceStop) - if err != nil { - err := fmt.Errorf("Error stopping alicloud instance: %s", err) - state.Put("error", err) - ui.Error(err.Error()) - return multistep.ActionHalt + + stopInstanceRequest := ecs.CreateStopInstanceRequest() + stopInstanceRequest.InstanceId = instance.InstanceId + stopInstanceRequest.ForceStop = requests.Boolean(strconv.FormatBool(s.ForceStop)) + if _, err := client.StopInstance(stopInstanceRequest); err != nil { + return halt(state, err, "Error stopping alicloud instance") } } ui.Say(fmt.Sprintf("Waiting instance stopped: %s", instance.InstanceId)) - err := client.WaitForInstance(instance.InstanceId, ecs.Stopped, ALICLOUD_DEFAULT_TIMEOUT) + _, err := client.WaitForInstanceStatus(instance.RegionId, instance.InstanceId, InstanceStatusStopped) if err != nil { - err := fmt.Errorf("Error waiting for alicloud instance to stop: %s", err) - state.Put("error", err) - ui.Error(err.Error()) - return multistep.ActionHalt + return halt(state, err, "Error waiting for alicloud instance to stop") } return multistep.ActionContinue diff --git a/examples/alicloud/basic/alicloud_windows.json b/examples/alicloud/basic/alicloud_windows.json index 70a36a20e..21fd98d64 100644 --- a/examples/alicloud/basic/alicloud_windows.json +++ b/examples/alicloud/basic/alicloud_windows.json @@ -9,7 +9,7 @@ "secret_key":"{{user `secret_key`}}", "region":"cn-beijing", "image_name":"packer_test", - "source_image":"win2008r2_64_ent_sp1_zh-cn_40G_alibase_20170915.vhd", + "source_image":"winsvr_64_dtcC_1809_en-us_40G_alibase_20190318.vhd", "instance_type":"ecs.n1.tiny", "io_optimized":"true", "internet_charge_type":"PayByTraffic", diff --git a/examples/alicloud/basic/alicloud_with_data_disk.json b/examples/alicloud/basic/alicloud_with_data_disk.json index dcc8c70ef..06bcf14e2 100644 --- a/examples/alicloud/basic/alicloud_with_data_disk.json +++ b/examples/alicloud/basic/alicloud_with_data_disk.json @@ -14,7 +14,18 @@ "instance_type":"ecs.n1.tiny", "internet_charge_type":"PayByTraffic", "io_optimized":"true", - "image_disk_mappings":[{"disk_name":"data1","disk_size":20},{"disk_name":"data1","disk_size":20,"disk_device":"/dev/xvdz"}] + "image_disk_mappings":[ + { + "disk_name":"data1", + "disk_size":20, + "disk_delete_with_instance": true + },{ + "disk_name":"data2", + "disk_size":20, + "disk_device":"/dev/xvdz", + "disk_delete_with_instance": true + } + ] }], "provisioners": [{ "type": "shell", diff --git a/go.mod b/go.mod index 75a4d9389..1b370743c 100644 --- a/go.mod +++ b/go.mod @@ -10,6 +10,7 @@ require ( github.com/NaverCloudPlatform/ncloud-sdk-go v0.0.0-20180110055012-c2e73f942591 github.com/Telmate/proxmox-api-go v0.0.0-20190410200643-f08824d5082d github.com/abdullin/seq v0.0.0-20160510034733-d5467c17e7af // indirect + github.com/aliyun/alibaba-cloud-sdk-go v0.0.0-20190418113227-25233c783f4e github.com/aliyun/aliyun-oss-go-sdk v0.0.0-20170113022742-e6dbea820a9f github.com/antchfx/xpath v0.0.0-20170728053731-b5c552e1acbd // indirect github.com/antchfx/xquery v0.0.0-20170730121040-eb8c3c172607 // indirect @@ -21,7 +22,6 @@ require ( github.com/c2h5oh/datasize v0.0.0-20171227191756-4eba002a5eae github.com/cheggaaa/pb v1.0.27 github.com/creack/goselect v0.0.0-20180210034346-528c74964609 // indirect - github.com/denverdino/aliyungo v0.0.0-20190220033614-36e2ae938978 github.com/dgrijalva/jwt-go v3.2.0+incompatible github.com/digitalocean/godo v1.11.1 github.com/dnaeon/go-vcr v1.0.0 // indirect @@ -55,6 +55,7 @@ require ( github.com/hetznercloud/hcloud-go v1.12.0 github.com/hyperonecom/h1-client-go v0.0.0-20190122232013-cf38e8387775 github.com/joyent/triton-go v0.0.0-20180116165742-545edbe0d564 + github.com/json-iterator/go v1.1.6 // indirect github.com/jtolds/gls v4.2.1+incompatible // indirect github.com/kardianos/osext v0.0.0-20170510131534-ae77be60afb1 github.com/klauspost/compress v0.0.0-20160131094358-f86d2e6d8a77 // indirect @@ -78,6 +79,8 @@ require ( github.com/mitchellh/panicwrap v0.0.0-20170106182340-fce601fe5557 github.com/mitchellh/prefixedio v0.0.0-20151214002211-6e6954073784 github.com/mitchellh/reflectwalk v1.0.0 + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.1 // indirect github.com/moul/anonuuid v0.0.0-20160222162117-609b752a95ef // indirect github.com/moul/gotty-client v0.0.0-20180327180212-b26a57ebc215 // indirect github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32 // indirect @@ -108,11 +111,12 @@ require ( golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 golang.org/x/net v0.0.0-20190311183353-d8887717615a golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421 - golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6 + golang.org/x/sync v0.0.0-20190423024810-112230192c58 golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a google.golang.org/api v0.3.1 google.golang.org/grpc v1.19.1 gopkg.in/h2non/gock.v1 v1.0.12 // indirect + gopkg.in/ini.v1 v1.42.0 // indirect gopkg.in/jarcoal/httpmock.v1 v1.0.0-20181117152235-275e9df93516 // indirect gopkg.in/yaml.v2 v2.2.2 // indirect ) diff --git a/go.sum b/go.sum index ad20cc1f9..4409dbd38 100644 --- a/go.sum +++ b/go.sum @@ -12,8 +12,6 @@ dmitri.shuralyov.com/state v0.0.0-20180228185332-28bcc343414c/go.mod h1:0PRwlb0D git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= github.com/1and1/oneandone-cloudserver-sdk-go v1.0.1 h1:RMTyvS5bjvSWiUcfqfr/E2pxHEMrALvU+E12n6biymg= github.com/1and1/oneandone-cloudserver-sdk-go v1.0.1/go.mod h1:61apmbkVJH4kg+38ftT+/l0XxdUCVnHggqcOTqZRSEE= -github.com/Azure/azure-sdk-for-go v17.3.1+incompatible h1:9Nzge8xxnYm5lVRkvTpG1odiDN0fYDorQwVEaVfg1+g= -github.com/Azure/azure-sdk-for-go v17.3.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go v27.3.0+incompatible h1:i+ROfG3CsZUPoVAnhK06T3R6PmBzKB9ds+lHBpN7Mzo= github.com/Azure/azure-sdk-for-go v27.3.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/go-autorest v10.12.0+incompatible h1:6YphwUK+oXbzvCc1fd5VrnxCekwzDkpA7gUEbci2MvI= @@ -35,6 +33,8 @@ github.com/abdullin/seq v0.0.0-20160510034733-d5467c17e7af h1:DBNMBMuMiWYu0b+8KM github.com/abdullin/seq v0.0.0-20160510034733-d5467c17e7af/go.mod h1:5Jv4cbFiHJMsVxt52+i0Ha45fjshj6wxYr1r19tB9bw= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/aliyun/alibaba-cloud-sdk-go v0.0.0-20190418113227-25233c783f4e h1:/8wOj52pewmIX/8d5eVO3t7Rr3astkBI/ruyg4WNqRo= +github.com/aliyun/alibaba-cloud-sdk-go v0.0.0-20190418113227-25233c783f4e/go.mod h1:T9M45xf79ahXVelWoOBmH0y4aC1t5kXO5BxwyakgIGA= github.com/aliyun/aliyun-oss-go-sdk v0.0.0-20170113022742-e6dbea820a9f h1:jI4DIE5Vf4oRaHfthB0oRhU+yuYuoOTurDzwAlskP00= github.com/aliyun/aliyun-oss-go-sdk v0.0.0-20170113022742-e6dbea820a9f/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= @@ -77,8 +77,6 @@ github.com/creack/goselect v0.0.0-20180210034346-528c74964609/go.mod h1:gHrIcH/9 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/denverdino/aliyungo v0.0.0-20190220033614-36e2ae938978 h1:oyfbRmu7YnytN4bXhvJPY1HPgUL52j5AxtgGDU0bMVs= -github.com/denverdino/aliyungo v0.0.0-20190220033614-36e2ae938978/go.mod h1:dV8lFg6daOBZbT6/BDGIz6Y3WFGn8juu6G+CQ6LHtl0= github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/digitalocean/godo v1.11.1 h1:OsTh37YFKk+g6DnAOrkXJ9oDArTkRx5UTkBJ2EWAO38= @@ -216,6 +214,8 @@ github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5i github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/joyent/triton-go v0.0.0-20180116165742-545edbe0d564 h1:+HMa2xWQOm+9ebsl0+XsuLaPuFCxExv3sCXo5psVzYI= github.com/joyent/triton-go v0.0.0-20180116165742-545edbe0d564/go.mod h1:U+RSyWxWd04xTqnuOQxnai7XGS2PrPY2cfGoDKtMHjA= +github.com/json-iterator/go v1.1.6 h1:MrUvLMLTMxbqFJ9kzlvat/rYZqZnW3u4wkLzWTaFwKs= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/jtolds/gls v4.2.1+incompatible h1:fSuqC+Gmlu6l/ZYAoZzx2pyucC8Xza35fpRVWLVmUEE= github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= @@ -288,6 +288,10 @@ github.com/mitchellh/prefixedio v0.0.0-20151214002211-6e6954073784 h1:+DAetXqxv/ github.com/mitchellh/prefixedio v0.0.0-20151214002211-6e6954073784/go.mod h1:kB1naBgV9ORnkiTVeyJOI1DavaJkG4oNIq0Af6ZVKUo= github.com/mitchellh/reflectwalk v1.0.0 h1:9D+8oIskB4VJBN5SFlmc27fSlIBZaov1Wpk/IfikLNY= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/moul/anonuuid v0.0.0-20160222162117-609b752a95ef h1:E/seV1Rtsnr2juBw1Dfz4iDPT3/5s1H/BATx+ePmSyo= github.com/moul/anonuuid v0.0.0-20160222162117-609b752a95ef/go.mod h1:LgKrp0Iss/BVwquptq4eIe6HPr0s3t1WHT5x0qOh14U= github.com/moul/gotty-client v0.0.0-20180327180212-b26a57ebc215 h1:y6FZWUBBt1iPmJyGbGza3ncvVBMKzgd32oFChRZR7Do= @@ -416,8 +420,6 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3 h1:KYQXGkl6vs02hK7pK4eIbw0NpNPedieTSTEiJ//bwGs= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 h1:mKdxBk7AujPs8kU4m80U72y/zjbZ3UcXC7dClwKbUI0= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -454,6 +456,8 @@ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FY golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6 h1:bjcUS9ztw9kFmmIxJInhon/0Is3p+EHBKNgquIzo1OI= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -466,8 +470,6 @@ golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181213200352-4d1cda033e06/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181218192612-074acd46bca6 h1:MXtOG7w2ND9qNCUZSDBGll/SpVIq7ftozR9I8/JGBHY= -golang.org/x/sys v0.0.0-20181218192612-074acd46bca6/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= @@ -521,6 +523,8 @@ gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMy gopkg.in/h2non/gock.v1 v1.0.12 h1:o3JJqe+h7R9Ay6LtMeFrKz1WnokrJDrNpDQs9KGqVn8= gopkg.in/h2non/gock.v1 v1.0.12/go.mod h1:KHI4Z1sxDW6P4N3DfTWSEza07YpkQP7KJBfglRMEjKY= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/ini.v1 v1.42.0 h1:7N3gPTt50s8GuLortA00n8AqRTk75qOP98+mTPpgzRk= +gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/jarcoal/httpmock.v1 v1.0.0-20181117152235-275e9df93516 h1:H6trpavCIuipdInWrab8l34Mf+GGVfphniHostMdMaQ= gopkg.in/jarcoal/httpmock.v1 v1.0.0-20181117152235-275e9df93516/go.mod h1:d3R+NllX3X5e0zlG1Rful3uLvsGC/Q3OHut5464DEQw= gopkg.in/resty.v1 v1.12.0 h1:CuXP0Pjfw9rOuY6EP+UvtNvt5DSqHpIxILZKT/quCZI= diff --git a/post-processor/alicloud-import/post-processor.go b/post-processor/alicloud-import/post-processor.go index 0c1786bed..bb518a8c1 100644 --- a/post-processor/alicloud-import/post-processor.go +++ b/post-processor/alicloud-import/post-processor.go @@ -3,15 +3,17 @@ package alicloudimport import ( "context" "fmt" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "log" "strconv" "strings" "time" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" + "github.com/aliyun/alibaba-cloud-sdk-go/services/ecs" + "github.com/aliyun/alibaba-cloud-sdk-go/services/ram" "github.com/aliyun/aliyun-oss-go-sdk/oss" - packercommon "github.com/denverdino/aliyungo/common" - "github.com/denverdino/aliyungo/ecs" - "github.com/denverdino/aliyungo/ram" packerecs "github.com/hashicorp/packer/builder/alicloud/ecs" "github.com/hashicorp/packer/common" "github.com/hashicorp/packer/helper/config" @@ -20,12 +22,20 @@ import ( ) const ( - BuilderId = "packer.post-processor.alicloud-import" - OSSSuffix = "oss-" - RAWFileFormat = "raw" - VHDFileFormat = "vhd" - BUSINESSINFO = "packer" - AliyunECSImageImportDefaultRolePolicy = `{ + Packer = "HashiCorp-Packer" + BuilderId = "packer.post-processor.alicloud-import" + OSSSuffix = "oss-" + RAWFileFormat = "raw" + VHDFileFormat = "vhd" +) + +const ( + PolicyTypeSystem = "System" + NoSetRoleError = "NoSetRoletoECSServiceAcount" + RoleNotExistError = "EntityNotExist.Role" + DefaultImportRoleName = "AliyunECSImageImportDefaultRole" + DefaultImportPolicyName = "AliyunECSImageImportRolePolicy" + DefaultImportRolePolicy = `{ "Statement": [ { "Action": "sts:AssumeRole", @@ -52,7 +62,6 @@ type Config struct { SkipClean bool `mapstructure:"skip_clean"` Tags map[string]string `mapstructure:"tags"` AlicloudImageName string `mapstructure:"image_name"` - AlicloudImageVersion string `mapstructure:"image_version"` AlicloudImageDescription string `mapstructure:"image_description"` AlicloudImageShareAccounts []string `mapstructure:"image_share_account"` AlicloudImageDestinationRegions []string `mapstructure:"image_copy_regions"` @@ -69,6 +78,9 @@ type Config struct { type PostProcessor struct { config Config DiskDeviceMapping []ecs.DiskDeviceMapping + + ossClient *oss.Client + ramClient *ram.Client } // Entry point for configuration parsing when we've defined @@ -130,9 +142,10 @@ func (p *PostProcessor) PostProcess(ctx context.Context, ui packer.Ui, artifact if p.config.OSSKey == "" { p.config.OSSKey = "Packer_" + strconv.Itoa(time.Now().Nanosecond()) } - log.Printf("Rendered oss_key_name as %s", p.config.OSSKey) - log.Println("Looking for RAW or VHD in artifact") + ui.Say(fmt.Sprintf("Rendered oss_key_name as %s", p.config.OSSKey)) + ui.Say("Looking for RAW or VHD in artifact") + // Locate the files output from the builder source := "" for _, path := range artifact.Files() { @@ -151,163 +164,102 @@ func (p *PostProcessor) PostProcess(ctx context.Context, ui packer.Ui, artifact if err != nil { return nil, false, false, fmt.Errorf("Failed to connect alicloud ecs %s", err) } - ecsClient.SetBusinessInfo(BUSINESSINFO) - images, _, err := ecsClient.DescribeImages(&ecs.DescribeImagesArgs{ - RegionId: packercommon.Region(p.config.AlicloudRegion), - ImageName: p.config.AlicloudImageName, - }) + endpoint := getEndPoint(p.config.AlicloudRegion, p.config.OSSBucket) + + describeImagesRequest := ecs.CreateDescribeImagesRequest() + describeImagesRequest.RegionId = p.config.AlicloudRegion + describeImagesRequest.ImageName = p.config.AlicloudImageName + imagesResponse, err := ecsClient.DescribeImages(describeImagesRequest) if err != nil { - return nil, false, false, fmt.Errorf("Failed to start import from %s/%s: %s", - getEndPonit(p.config.OSSBucket), p.config.OSSKey, err) + return nil, false, false, fmt.Errorf("Failed to start import from %s/%s: %s", endpoint, p.config.OSSKey, err) } + images := imagesResponse.Images.Image if len(images) > 0 && !p.config.AlicloudImageForceDelete { return nil, false, false, fmt.Errorf("Duplicated image exists, please delete the existing images " + "or set the 'image_force_delete' value as true") } - // Set up the OSS client - log.Println("Creating OSS Client") - client, err := oss.New(getEndPonit(p.config.AlicloudRegion), p.config.AlicloudAccessKey, - p.config.AlicloudSecretKey) - if err != nil { - return nil, false, false, fmt.Errorf("Creating oss connection failed: %s", err) - } - bucket, err := queryOrCreateBucket(p.config.OSSBucket, client) + bucket, err := p.queryOrCreateBucket(p.config.OSSBucket) if err != nil { return nil, false, false, fmt.Errorf("Failed to query or create bucket %s: %s", p.config.OSSBucket, err) } - if err != nil { - return nil, false, false, fmt.Errorf("Failed to open %s: %s", source, err) - } + ui.Say(fmt.Sprintf("Waiting for uploading file %s to %s/%s...", source, endpoint, p.config.OSSKey)) err = bucket.PutObjectFromFile(p.config.OSSKey, source) if err != nil { return nil, false, false, fmt.Errorf("Failed to upload image %s: %s", source, err) } + + ui.Say(fmt.Sprintf("Image file %s has been uploaded to OSS", source)) + if len(images) > 0 && p.config.AlicloudImageForceDelete { - if err = ecsClient.DeleteImage(packercommon.Region(p.config.AlicloudRegion), - images[0].ImageId); err != nil { + deleteImageRequest := ecs.CreateDeleteImageRequest() + deleteImageRequest.RegionId = p.config.AlicloudRegion + deleteImageRequest.ImageId = images[0].ImageId + _, err := ecsClient.DeleteImage(deleteImageRequest) + if err != nil { return nil, false, false, fmt.Errorf("Delete duplicated image %s failed", images[0].ImageName) } } - diskDeviceMapping := ecs.DiskDeviceMapping{ - Size: p.config.Size, - Format: p.config.Format, - OSSBucket: p.config.OSSBucket, - OSSObject: p.config.OSSKey, - } - imageImageArgs := &ecs.ImportImageArgs{ - RegionId: packercommon.Region(p.config.AlicloudRegion), - ImageName: p.config.AlicloudImageName, - ImageVersion: p.config.AlicloudImageVersion, - Description: p.config.AlicloudImageDescription, - Architecture: p.config.Architecture, - OSType: p.config.OSType, - Platform: p.config.Platform, - } - imageImageArgs.DiskDeviceMappings.DiskDeviceMapping = []ecs.DiskDeviceMapping{ - diskDeviceMapping, - } - imageId, err := ecsClient.ImportImage(imageImageArgs) - + importImageRequest := p.buildImportImageRequest() + importImageResponse, err := ecsClient.ImportImage(importImageRequest) if err != nil { - e, _ := err.(*packercommon.Error) - if e.Code == "NoSetRoletoECSServiceAccount" { - ramClient := ram.NewClient(p.config.AlicloudAccessKey, p.config.AlicloudSecretKey) - roleResponse, err := ramClient.GetRole(ram.RoleQueryRequest{ - RoleName: "AliyunECSImageImportDefaultRole", - }) - if err != nil { - return nil, false, false, fmt.Errorf("Failed to start import from %s/%s: %s", - getEndPonit(p.config.OSSBucket), p.config.OSSKey, err) - } - if roleResponse.Role.RoleId == "" { - if _, err = ramClient.CreateRole(ram.RoleRequest{ - RoleName: "AliyunECSImageImportDefaultRole", - AssumeRolePolicyDocument: AliyunECSImageImportDefaultRolePolicy, - }); err != nil { - return nil, false, false, fmt.Errorf("Failed to start import from %s/%s: %s", - getEndPonit(p.config.OSSBucket), p.config.OSSKey, err) - } - if _, err := ramClient.AttachPolicyToRole(ram.AttachPolicyToRoleRequest{ - PolicyRequest: ram.PolicyRequest{ - PolicyName: "AliyunECSImageImportRolePolicy", - PolicyType: "System", - }, - RoleName: "AliyunECSImageImportDefaultRole", - }); err != nil { - return nil, false, false, fmt.Errorf("Failed to start import from %s/%s: %s", - getEndPonit(p.config.OSSBucket), p.config.OSSKey, err) - } - } else { - policyListResponse, err := ramClient.ListPoliciesForRole(ram.RoleQueryRequest{ - RoleName: "AliyunECSImageImportDefaultRole", - }) - if err != nil { - return nil, false, false, fmt.Errorf("Failed to start import from %s/%s: %s", - getEndPonit(p.config.OSSBucket), p.config.OSSKey, err) - } - isAliyunECSImageImportRolePolicyNotExit := true - for _, policy := range policyListResponse.Policies.Policy { - if policy.PolicyName == "AliyunECSImageImportRolePolicy" && - policy.PolicyType == "System" { - isAliyunECSImageImportRolePolicyNotExit = false - break - } - } - if isAliyunECSImageImportRolePolicyNotExit { - if _, err := ramClient.AttachPolicyToRole(ram.AttachPolicyToRoleRequest{ - PolicyRequest: ram.PolicyRequest{ - PolicyName: "AliyunECSImageImportRolePolicy", - PolicyType: "System", - }, - RoleName: "AliyunECSImageImportDefaultRole", - }); err != nil { - return nil, false, false, fmt.Errorf("Failed to start import from %s/%s: %s", - getEndPonit(p.config.OSSBucket), p.config.OSSKey, err) - } - } - if _, err = ramClient.UpdateRole( - ram.UpdateRoleRequest{ - RoleName: "AliyunECSImageImportDefaultRole", - NewAssumeRolePolicyDocument: AliyunECSImageImportDefaultRolePolicy, - }); err != nil { - return nil, false, false, fmt.Errorf("Failed to start import from %s/%s: %s", - getEndPonit(p.config.OSSBucket), p.config.OSSKey, err) - } - } - for i := 10; i > 0; i = i - 1 { - imageId, err = ecsClient.ImportImage(imageImageArgs) - if err != nil { - e, _ = err.(*packercommon.Error) - if e.Code == "NoSetRoletoECSServiceAccount" { - time.Sleep(5 * time.Second) - continue - } else if e.Code == "ImageIsImporting" || - e.Code == "InvalidImageName.Duplicated" { - break - } - return nil, false, false, fmt.Errorf("Failed to start import from %s/%s: %s", - getEndPonit(p.config.OSSBucket), p.config.OSSKey, err) - } - break - } - - } else { - - return nil, false, false, fmt.Errorf("Failed to start import from %s/%s: %s", - getEndPonit(p.config.OSSBucket), p.config.OSSKey, err) + e, ok := err.(errors.Error) + if !ok || e.ErrorCode() != NoSetRoleError { + return nil, false, false, fmt.Errorf("Failed to start import from %s/%s: %s", endpoint, p.config.OSSKey, err) } + + ui.Say("initialize ram role for importing image") + if err := p.prepareImportRole(); err != nil { + return nil, false, false, fmt.Errorf("Failed to start import from %s/%s: %s", endpoint, p.config.OSSKey, err) + } + + acsResponse, err := ecsClient.WaitForExpected(&packerecs.WaitForExpectArgs{ + RequestFunc: func() (responses.AcsResponse, error) { + return ecsClient.ImportImage(importImageRequest) + }, + EvalFunc: func(response responses.AcsResponse, err error) packerecs.WaitForExpectEvalResult { + if err == nil { + return packerecs.WaitForExpectSuccess + } + + e, ok = err.(errors.Error) + if ok && packerecs.ContainsInArray([]string{ + "ImageIsImporting", + "InvalidImageName.Duplicated", + }, e.ErrorCode()) { + return packerecs.WaitForExpectSuccess + } + + if ok && e.ErrorCode() != NoSetRoleError { + return packerecs.WaitForExpectFailToStop + } + + return packerecs.WaitForExpectToRetry + }, + }) + + if err != nil { + return nil, false, false, fmt.Errorf("Failed to start import from %s/%s: %s", endpoint, p.config.OSSKey, err) + } + + importImageResponse = acsResponse.(*ecs.ImportImageResponse) + } + + imageId := importImageResponse.ImageId + + ui.Say(fmt.Sprintf("Waiting for importing %s/%s to alicloud...", endpoint, p.config.OSSKey)) + _, err = ecsClient.WaitForImageStatus(p.config.AlicloudRegion, imageId, packerecs.ImageStatusAvailable, time.Duration(packerecs.ALICLOUD_DEFAULT_LONG_TIMEOUT)*time.Second) + if err != nil { + return nil, false, false, fmt.Errorf("Import image %s failed: %s", imageId, err) } - err = ecsClient.WaitForImageReady(packercommon.Region(p.config.AlicloudRegion), - imageId, packerecs.ALICLOUD_DEFAULT_LONG_TIMEOUT) // Add the reported Alicloud image ID to the artifact list - log.Printf("Importing created alicloud image ID %s in region %s Finished.", imageId, p.config.AlicloudRegion) + ui.Say(fmt.Sprintf("Importing created alicloud image ID %s in region %s Finished.", imageId, p.config.AlicloudRegion)) artifact = &packerecs.Artifact{ AlicloudImages: map[string]string{ p.config.AlicloudRegion: imageId, @@ -317,29 +269,49 @@ func (p *PostProcessor) PostProcess(ctx context.Context, ui packer.Ui, artifact } if !p.config.SkipClean { - ui.Message(fmt.Sprintf("Deleting import source %s/%s/%s", - getEndPonit(p.config.AlicloudRegion), p.config.OSSBucket, p.config.OSSKey)) + ui.Message(fmt.Sprintf("Deleting import source %s/%s/%s", endpoint, p.config.OSSBucket, p.config.OSSKey)) if err = bucket.DeleteObject(p.config.OSSKey); err != nil { - return nil, false, false, fmt.Errorf("Failed to delete %s/%s/%s: %s", - getEndPonit(p.config.AlicloudRegion), p.config.OSSBucket, p.config.OSSKey, err) + return nil, false, false, fmt.Errorf("Failed to delete %s/%s/%s: %s", endpoint, p.config.OSSBucket, p.config.OSSKey, err) } } return artifact, false, false, nil } -func queryOrCreateBucket(bucketName string, client *oss.Client) (*oss.Bucket, error) { - isExist, err := client.IsBucketExist(bucketName) +func (p *PostProcessor) getOssClient() *oss.Client { + if p.ossClient == nil { + log.Println("Creating OSS Client") + ossClient, _ := oss.New(getEndPoint(p.config.AlicloudRegion, ""), p.config.AlicloudAccessKey, + p.config.AlicloudSecretKey) + p.ossClient = ossClient + } + + return p.ossClient +} + +func (p *PostProcessor) getRamClient() *ram.Client { + if p.ramClient == nil { + ramClient, _ := ram.NewClientWithAccessKey(p.config.AlicloudRegion, p.config.AlicloudAccessKey, p.config.AlicloudSecretKey) + p.ramClient = ramClient + } + + return p.ramClient +} + +func (p *PostProcessor) queryOrCreateBucket(bucketName string) (*oss.Bucket, error) { + ossClient := p.getOssClient() + + isExist, err := ossClient.IsBucketExist(bucketName) if err != nil { return nil, err } if !isExist { - err = client.CreateBucket(bucketName) + err = ossClient.CreateBucket(bucketName) if err != nil { return nil, err } } - bucket, err := client.Bucket(bucketName) + bucket, err := ossClient.Bucket(bucketName) if err != nil { return nil, err } @@ -347,21 +319,128 @@ func queryOrCreateBucket(bucketName string, client *oss.Client) (*oss.Bucket, er } -func getEndPonit(region string) string { - return "https://" + GetOSSRegion(region) + ".aliyuncs.com" +func (p *PostProcessor) prepareImportRole() error { + ramClient := p.getRamClient() + + getRoleRequest := ram.CreateGetRoleRequest() + getRoleRequest.SetScheme(requests.HTTPS) + getRoleRequest.RoleName = DefaultImportRoleName + _, err := ramClient.GetRole(getRoleRequest) + if err == nil { + if e := p.updateOrAttachPolicy(); e != nil { + return e + } + + return nil + } + + e, ok := err.(errors.Error) + if !ok || e.ErrorCode() != RoleNotExistError { + return e + } + + if err := p.createRoleAndAttachPolicy(); err != nil { + return err + } + + time.Sleep(1 * time.Minute) + return nil } -func GetOSSRegion(region string) string { +func (p *PostProcessor) updateOrAttachPolicy() error { + ramClient := p.getRamClient() + + listPoliciesForRoleRequest := ram.CreateListPoliciesForRoleRequest() + listPoliciesForRoleRequest.SetScheme(requests.HTTPS) + listPoliciesForRoleRequest.RoleName = DefaultImportRoleName + policyListResponse, err := p.ramClient.ListPoliciesForRole(listPoliciesForRoleRequest) + if err != nil { + return fmt.Errorf("Failed to list policies: %s", err) + } + + rolePolicyExists := false + for _, policy := range policyListResponse.Policies.Policy { + if policy.PolicyName == DefaultImportPolicyName && policy.PolicyType == PolicyTypeSystem { + rolePolicyExists = true + break + } + } + + if rolePolicyExists { + updateRoleRequest := ram.CreateUpdateRoleRequest() + updateRoleRequest.SetScheme(requests.HTTPS) + updateRoleRequest.RoleName = DefaultImportRoleName + updateRoleRequest.NewAssumeRolePolicyDocument = DefaultImportRolePolicy + if _, err := ramClient.UpdateRole(updateRoleRequest); err != nil { + return fmt.Errorf("Failed to update role policy: %s", err) + } + } else { + attachPolicyToRoleRequest := ram.CreateAttachPolicyToRoleRequest() + attachPolicyToRoleRequest.SetScheme(requests.HTTPS) + attachPolicyToRoleRequest.PolicyName = DefaultImportPolicyName + attachPolicyToRoleRequest.PolicyType = PolicyTypeSystem + attachPolicyToRoleRequest.RoleName = DefaultImportRoleName + if _, err := ramClient.AttachPolicyToRole(attachPolicyToRoleRequest); err != nil { + return fmt.Errorf("Failed to attach role policy: %s", err) + } + } + + return nil +} + +func (p *PostProcessor) createRoleAndAttachPolicy() error { + ramClient := p.getRamClient() + + createRoleRequest := ram.CreateCreateRoleRequest() + createRoleRequest.SetScheme(requests.HTTPS) + createRoleRequest.RoleName = DefaultImportRoleName + createRoleRequest.AssumeRolePolicyDocument = DefaultImportRolePolicy + if _, err := ramClient.CreateRole(createRoleRequest); err != nil { + return fmt.Errorf("Failed to create role: %s", err) + } + + attachPolicyToRoleRequest := ram.CreateAttachPolicyToRoleRequest() + attachPolicyToRoleRequest.SetScheme(requests.HTTPS) + attachPolicyToRoleRequest.PolicyName = DefaultImportPolicyName + attachPolicyToRoleRequest.PolicyType = PolicyTypeSystem + attachPolicyToRoleRequest.RoleName = DefaultImportRoleName + if _, err := ramClient.AttachPolicyToRole(attachPolicyToRoleRequest); err != nil { + return fmt.Errorf("Failed to attach policy: %s", err) + } + return nil +} + +func (p *PostProcessor) buildImportImageRequest() *ecs.ImportImageRequest { + request := ecs.CreateImportImageRequest() + request.RegionId = p.config.AlicloudRegion + request.ImageName = p.config.AlicloudImageName + request.Description = p.config.AlicloudImageDescription + request.Architecture = p.config.Architecture + request.OSType = p.config.OSType + request.Platform = p.config.Platform + request.DiskDeviceMapping = &[]ecs.ImportImageDiskDeviceMapping{ + { + DiskImageSize: p.config.Size, + Format: p.config.Format, + OSSBucket: p.config.OSSBucket, + OSSObject: p.config.OSSKey, + }, + } + + return request +} + +func getEndPoint(region string, bucket string) string { + if bucket != "" { + return "https://" + bucket + "." + getOSSRegion(region) + ".aliyuncs.com" + } + + return "https://" + getOSSRegion(region) + ".aliyuncs.com" +} + +func getOSSRegion(region string) string { if strings.HasPrefix(region, OSSSuffix) { return region } return OSSSuffix + region } - -func GetECSRegion(region string) string { - if strings.HasPrefix(region, OSSSuffix) { - return strings.TrimSuffix(region, OSSSuffix) - } - return region - -} diff --git a/vendor/github.com/denverdino/aliyungo/LICENSE.txt b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/LICENSE similarity index 93% rename from vendor/github.com/denverdino/aliyungo/LICENSE.txt rename to vendor/github.com/aliyun/alibaba-cloud-sdk-go/LICENSE index 918297133..261eeb9e9 100644 --- a/vendor/github.com/denverdino/aliyungo/LICENSE.txt +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/LICENSE @@ -1,7 +1,6 @@ - Apache License Version 2.0, January 2004 - https://www.apache.org/licenses/ + http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION @@ -176,13 +175,24 @@ END OF TERMS AND CONDITIONS - Copyright 2015-2015 Li Yi (denverdino@gmail.com). + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] 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 - https://www.apache.org/licenses/LICENSE-2.0 + 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, diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credential.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credential.go new file mode 100644 index 000000000..7f20b7a40 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credential.go @@ -0,0 +1,18 @@ +/* + * 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. + */ + +package auth + +type Credential interface { +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/access_key_credential.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/access_key_credential.go new file mode 100644 index 000000000..68f822633 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/access_key_credential.go @@ -0,0 +1,34 @@ +package credentials + +// Deprecated: Use AccessKeyCredential in this package instead. +type BaseCredential struct { + AccessKeyId string + AccessKeySecret string +} + +type AccessKeyCredential struct { + AccessKeyId string + AccessKeySecret string +} + +// Deprecated: Use NewAccessKeyCredential in this package instead. +func NewBaseCredential(accessKeyId, accessKeySecret string) *BaseCredential { + return &BaseCredential{ + AccessKeyId: accessKeyId, + AccessKeySecret: accessKeySecret, + } +} + +func (baseCred *BaseCredential) ToAccessKeyCredential() *AccessKeyCredential { + return &AccessKeyCredential{ + AccessKeyId: baseCred.AccessKeyId, + AccessKeySecret: baseCred.AccessKeySecret, + } +} + +func NewAccessKeyCredential(accessKeyId, accessKeySecret string) *AccessKeyCredential { + return &AccessKeyCredential{ + AccessKeyId: accessKeyId, + AccessKeySecret: accessKeySecret, + } +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/bearer_token_credential.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/bearer_token_credential.go new file mode 100644 index 000000000..6d4763e66 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/bearer_token_credential.go @@ -0,0 +1,12 @@ +package credentials + +type BearerTokenCredential struct { + BearerToken string +} + +// NewBearerTokenCredential return a BearerTokenCredential object +func NewBearerTokenCredential(token string) *BearerTokenCredential { + return &BearerTokenCredential{ + BearerToken: token, + } +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/ecs_ram_role.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/ecs_ram_role.go new file mode 100644 index 000000000..55a5c2da0 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/ecs_ram_role.go @@ -0,0 +1,29 @@ +package credentials + +func (oldCred *StsRoleNameOnEcsCredential) ToEcsRamRoleCredential() *EcsRamRoleCredential { + return &EcsRamRoleCredential{ + RoleName: oldCred.RoleName, + } +} + +type EcsRamRoleCredential struct { + RoleName string +} + +func NewEcsRamRoleCredential(roleName string) *EcsRamRoleCredential { + return &EcsRamRoleCredential{ + RoleName: roleName, + } +} + +// Deprecated: Use EcsRamRoleCredential in this package instead. +type StsRoleNameOnEcsCredential struct { + RoleName string +} + +// Deprecated: Use NewEcsRamRoleCredential in this package instead. +func NewStsRoleNameOnEcsCredential(roleName string) *StsRoleNameOnEcsCredential { + return &StsRoleNameOnEcsCredential{ + RoleName: roleName, + } +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/env.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/env.go new file mode 100644 index 000000000..3cd0d020a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/env.go @@ -0,0 +1,30 @@ +package provider + +import ( + "errors" + "os" + + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials" + + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth" +) + +type EnvProvider struct{} + +var ProviderEnv = new(EnvProvider) + +func NewEnvProvider() Provider { + return &EnvProvider{} +} + +func (p *EnvProvider) Resolve() (auth.Credential, error) { + accessKeyID, ok1 := os.LookupEnv(ENVAccessKeyID) + accessKeySecret, ok2 := os.LookupEnv(ENVAccessKeySecret) + if !ok1 || !ok2 { + return nil, nil + } + if accessKeyID == "" || accessKeySecret == "" { + return nil, errors.New("Environmental variable (ALIBABACLOUD_ACCESS_KEY_ID or ALIBABACLOUD_ACCESS_KEY_SECRET) is empty") + } + return credentials.NewAccessKeyCredential(accessKeyID, accessKeySecret), nil +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/instance_credentials.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/instance_credentials.go new file mode 100644 index 000000000..1906d21f6 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/instance_credentials.go @@ -0,0 +1,92 @@ +package provider + +import ( + "encoding/json" + "errors" + "fmt" + "io/ioutil" + "net/http" + "os" + "time" + + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials" +) + +var securityCredURL = "http://100.100.100.200/latest/meta-data/ram/security-credentials/" + +type InstanceCredentialsProvider struct{} + +var ProviderInstance = new(InstanceCredentialsProvider) + +var HookGet = func(fn func(string) (int, []byte, error)) func(string) (int, []byte, error) { + return fn +} + +func NewInstanceCredentialsProvider() Provider { + return &InstanceCredentialsProvider{} +} + +func (p *InstanceCredentialsProvider) Resolve() (auth.Credential, error) { + roleName, ok := os.LookupEnv(ENVEcsMetadata) + if !ok { + return nil, nil + } + if roleName == "" { + return nil, errors.New("Environmental variable 'ALIBABA_CLOUD_ECS_METADATA' are empty") + } + status, content, err := HookGet(get)(securityCredURL + roleName) + if err != nil { + return nil, err + } + if status != 200 { + if status == 404 { + return nil, fmt.Errorf("The role was not found in the instance") + } + return nil, fmt.Errorf("Received %d when getting security credentials for %s", status, roleName) + } + body := make(map[string]interface{}) + + if err := json.Unmarshal(content, &body); err != nil { + return nil, err + } + + accessKeyID, err := extractString(body, "AccessKeyId") + if err != nil { + return nil, err + } + accessKeySecret, err := extractString(body, "AccessKeySecret") + if err != nil { + return nil, err + } + securityToken, err := extractString(body, "SecurityToken") + if err != nil { + return nil, err + } + + return credentials.NewStsTokenCredential(accessKeyID, accessKeySecret, securityToken), nil +} + +func get(url string) (status int, content []byte, err error) { + httpClient := http.DefaultClient + httpClient.Timeout = time.Second * 1 + resp, err := httpClient.Get(url) + if err != nil { + return + } + defer resp.Body.Close() + content, err = ioutil.ReadAll(resp.Body) + return resp.StatusCode, content, err +} + +func extractString(m map[string]interface{}, key string) (string, error) { + raw, ok := m[key] + if !ok { + return "", fmt.Errorf("%s not in map", key) + } + str, ok := raw.(string) + if !ok { + return "", fmt.Errorf("%s is not a string in map", key) + } + return str, nil +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/profile_credentials.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/profile_credentials.go new file mode 100644 index 000000000..8d525c37a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/profile_credentials.go @@ -0,0 +1,158 @@ +package provider + +import ( + "bufio" + "errors" + "os" + "runtime" + "strings" + + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials" + + ini "gopkg.in/ini.v1" +) + +type ProfileProvider struct { + Profile string +} + +var ProviderProfile = NewProfileProvider() + +// NewProfileProvider receive zero or more parameters, +// when length of name is 0, the value of field Profile will be "default", +// and when there are multiple inputs, the function will take the +// first one and discard the other values. +func NewProfileProvider(name ...string) Provider { + p := new(ProfileProvider) + if len(name) == 0 { + p.Profile = "default" + } else { + p.Profile = name[0] + } + return p +} + +// Resolve implements the Provider interface +// when credential type is rsa_key_pair, the content of private_key file +// must be able to be parsed directly into the required string +// that NewRsaKeyPairCredential function needed +func (p *ProfileProvider) Resolve() (auth.Credential, error) { + path, ok := os.LookupEnv(ENVCredentialFile) + if !ok { + path, err := checkDefaultPath() + if err != nil { + return nil, err + } + if path == "" { + return nil, nil + } + } else if path == "" { + return nil, errors.New("Environment variable '" + ENVCredentialFile + "' cannot be empty") + } + + ini, err := ini.Load(path) + if err != nil { + return nil, errors.New("ERROR: Can not open file" + err.Error()) + } + + section, err := ini.GetSection(p.Profile) + if err != nil { + return nil, errors.New("ERROR: Can not load section" + err.Error()) + } + + value, err := section.GetKey("type") + if err != nil { + return nil, errors.New("ERROR: Can not find credential type" + err.Error()) + } + + switch value.String() { + case "access_key": + value1, err1 := section.GetKey("access_key_id") + value2, err2 := section.GetKey("access_key_secret") + if err1 != nil || err2 != nil { + return nil, errors.New("ERROR: Failed to get value") + } + if value1.String() == "" || value2.String() == "" { + return nil, errors.New("ERROR: Value can't be empty") + } + return credentials.NewAccessKeyCredential(value1.String(), value2.String()), nil + case "ecs_ram_role": + value1, err1 := section.GetKey("role_name") + if err1 != nil { + return nil, errors.New("ERROR: Failed to get value") + } + if value1.String() == "" { + return nil, errors.New("ERROR: Value can't be empty") + } + return credentials.NewEcsRamRoleCredential(value1.String()), nil + case "ram_role_arn": + value1, err1 := section.GetKey("access_key_id") + value2, err2 := section.GetKey("access_key_secret") + value3, err3 := section.GetKey("role_arn") + value4, err4 := section.GetKey("role_session_name") + if err1 != nil || err2 != nil || err3 != nil || err4 != nil { + return nil, errors.New("ERROR: Failed to get value") + } + if value1.String() == "" || value2.String() == "" || value3.String() == "" || value4.String() == "" { + return nil, errors.New("ERROR: Value can't be empty") + } + return credentials.NewRamRoleArnCredential(value1.String(), value2.String(), value3.String(), value4.String(), 3600), nil + case "rsa_key_pair": + value1, err1 := section.GetKey("public_key_id") + value2, err2 := section.GetKey("private_key_file") + if err1 != nil || err2 != nil { + return nil, errors.New("ERROR: Failed to get value") + } + if value1.String() == "" || value2.String() == "" { + return nil, errors.New("ERROR: Value can't be empty") + } + file, err := os.Open(value2.String()) + if err != nil { + return nil, errors.New("ERROR: Can not get private_key") + } + defer file.Close() + var privateKey string + scan := bufio.NewScanner(file) + var data string + for scan.Scan() { + if strings.HasPrefix(scan.Text(), "----") { + continue + } + data += scan.Text() + "\n" + } + return credentials.NewRsaKeyPairCredential(privateKey, value1.String(), 3600), nil + default: + return nil, errors.New("ERROR: Failed to get credential") + } +} + +// GetHomePath return home directory according to the system. +// if the environmental virables does not exist, will return empty +func GetHomePath() string { + if runtime.GOOS == "windows" { + path, ok := os.LookupEnv("USERPROFILE") + if !ok { + return "" + } + return path + } + path, ok := os.LookupEnv("HOME") + if !ok { + return "" + } + return path +} + +func checkDefaultPath() (path string, err error) { + path = GetHomePath() + if path == "" { + return "", errors.New("The default credential file path is invalid") + } + path = strings.Replace("~/.alibabacloud/credentials", "~", path, 1) + _, err = os.Stat(path) + if err != nil { + return "", nil + } + return path, nil +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/provider.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/provider.go new file mode 100644 index 000000000..ae4e168eb --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/provider.go @@ -0,0 +1,19 @@ +package provider + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth" +) + +//Environmental virables that may be used by the provider +const ( + ENVAccessKeyID = "ALIBABA_CLOUD_ACCESS_KEY_ID" + ENVAccessKeySecret = "ALIBABA_CLOUD_ACCESS_KEY_SECRET" + ENVCredentialFile = "ALIBABA_CLOUD_CREDENTIALS_FILE" + ENVEcsMetadata = "ALIBABA_CLOUD_ECS_METADATA" + PATHCredentialFile = "~/.alibabacloud/credentials" +) + +// When you want to customize the provider, you only need to implement the method of the interface. +type Provider interface { + Resolve() (auth.Credential, error) +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/provider_chain.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/provider_chain.go new file mode 100644 index 000000000..3f9315d13 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/provider_chain.go @@ -0,0 +1,34 @@ +package provider + +import ( + "errors" + + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth" +) + +type ProviderChain struct { + Providers []Provider +} + +var defaultproviders = []Provider{ProviderEnv, ProviderProfile, ProviderInstance} +var DefaultChain = NewProviderChain(defaultproviders) + +func NewProviderChain(providers []Provider) Provider { + return &ProviderChain{ + Providers: providers, + } +} + +func (p *ProviderChain) Resolve() (auth.Credential, error) { + for _, provider := range p.Providers { + creds, err := provider.Resolve() + if err != nil { + return nil, err + } else if err == nil && creds == nil { + continue + } + return creds, err + } + return nil, errors.New("No credential found") + +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/rsa_key_pair_credential.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/rsa_key_pair_credential.go new file mode 100644 index 000000000..00d688eb8 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/rsa_key_pair_credential.go @@ -0,0 +1,15 @@ +package credentials + +type RsaKeyPairCredential struct { + PrivateKey string + PublicKeyId string + SessionExpiration int +} + +func NewRsaKeyPairCredential(privateKey, publicKeyId string, sessionExpiration int) *RsaKeyPairCredential { + return &RsaKeyPairCredential{ + PrivateKey: privateKey, + PublicKeyId: publicKeyId, + SessionExpiration: sessionExpiration, + } +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/sts_credential.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/sts_credential.go new file mode 100644 index 000000000..554431ff0 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/sts_credential.go @@ -0,0 +1,15 @@ +package credentials + +type StsTokenCredential struct { + AccessKeyId string + AccessKeySecret string + AccessKeyStsToken string +} + +func NewStsTokenCredential(accessKeyId, accessKeySecret, accessKeyStsToken string) *StsTokenCredential { + return &StsTokenCredential{ + AccessKeyId: accessKeyId, + AccessKeySecret: accessKeySecret, + AccessKeyStsToken: accessKeyStsToken, + } +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/sts_role_arn_credential.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/sts_role_arn_credential.go new file mode 100644 index 000000000..27602fd74 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/sts_role_arn_credential.go @@ -0,0 +1,61 @@ +package credentials + +// Deprecated: Use RamRoleArnCredential in this package instead. +type StsRoleArnCredential struct { + AccessKeyId string + AccessKeySecret string + RoleArn string + RoleSessionName string + RoleSessionExpiration int +} + +type RamRoleArnCredential struct { + AccessKeyId string + AccessKeySecret string + RoleArn string + RoleSessionName string + RoleSessionExpiration int + Policy string +} + +// Deprecated: Use RamRoleArnCredential in this package instead. +func NewStsRoleArnCredential(accessKeyId, accessKeySecret, roleArn, roleSessionName string, roleSessionExpiration int) *StsRoleArnCredential { + return &StsRoleArnCredential{ + AccessKeyId: accessKeyId, + AccessKeySecret: accessKeySecret, + RoleArn: roleArn, + RoleSessionName: roleSessionName, + RoleSessionExpiration: roleSessionExpiration, + } +} + +func (oldCred *StsRoleArnCredential) ToRamRoleArnCredential() *RamRoleArnCredential { + return &RamRoleArnCredential{ + AccessKeyId: oldCred.AccessKeyId, + AccessKeySecret: oldCred.AccessKeySecret, + RoleArn: oldCred.RoleArn, + RoleSessionName: oldCred.RoleSessionName, + RoleSessionExpiration: oldCred.RoleSessionExpiration, + } +} + +func NewRamRoleArnCredential(accessKeyId, accessKeySecret, roleArn, roleSessionName string, roleSessionExpiration int) *RamRoleArnCredential { + return &RamRoleArnCredential{ + AccessKeyId: accessKeyId, + AccessKeySecret: accessKeySecret, + RoleArn: roleArn, + RoleSessionName: roleSessionName, + RoleSessionExpiration: roleSessionExpiration, + } +} + +func NewRamRoleArnWithPolicyCredential(accessKeyId, accessKeySecret, roleArn, roleSessionName, policy string, roleSessionExpiration int) *RamRoleArnCredential { + return &RamRoleArnCredential{ + AccessKeyId: accessKeyId, + AccessKeySecret: accessKeySecret, + RoleArn: roleArn, + RoleSessionName: roleSessionName, + RoleSessionExpiration: roleSessionExpiration, + Policy: policy, + } +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/roa_signature_composer.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/roa_signature_composer.go new file mode 100644 index 000000000..77fcec231 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/roa_signature_composer.go @@ -0,0 +1,136 @@ +/* + * 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. + */ + +package auth + +import ( + "bytes" + "sort" + "strings" + + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils" +) + +var debug utils.Debug + +var hookGetDate = func(fn func() string) string { + return fn() +} + +func init() { + debug = utils.Init("sdk") +} + +func signRoaRequest(request requests.AcsRequest, signer Signer, regionId string) (err error) { + completeROASignParams(request, signer, regionId) + stringToSign := buildRoaStringToSign(request) + request.SetStringToSign(stringToSign) + signature := signer.Sign(stringToSign, "") + accessKeyId, err := signer.GetAccessKeyId() + if err != nil { + return nil + } + + request.GetHeaders()["Authorization"] = "acs " + accessKeyId + ":" + signature + + return +} + +func completeROASignParams(request requests.AcsRequest, signer Signer, regionId string) { + headerParams := request.GetHeaders() + + // complete query params + queryParams := request.GetQueryParams() + //if _, ok := queryParams["RegionId"]; !ok { + // queryParams["RegionId"] = regionId + //} + if extraParam := signer.GetExtraParam(); extraParam != nil { + for key, value := range extraParam { + if key == "SecurityToken" { + headerParams["x-acs-security-token"] = value + continue + } + if key == "BearerToken" { + headerParams["x-acs-bearer-token"] = value + continue + } + queryParams[key] = value + } + } + + // complete header params + headerParams["Date"] = hookGetDate(utils.GetTimeInFormatRFC2616) + headerParams["x-acs-signature-method"] = signer.GetName() + headerParams["x-acs-signature-version"] = signer.GetVersion() + if request.GetFormParams() != nil && len(request.GetFormParams()) > 0 { + formString := utils.GetUrlFormedMap(request.GetFormParams()) + request.SetContent([]byte(formString)) + headerParams["Content-Type"] = requests.Form + } + contentMD5 := utils.GetMD5Base64(request.GetContent()) + headerParams["Content-MD5"] = contentMD5 + if _, contains := headerParams["Content-Type"]; !contains { + headerParams["Content-Type"] = requests.Raw + } + switch format := request.GetAcceptFormat(); format { + case "JSON": + headerParams["Accept"] = requests.Json + case "XML": + headerParams["Accept"] = requests.Xml + default: + headerParams["Accept"] = requests.Raw + } +} + +func buildRoaStringToSign(request requests.AcsRequest) (stringToSign string) { + + headers := request.GetHeaders() + + stringToSignBuilder := bytes.Buffer{} + stringToSignBuilder.WriteString(request.GetMethod()) + stringToSignBuilder.WriteString(requests.HeaderSeparator) + + // append header keys for sign + appendIfContain(headers, &stringToSignBuilder, "Accept", requests.HeaderSeparator) + appendIfContain(headers, &stringToSignBuilder, "Content-MD5", requests.HeaderSeparator) + appendIfContain(headers, &stringToSignBuilder, "Content-Type", requests.HeaderSeparator) + appendIfContain(headers, &stringToSignBuilder, "Date", requests.HeaderSeparator) + + // sort and append headers witch starts with 'x-acs-' + var acsHeaders []string + for key := range headers { + if strings.HasPrefix(key, "x-acs-") { + acsHeaders = append(acsHeaders, key) + } + } + sort.Strings(acsHeaders) + for _, key := range acsHeaders { + stringToSignBuilder.WriteString(key + ":" + headers[key]) + stringToSignBuilder.WriteString(requests.HeaderSeparator) + } + + // append query params + stringToSignBuilder.WriteString(request.BuildQueries()) + stringToSign = stringToSignBuilder.String() + debug("stringToSign: %s", stringToSign) + return +} + +func appendIfContain(sourceMap map[string]string, target *bytes.Buffer, key, separator string) { + if value, contain := sourceMap[key]; contain && len(value) > 0 { + target.WriteString(sourceMap[key]) + target.WriteString(separator) + } +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/rpc_signature_composer.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/rpc_signature_composer.go new file mode 100644 index 000000000..14ea15ca4 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/rpc_signature_composer.go @@ -0,0 +1,94 @@ +/* + * 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. + */ + +package auth + +import ( + "net/url" + "strings" + + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils" +) + +var hookGetUUIDV4 = func(fn func() string) string { + return fn() +} + +func signRpcRequest(request requests.AcsRequest, signer Signer, regionId string) (err error) { + err = completeRpcSignParams(request, signer, regionId) + if err != nil { + return + } + // remove while retry + if _, containsSign := request.GetQueryParams()["Signature"]; containsSign { + delete(request.GetQueryParams(), "Signature") + } + stringToSign := buildRpcStringToSign(request) + request.SetStringToSign(stringToSign) + signature := signer.Sign(stringToSign, "&") + request.GetQueryParams()["Signature"] = signature + + return +} + +func completeRpcSignParams(request requests.AcsRequest, signer Signer, regionId string) (err error) { + queryParams := request.GetQueryParams() + queryParams["Version"] = request.GetVersion() + queryParams["Action"] = request.GetActionName() + queryParams["Format"] = request.GetAcceptFormat() + queryParams["Timestamp"] = hookGetDate(utils.GetTimeInFormatISO8601) + queryParams["SignatureMethod"] = signer.GetName() + queryParams["SignatureType"] = signer.GetType() + queryParams["SignatureVersion"] = signer.GetVersion() + queryParams["SignatureNonce"] = hookGetUUIDV4(utils.GetUUIDV4) + queryParams["AccessKeyId"], err = signer.GetAccessKeyId() + + if err != nil { + return + } + + if _, contains := queryParams["RegionId"]; !contains { + queryParams["RegionId"] = regionId + } + if extraParam := signer.GetExtraParam(); extraParam != nil { + for key, value := range extraParam { + queryParams[key] = value + } + } + + request.GetHeaders()["Content-Type"] = requests.Form + formString := utils.GetUrlFormedMap(request.GetFormParams()) + request.SetContent([]byte(formString)) + + return +} + +func buildRpcStringToSign(request requests.AcsRequest) (stringToSign string) { + signParams := make(map[string]string) + for key, value := range request.GetQueryParams() { + signParams[key] = value + } + for key, value := range request.GetFormParams() { + signParams[key] = value + } + + stringToSign = utils.GetUrlFormedMap(signParams) + stringToSign = strings.Replace(stringToSign, "+", "%20", -1) + stringToSign = strings.Replace(stringToSign, "*", "%2A", -1) + stringToSign = strings.Replace(stringToSign, "%7E", "~", -1) + stringToSign = url.QueryEscape(stringToSign) + stringToSign = request.GetMethod() + "&%2F&" + stringToSign + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signer.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signer.go new file mode 100644 index 000000000..cbbc3cef7 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signer.go @@ -0,0 +1,98 @@ +/* + * 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. + */ + +package auth + +import ( + "fmt" + "reflect" + + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +type Signer interface { + GetName() string + GetType() string + GetVersion() string + GetAccessKeyId() (string, error) + GetExtraParam() map[string]string + Sign(stringToSign, secretSuffix string) string +} + +func NewSignerWithCredential(credential Credential, commonApi func(request *requests.CommonRequest, signer interface{}) (response *responses.CommonResponse, err error)) (signer Signer, err error) { + switch instance := credential.(type) { + case *credentials.AccessKeyCredential: + { + signer = signers.NewAccessKeySigner(instance) + } + case *credentials.StsTokenCredential: + { + signer = signers.NewStsTokenSigner(instance) + } + case *credentials.BearerTokenCredential: + { + signer = signers.NewBearerTokenSigner(instance) + } + case *credentials.RamRoleArnCredential: + { + signer, err = signers.NewRamRoleArnSigner(instance, commonApi) + } + case *credentials.RsaKeyPairCredential: + { + signer, err = signers.NewSignerKeyPair(instance, commonApi) + } + case *credentials.EcsRamRoleCredential: + { + signer = signers.NewEcsRamRoleSigner(instance, commonApi) + } + case *credentials.BaseCredential: // deprecated user interface + { + signer = signers.NewAccessKeySigner(instance.ToAccessKeyCredential()) + } + case *credentials.StsRoleArnCredential: // deprecated user interface + { + signer, err = signers.NewRamRoleArnSigner(instance.ToRamRoleArnCredential(), commonApi) + } + case *credentials.StsRoleNameOnEcsCredential: // deprecated user interface + { + signer = signers.NewEcsRamRoleSigner(instance.ToEcsRamRoleCredential(), commonApi) + } + default: + message := fmt.Sprintf(errors.UnsupportedCredentialErrorMessage, reflect.TypeOf(credential)) + err = errors.NewClientError(errors.UnsupportedCredentialErrorCode, message, nil) + } + return +} + +func Sign(request requests.AcsRequest, signer Signer, regionId string) (err error) { + switch request.GetStyle() { + case requests.ROA: + { + err = signRoaRequest(request, signer, regionId) + } + case requests.RPC: + { + err = signRpcRequest(request, signer, regionId) + } + default: + message := fmt.Sprintf(errors.UnknownRequestTypeErrorMessage, reflect.TypeOf(request)) + err = errors.NewClientError(errors.UnknownRequestTypeErrorCode, message, nil) + } + + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/algorithms.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/algorithms.go new file mode 100644 index 000000000..887f50209 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/algorithms.go @@ -0,0 +1,57 @@ +/* + * 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. + */ + +package signers + +import ( + "crypto" + "crypto/hmac" + "crypto/rand" + "crypto/rsa" + "crypto/sha1" + "crypto/x509" + "encoding/base64" +) + +func ShaHmac1(source, secret string) string { + key := []byte(secret) + hmac := hmac.New(sha1.New, key) + hmac.Write([]byte(source)) + signedBytes := hmac.Sum(nil) + signedString := base64.StdEncoding.EncodeToString(signedBytes) + return signedString +} + +func Sha256WithRsa(source, secret string) string { + // block, _ := pem.Decode([]byte(secret)) + decodeString, err := base64.StdEncoding.DecodeString(secret) + if err != nil { + panic(err) + } + private, err := x509.ParsePKCS8PrivateKey(decodeString) + if err != nil { + panic(err) + } + + h := crypto.Hash.New(crypto.SHA256) + h.Write([]byte(source)) + hashed := h.Sum(nil) + signature, err := rsa.SignPKCS1v15(rand.Reader, private.(*rsa.PrivateKey), + crypto.SHA256, hashed) + if err != nil { + panic(err) + } + + return base64.StdEncoding.EncodeToString(signature) +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/credential_updater.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/credential_updater.go new file mode 100644 index 000000000..ba291a41e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/credential_updater.go @@ -0,0 +1,54 @@ +/* + * 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. + */ + +package signers + +import ( + "time" + + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +const defaultInAdvanceScale = 0.95 + +type credentialUpdater struct { + credentialExpiration int + lastUpdateTimestamp int64 + inAdvanceScale float64 + buildRequestMethod func() (*requests.CommonRequest, error) + responseCallBack func(response *responses.CommonResponse) error + refreshApi func(request *requests.CommonRequest) (response *responses.CommonResponse, err error) +} + +func (updater *credentialUpdater) needUpdateCredential() (result bool) { + if updater.inAdvanceScale == 0 { + updater.inAdvanceScale = defaultInAdvanceScale + } + return time.Now().Unix()-updater.lastUpdateTimestamp >= int64(float64(updater.credentialExpiration)*updater.inAdvanceScale) +} + +func (updater *credentialUpdater) updateCredential() (err error) { + request, err := updater.buildRequestMethod() + if err != nil { + return + } + response, err := updater.refreshApi(request) + if err != nil { + return + } + updater.lastUpdateTimestamp = time.Now().Unix() + err = updater.responseCallBack(response) + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/session_credential.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/session_credential.go new file mode 100644 index 000000000..99c624c88 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/session_credential.go @@ -0,0 +1,7 @@ +package signers + +type SessionCredential struct { + AccessKeyId string + AccessKeySecret string + StsToken string +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_access_key.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_access_key.go new file mode 100644 index 000000000..bc4f35b85 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_access_key.go @@ -0,0 +1,54 @@ +/* + * 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. + */ + +package signers + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials" +) + +type AccessKeySigner struct { + credential *credentials.AccessKeyCredential +} + +func (signer *AccessKeySigner) GetExtraParam() map[string]string { + return nil +} + +func NewAccessKeySigner(credential *credentials.AccessKeyCredential) *AccessKeySigner { + return &AccessKeySigner{ + credential: credential, + } +} + +func (*AccessKeySigner) GetName() string { + return "HMAC-SHA1" +} + +func (*AccessKeySigner) GetType() string { + return "" +} + +func (*AccessKeySigner) GetVersion() string { + return "1.0" +} + +func (signer *AccessKeySigner) GetAccessKeyId() (accessKeyId string, err error) { + return signer.credential.AccessKeyId, nil +} + +func (signer *AccessKeySigner) Sign(stringToSign, secretSuffix string) string { + secret := signer.credential.AccessKeySecret + secretSuffix + return ShaHmac1(stringToSign, secret) +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_bearer_token.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_bearer_token.go new file mode 100644 index 000000000..75b78433a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_bearer_token.go @@ -0,0 +1,35 @@ +package signers + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials" +) + +type BearerTokenSigner struct { + credential *credentials.BearerTokenCredential +} + +func NewBearerTokenSigner(credential *credentials.BearerTokenCredential) *BearerTokenSigner { + return &BearerTokenSigner{ + credential: credential, + } +} + +func (signer *BearerTokenSigner) GetExtraParam() map[string]string { + return map[string]string{"BearerToken": signer.credential.BearerToken} +} + +func (*BearerTokenSigner) GetName() string { + return "" +} +func (*BearerTokenSigner) GetType() string { + return "BEARERTOKEN" +} +func (*BearerTokenSigner) GetVersion() string { + return "1.0" +} +func (signer *BearerTokenSigner) GetAccessKeyId() (accessKeyId string, err error) { + return "", nil +} +func (signer *BearerTokenSigner) Sign(stringToSign, secretSuffix string) string { + return "" +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_ecs_ram_role.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_ecs_ram_role.go new file mode 100644 index 000000000..73788429e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_ecs_ram_role.go @@ -0,0 +1,167 @@ +/* + * 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. + */ + +package signers + +import ( + "encoding/json" + "fmt" + "net/http" + "strings" + "time" + + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" + jmespath "github.com/jmespath/go-jmespath" +) + +var securityCredURL = "http://100.100.100.200/latest/meta-data/ram/security-credentials/" + +type EcsRamRoleSigner struct { + *credentialUpdater + sessionCredential *SessionCredential + credential *credentials.EcsRamRoleCredential + commonApi func(request *requests.CommonRequest, signer interface{}) (response *responses.CommonResponse, err error) +} + +func NewEcsRamRoleSigner(credential *credentials.EcsRamRoleCredential, commonApi func(*requests.CommonRequest, interface{}) (response *responses.CommonResponse, err error)) (signer *EcsRamRoleSigner) { + signer = &EcsRamRoleSigner{ + credential: credential, + commonApi: commonApi, + } + + signer.credentialUpdater = &credentialUpdater{ + credentialExpiration: defaultDurationSeconds / 60, + buildRequestMethod: signer.buildCommonRequest, + responseCallBack: signer.refreshCredential, + refreshApi: signer.refreshApi, + } + + return signer +} + +func (*EcsRamRoleSigner) GetName() string { + return "HMAC-SHA1" +} + +func (*EcsRamRoleSigner) GetType() string { + return "" +} + +func (*EcsRamRoleSigner) GetVersion() string { + return "1.0" +} + +func (signer *EcsRamRoleSigner) GetAccessKeyId() (accessKeyId string, err error) { + if signer.sessionCredential == nil || signer.needUpdateCredential() { + err = signer.updateCredential() + if err != nil { + return + } + } + if signer.sessionCredential == nil || len(signer.sessionCredential.AccessKeyId) <= 0 { + return "", nil + } + return signer.sessionCredential.AccessKeyId, nil +} + +func (signer *EcsRamRoleSigner) GetExtraParam() map[string]string { + if signer.sessionCredential == nil { + return make(map[string]string) + } + if len(signer.sessionCredential.StsToken) <= 0 { + return make(map[string]string) + } + return map[string]string{"SecurityToken": signer.sessionCredential.StsToken} +} + +func (signer *EcsRamRoleSigner) Sign(stringToSign, secretSuffix string) string { + secret := signer.sessionCredential.AccessKeySecret + secretSuffix + return ShaHmac1(stringToSign, secret) +} + +func (signer *EcsRamRoleSigner) buildCommonRequest() (request *requests.CommonRequest, err error) { + return +} + +func (signer *EcsRamRoleSigner) refreshApi(request *requests.CommonRequest) (response *responses.CommonResponse, err error) { + requestUrl := securityCredURL + signer.credential.RoleName + httpRequest, err := http.NewRequest(requests.GET, requestUrl, strings.NewReader("")) + if err != nil { + err = fmt.Errorf("refresh Ecs sts token err: %s", err.Error()) + return + } + httpClient := &http.Client{} + httpResponse, err := httpClient.Do(httpRequest) + if err != nil { + err = fmt.Errorf("refresh Ecs sts token err: %s", err.Error()) + return + } + + response = responses.NewCommonResponse() + err = responses.Unmarshal(response, httpResponse, "") + return +} + +func (signer *EcsRamRoleSigner) refreshCredential(response *responses.CommonResponse) (err error) { + if response.GetHttpStatus() != http.StatusOK { + return fmt.Errorf("refresh Ecs sts token err, httpStatus: %d, message = %s", response.GetHttpStatus(), response.GetHttpContentString()) + } + var data interface{} + err = json.Unmarshal(response.GetHttpContentBytes(), &data) + if err != nil { + return fmt.Errorf("refresh Ecs sts token err, json.Unmarshal fail: %s", err.Error()) + } + code, err := jmespath.Search("Code", data) + if err != nil { + return fmt.Errorf("refresh Ecs sts token err, fail to get Code: %s", err.Error()) + } + if code.(string) != "Success" { + return fmt.Errorf("refresh Ecs sts token err, Code is not Success") + } + accessKeyId, err := jmespath.Search("AccessKeyId", data) + if err != nil { + return fmt.Errorf("refresh Ecs sts token err, fail to get AccessKeyId: %s", err.Error()) + } + accessKeySecret, err := jmespath.Search("AccessKeySecret", data) + if err != nil { + return fmt.Errorf("refresh Ecs sts token err, fail to get AccessKeySecret: %s", err.Error()) + } + securityToken, err := jmespath.Search("SecurityToken", data) + if err != nil { + return fmt.Errorf("refresh Ecs sts token err, fail to get SecurityToken: %s", err.Error()) + } + expiration, err := jmespath.Search("Expiration", data) + if err != nil { + return fmt.Errorf("refresh Ecs sts token err, fail to get Expiration: %s", err.Error()) + } + if accessKeyId == nil || accessKeySecret == nil || securityToken == nil || expiration == nil { + return + } + + expirationTime, err := time.Parse("2006-01-02T15:04:05Z", expiration.(string)) + signer.credentialExpiration = int(expirationTime.Unix() - time.Now().Unix()) + signer.sessionCredential = &SessionCredential{ + AccessKeyId: accessKeyId.(string), + AccessKeySecret: accessKeySecret.(string), + StsToken: securityToken.(string), + } + + return +} + +func (signer *EcsRamRoleSigner) GetSessionCredential() *SessionCredential { + return signer.sessionCredential +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_key_pair.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_key_pair.go new file mode 100644 index 000000000..19273d5a6 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_key_pair.go @@ -0,0 +1,148 @@ +/* + * 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. + */ + +package signers + +import ( + "encoding/json" + "fmt" + "net/http" + "strconv" + + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" + jmespath "github.com/jmespath/go-jmespath" +) + +type SignerKeyPair struct { + *credentialUpdater + sessionCredential *SessionCredential + credential *credentials.RsaKeyPairCredential + commonApi func(request *requests.CommonRequest, signer interface{}) (response *responses.CommonResponse, err error) +} + +func NewSignerKeyPair(credential *credentials.RsaKeyPairCredential, commonApi func(*requests.CommonRequest, interface{}) (response *responses.CommonResponse, err error)) (signer *SignerKeyPair, err error) { + signer = &SignerKeyPair{ + credential: credential, + commonApi: commonApi, + } + + signer.credentialUpdater = &credentialUpdater{ + credentialExpiration: credential.SessionExpiration, + buildRequestMethod: signer.buildCommonRequest, + responseCallBack: signer.refreshCredential, + refreshApi: signer.refreshApi, + } + + if credential.SessionExpiration > 0 { + if credential.SessionExpiration >= 900 && credential.SessionExpiration <= 3600 { + signer.credentialExpiration = credential.SessionExpiration + } else { + err = errors.NewClientError(errors.InvalidParamErrorCode, "Key Pair session duration should be in the range of 15min - 1Hr", nil) + } + } else { + signer.credentialExpiration = defaultDurationSeconds + } + return +} + +func (*SignerKeyPair) GetName() string { + return "HMAC-SHA1" +} + +func (*SignerKeyPair) GetType() string { + return "" +} + +func (*SignerKeyPair) GetVersion() string { + return "1.0" +} + +func (signer *SignerKeyPair) ensureCredential() error { + if signer.sessionCredential == nil || signer.needUpdateCredential() { + return signer.updateCredential() + } + return nil +} + +func (signer *SignerKeyPair) GetAccessKeyId() (accessKeyId string, err error) { + err = signer.ensureCredential() + if err != nil { + return + } + if signer.sessionCredential == nil || len(signer.sessionCredential.AccessKeyId) <= 0 { + accessKeyId = "" + return + } + + accessKeyId = signer.sessionCredential.AccessKeyId + return +} + +func (signer *SignerKeyPair) GetExtraParam() map[string]string { + return make(map[string]string) +} + +func (signer *SignerKeyPair) Sign(stringToSign, secretSuffix string) string { + secret := signer.sessionCredential.AccessKeySecret + secretSuffix + return ShaHmac1(stringToSign, secret) +} + +func (signer *SignerKeyPair) buildCommonRequest() (request *requests.CommonRequest, err error) { + request = requests.NewCommonRequest() + request.Product = "Sts" + request.Version = "2015-04-01" + request.ApiName = "GenerateSessionAccessKey" + request.Scheme = requests.HTTPS + request.SetDomain("sts.ap-northeast-1.aliyuncs.com") + request.QueryParams["PublicKeyId"] = signer.credential.PublicKeyId + request.QueryParams["DurationSeconds"] = strconv.Itoa(signer.credentialExpiration) + return +} + +func (signer *SignerKeyPair) refreshApi(request *requests.CommonRequest) (response *responses.CommonResponse, err error) { + signerV2 := NewSignerV2(signer.credential) + return signer.commonApi(request, signerV2) +} + +func (signer *SignerKeyPair) refreshCredential(response *responses.CommonResponse) (err error) { + if response.GetHttpStatus() != http.StatusOK { + message := "refresh session AccessKey failed" + err = errors.NewServerError(response.GetHttpStatus(), response.GetHttpContentString(), message) + return + } + var data interface{} + err = json.Unmarshal(response.GetHttpContentBytes(), &data) + if err != nil { + return fmt.Errorf("refresh KeyPair err, json.Unmarshal fail: %s", err.Error()) + } + accessKeyId, err := jmespath.Search("SessionAccessKey.SessionAccessKeyId", data) + if err != nil { + return fmt.Errorf("refresh KeyPair err, fail to get SessionAccessKeyId: %s", err.Error()) + } + accessKeySecret, err := jmespath.Search("SessionAccessKey.SessionAccessKeySecret", data) + if err != nil { + return fmt.Errorf("refresh KeyPair err, fail to get SessionAccessKeySecret: %s", err.Error()) + } + if accessKeyId == nil || accessKeySecret == nil { + return + } + signer.sessionCredential = &SessionCredential{ + AccessKeyId: accessKeyId.(string), + AccessKeySecret: accessKeySecret.(string), + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_ram_role_arn.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_ram_role_arn.go new file mode 100644 index 000000000..c945c8aeb --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_ram_role_arn.go @@ -0,0 +1,175 @@ +/* + * 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. + */ + +package signers + +import ( + "encoding/json" + "fmt" + "net/http" + "strconv" + "time" + + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" + jmespath "github.com/jmespath/go-jmespath" +) + +const ( + defaultDurationSeconds = 3600 +) + +type RamRoleArnSigner struct { + *credentialUpdater + roleSessionName string + sessionCredential *SessionCredential + credential *credentials.RamRoleArnCredential + commonApi func(request *requests.CommonRequest, signer interface{}) (response *responses.CommonResponse, err error) +} + +func NewRamRoleArnSigner(credential *credentials.RamRoleArnCredential, commonApi func(request *requests.CommonRequest, signer interface{}) (response *responses.CommonResponse, err error)) (signer *RamRoleArnSigner, err error) { + signer = &RamRoleArnSigner{ + credential: credential, + commonApi: commonApi, + } + + signer.credentialUpdater = &credentialUpdater{ + credentialExpiration: credential.RoleSessionExpiration, + buildRequestMethod: signer.buildCommonRequest, + responseCallBack: signer.refreshCredential, + refreshApi: signer.refreshApi, + } + + if len(credential.RoleSessionName) > 0 { + signer.roleSessionName = credential.RoleSessionName + } else { + signer.roleSessionName = "aliyun-go-sdk-" + strconv.FormatInt(time.Now().UnixNano()/1000, 10) + } + if credential.RoleSessionExpiration > 0 { + if credential.RoleSessionExpiration >= 900 && credential.RoleSessionExpiration <= 3600 { + signer.credentialExpiration = credential.RoleSessionExpiration + } else { + err = errors.NewClientError(errors.InvalidParamErrorCode, "Assume Role session duration should be in the range of 15min - 1Hr", nil) + } + } else { + signer.credentialExpiration = defaultDurationSeconds + } + return +} + +func (*RamRoleArnSigner) GetName() string { + return "HMAC-SHA1" +} + +func (*RamRoleArnSigner) GetType() string { + return "" +} + +func (*RamRoleArnSigner) GetVersion() string { + return "1.0" +} + +func (signer *RamRoleArnSigner) GetAccessKeyId() (accessKeyId string, err error) { + if signer.sessionCredential == nil || signer.needUpdateCredential() { + err = signer.updateCredential() + if err != nil { + return + } + } + + if signer.sessionCredential == nil || len(signer.sessionCredential.AccessKeyId) <= 0 { + return "", err + } + + return signer.sessionCredential.AccessKeyId, nil +} + +func (signer *RamRoleArnSigner) GetExtraParam() map[string]string { + if signer.sessionCredential == nil || signer.needUpdateCredential() { + signer.updateCredential() + } + if signer.sessionCredential == nil || len(signer.sessionCredential.StsToken) <= 0 { + return make(map[string]string) + } + return map[string]string{"SecurityToken": signer.sessionCredential.StsToken} +} + +func (signer *RamRoleArnSigner) Sign(stringToSign, secretSuffix string) string { + secret := signer.sessionCredential.AccessKeySecret + secretSuffix + return ShaHmac1(stringToSign, secret) +} + +func (signer *RamRoleArnSigner) buildCommonRequest() (request *requests.CommonRequest, err error) { + request = requests.NewCommonRequest() + request.Product = "Sts" + request.Version = "2015-04-01" + request.ApiName = "AssumeRole" + request.Scheme = requests.HTTPS + request.QueryParams["RoleArn"] = signer.credential.RoleArn + if signer.credential.Policy != "" { + request.QueryParams["Policy"] = signer.credential.Policy + } + request.QueryParams["RoleSessionName"] = signer.credential.RoleSessionName + request.QueryParams["DurationSeconds"] = strconv.Itoa(signer.credentialExpiration) + return +} + +func (signer *RamRoleArnSigner) refreshApi(request *requests.CommonRequest) (response *responses.CommonResponse, err error) { + credential := &credentials.AccessKeyCredential{ + AccessKeyId: signer.credential.AccessKeyId, + AccessKeySecret: signer.credential.AccessKeySecret, + } + signerV1 := NewAccessKeySigner(credential) + return signer.commonApi(request, signerV1) +} + +func (signer *RamRoleArnSigner) refreshCredential(response *responses.CommonResponse) (err error) { + if response.GetHttpStatus() != http.StatusOK { + message := "refresh session token failed" + err = errors.NewServerError(response.GetHttpStatus(), response.GetHttpContentString(), message) + return + } + var data interface{} + err = json.Unmarshal(response.GetHttpContentBytes(), &data) + if err != nil { + return fmt.Errorf("refresh RoleArn sts token err, json.Unmarshal fail: %s", err.Error()) + } + accessKeyId, err := jmespath.Search("Credentials.AccessKeyId", data) + if err != nil { + return fmt.Errorf("refresh RoleArn sts token err, fail to get AccessKeyId: %s", err.Error()) + } + accessKeySecret, err := jmespath.Search("Credentials.AccessKeySecret", data) + if err != nil { + return fmt.Errorf("refresh RoleArn sts token err, fail to get AccessKeySecret: %s", err.Error()) + } + securityToken, err := jmespath.Search("Credentials.SecurityToken", data) + if err != nil { + return fmt.Errorf("refresh RoleArn sts token err, fail to get SecurityToken: %s", err.Error()) + } + if accessKeyId == nil || accessKeySecret == nil || securityToken == nil { + return + } + signer.sessionCredential = &SessionCredential{ + AccessKeyId: accessKeyId.(string), + AccessKeySecret: accessKeySecret.(string), + StsToken: securityToken.(string), + } + return +} + +func (signer *RamRoleArnSigner) GetSessionCredential() *SessionCredential { + return signer.sessionCredential +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_sts_token.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_sts_token.go new file mode 100644 index 000000000..d0ce36c38 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_sts_token.go @@ -0,0 +1,54 @@ +/* + * 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. + */ + +package signers + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials" +) + +type StsTokenSigner struct { + credential *credentials.StsTokenCredential +} + +func NewStsTokenSigner(credential *credentials.StsTokenCredential) *StsTokenSigner { + return &StsTokenSigner{ + credential: credential, + } +} + +func (*StsTokenSigner) GetName() string { + return "HMAC-SHA1" +} + +func (*StsTokenSigner) GetType() string { + return "" +} + +func (*StsTokenSigner) GetVersion() string { + return "1.0" +} + +func (signer *StsTokenSigner) GetAccessKeyId() (accessKeyId string, err error) { + return signer.credential.AccessKeyId, nil +} + +func (signer *StsTokenSigner) GetExtraParam() map[string]string { + return map[string]string{"SecurityToken": signer.credential.AccessKeyStsToken} +} + +func (signer *StsTokenSigner) Sign(stringToSign, secretSuffix string) string { + secret := signer.credential.AccessKeySecret + secretSuffix + return ShaHmac1(stringToSign, secret) +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_v2.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_v2.go new file mode 100644 index 000000000..973485298 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_v2.go @@ -0,0 +1,54 @@ +/* + * 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. + */ + +package signers + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials" +) + +type SignerV2 struct { + credential *credentials.RsaKeyPairCredential +} + +func (signer *SignerV2) GetExtraParam() map[string]string { + return nil +} + +func NewSignerV2(credential *credentials.RsaKeyPairCredential) *SignerV2 { + return &SignerV2{ + credential: credential, + } +} + +func (*SignerV2) GetName() string { + return "SHA256withRSA" +} + +func (*SignerV2) GetType() string { + return "PRIVATEKEY" +} + +func (*SignerV2) GetVersion() string { + return "1.0" +} + +func (signer *SignerV2) GetAccessKeyId() (accessKeyId string, err error) { + return signer.credential.PublicKeyId, err +} + +func (signer *SignerV2) Sign(stringToSign, secretSuffix string) string { + secret := signer.credential.PrivateKey + return Sha256WithRsa(stringToSign, secret) +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/client.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/client.go new file mode 100644 index 000000000..01c2f93ba --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/client.go @@ -0,0 +1,725 @@ +/* + * 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. + */ + +package sdk + +import ( + "context" + "crypto/tls" + "fmt" + "net" + "net/http" + "net/url" + "os" + "runtime" + "strconv" + "strings" + "sync" + "time" + + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider" + + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils" +) + +var debug utils.Debug + +func init() { + debug = utils.Init("sdk") +} + +// Version this value will be replaced while build: -ldflags="-X sdk.version=x.x.x" +var Version = "0.0.1" +var defaultConnectTimeout = 5 * time.Second +var defaultReadTimeout = 10 * time.Second + +var DefaultUserAgent = fmt.Sprintf("AlibabaCloud (%s; %s) Golang/%s Core/%s", runtime.GOOS, runtime.GOARCH, strings.Trim(runtime.Version(), "go"), Version) + +var hookDo = func(fn func(req *http.Request) (*http.Response, error)) func(req *http.Request) (*http.Response, error) { + return fn +} + +// Client the type Client +type Client struct { + isInsecure bool + regionId string + config *Config + httpProxy string + httpsProxy string + noProxy string + logger *Logger + userAgent map[string]string + signer auth.Signer + httpClient *http.Client + asyncTaskQueue chan func() + readTimeout time.Duration + connectTimeout time.Duration + + debug bool + isRunning bool + // void "panic(write to close channel)" cause of addAsync() after Shutdown() + asyncChanLock *sync.RWMutex +} + +func (client *Client) Init() (err error) { + panic("not support yet") +} + +func (client *Client) SetHTTPSInsecure(isInsecure bool) { + client.isInsecure = isInsecure +} + +func (client *Client) GetHTTPSInsecure() bool { + return client.isInsecure +} + +func (client *Client) SetHttpsProxy(httpsProxy string) { + client.httpsProxy = httpsProxy +} + +func (client *Client) GetHttpsProxy() string { + return client.httpsProxy +} + +func (client *Client) SetHttpProxy(httpProxy string) { + client.httpProxy = httpProxy +} + +func (client *Client) GetHttpProxy() string { + return client.httpProxy +} + +func (client *Client) SetNoProxy(noProxy string) { + client.noProxy = noProxy +} + +func (client *Client) GetNoProxy() string { + return client.noProxy +} + +// InitWithProviderChain will get credential from the providerChain, +// the RsaKeyPairCredential Only applicable to regionID `ap-northeast-1`, +// if your providerChain may return a credential type with RsaKeyPairCredential, +// please ensure your regionID is `ap-northeast-1`. +func (client *Client) InitWithProviderChain(regionId string, provider provider.Provider) (err error) { + config := client.InitClientConfig() + credential, err := provider.Resolve() + if err != nil { + return + } + return client.InitWithOptions(regionId, config, credential) +} + +func (client *Client) InitWithOptions(regionId string, config *Config, credential auth.Credential) (err error) { + client.isRunning = true + client.asyncChanLock = new(sync.RWMutex) + client.regionId = regionId + client.config = config + client.httpClient = &http.Client{} + + if config.HttpTransport != nil { + client.httpClient.Transport = config.HttpTransport + } + + if config.Timeout > 0 { + client.httpClient.Timeout = config.Timeout + } + + if config.EnableAsync { + client.EnableAsync(config.GoRoutinePoolSize, config.MaxTaskQueueSize) + } + + client.signer, err = auth.NewSignerWithCredential(credential, client.ProcessCommonRequestWithSigner) + + return +} + +func (client *Client) SetReadTimeout(readTimeout time.Duration) { + client.readTimeout = readTimeout +} + +func (client *Client) SetConnectTimeout(connectTimeout time.Duration) { + client.connectTimeout = connectTimeout +} + +func (client *Client) GetReadTimeout() time.Duration { + return client.readTimeout +} + +func (client *Client) GetConnectTimeout() time.Duration { + return client.connectTimeout +} + +func (client *Client) getHttpProxy(scheme string) (proxy *url.URL, err error) { + if scheme == "https" { + if client.GetHttpsProxy() != "" { + proxy, err = url.Parse(client.httpsProxy) + } else if rawurl := os.Getenv("HTTPS_PROXY"); rawurl != "" { + proxy, err = url.Parse(rawurl) + } else if rawurl := os.Getenv("https_proxy"); rawurl != "" { + proxy, err = url.Parse(rawurl) + } + } else { + if client.GetHttpProxy() != "" { + proxy, err = url.Parse(client.httpProxy) + } else if rawurl := os.Getenv("HTTP_PROXY"); rawurl != "" { + proxy, err = url.Parse(rawurl) + } else if rawurl := os.Getenv("http_proxy"); rawurl != "" { + proxy, err = url.Parse(rawurl) + } + } + + return proxy, err +} + +func (client *Client) getNoProxy(scheme string) []string { + var urls []string + if client.GetNoProxy() != "" { + urls = strings.Split(client.noProxy, ",") + } else if rawurl := os.Getenv("NO_PROXY"); rawurl != "" { + urls = strings.Split(rawurl, ",") + } else if rawurl := os.Getenv("no_proxy"); rawurl != "" { + urls = strings.Split(rawurl, ",") + } + + return urls +} + +// EnableAsync enable the async task queue +func (client *Client) EnableAsync(routinePoolSize, maxTaskQueueSize int) { + client.asyncTaskQueue = make(chan func(), maxTaskQueueSize) + for i := 0; i < routinePoolSize; i++ { + go func() { + for client.isRunning { + select { + case task, notClosed := <-client.asyncTaskQueue: + if notClosed { + task() + } + } + } + }() + } +} + +func (client *Client) InitWithAccessKey(regionId, accessKeyId, accessKeySecret string) (err error) { + config := client.InitClientConfig() + credential := &credentials.BaseCredential{ + AccessKeyId: accessKeyId, + AccessKeySecret: accessKeySecret, + } + return client.InitWithOptions(regionId, config, credential) +} + +func (client *Client) InitWithStsToken(regionId, accessKeyId, accessKeySecret, securityToken string) (err error) { + config := client.InitClientConfig() + credential := &credentials.StsTokenCredential{ + AccessKeyId: accessKeyId, + AccessKeySecret: accessKeySecret, + AccessKeyStsToken: securityToken, + } + return client.InitWithOptions(regionId, config, credential) +} + +func (client *Client) InitWithRamRoleArn(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (err error) { + config := client.InitClientConfig() + credential := &credentials.RamRoleArnCredential{ + AccessKeyId: accessKeyId, + AccessKeySecret: accessKeySecret, + RoleArn: roleArn, + RoleSessionName: roleSessionName, + } + return client.InitWithOptions(regionId, config, credential) +} + +func (client *Client) InitWithRamRoleArnAndPolicy(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName, policy string) (err error) { + config := client.InitClientConfig() + credential := &credentials.RamRoleArnCredential{ + AccessKeyId: accessKeyId, + AccessKeySecret: accessKeySecret, + RoleArn: roleArn, + RoleSessionName: roleSessionName, + Policy: policy, + } + return client.InitWithOptions(regionId, config, credential) +} + +func (client *Client) InitWithRsaKeyPair(regionId, publicKeyId, privateKey string, sessionExpiration int) (err error) { + config := client.InitClientConfig() + credential := &credentials.RsaKeyPairCredential{ + PrivateKey: privateKey, + PublicKeyId: publicKeyId, + SessionExpiration: sessionExpiration, + } + return client.InitWithOptions(regionId, config, credential) +} + +func (client *Client) InitWithEcsRamRole(regionId, roleName string) (err error) { + config := client.InitClientConfig() + credential := &credentials.EcsRamRoleCredential{ + RoleName: roleName, + } + return client.InitWithOptions(regionId, config, credential) +} + +func (client *Client) InitWithBearerToken(regionId, bearerToken string) (err error) { + config := client.InitClientConfig() + credential := &credentials.BearerTokenCredential{ + BearerToken: bearerToken, + } + return client.InitWithOptions(regionId, config, credential) +} + +func (client *Client) InitClientConfig() (config *Config) { + if client.config != nil { + return client.config + } else { + return NewConfig() + } +} + +func (client *Client) DoAction(request requests.AcsRequest, response responses.AcsResponse) (err error) { + return client.DoActionWithSigner(request, response, nil) +} + +func (client *Client) buildRequestWithSigner(request requests.AcsRequest, signer auth.Signer) (httpRequest *http.Request, err error) { + // add clientVersion + request.GetHeaders()["x-sdk-core-version"] = Version + + regionId := client.regionId + if len(request.GetRegionId()) > 0 { + regionId = request.GetRegionId() + } + + // resolve endpoint + resolveParam := &endpoints.ResolveParam{ + Domain: request.GetDomain(), + Product: request.GetProduct(), + RegionId: regionId, + LocationProduct: request.GetLocationServiceCode(), + LocationEndpointType: request.GetLocationEndpointType(), + CommonApi: client.ProcessCommonRequest, + } + endpoint, err := endpoints.Resolve(resolveParam) + if err != nil { + return + } + request.SetDomain(endpoint) + if request.GetScheme() == "" { + request.SetScheme(client.config.Scheme) + } + // init request params + err = requests.InitParams(request) + if err != nil { + return + } + + // signature + var finalSigner auth.Signer + if signer != nil { + finalSigner = signer + } else { + finalSigner = client.signer + } + httpRequest, err = buildHttpRequest(request, finalSigner, regionId) + if err == nil { + userAgent := DefaultUserAgent + getSendUserAgent(client.config.UserAgent, client.userAgent, request.GetUserAgent()) + httpRequest.Header.Set("User-Agent", userAgent) + } + + return +} + +func getSendUserAgent(configUserAgent string, clientUserAgent, requestUserAgent map[string]string) string { + realUserAgent := "" + for key1, value1 := range clientUserAgent { + for key2, _ := range requestUserAgent { + if key1 == key2 { + key1 = "" + } + } + if key1 != "" { + realUserAgent += fmt.Sprintf(" %s/%s", key1, value1) + + } + } + for key, value := range requestUserAgent { + realUserAgent += fmt.Sprintf(" %s/%s", key, value) + } + if configUserAgent != "" { + return realUserAgent + fmt.Sprintf(" Extra/%s", configUserAgent) + } + return realUserAgent +} + +func (client *Client) AppendUserAgent(key, value string) { + newkey := true + + if client.userAgent == nil { + client.userAgent = make(map[string]string) + } + if strings.ToLower(key) != "core" && strings.ToLower(key) != "go" { + for tag, _ := range client.userAgent { + if tag == key { + client.userAgent[tag] = value + newkey = false + } + } + if newkey { + client.userAgent[key] = value + } + } +} + +func (client *Client) BuildRequestWithSigner(request requests.AcsRequest, signer auth.Signer) (err error) { + _, err = client.buildRequestWithSigner(request, signer) + return +} + +func (client *Client) getTimeout(request requests.AcsRequest) (time.Duration, time.Duration) { + readTimeout := defaultReadTimeout + connectTimeout := defaultConnectTimeout + + reqReadTimeout := request.GetReadTimeout() + reqConnectTimeout := request.GetConnectTimeout() + if reqReadTimeout != 0*time.Millisecond { + readTimeout = reqReadTimeout + } else if client.readTimeout != 0*time.Millisecond { + readTimeout = client.readTimeout + } else if client.httpClient.Timeout != 0 && client.httpClient.Timeout != 10000000000 { + readTimeout = client.httpClient.Timeout + } + + if reqConnectTimeout != 0*time.Millisecond { + connectTimeout = reqConnectTimeout + } else if client.connectTimeout != 0*time.Millisecond { + connectTimeout = client.connectTimeout + } + return readTimeout, connectTimeout +} + +func Timeout(connectTimeout time.Duration) func(cxt context.Context, net, addr string) (c net.Conn, err error) { + return func(ctx context.Context, network, address string) (net.Conn, error) { + return (&net.Dialer{ + Timeout: connectTimeout, + DualStack: true, + }).DialContext(ctx, network, address) + } +} + +func (client *Client) setTimeout(request requests.AcsRequest) { + readTimeout, connectTimeout := client.getTimeout(request) + client.httpClient.Timeout = readTimeout + if trans, ok := client.httpClient.Transport.(*http.Transport); ok && trans != nil { + trans.DialContext = Timeout(connectTimeout) + client.httpClient.Transport = trans + } else { + client.httpClient.Transport = &http.Transport{ + DialContext: Timeout(connectTimeout), + } + } +} + +func (client *Client) getHTTPSInsecure(request requests.AcsRequest) (insecure bool) { + if request.GetHTTPSInsecure() != nil { + insecure = *request.GetHTTPSInsecure() + } else { + insecure = client.GetHTTPSInsecure() + } + return insecure +} + +func (client *Client) DoActionWithSigner(request requests.AcsRequest, response responses.AcsResponse, signer auth.Signer) (err error) { + + fieldMap := make(map[string]string) + initLogMsg(fieldMap) + defer func() { + client.printLog(fieldMap, err) + }() + httpRequest, err := client.buildRequestWithSigner(request, signer) + if err != nil { + return + } + + client.setTimeout(request) + proxy, err := client.getHttpProxy(httpRequest.URL.Scheme) + if err != nil { + return err + } + + noProxy := client.getNoProxy(httpRequest.URL.Scheme) + + var flag bool + for _, value := range noProxy { + if value == httpRequest.Host { + flag = true + break + } + } + + // Set whether to ignore certificate validation. + // Default InsecureSkipVerify is false. + if trans, ok := client.httpClient.Transport.(*http.Transport); ok && trans != nil { + trans.TLSClientConfig = &tls.Config{ + InsecureSkipVerify: client.getHTTPSInsecure(request), + } + if proxy != nil && !flag { + trans.Proxy = http.ProxyURL(proxy) + } + client.httpClient.Transport = trans + } + + var httpResponse *http.Response + for retryTimes := 0; retryTimes <= client.config.MaxRetryTime; retryTimes++ { + if proxy != nil && proxy.User != nil { + if password, passwordSet := proxy.User.Password(); passwordSet { + httpRequest.SetBasicAuth(proxy.User.Username(), password) + } + } + if retryTimes > 0 { + client.printLog(fieldMap, err) + initLogMsg(fieldMap) + } + putMsgToMap(fieldMap, httpRequest) + debug("> %s %s %s", httpRequest.Method, httpRequest.URL.RequestURI(), httpRequest.Proto) + debug("> Host: %s", httpRequest.Host) + for key, value := range httpRequest.Header { + debug("> %s: %v", key, strings.Join(value, "")) + } + debug(">") + debug(" Retry Times: %d.", retryTimes) + + startTime := time.Now() + fieldMap["{start_time}"] = startTime.Format("2006-01-02 15:04:05") + httpResponse, err = hookDo(client.httpClient.Do)(httpRequest) + fieldMap["{cost}"] = time.Now().Sub(startTime).String() + if err == nil { + fieldMap["{code}"] = strconv.Itoa(httpResponse.StatusCode) + fieldMap["{res_headers}"] = TransToString(httpResponse.Header) + debug("< %s %s", httpResponse.Proto, httpResponse.Status) + for key, value := range httpResponse.Header { + debug("< %s: %v", key, strings.Join(value, "")) + } + } + debug("<") + // receive error + if err != nil { + debug(" Error: %s.", err.Error()) + if !client.config.AutoRetry { + return + } else if retryTimes >= client.config.MaxRetryTime { + // timeout but reached the max retry times, return + times := strconv.Itoa(retryTimes + 1) + timeoutErrorMsg := fmt.Sprintf(errors.TimeoutErrorMessage, times, times) + if strings.Contains(err.Error(), "Client.Timeout") { + timeoutErrorMsg += " Read timeout. Please set a valid ReadTimeout." + } else { + timeoutErrorMsg += " Connect timeout. Please set a valid ConnectTimeout." + } + err = errors.NewClientError(errors.TimeoutErrorCode, timeoutErrorMsg, err) + return + } + } + // if status code >= 500 or timeout, will trigger retry + if client.config.AutoRetry && (err != nil || isServerError(httpResponse)) { + client.setTimeout(request) + // rewrite signatureNonce and signature + httpRequest, err = client.buildRequestWithSigner(request, signer) + // buildHttpRequest(request, finalSigner, regionId) + if err != nil { + return + } + continue + } + break + } + + err = responses.Unmarshal(response, httpResponse, request.GetAcceptFormat()) + // wrap server errors + if serverErr, ok := err.(*errors.ServerError); ok { + var wrapInfo = map[string]string{} + wrapInfo["StringToSign"] = request.GetStringToSign() + err = errors.WrapServerError(serverErr, wrapInfo) + } + return +} + +func putMsgToMap(fieldMap map[string]string, request *http.Request) { + fieldMap["{host}"] = request.Host + fieldMap["{method}"] = request.Method + fieldMap["{uri}"] = request.URL.RequestURI() + fieldMap["{pid}"] = strconv.Itoa(os.Getpid()) + fieldMap["{version}"] = strings.Split(request.Proto, "/")[1] + hostname, _ := os.Hostname() + fieldMap["{hostname}"] = hostname + fieldMap["{req_headers}"] = TransToString(request.Header) + fieldMap["{target}"] = request.URL.Path + request.URL.RawQuery +} + +func buildHttpRequest(request requests.AcsRequest, singer auth.Signer, regionId string) (httpRequest *http.Request, err error) { + err = auth.Sign(request, singer, regionId) + if err != nil { + return + } + requestMethod := request.GetMethod() + requestUrl := request.BuildUrl() + body := request.GetBodyReader() + httpRequest, err = http.NewRequest(requestMethod, requestUrl, body) + if err != nil { + return + } + for key, value := range request.GetHeaders() { + httpRequest.Header[key] = []string{value} + } + // host is a special case + if host, containsHost := request.GetHeaders()["Host"]; containsHost { + httpRequest.Host = host + } + return +} + +func isServerError(httpResponse *http.Response) bool { + return httpResponse.StatusCode >= http.StatusInternalServerError +} + +/** +only block when any one of the following occurs: +1. the asyncTaskQueue is full, increase the queue size to avoid this +2. Shutdown() in progressing, the client is being closed +**/ +func (client *Client) AddAsyncTask(task func()) (err error) { + if client.asyncTaskQueue != nil { + client.asyncChanLock.RLock() + defer client.asyncChanLock.RUnlock() + if client.isRunning { + client.asyncTaskQueue <- task + } + } else { + err = errors.NewClientError(errors.AsyncFunctionNotEnabledCode, errors.AsyncFunctionNotEnabledMessage, nil) + } + return +} + +func (client *Client) GetConfig() *Config { + return client.config +} + +func NewClient() (client *Client, err error) { + client = &Client{} + err = client.Init() + return +} + +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 +} + +func NewClientWithOptions(regionId string, config *Config, credential auth.Credential) (client *Client, err error) { + client = &Client{} + err = client.InitWithOptions(regionId, config, credential) + return +} + +func NewClientWithAccessKey(regionId, accessKeyId, accessKeySecret string) (client *Client, err error) { + client = &Client{} + err = client.InitWithAccessKey(regionId, accessKeyId, accessKeySecret) + return +} + +func NewClientWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken string) (client *Client, err error) { + client = &Client{} + err = client.InitWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken) + return +} + +func NewClientWithRamRoleArn(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (client *Client, err error) { + client = &Client{} + err = client.InitWithRamRoleArn(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName) + return +} + +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 +} + +func NewClientWithEcsRamRole(regionId string, roleName string) (client *Client, err error) { + client = &Client{} + err = client.InitWithEcsRamRole(regionId, roleName) + return +} + +func NewClientWithRsaKeyPair(regionId string, publicKeyId, privateKey string, sessionExpiration int) (client *Client, err error) { + client = &Client{} + err = client.InitWithRsaKeyPair(regionId, publicKeyId, privateKey, sessionExpiration) + return +} + +func NewClientWithBearerToken(regionId, bearerToken string) (client *Client, err error) { + client = &Client{} + err = client.InitWithBearerToken(regionId, bearerToken) + return +} + +func (client *Client) ProcessCommonRequest(request *requests.CommonRequest) (response *responses.CommonResponse, err error) { + request.TransToAcsRequest() + response = responses.NewCommonResponse() + err = client.DoAction(request, response) + return +} + +func (client *Client) ProcessCommonRequestWithSigner(request *requests.CommonRequest, signerInterface interface{}) (response *responses.CommonResponse, err error) { + if signer, isSigner := signerInterface.(auth.Signer); isSigner { + request.TransToAcsRequest() + response = responses.NewCommonResponse() + err = client.DoActionWithSigner(request, response, signer) + return + } + panic("should not be here") +} + +func (client *Client) Shutdown() { + // lock the addAsync() + client.asyncChanLock.Lock() + defer client.asyncChanLock.Unlock() + if client.asyncTaskQueue != nil { + close(client.asyncTaskQueue) + } + client.isRunning = false +} + +// Deprecated: Use NewClientWithRamRoleArn in this package instead. +func NewClientWithStsRoleArn(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (client *Client, err error) { + return NewClientWithRamRoleArn(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName) +} + +// Deprecated: Use NewClientWithEcsRamRole in this package instead. +func NewClientWithStsRoleNameOnEcs(regionId string, roleName string) (client *Client, err error) { + return NewClientWithEcsRamRole(regionId, roleName) +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/config.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/config.go new file mode 100644 index 000000000..e8862e0c2 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/config.go @@ -0,0 +1,91 @@ +/* + * 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. + */ + +package sdk + +import ( + "net/http" + "time" + + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils" +) + +type Config struct { + AutoRetry bool `default:"true"` + MaxRetryTime int `default:"3"` + UserAgent string `default:""` + Debug bool `default:"false"` + Timeout time.Duration `default:"10000000000"` + HttpTransport *http.Transport `default:""` + EnableAsync bool `default:"false"` + MaxTaskQueueSize int `default:"1000"` + GoRoutinePoolSize int `default:"5"` + Scheme string `default:"HTTP"` +} + +func NewConfig() (config *Config) { + config = &Config{} + utils.InitStructWithDefaultTag(config) + return +} + +func (c *Config) WithAutoRetry(isAutoRetry bool) *Config { + c.AutoRetry = isAutoRetry + return c +} + +func (c *Config) WithMaxRetryTime(maxRetryTime int) *Config { + c.MaxRetryTime = maxRetryTime + return c +} + +func (c *Config) WithUserAgent(userAgent string) *Config { + c.UserAgent = userAgent + return c +} + +func (c *Config) WithDebug(isDebug bool) *Config { + c.Debug = isDebug + return c +} + +func (c *Config) WithTimeout(timeout time.Duration) *Config { + c.Timeout = timeout + return c +} + +func (c *Config) WithHttpTransport(httpTransport *http.Transport) *Config { + c.HttpTransport = httpTransport + return c +} + +func (c *Config) WithEnableAsync(isEnableAsync bool) *Config { + c.EnableAsync = isEnableAsync + return c +} + +func (c *Config) WithMaxTaskQueueSize(maxTaskQueueSize int) *Config { + c.MaxTaskQueueSize = maxTaskQueueSize + return c +} + +func (c *Config) WithGoRoutinePoolSize(goRoutinePoolSize int) *Config { + c.GoRoutinePoolSize = goRoutinePoolSize + return c +} + +func (c *Config) WithScheme(scheme string) *Config { + c.Scheme = scheme + return c +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/endpoints_config.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/endpoints_config.go new file mode 100644 index 000000000..60adf7d45 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/endpoints_config.go @@ -0,0 +1,1670 @@ + +package endpoints + +import ( + "encoding/json" + "fmt" + "sync" +) + +const endpointsJson =`{ + "products": [ + { + "code": "ecs", + "document_id": "25484", + "location_service_code": "ecs", + "regional_endpoints": [ + { + "region": "cn-shanghai", + "endpoint": "ecs-cn-hangzhou.aliyuncs.com" + }, + { + "region": "eu-west-1", + "endpoint": "ecs.eu-west-1.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "ecs.cn-huhehaote.aliyuncs.com" + }, + { + "region": "me-east-1", + "endpoint": "ecs.me-east-1.aliyuncs.com" + }, + { + "region": "ap-southeast-3", + "endpoint": "ecs.ap-southeast-3.aliyuncs.com" + }, + { + "region": "ap-southeast-2", + "endpoint": "ecs.ap-southeast-2.aliyuncs.com" + }, + { + "region": "ap-south-1", + "endpoint": "ecs.ap-south-1.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "ecs-cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "ecs-cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "ecs-cn-hangzhou.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "ecs.ap-northeast-1.aliyuncs.com" + }, + { + "region": "ap-southeast-5", + "endpoint": "ecs.ap-southeast-5.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "ecs.eu-central-1.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "ecs.cn-zhangjiakou.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "ecs-cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "ecs-cn-hangzhou.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "ecs-cn-hangzhou.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "ecs-cn-hangzhou.aliyuncs.com" + }, + { + "region": "us-east-1", + "endpoint": "ecs-cn-hangzhou.aliyuncs.com" + } + ], + "global_endpoint": "ecs-cn-hangzhou.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "chatbot", + "document_id": "60760", + "location_service_code": "beebot", + "regional_endpoints": [ + { + "region": "cn-shanghai", + "endpoint": "chatbot.cn-shanghai.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "chatbot.cn-hangzhou.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "chatbot.[RegionId].aliyuncs.com" + }, + { + "code": "alidns", + "document_id": "29739", + "location_service_code": "alidns", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "alidns.aliyuncs.com" + } + ], + "global_endpoint": "alidns.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "itaas", + "document_id": "55759", + "location_service_code": "itaas", + "regional_endpoints": null, + "global_endpoint": "itaas.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "csb", + "document_id": "64837", + "location_service_code": "csb", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "csb.cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "csb.cn-beijing.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "csb.[RegionId].aliyuncs.com" + }, + { + "code": "slb", + "document_id": "27565", + "location_service_code": "slb", + "regional_endpoints": [ + { + "region": "cn-hongkong", + "endpoint": "slb.aliyuncs.com" + }, + { + "region": "me-east-1", + "endpoint": "slb.me-east-1.aliyuncs.com" + }, + { + "region": "ap-southeast-5", + "endpoint": "slb.ap-southeast-5.aliyuncs.com" + }, + { + "region": "ap-southeast-2", + "endpoint": "slb.ap-southeast-2.aliyuncs.com" + }, + { + "region": "ap-south-1", + "endpoint": "slb.ap-south-1.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "slb.eu-central-1.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "slb.aliyuncs.com" + }, + { + "region": "eu-west-1", + "endpoint": "slb.eu-west-1.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "slb.cn-huhehaote.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "slb.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "slb.cn-zhangjiakou.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "slb.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "slb.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "slb.aliyuncs.com" + }, + { + "region": "us-east-1", + "endpoint": "slb.aliyuncs.com" + }, + { + "region": "ap-southeast-3", + "endpoint": "slb.ap-southeast-3.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "slb.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "slb.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "slb.ap-northeast-1.aliyuncs.com" + } + ], + "global_endpoint": "slb.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "cloudwf", + "document_id": "58111", + "location_service_code": "cloudwf", + "regional_endpoints": null, + "global_endpoint": "cloudwf.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "cloudphoto", + "document_id": "59902", + "location_service_code": "cloudphoto", + "regional_endpoints": [ + { + "region": "cn-shanghai", + "endpoint": "cloudphoto.cn-shanghai.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "cloudphoto.[RegionId].aliyuncs.com" + }, + { + "code": "dds", + "document_id": "61715", + "location_service_code": "dds", + "regional_endpoints": [ + { + "region": "ap-southeast-5", + "endpoint": "mongodb.ap-southeast-5.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "mongodb.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "mongodb.aliyuncs.com" + }, + { + "region": "eu-west-1", + "endpoint": "mongodb.eu-west-1.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "mongodb.aliyuncs.com" + }, + { + "region": "us-east-1", + "endpoint": "mongodb.aliyuncs.com" + }, + { + "region": "me-east-1", + "endpoint": "mongodb.me-east-1.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "mongodb.cn-zhangjiakou.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "mongodb.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "mongodb.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "mongodb.ap-northeast-1.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "mongodb.aliyuncs.com" + }, + { + "region": "ap-southeast-2", + "endpoint": "mongodb.ap-southeast-2.aliyuncs.com" + }, + { + "region": "ap-southeast-3", + "endpoint": "mongodb.ap-southeast-3.aliyuncs.com" + }, + { + "region": "ap-south-1", + "endpoint": "mongodb.ap-south-1.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "mongodb.eu-central-1.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "mongodb.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "mongodb.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "mongodb.cn-huhehaote.aliyuncs.com" + } + ], + "global_endpoint": "mongodb.aliyuncs.com", + "regional_endpoint_pattern": "mongodb.[RegionId].aliyuncs.com" + }, + { + "code": "dm", + "document_id": "29434", + "location_service_code": "dm", + "regional_endpoints": [ + { + "region": "ap-southeast-2", + "endpoint": "dm.ap-southeast-2.aliyuncs.com" + } + ], + "global_endpoint": "dm.aliyuncs.com", + "regional_endpoint_pattern": "dm.[RegionId].aliyuncs.com" + }, + { + "code": "ons", + "document_id": "44416", + "location_service_code": "ons", + "regional_endpoints": [ + { + "region": "cn-zhangjiakou", + "endpoint": "ons.cn-zhangjiakou.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "ons.us-west-1.aliyuncs.com" + }, + { + "region": "me-east-1", + "endpoint": "ons.me-east-1.aliyuncs.com" + }, + { + "region": "us-east-1", + "endpoint": "ons.us-east-1.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "ons.ap-northeast-1.aliyuncs.com" + }, + { + "region": "ap-southeast-2", + "endpoint": "ons.ap-southeast-2.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "ons.ap-southeast-1.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "ons.cn-shanghai.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "ons.cn-shenzhen.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "ons.cn-hangzhou.aliyuncs.com" + }, + { + "region": "ap-south-1", + "endpoint": "ons.cn-hangzhou.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "ons.eu-central-1.aliyuncs.com" + }, + { + "region": "eu-west-1", + "endpoint": "ons.eu-west-1.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "ons.cn-beijing.aliyuncs.com" + }, + { + "region": "ap-southeast-3", + "endpoint": "ons.ap-southeast-3.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "ons.cn-huhehaote.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "ons.cn-hongkong.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "ons.cn-qingdao.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "polardb", + "document_id": "58764", + "location_service_code": "polardb", + "regional_endpoints": [ + { + "region": "cn-qingdao", + "endpoint": "polardb.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "polardb.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "polardb.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "polardb.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "polardb.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "polardb.cn-huhehaote.aliyuncs.com" + }, + { + "region": "ap-southeast-5", + "endpoint": "polardb.ap-southeast-5.aliyuncs.com" + }, + { + "region": "ap-south-1", + "endpoint": "polardb.ap-south-1.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "polardb.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "polardb.aliyuncs.com" + }, + { + "code": "batchcompute", + "document_id": "44717", + "location_service_code": "batchcompute", + "regional_endpoints": [ + { + "region": "us-west-1", + "endpoint": "batchcompute.us-west-1.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "batchcompute.cn-beijing.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "batchcompute.cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "batchcompute.cn-shanghai.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "batchcompute.ap-southeast-1.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "batchcompute.cn-huhehaote.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "batchcompute.cn-qingdao.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "batchcompute.cn-zhangjiakou.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "batchcompute.cn-shenzhen.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "batchcompute.[RegionId].aliyuncs.com" + }, + { + "code": "cloudauth", + "document_id": "60687", + "location_service_code": "cloudauth", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "cloudauth.aliyuncs.com" + } + ], + "global_endpoint": "cloudauth.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "vod", + "document_id": "60574", + "location_service_code": "vod", + "regional_endpoints": [ + { + "region": "cn-beijing", + "endpoint": "vod.cn-shanghai.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "vod.ap-southeast-1.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "vod.eu-central-1.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "vod.cn-shanghai.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "vod.cn-shanghai.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "vod.cn-shanghai.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "ram", + "document_id": "28672", + "location_service_code": "ram", + "regional_endpoints": null, + "global_endpoint": "ram.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "ess", + "document_id": "25925", + "location_service_code": "ess", + "regional_endpoints": [ + { + "region": "me-east-1", + "endpoint": "ess.me-east-1.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "ess.ap-northeast-1.aliyuncs.com" + }, + { + "region": "ap-south-1", + "endpoint": "ess.ap-south-1.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "ess.eu-central-1.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "ess.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "ess.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "ess.cn-huhehaote.aliyuncs.com" + }, + { + "region": "ap-southeast-2", + "endpoint": "ess.ap-southeast-2.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "ess.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "ess.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "ess.aliyuncs.com" + }, + { + "region": "us-east-1", + "endpoint": "ess.aliyuncs.com" + }, + { + "region": "ap-southeast-5", + "endpoint": "ess.ap-southeast-5.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "ess.aliyuncs.com" + }, + { + "region": "ap-southeast-3", + "endpoint": "ess.ap-southeast-3.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "ess.cn-zhangjiakou.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "ess.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "ess.aliyuncs.com" + }, + { + "region": "eu-west-1", + "endpoint": "ess.eu-west-1.aliyuncs.com" + } + ], + "global_endpoint": "ess.aliyuncs.com", + "regional_endpoint_pattern": "ess.[RegionId].aliyuncs.com" + }, + { + "code": "live", + "document_id": "48207", + "location_service_code": "live", + "regional_endpoints": [ + { + "region": "cn-beijing", + "endpoint": "live.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "live.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "live.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "live.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "live.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "live.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "live.aliyuncs.com" + } + ], + "global_endpoint": "live.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "hpc", + "document_id": "35201", + "location_service_code": "hpc", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "hpc.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "hpc.aliyuncs.com" + } + ], + "global_endpoint": "hpc.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "rds", + "document_id": "26223", + "location_service_code": "rds", + "regional_endpoints": [ + { + "region": "me-east-1", + "endpoint": "rds.me-east-1.aliyuncs.com" + }, + { + "region": "ap-south-1", + "endpoint": "rds.ap-south-1.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "rds.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "rds.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "rds.aliyuncs.com" + }, + { + "region": "ap-southeast-3", + "endpoint": "rds.ap-southeast-3.aliyuncs.com" + }, + { + "region": "ap-southeast-2", + "endpoint": "rds.ap-southeast-2.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "rds.cn-zhangjiakou.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "rds.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "rds.aliyuncs.com" + }, + { + "region": "us-east-1", + "endpoint": "rds.aliyuncs.com" + }, + { + "region": "ap-southeast-5", + "endpoint": "rds.ap-southeast-5.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "rds.eu-central-1.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "rds.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "rds.aliyuncs.com" + }, + { + "region": "eu-west-1", + "endpoint": "rds.eu-west-1.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "rds.cn-huhehaote.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "rds.ap-northeast-1.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "rds.aliyuncs.com" + } + ], + "global_endpoint": "rds.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "cloudapi", + "document_id": "43590", + "location_service_code": "apigateway", + "regional_endpoints": [ + { + "region": "cn-beijing", + "endpoint": "apigateway.cn-beijing.aliyuncs.com" + }, + { + "region": "ap-southeast-2", + "endpoint": "apigateway.ap-southeast-2.aliyuncs.com" + }, + { + "region": "ap-south-1", + "endpoint": "apigateway.ap-south-1.aliyuncs.com" + }, + { + "region": "us-east-1", + "endpoint": "apigateway.us-east-1.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "apigateway.cn-shanghai.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "apigateway.us-west-1.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "apigateway.ap-southeast-1.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "apigateway.eu-central-1.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "apigateway.cn-qingdao.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "apigateway.cn-zhangjiakou.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "apigateway.cn-huhehaote.aliyuncs.com" + }, + { + "region": "eu-west-1", + "endpoint": "apigateway.eu-west-1.aliyuncs.com" + }, + { + "region": "me-east-1", + "endpoint": "apigateway.me-east-1.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "apigateway.cn-hangzhou.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "apigateway.ap-northeast-1.aliyuncs.com" + }, + { + "region": "ap-southeast-5", + "endpoint": "apigateway.ap-southeast-5.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "apigateway.cn-hongkong.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "apigateway.cn-shenzhen.aliyuncs.com" + }, + { + "region": "ap-southeast-3", + "endpoint": "apigateway.ap-southeast-3.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "apigateway.[RegionId].aliyuncs.com" + }, + { + "code": "sas-api", + "document_id": "28498", + "location_service_code": "sas", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "sas.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "cs", + "document_id": "26043", + "location_service_code": "cs", + "regional_endpoints": null, + "global_endpoint": "cs.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "jaq", + "document_id": "35037", + "location_service_code": "jaq", + "regional_endpoints": null, + "global_endpoint": "jaq.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "r-kvstore", + "document_id": "60831", + "location_service_code": "redisa", + "regional_endpoints": [ + { + "region": "cn-huhehaote", + "endpoint": "r-kvstore.cn-huhehaote.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "r-kvstore.cn-zhangjiakou.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "r-kvstore.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "r-kvstore.aliyuncs.com" + }, + { + "region": "ap-south-1", + "endpoint": "r-kvstore.ap-south-1.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "r-kvstore.eu-central-1.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "r-kvstore.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "r-kvstore.aliyuncs.com" + }, + { + "region": "me-east-1", + "endpoint": "r-kvstore.me-east-1.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "r-kvstore.ap-northeast-1.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "r-kvstore.cn-hongkong.aliyuncs.com" + }, + { + "region": "ap-southeast-2", + "endpoint": "r-kvstore.ap-southeast-2.aliyuncs.com" + }, + { + "region": "eu-west-1", + "endpoint": "r-kvstore.eu-west-1.aliyuncs.com" + }, + { + "region": "ap-southeast-5", + "endpoint": "r-kvstore.ap-southeast-5.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "r-kvstore.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "r-kvstore.ap-southeast-1.aliyuncs.com" + }, + { + "region": "ap-southeast-3", + "endpoint": "r-kvstore.ap-southeast-3.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "r-kvstore.aliyuncs.com" + }, + { + "region": "us-east-1", + "endpoint": "r-kvstore.aliyuncs.com" + } + ], + "global_endpoint": "r-kvstore.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "drds", + "document_id": "51111", + "location_service_code": "drds", + "regional_endpoints": [ + { + "region": "ap-southeast-1", + "endpoint": "drds.ap-southeast-1.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "drds.cn-hangzhou.aliyuncs.com" + } + ], + "global_endpoint": "drds.aliyuncs.com", + "regional_endpoint_pattern": "drds.aliyuncs.com" + }, + { + "code": "waf", + "document_id": "62847", + "location_service_code": "waf", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "wafopenapi.cn-hangzhou.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "sts", + "document_id": "28756", + "location_service_code": "sts", + "regional_endpoints": null, + "global_endpoint": "sts.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "cr", + "document_id": "60716", + "location_service_code": "cr", + "regional_endpoints": null, + "global_endpoint": "cr.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "arms", + "document_id": "42924", + "location_service_code": "arms", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "arms.cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "arms.cn-shanghai.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "arms.cn-hongkong.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "arms.ap-southeast-1.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "arms.cn-shenzhen.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "arms.cn-qingdao.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "arms.cn-beijing.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "arms.[RegionId].aliyuncs.com" + }, + { + "code": "iot", + "document_id": "30557", + "location_service_code": "iot", + "regional_endpoints": [ + { + "region": "us-east-1", + "endpoint": "iot.us-east-1.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "iot.ap-northeast-1.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "iot.us-west-1.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "iot.eu-central-1.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "iot.cn-shanghai.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "iot.ap-southeast-1.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "iot.[RegionId].aliyuncs.com" + }, + { + "code": "vpc", + "document_id": "34962", + "location_service_code": "vpc", + "regional_endpoints": [ + { + "region": "us-west-1", + "endpoint": "vpc.aliyuncs.com" + }, + { + "region": "us-east-1", + "endpoint": "vpc.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "vpc.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "vpc.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "vpc.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "vpc.cn-huhehaote.aliyuncs.com" + }, + { + "region": "me-east-1", + "endpoint": "vpc.me-east-1.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "vpc.ap-northeast-1.aliyuncs.com" + }, + { + "region": "ap-southeast-3", + "endpoint": "vpc.ap-southeast-3.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "vpc.eu-central-1.aliyuncs.com" + }, + { + "region": "ap-southeast-5", + "endpoint": "vpc.ap-southeast-5.aliyuncs.com" + }, + { + "region": "ap-south-1", + "endpoint": "vpc.ap-south-1.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "vpc.cn-zhangjiakou.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "vpc.aliyuncs.com" + }, + { + "region": "ap-southeast-2", + "endpoint": "vpc.ap-southeast-2.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "vpc.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "vpc.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "vpc.aliyuncs.com" + }, + { + "region": "eu-west-1", + "endpoint": "vpc.eu-west-1.aliyuncs.com" + } + ], + "global_endpoint": "vpc.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "aegis", + "document_id": "28449", + "location_service_code": "vipaegis", + "regional_endpoints": [ + { + "region": "ap-southeast-3", + "endpoint": "aegis.ap-southeast-3.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "aegis.cn-hangzhou.aliyuncs.com" + } + ], + "global_endpoint": "aegis.cn-hangzhou.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "domain", + "document_id": "42875", + "location_service_code": "domain", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "domain.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "domain-intl.aliyuncs.com" + } + ], + "global_endpoint": "domain.aliyuncs.com", + "regional_endpoint_pattern": "domain.aliyuncs.com" + }, + { + "code": "cdn", + "document_id": "27148", + "location_service_code": "cdn", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "cdn.aliyuncs.com" + } + ], + "global_endpoint": "cdn.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "qualitycheck", + "document_id": "50807", + "location_service_code": "qualitycheck", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "qualitycheck.cn-hangzhou.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "emr", + "document_id": "28140", + "location_service_code": "emr", + "regional_endpoints": [ + { + "region": "us-east-1", + "endpoint": "emr.us-east-1.aliyuncs.com" + }, + { + "region": "ap-southeast-5", + "endpoint": "emr.ap-southeast-5.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "emr.eu-central-1.aliyuncs.com" + }, + { + "region": "eu-west-1", + "endpoint": "emr.eu-west-1.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "emr.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "emr.aliyuncs.com" + }, + { + "region": "ap-south-1", + "endpoint": "emr.ap-south-1.aliyuncs.com" + }, + { + "region": "me-east-1", + "endpoint": "emr.me-east-1.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "emr.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "emr.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "emr.cn-hongkong.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "emr.cn-huhehaote.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "emr.ap-northeast-1.aliyuncs.com" + }, + { + "region": "ap-southeast-3", + "endpoint": "emr.ap-southeast-3.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "emr.aliyuncs.com" + }, + { + "region": "ap-southeast-2", + "endpoint": "emr.ap-southeast-2.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "emr.cn-zhangjiakou.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "emr.cn-qingdao.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "emr.aliyuncs.com" + } + ], + "global_endpoint": "emr.aliyuncs.com", + "regional_endpoint_pattern": "emr.[RegionId].aliyuncs.com" + }, + { + "code": "httpdns", + "document_id": "52679", + "location_service_code": "httpdns", + "regional_endpoints": null, + "global_endpoint": "httpdns-api.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "push", + "document_id": "30074", + "location_service_code": "push", + "regional_endpoints": null, + "global_endpoint": "cloudpush.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "cms", + "document_id": "28615", + "location_service_code": "cms", + "regional_endpoints": [ + { + "region": "cn-qingdao", + "endpoint": "metrics.cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "metrics.cn-hangzhou.aliyuncs.com" + }, + { + "region": "eu-west-1", + "endpoint": "metrics.eu-west-1.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "metrics.cn-hangzhou.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "metrics.ap-northeast-1.aliyuncs.com" + }, + { + "region": "ap-south-1", + "endpoint": "metrics.ap-south-1.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "metrics.cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "metrics.cn-hangzhou.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "metrics.cn-hangzhou.aliyuncs.com" + }, + { + "region": "ap-southeast-2", + "endpoint": "metrics.cn-hangzhou.aliyuncs.com" + }, + { + "region": "ap-southeast-5", + "endpoint": "metrics.ap-southeast-5.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "metrics.cn-huhehaote.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "metrics.cn-hangzhou.aliyuncs.com" + }, + { + "region": "me-east-1", + "endpoint": "metrics.cn-hangzhou.aliyuncs.com" + }, + { + "region": "ap-southeast-3", + "endpoint": "metrics.ap-southeast-3.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "metrics.cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "metrics.cn-hangzhou.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "metrics.cn-hangzhou.aliyuncs.com" + }, + { + "region": "us-east-1", + "endpoint": "metrics.cn-hangzhou.aliyuncs.com" + } + ], + "global_endpoint": "metrics.cn-hangzhou.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "nas", + "document_id": "62598", + "location_service_code": "nas", + "regional_endpoints": [ + { + "region": "ap-southeast-5", + "endpoint": "nas.ap-southeast-5.aliyuncs.com" + }, + { + "region": "ap-south-1", + "endpoint": "nas.ap-south-1.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "nas.us-west-1.aliyuncs.com" + }, + { + "region": "ap-southeast-3", + "endpoint": "nas.ap-southeast-3.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "nas.cn-zhangjiakou.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "nas.ap-northeast-1.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "nas.cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "nas.cn-qingdao.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "nas.cn-beijing.aliyuncs.com" + }, + { + "region": "ap-southeast-2", + "endpoint": "nas.ap-southeast-2.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "nas.cn-shenzhen.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "nas.eu-central-1.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "nas.cn-huhehaote.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "nas.cn-shanghai.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "nas.cn-hongkong.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "nas.ap-southeast-1.aliyuncs.com" + }, + { + "region": "us-east-1", + "endpoint": "nas.us-east-1.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "cds", + "document_id": "62887", + "location_service_code": "codepipeline", + "regional_endpoints": [ + { + "region": "cn-beijing", + "endpoint": "cds.cn-beijing.aliyuncs.com" + } + ], + "global_endpoint": "cds.cn-beijing.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "green", + "document_id": "28427", + "location_service_code": "green", + "regional_endpoints": [ + { + "region": "us-west-1", + "endpoint": "green.us-west-1.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "green.cn-beijing.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "green.ap-southeast-1.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "green.cn-shanghai.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "green.cn-hangzhou.aliyuncs.com" + } + ], + "global_endpoint": "green.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "ccc", + "document_id": "63027", + "location_service_code": "ccc", + "regional_endpoints": [ + { + "region": "cn-shanghai", + "endpoint": "ccc.cn-shanghai.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "ccc.cn-hangzhou.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "ccc.[RegionId].aliyuncs.com" + }, + { + "code": "ros", + "document_id": "28899", + "location_service_code": "ros", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "ros.aliyuncs.com" + } + ], + "global_endpoint": "ros.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "mts", + "document_id": "29212", + "location_service_code": "mts", + "regional_endpoints": [ + { + "region": "ap-northeast-1", + "endpoint": "mts.ap-northeast-1.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "mts.cn-shanghai.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "mts.cn-hongkong.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "mts.cn-shenzhen.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "mts.us-west-1.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "mts.cn-zhangjiakou.aliyuncs.com" + }, + { + "region": "eu-west-1", + "endpoint": "mts.eu-west-1.aliyuncs.com" + }, + { + "region": "ap-south-1", + "endpoint": "mts.ap-south-1.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "mts.cn-beijing.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "mts.cn-hangzhou.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "mts.ap-southeast-1.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "mts.eu-central-1.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + } + ] +}` +var initOnce sync.Once +var data interface{} + +func getEndpointConfigData() interface{} { + initOnce.Do(func() { + err := json.Unmarshal([]byte(endpointsJson), &data) + if err != nil { + panic(fmt.Sprintf("init endpoint config data failed. %s", err)) + } + }) + return data +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/local_global_resolver.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/local_global_resolver.go new file mode 100644 index 000000000..160e62cb6 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/local_global_resolver.go @@ -0,0 +1,43 @@ +/* + * 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. + */ + +package endpoints + +import ( + "fmt" + "strings" + + "github.com/jmespath/go-jmespath" +) + +type LocalGlobalResolver struct { +} + +func (resolver *LocalGlobalResolver) GetName() (name string) { + name = "local global resolver" + return +} + +func (resolver *LocalGlobalResolver) TryResolve(param *ResolveParam) (endpoint string, support bool, err error) { + // get the global endpoints configs + endpointExpression := fmt.Sprintf("products[?code=='%s'].global_endpoint", strings.ToLower(param.Product)) + endpointData, err := jmespath.Search(endpointExpression, getEndpointConfigData()) + if err == nil && endpointData != nil && len(endpointData.([]interface{})) > 0 { + endpoint = endpointData.([]interface{})[0].(string) + support = len(endpoint) > 0 + return + } + support = false + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/local_regional_resolver.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/local_regional_resolver.go new file mode 100644 index 000000000..7fee64d42 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/local_regional_resolver.go @@ -0,0 +1,48 @@ +/* + * 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. + */ + +package endpoints + +import ( + "fmt" + "strings" + + "github.com/jmespath/go-jmespath" +) + +type LocalRegionalResolver struct { +} + +func (resolver *LocalRegionalResolver) GetName() (name string) { + name = "local regional resolver" + return +} + +func (resolver *LocalRegionalResolver) TryResolve(param *ResolveParam) (endpoint string, support bool, err error) { + // get the regional endpoints configs + regionalExpression := fmt.Sprintf("products[?code=='%s'].regional_endpoints", strings.ToLower(param.Product)) + regionalData, err := jmespath.Search(regionalExpression, getEndpointConfigData()) + if err == nil && regionalData != nil && len(regionalData.([]interface{})) > 0 { + endpointExpression := fmt.Sprintf("[0][?region=='%s'].endpoint", strings.ToLower(param.RegionId)) + var endpointData interface{} + endpointData, err = jmespath.Search(endpointExpression, regionalData) + if err == nil && endpointData != nil && len(endpointData.([]interface{})) > 0 { + endpoint = endpointData.([]interface{})[0].(string) + support = len(endpoint) > 0 + return + } + } + support = false + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/location_resolver.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/location_resolver.go new file mode 100644 index 000000000..cc354cc4d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/location_resolver.go @@ -0,0 +1,176 @@ +/* + * 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. + */ +package endpoints + +import ( + "encoding/json" + "sync" + "time" + + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" +) + +const ( + // EndpointCacheExpireTime ... + EndpointCacheExpireTime = 3600 //Seconds +) + +// Cache caches endpoint for specific product and region +type Cache struct { + sync.RWMutex + cache map[string]interface{} +} + +// Get ... +func (c *Cache) Get(k string) (v interface{}) { + c.RLock() + v = c.cache[k] + c.RUnlock() + return +} + +// Set ... +func (c *Cache) Set(k string, v interface{}) { + c.Lock() + c.cache[k] = v + c.Unlock() +} + +var lastClearTimePerProduct = &Cache{cache: make(map[string]interface{})} +var endpointCache = &Cache{cache: make(map[string]interface{})} + +// LocationResolver ... +type LocationResolver struct { +} + +func (resolver *LocationResolver) GetName() (name string) { + name = "location resolver" + return +} + +// TryResolve resolves endpoint giving product and region +func (resolver *LocationResolver) TryResolve(param *ResolveParam) (endpoint string, support bool, err error) { + if len(param.LocationProduct) <= 0 { + support = false + return + } + + //get from cache + cacheKey := param.Product + "#" + param.RegionId + var ok bool + endpoint, ok = endpointCache.Get(cacheKey).(string) + + if ok && len(endpoint) > 0 && !CheckCacheIsExpire(cacheKey) { + support = true + return + } + + //get from remote + getEndpointRequest := requests.NewCommonRequest() + + getEndpointRequest.Product = "Location" + getEndpointRequest.Version = "2015-06-12" + getEndpointRequest.ApiName = "DescribeEndpoints" + getEndpointRequest.Domain = "location-readonly.aliyuncs.com" + getEndpointRequest.Method = "GET" + getEndpointRequest.Scheme = requests.HTTPS + + getEndpointRequest.QueryParams["Id"] = param.RegionId + getEndpointRequest.QueryParams["ServiceCode"] = param.LocationProduct + if len(param.LocationEndpointType) > 0 { + getEndpointRequest.QueryParams["Type"] = param.LocationEndpointType + } else { + getEndpointRequest.QueryParams["Type"] = "openAPI" + } + + response, err := param.CommonApi(getEndpointRequest) + if err != nil { + support = false + return + } + + if !response.IsSuccess() { + support = false + return + } + + var getEndpointResponse GetEndpointResponse + err = json.Unmarshal([]byte(response.GetHttpContentString()), &getEndpointResponse) + if err != nil { + support = false + return + } + + if !getEndpointResponse.Success || getEndpointResponse.Endpoints == nil { + support = false + return + } + if len(getEndpointResponse.Endpoints.Endpoint) <= 0 { + support = false + return + } + if len(getEndpointResponse.Endpoints.Endpoint[0].Endpoint) > 0 { + endpoint = getEndpointResponse.Endpoints.Endpoint[0].Endpoint + endpointCache.Set(cacheKey, endpoint) + lastClearTimePerProduct.Set(cacheKey, time.Now().Unix()) + support = true + return + } + + support = false + return +} + +// CheckCacheIsExpire ... +func CheckCacheIsExpire(cacheKey string) bool { + lastClearTime, ok := lastClearTimePerProduct.Get(cacheKey).(int64) + if !ok { + return true + } + + if lastClearTime <= 0 { + lastClearTime = time.Now().Unix() + lastClearTimePerProduct.Set(cacheKey, lastClearTime) + } + + now := time.Now().Unix() + elapsedTime := now - lastClearTime + if elapsedTime > EndpointCacheExpireTime { + return true + } + + return false +} + +// GetEndpointResponse ... +type GetEndpointResponse struct { + Endpoints *EndpointsObj + RequestId string + Success bool +} + +// EndpointsObj ... +type EndpointsObj struct { + Endpoint []EndpointObj +} + +// EndpointObj ... +type EndpointObj struct { + // Protocols map[string]string + Type string + Namespace string + Id string + SerivceCode string + Endpoint string +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/mapping_resolver.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/mapping_resolver.go new file mode 100644 index 000000000..e39f53367 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/mapping_resolver.go @@ -0,0 +1,48 @@ +/* + * 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. + */ + +package endpoints + +import ( + "fmt" + "strings" +) + +const keyFormatter = "%s::%s" + +var endpointMapping = make(map[string]string) + +// AddEndpointMapping Use product id and region id as key to store the endpoint into inner map +func AddEndpointMapping(regionId, productId, endpoint string) (err error) { + key := fmt.Sprintf(keyFormatter, strings.ToLower(regionId), strings.ToLower(productId)) + endpointMapping[key] = endpoint + return nil +} + +// MappingResolver the mapping resolver type +type MappingResolver struct { +} + +// GetName get the resolver name: "mapping resolver" +func (resolver *MappingResolver) GetName() (name string) { + name = "mapping resolver" + return +} + +// TryResolve use Product and RegionId as key to find endpoint from inner map +func (resolver *MappingResolver) TryResolve(param *ResolveParam) (endpoint string, support bool, err error) { + key := fmt.Sprintf(keyFormatter, strings.ToLower(param.RegionId), strings.ToLower(param.Product)) + endpoint, contains := endpointMapping[key] + return endpoint, contains, nil +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/resolver.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/resolver.go new file mode 100644 index 000000000..5e1e30530 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/resolver.go @@ -0,0 +1,98 @@ +/* + * 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. + */ + +package endpoints + +import ( + "encoding/json" + "fmt" + "sync" + + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils" +) + +var debug utils.Debug + +func init() { + debug = utils.Init("sdk") +} + +const ( + ResolveEndpointUserGuideLink = "" +) + +var once sync.Once +var resolvers []Resolver + +type Resolver interface { + TryResolve(param *ResolveParam) (endpoint string, support bool, err error) + GetName() (name string) +} + +// Resolve resolve endpoint with params +// It will resolve with each supported resolver until anyone resolved +func Resolve(param *ResolveParam) (endpoint string, err error) { + supportedResolvers := getAllResolvers() + var lastErr error + for _, resolver := range supportedResolvers { + endpoint, supported, resolveErr := resolver.TryResolve(param) + if resolveErr != nil { + lastErr = resolveErr + } + + if supported { + debug("resolve endpoint with %s\n", param) + debug("\t%s by resolver(%s)\n", endpoint, resolver.GetName()) + return endpoint, nil + } + } + + // not support + errorMsg := fmt.Sprintf(errors.CanNotResolveEndpointErrorMessage, param, ResolveEndpointUserGuideLink) + err = errors.NewClientError(errors.CanNotResolveEndpointErrorCode, errorMsg, lastErr) + return +} + +func getAllResolvers() []Resolver { + once.Do(func() { + resolvers = []Resolver{ + &SimpleHostResolver{}, + &MappingResolver{}, + &LocationResolver{}, + &LocalRegionalResolver{}, + &LocalGlobalResolver{}, + } + }) + return resolvers +} + +type ResolveParam struct { + Domain string + Product string + RegionId string + LocationProduct string + LocationEndpointType string + CommonApi func(request *requests.CommonRequest) (response *responses.CommonResponse, err error) `json:"-"` +} + +func (param *ResolveParam) String() string { + jsonBytes, err := json.Marshal(param) + if err != nil { + return fmt.Sprint("ResolveParam.String() process error:", err) + } + return string(jsonBytes) +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/simple_host_resolver.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/simple_host_resolver.go new file mode 100644 index 000000000..9ba2346c6 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/simple_host_resolver.go @@ -0,0 +1,33 @@ +/* + * 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. + */ + +package endpoints + +// SimpleHostResolver the simple host resolver type +type SimpleHostResolver struct { +} + +// GetName get the resolver name: "simple host resolver" +func (resolver *SimpleHostResolver) GetName() (name string) { + name = "simple host resolver" + return +} + +// TryResolve if the Domain exist in param, use it as endpoint +func (resolver *SimpleHostResolver) TryResolve(param *ResolveParam) (endpoint string, support bool, err error) { + if support = len(param.Domain) > 0; support { + endpoint = param.Domain + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors/client_error.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors/client_error.go new file mode 100644 index 000000000..1e2d9c004 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors/client_error.go @@ -0,0 +1,92 @@ +/* + * 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. + */ + +package errors + +import "fmt" + +const ( + DefaultClientErrorStatus = 400 + DefaultClientErrorCode = "SDK.ClientError" + + UnsupportedCredentialErrorCode = "SDK.UnsupportedCredential" + UnsupportedCredentialErrorMessage = "Specified credential (type = %s) is not supported, please check" + + CanNotResolveEndpointErrorCode = "SDK.CanNotResolveEndpoint" + CanNotResolveEndpointErrorMessage = "Can not resolve endpoint(param = %s), please check your accessKey with secret, and read the user guide\n %s" + + UnsupportedParamPositionErrorCode = "SDK.UnsupportedParamPosition" + UnsupportedParamPositionErrorMessage = "Specified param position (%s) is not supported, please upgrade sdk and retry" + + AsyncFunctionNotEnabledCode = "SDK.AsyncFunctionNotEnabled" + AsyncFunctionNotEnabledMessage = "Async function is not enabled in client, please invoke 'client.EnableAsync' function" + + UnknownRequestTypeErrorCode = "SDK.UnknownRequestType" + UnknownRequestTypeErrorMessage = "Unknown Request Type: %s" + + MissingParamErrorCode = "SDK.MissingParam" + InvalidParamErrorCode = "SDK.InvalidParam" + + JsonUnmarshalErrorCode = "SDK.JsonUnmarshalError" + JsonUnmarshalErrorMessage = "Failed to unmarshal response, but you can get the data via response.GetHttpStatusCode() and response.GetHttpContentString()" + + TimeoutErrorCode = "SDK.TimeoutError" + TimeoutErrorMessage = "The request timed out %s times(%s for retry), perhaps we should have the threshold raised a little?" +) + +type ClientError struct { + errorCode string + message string + originError error +} + +func NewClientError(errorCode, message string, originErr error) Error { + return &ClientError{ + errorCode: errorCode, + message: message, + originError: originErr, + } +} + +func (err *ClientError) Error() string { + clientErrMsg := fmt.Sprintf("[%s] %s", err.ErrorCode(), err.message) + if err.originError != nil { + return clientErrMsg + "\ncaused by:\n" + err.originError.Error() + } + return clientErrMsg +} + +func (err *ClientError) OriginError() error { + return err.originError +} + +func (*ClientError) HttpStatus() int { + return DefaultClientErrorStatus +} + +func (err *ClientError) ErrorCode() string { + if err.errorCode == "" { + return DefaultClientErrorCode + } else { + return err.errorCode + } +} + +func (err *ClientError) Message() string { + return err.message +} + +func (err *ClientError) String() string { + return err.Error() +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors/error.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors/error.go new file mode 100644 index 000000000..49962f3b5 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors/error.go @@ -0,0 +1,23 @@ +/* + * 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. + */ + +package errors + +type Error interface { + error + HttpStatus() int + ErrorCode() string + Message() string + OriginError() error +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors/server_error.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors/server_error.go new file mode 100644 index 000000000..1b7810414 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors/server_error.go @@ -0,0 +1,123 @@ +/* + * 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. + */ + +package errors + +import ( + "encoding/json" + "fmt" + + "github.com/jmespath/go-jmespath" +) + +var wrapperList = []ServerErrorWrapper{ + &SignatureDostNotMatchWrapper{}, +} + +type ServerError struct { + httpStatus int + requestId string + hostId string + errorCode string + recommend string + message string + comment string +} + +type ServerErrorWrapper interface { + tryWrap(error *ServerError, wrapInfo map[string]string) bool +} + +func (err *ServerError) Error() string { + return fmt.Sprintf("SDK.ServerError\nErrorCode: %s\nRecommend: %s\nRequestId: %s\nMessage: %s", + err.errorCode, err.comment+err.recommend, err.requestId, err.message) +} + +func NewServerError(httpStatus int, responseContent, comment string) Error { + result := &ServerError{ + httpStatus: httpStatus, + message: responseContent, + comment: comment, + } + + var data interface{} + err := json.Unmarshal([]byte(responseContent), &data) + if err == nil { + requestId, _ := jmespath.Search("RequestId", data) + hostId, _ := jmespath.Search("HostId", data) + errorCode, _ := jmespath.Search("Code", data) + recommend, _ := jmespath.Search("Recommend", data) + message, _ := jmespath.Search("Message", data) + + if requestId != nil { + result.requestId = requestId.(string) + } + if hostId != nil { + result.hostId = hostId.(string) + } + if errorCode != nil { + result.errorCode = errorCode.(string) + } + if recommend != nil { + result.recommend = recommend.(string) + } + if message != nil { + result.message = message.(string) + } + } + + return result +} + +func WrapServerError(originError *ServerError, wrapInfo map[string]string) *ServerError { + for _, wrapper := range wrapperList { + ok := wrapper.tryWrap(originError, wrapInfo) + if ok { + return originError + } + } + return originError +} + +func (err *ServerError) HttpStatus() int { + return err.httpStatus +} + +func (err *ServerError) ErrorCode() string { + return err.errorCode +} + +func (err *ServerError) Message() string { + return err.message +} + +func (err *ServerError) OriginError() error { + return nil +} + +func (err *ServerError) HostId() string { + return err.hostId +} + +func (err *ServerError) RequestId() string { + return err.requestId +} + +func (err *ServerError) Recommend() string { + return err.recommend +} + +func (err *ServerError) Comment() string { + return err.comment +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors/signature_does_not_match_wrapper.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors/signature_does_not_match_wrapper.go new file mode 100644 index 000000000..4b09d7d71 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors/signature_does_not_match_wrapper.go @@ -0,0 +1,45 @@ +package errors + +import ( + "strings" + + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils" +) + +const SignatureDostNotMatchErrorCode = "SignatureDoesNotMatch" +const IncompleteSignatureErrorCode = "IncompleteSignature" +const MessageContain = "server string to sign is:" + +var debug utils.Debug + +func init() { + debug = utils.Init("sdk") +} + +type SignatureDostNotMatchWrapper struct { +} + +func (*SignatureDostNotMatchWrapper) tryWrap(error *ServerError, wrapInfo map[string]string) (ok bool) { + clientStringToSign := wrapInfo["StringToSign"] + if (error.errorCode == SignatureDostNotMatchErrorCode || error.errorCode == IncompleteSignatureErrorCode) && clientStringToSign != "" { + message := error.message + if strings.Contains(message, MessageContain) { + str := strings.Split(message, MessageContain) + serverStringToSign := str[1] + + if clientStringToSign == serverStringToSign { + // user secret is error + error.recommend = "InvalidAccessKeySecret: Please check you AccessKeySecret" + } else { + debug("Client StringToSign: %s", clientStringToSign) + debug("Server StringToSign: %s", serverStringToSign) + error.recommend = "This may be a bug with the SDK and we hope you can submit this question in the " + + "github issue(https://github.com/aliyun/alibaba-cloud-sdk-go/issues), thanks very much" + } + } + ok = true + return + } + ok = false + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/logger.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/logger.go new file mode 100644 index 000000000..04f033935 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/logger.go @@ -0,0 +1,116 @@ +package sdk + +import ( + "encoding/json" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils" + "io" + "log" + "os" + "strings" + "time" +) + +var logChannel string +var defaultChannel = "AlibabaCloud" + +type Logger struct { + *log.Logger + formatTemplate string + isOpen bool + lastLogMsg string +} + +var defaultLoggerTemplate = `{time} {channel}: "{method} {uri} HTTP/{version}" {code} {cost} {hostname}` +var loggerParam = []string{"{time}", "{start_time}", "{ts}", "{channel}", "{pid}", "{host}", "{method}", "{uri}", "{version}", "{target}", "{hostname}", "{code}", "{error}", "{req_headers}", "{res_headers}", "{cost}"} + +func initLogMsg(fieldMap map[string]string) { + for _, value := range loggerParam { + fieldMap[value] = "" + } +} + +func (client *Client) GetLogger() *Logger { + return client.logger +} + +func (client *Client) GetLoggerMsg() string { + if client.logger == nil { + client.SetLogger("", "", os.Stdout, "") + } + return client.logger.lastLogMsg +} + +func (client *Client) SetLogger(level string, channel string, out io.Writer, template string) { + if level == "" { + level = "info" + } + + logChannel = "AlibabaCloud" + if channel != "" { + logChannel = channel + } + log := log.New(out, "["+strings.ToUpper(level)+"]", log.Lshortfile) + if template == "" { + template = defaultLoggerTemplate + } + + client.logger = &Logger{ + Logger: log, + formatTemplate: template, + isOpen: true, + } +} + +func (client *Client) OpenLogger() { + if client.logger == nil { + client.SetLogger("", "", os.Stdout, "") + } + client.logger.isOpen = true +} + +func (client *Client) CloseLogger() { + if client.logger != nil { + client.logger.isOpen = false + } +} + +func (client *Client) SetTemplate(template string) { + if client.logger == nil { + client.SetLogger("", "", os.Stdout, "") + } + client.logger.formatTemplate = template +} + +func (client *Client) GetTemplate() string { + if client.logger == nil { + client.SetLogger("", "", os.Stdout, "") + } + return client.logger.formatTemplate +} + +func TransToString(object interface{}) string { + byt, err := json.Marshal(object) + if err != nil { + return "" + } + return string(byt) +} + +func (client *Client) printLog(fieldMap map[string]string, err error) { + if err != nil { + fieldMap["{error}"] = err.Error() + } + fieldMap["{time}"] = time.Now().Format("2006-01-02 15:04:05") + fieldMap["{ts}"] = utils.GetTimeInFormatISO8601() + fieldMap["{channel}"] = logChannel + if client.logger != nil { + logMsg := client.logger.formatTemplate + for key, value := range fieldMap { + logMsg = strings.Replace(logMsg, key, value, -1) + } + client.logger.lastLogMsg = logMsg + if client.logger.isOpen == true { + client.logger.Output(2, logMsg) + } + } +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/acs_request.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/acs_request.go new file mode 100644 index 000000000..725b20b91 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/acs_request.go @@ -0,0 +1,373 @@ +/* + * 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. + */ + +package requests + +import ( + "encoding/json" + "fmt" + "io" + "reflect" + "strconv" + "strings" + "time" + + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors" +) + +const ( + RPC = "RPC" + ROA = "ROA" + + HTTP = "HTTP" + HTTPS = "HTTPS" + + DefaultHttpPort = "80" + + GET = "GET" + PUT = "PUT" + POST = "POST" + DELETE = "DELETE" + HEAD = "HEAD" + OPTIONS = "OPTIONS" + + Json = "application/json" + Xml = "application/xml" + Raw = "application/octet-stream" + Form = "application/x-www-form-urlencoded" + + Header = "Header" + Query = "Query" + Body = "Body" + Path = "Path" + + HeaderSeparator = "\n" +) + +// interface +type AcsRequest interface { + GetScheme() string + GetMethod() string + GetDomain() string + GetPort() string + GetRegionId() string + GetHeaders() map[string]string + GetQueryParams() map[string]string + GetFormParams() map[string]string + GetContent() []byte + GetBodyReader() io.Reader + GetStyle() string + GetProduct() string + GetVersion() string + GetActionName() string + GetAcceptFormat() string + GetLocationServiceCode() string + GetLocationEndpointType() string + GetReadTimeout() time.Duration + GetConnectTimeout() time.Duration + SetReadTimeout(readTimeout time.Duration) + SetConnectTimeout(connectTimeout time.Duration) + SetHTTPSInsecure(isInsecure bool) + GetHTTPSInsecure() *bool + + GetUserAgent() map[string]string + + SetStringToSign(stringToSign string) + GetStringToSign() string + + SetDomain(domain string) + SetContent(content []byte) + SetScheme(scheme string) + BuildUrl() string + BuildQueries() string + + addHeaderParam(key, value string) + addQueryParam(key, value string) + addFormParam(key, value string) + addPathParam(key, value string) +} + +// base class +type baseRequest struct { + Scheme string + Method string + Domain string + Port string + RegionId string + ReadTimeout time.Duration + ConnectTimeout time.Duration + isInsecure *bool + + userAgent map[string]string + product string + version string + + actionName string + + AcceptFormat string + + QueryParams map[string]string + Headers map[string]string + FormParams map[string]string + Content []byte + + locationServiceCode string + locationEndpointType string + + queries string + + stringToSign string +} + +func (request *baseRequest) GetQueryParams() map[string]string { + return request.QueryParams +} + +func (request *baseRequest) GetFormParams() map[string]string { + return request.FormParams +} + +func (request *baseRequest) GetReadTimeout() time.Duration { + return request.ReadTimeout +} + +func (request *baseRequest) GetConnectTimeout() time.Duration { + return request.ConnectTimeout +} + +func (request *baseRequest) SetReadTimeout(readTimeout time.Duration) { + request.ReadTimeout = readTimeout +} + +func (request *baseRequest) SetConnectTimeout(connectTimeout time.Duration) { + request.ConnectTimeout = connectTimeout +} + +func (request *baseRequest) GetHTTPSInsecure() *bool { + return request.isInsecure +} + +func (request *baseRequest) SetHTTPSInsecure(isInsecure bool) { + request.isInsecure = &isInsecure +} + +func (request *baseRequest) GetContent() []byte { + return request.Content +} + +func (request *baseRequest) GetVersion() string { + return request.version +} + +func (request *baseRequest) GetActionName() string { + return request.actionName +} + +func (request *baseRequest) SetContent(content []byte) { + request.Content = content +} + +func (request *baseRequest) GetUserAgent() map[string]string { + return request.userAgent +} + +func (request *baseRequest) AppendUserAgent(key, value string) { + newkey := true + if request.userAgent == nil { + request.userAgent = make(map[string]string) + } + if strings.ToLower(key) != "core" && strings.ToLower(key) != "go" { + for tag, _ := range request.userAgent { + if tag == key { + request.userAgent[tag] = value + newkey = false + } + } + if newkey { + request.userAgent[key] = value + } + } +} + +func (request *baseRequest) addHeaderParam(key, value string) { + request.Headers[key] = value +} + +func (request *baseRequest) addQueryParam(key, value string) { + request.QueryParams[key] = value +} + +func (request *baseRequest) addFormParam(key, value string) { + request.FormParams[key] = value +} + +func (request *baseRequest) GetAcceptFormat() string { + return request.AcceptFormat +} + +func (request *baseRequest) GetLocationServiceCode() string { + return request.locationServiceCode +} + +func (request *baseRequest) GetLocationEndpointType() string { + return request.locationEndpointType +} + +func (request *baseRequest) GetProduct() string { + return request.product +} + +func (request *baseRequest) GetScheme() string { + return request.Scheme +} + +func (request *baseRequest) SetScheme(scheme string) { + request.Scheme = scheme +} + +func (request *baseRequest) GetMethod() string { + return request.Method +} + +func (request *baseRequest) GetDomain() string { + return request.Domain +} + +func (request *baseRequest) SetDomain(host string) { + request.Domain = host +} + +func (request *baseRequest) GetPort() string { + return request.Port +} + +func (request *baseRequest) GetRegionId() string { + return request.RegionId +} + +func (request *baseRequest) GetHeaders() map[string]string { + return request.Headers +} + +func (request *baseRequest) SetContentType(contentType string) { + request.addHeaderParam("Content-Type", contentType) +} + +func (request *baseRequest) GetContentType() (contentType string, contains bool) { + contentType, contains = request.Headers["Content-Type"] + return +} + +func (request *baseRequest) SetStringToSign(stringToSign string) { + request.stringToSign = stringToSign +} + +func (request *baseRequest) GetStringToSign() string { + return request.stringToSign +} + +func defaultBaseRequest() (request *baseRequest) { + request = &baseRequest{ + Scheme: "", + AcceptFormat: "JSON", + Method: GET, + QueryParams: make(map[string]string), + Headers: map[string]string{ + "x-sdk-client": "golang/1.0.0", + "x-sdk-invoke-type": "normal", + "Accept-Encoding": "identity", + }, + FormParams: make(map[string]string), + } + return +} + +func InitParams(request AcsRequest) (err error) { + requestValue := reflect.ValueOf(request).Elem() + err = flatRepeatedList(requestValue, request, "", "") + return +} + +func flatRepeatedList(dataValue reflect.Value, request AcsRequest, position, prefix string) (err error) { + dataType := dataValue.Type() + for i := 0; i < dataType.NumField(); i++ { + field := dataType.Field(i) + name, containsNameTag := field.Tag.Lookup("name") + fieldPosition := position + if fieldPosition == "" { + fieldPosition, _ = field.Tag.Lookup("position") + } + typeTag, containsTypeTag := field.Tag.Lookup("type") + if containsNameTag { + if !containsTypeTag { + // simple param + key := prefix + name + value := dataValue.Field(i).String() + if dataValue.Field(i).Kind().String() == "map" { + byt, _ := json.Marshal(dataValue.Field(i).Interface()) + value = string(byt) + } + err = addParam(request, fieldPosition, key, value) + if err != nil { + return + } + } else if typeTag == "Repeated" { + // repeated param + repeatedFieldValue := dataValue.Field(i) + if repeatedFieldValue.Kind() != reflect.Slice { + // possible value: {"[]string", "*[]struct"}, we must call Elem() in the last condition + repeatedFieldValue = repeatedFieldValue.Elem() + } + if repeatedFieldValue.IsValid() && !repeatedFieldValue.IsNil() { + for m := 0; m < repeatedFieldValue.Len(); m++ { + elementValue := repeatedFieldValue.Index(m) + key := prefix + name + "." + strconv.Itoa(m+1) + if elementValue.Type().Kind().String() == "string" { + value := elementValue.String() + err = addParam(request, fieldPosition, key, value) + if err != nil { + return + } + } else { + err = flatRepeatedList(elementValue, request, fieldPosition, key+".") + if err != nil { + return + } + } + } + } + } + } + } + return +} + +func addParam(request AcsRequest, position, name, value string) (err error) { + if len(value) > 0 { + switch position { + case Header: + request.addHeaderParam(name, value) + case Query: + request.addQueryParam(name, value) + case Path: + request.addPathParam(name, value) + case Body: + request.addFormParam(name, value) + default: + errMsg := fmt.Sprintf(errors.UnsupportedParamPositionErrorMessage, position) + err = errors.NewClientError(errors.UnsupportedParamPositionErrorCode, errMsg, nil) + } + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/common_request.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/common_request.go new file mode 100644 index 000000000..80c170097 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/common_request.go @@ -0,0 +1,108 @@ +package requests + +import ( + "bytes" + "fmt" + "io" + "sort" + "strings" +) + +type CommonRequest struct { + *baseRequest + + Version string + ApiName string + Product string + ServiceCode string + + // roa params + PathPattern string + PathParams map[string]string + + Ontology AcsRequest +} + +func NewCommonRequest() (request *CommonRequest) { + request = &CommonRequest{ + baseRequest: defaultBaseRequest(), + } + request.Headers["x-sdk-invoke-type"] = "common" + request.PathParams = make(map[string]string) + return +} + +func (request *CommonRequest) String() string { + request.TransToAcsRequest() + + resultBuilder := bytes.Buffer{} + + mapOutput := func(m map[string]string) { + if len(m) > 0 { + sortedKeys := make([]string, 0) + for k := range m { + sortedKeys = append(sortedKeys, k) + } + + // sort 'string' key in increasing order + sort.Strings(sortedKeys) + + for _, key := range sortedKeys { + resultBuilder.WriteString(key + ": " + m[key] + "\n") + } + } + } + + // Request Line + resultBuilder.WriteString(fmt.Sprintf("%s %s %s/1.1\n", request.Method, request.BuildQueries(), strings.ToUpper(request.Scheme))) + + // Headers + resultBuilder.WriteString("Host" + ": " + request.Domain + "\n") + mapOutput(request.Headers) + + resultBuilder.WriteString("\n") + // Body + if len(request.Content) > 0 { + resultBuilder.WriteString(string(request.Content) + "\n") + } else { + mapOutput(request.FormParams) + } + + return resultBuilder.String() +} + +func (request *CommonRequest) TransToAcsRequest() { + if len(request.PathPattern) > 0 { + roaRequest := &RoaRequest{} + roaRequest.initWithCommonRequest(request) + request.Ontology = roaRequest + } else { + rpcRequest := &RpcRequest{} + rpcRequest.baseRequest = request.baseRequest + rpcRequest.product = request.Product + rpcRequest.version = request.Version + rpcRequest.locationServiceCode = request.ServiceCode + rpcRequest.actionName = request.ApiName + request.Ontology = rpcRequest + } +} + +func (request *CommonRequest) BuildUrl() string { + return request.Ontology.BuildUrl() +} + +func (request *CommonRequest) BuildQueries() string { + return request.Ontology.BuildQueries() +} + +func (request *CommonRequest) GetBodyReader() io.Reader { + return request.Ontology.GetBodyReader() +} + +func (request *CommonRequest) GetStyle() string { + return request.Ontology.GetStyle() +} + +func (request *CommonRequest) addPathParam(key, value string) { + request.PathParams[key] = value +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/roa_request.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/roa_request.go new file mode 100644 index 000000000..8159aa377 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/roa_request.go @@ -0,0 +1,152 @@ +/* + * 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. + */ + +package requests + +import ( + "bytes" + "fmt" + "io" + "net/url" + "sort" + "strings" + + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils" +) + +type RoaRequest struct { + *baseRequest + pathPattern string + PathParams map[string]string +} + +func (*RoaRequest) GetStyle() string { + return ROA +} + +func (request *RoaRequest) GetBodyReader() io.Reader { + if request.FormParams != nil && len(request.FormParams) > 0 { + formString := utils.GetUrlFormedMap(request.FormParams) + return strings.NewReader(formString) + } else if len(request.Content) > 0 { + return bytes.NewReader(request.Content) + } else { + return nil + } +} + +// for sign method, need not url encoded +func (request *RoaRequest) BuildQueries() string { + return request.buildQueries() +} + +func (request *RoaRequest) buildPath() string { + path := request.pathPattern + for key, value := range request.PathParams { + path = strings.Replace(path, "["+key+"]", value, 1) + } + return path +} + +func (request *RoaRequest) buildQueries() string { + // replace path params with value + path := request.buildPath() + queryParams := request.QueryParams + // sort QueryParams by key + var queryKeys []string + for key := range queryParams { + queryKeys = append(queryKeys, key) + } + sort.Strings(queryKeys) + + // append urlBuilder + urlBuilder := bytes.Buffer{} + urlBuilder.WriteString(path) + if len(queryKeys) > 0 { + urlBuilder.WriteString("?") + } + for i := 0; i < len(queryKeys); i++ { + queryKey := queryKeys[i] + urlBuilder.WriteString(queryKey) + if value := queryParams[queryKey]; len(value) > 0 { + urlBuilder.WriteString("=") + urlBuilder.WriteString(value) + } + if i < len(queryKeys)-1 { + urlBuilder.WriteString("&") + } + } + result := urlBuilder.String() + result = popStandardUrlencode(result) + return result +} + +func (request *RoaRequest) buildQueryString() string { + queryParams := request.QueryParams + // sort QueryParams by key + q := url.Values{} + for key, value := range queryParams { + q.Add(key, value) + } + return q.Encode() +} + +func popStandardUrlencode(stringToSign string) (result string) { + result = strings.Replace(stringToSign, "+", "%20", -1) + result = strings.Replace(result, "*", "%2A", -1) + result = strings.Replace(result, "%7E", "~", -1) + return +} + +func (request *RoaRequest) BuildUrl() string { + // for network trans, need url encoded + scheme := strings.ToLower(request.Scheme) + domain := request.Domain + port := request.Port + path := request.buildPath() + url := fmt.Sprintf("%s://%s:%s%s", scheme, domain, port, path) + querystring := request.buildQueryString() + if len(querystring) > 0 { + url = fmt.Sprintf("%s?%s", url, querystring) + } + return url +} + +func (request *RoaRequest) addPathParam(key, value string) { + request.PathParams[key] = value +} + +func (request *RoaRequest) InitWithApiInfo(product, version, action, uriPattern, serviceCode, endpointType string) { + request.baseRequest = defaultBaseRequest() + request.PathParams = make(map[string]string) + request.Headers["x-acs-version"] = version + request.pathPattern = uriPattern + request.locationServiceCode = serviceCode + request.locationEndpointType = endpointType + request.product = product + //request.version = version + //request.actionName = action +} + +func (request *RoaRequest) initWithCommonRequest(commonRequest *CommonRequest) { + request.baseRequest = commonRequest.baseRequest + request.PathParams = commonRequest.PathParams + request.product = commonRequest.Product + //request.version = commonRequest.Version + request.Headers["x-acs-version"] = commonRequest.Version + //request.actionName = commonRequest.ApiName + request.pathPattern = commonRequest.PathPattern + request.locationServiceCode = commonRequest.ServiceCode + request.locationEndpointType = "" +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/rpc_request.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/rpc_request.go new file mode 100644 index 000000000..01be6fd04 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/rpc_request.go @@ -0,0 +1,79 @@ +/* + * 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. + */ + +package requests + +import ( + "fmt" + "io" + "strings" + + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils" +) + +type RpcRequest struct { + *baseRequest +} + +func (request *RpcRequest) init() { + request.baseRequest = defaultBaseRequest() + request.Method = POST +} + +func (*RpcRequest) GetStyle() string { + return RPC +} + +func (request *RpcRequest) GetBodyReader() io.Reader { + if request.FormParams != nil && len(request.FormParams) > 0 { + formString := utils.GetUrlFormedMap(request.FormParams) + return strings.NewReader(formString) + } else { + return strings.NewReader("") + } +} + +func (request *RpcRequest) BuildQueries() string { + request.queries = "/?" + utils.GetUrlFormedMap(request.QueryParams) + return request.queries +} + +func (request *RpcRequest) BuildUrl() string { + url := fmt.Sprintf("%s://%s", strings.ToLower(request.Scheme), request.Domain) + if len(request.Port) > 0 { + url = fmt.Sprintf("%s:%s", url, request.Port) + } + return url + request.BuildQueries() +} + +func (request *RpcRequest) GetVersion() string { + return request.version +} + +func (request *RpcRequest) GetActionName() string { + return request.actionName +} + +func (request *RpcRequest) addPathParam(key, value string) { + panic("not support") +} + +func (request *RpcRequest) InitWithApiInfo(product, version, action, serviceCode, endpointType string) { + request.init() + request.product = product + request.version = version + request.actionName = action + request.locationServiceCode = serviceCode + request.locationEndpointType = endpointType +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/types.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/types.go new file mode 100644 index 000000000..28af63ea1 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/types.go @@ -0,0 +1,53 @@ +package requests + +import "strconv" + +type Integer string + +func NewInteger(integer int) Integer { + return Integer(strconv.Itoa(integer)) +} + +func (integer Integer) HasValue() bool { + return integer != "" +} + +func (integer Integer) GetValue() (int, error) { + return strconv.Atoi(string(integer)) +} + +func NewInteger64(integer int64) Integer { + return Integer(strconv.FormatInt(integer, 10)) +} + +func (integer Integer) GetValue64() (int64, error) { + return strconv.ParseInt(string(integer), 10, 0) +} + +type Boolean string + +func NewBoolean(bool bool) Boolean { + return Boolean(strconv.FormatBool(bool)) +} + +func (boolean Boolean) HasValue() bool { + return boolean != "" +} + +func (boolean Boolean) GetValue() (bool, error) { + return strconv.ParseBool(string(boolean)) +} + +type Float string + +func NewFloat(f float64) Float { + return Float(strconv.FormatFloat(f, 'f', 6, 64)) +} + +func (float Float) HasValue() bool { + return float != "" +} + +func (float Float) GetValue() (float64, error) { + return strconv.ParseFloat(string(float), 64) +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses/json_parser.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses/json_parser.go new file mode 100644 index 000000000..4c9570198 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses/json_parser.go @@ -0,0 +1,332 @@ +package responses + +import ( + "encoding/json" + "io" + "math" + "strconv" + "strings" + "sync" + "unsafe" + + jsoniter "github.com/json-iterator/go" +) + +const maxUint = ^uint(0) +const maxInt = int(maxUint >> 1) +const minInt = -maxInt - 1 + +var jsonParser jsoniter.API +var initJson = &sync.Once{} + +func initJsonParserOnce() { + initJson.Do(func() { + registerBetterFuzzyDecoder() + jsonParser = jsoniter.Config{ + EscapeHTML: true, + SortMapKeys: true, + ValidateJsonRawMessage: true, + CaseSensitive: true, + }.Froze() + }) +} + +func registerBetterFuzzyDecoder() { + jsoniter.RegisterTypeDecoder("string", &nullableFuzzyStringDecoder{}) + jsoniter.RegisterTypeDecoder("bool", &fuzzyBoolDecoder{}) + jsoniter.RegisterTypeDecoder("float32", &nullableFuzzyFloat32Decoder{}) + jsoniter.RegisterTypeDecoder("float64", &nullableFuzzyFloat64Decoder{}) + jsoniter.RegisterTypeDecoder("int", &nullableFuzzyIntegerDecoder{func(isFloat bool, ptr unsafe.Pointer, iter *jsoniter.Iterator) { + if isFloat { + val := iter.ReadFloat64() + if val > float64(maxInt) || val < float64(minInt) { + iter.ReportError("fuzzy decode int", "exceed range") + return + } + *((*int)(ptr)) = int(val) + } else { + *((*int)(ptr)) = iter.ReadInt() + } + }}) + jsoniter.RegisterTypeDecoder("uint", &nullableFuzzyIntegerDecoder{func(isFloat bool, ptr unsafe.Pointer, iter *jsoniter.Iterator) { + if isFloat { + val := iter.ReadFloat64() + if val > float64(maxUint) || val < 0 { + iter.ReportError("fuzzy decode uint", "exceed range") + return + } + *((*uint)(ptr)) = uint(val) + } else { + *((*uint)(ptr)) = iter.ReadUint() + } + }}) + jsoniter.RegisterTypeDecoder("int8", &nullableFuzzyIntegerDecoder{func(isFloat bool, ptr unsafe.Pointer, iter *jsoniter.Iterator) { + if isFloat { + val := iter.ReadFloat64() + if val > float64(math.MaxInt8) || val < float64(math.MinInt8) { + iter.ReportError("fuzzy decode int8", "exceed range") + return + } + *((*int8)(ptr)) = int8(val) + } else { + *((*int8)(ptr)) = iter.ReadInt8() + } + }}) + jsoniter.RegisterTypeDecoder("uint8", &nullableFuzzyIntegerDecoder{func(isFloat bool, ptr unsafe.Pointer, iter *jsoniter.Iterator) { + if isFloat { + val := iter.ReadFloat64() + if val > float64(math.MaxUint8) || val < 0 { + iter.ReportError("fuzzy decode uint8", "exceed range") + return + } + *((*uint8)(ptr)) = uint8(val) + } else { + *((*uint8)(ptr)) = iter.ReadUint8() + } + }}) + jsoniter.RegisterTypeDecoder("int16", &nullableFuzzyIntegerDecoder{func(isFloat bool, ptr unsafe.Pointer, iter *jsoniter.Iterator) { + if isFloat { + val := iter.ReadFloat64() + if val > float64(math.MaxInt16) || val < float64(math.MinInt16) { + iter.ReportError("fuzzy decode int16", "exceed range") + return + } + *((*int16)(ptr)) = int16(val) + } else { + *((*int16)(ptr)) = iter.ReadInt16() + } + }}) + jsoniter.RegisterTypeDecoder("uint16", &nullableFuzzyIntegerDecoder{func(isFloat bool, ptr unsafe.Pointer, iter *jsoniter.Iterator) { + if isFloat { + val := iter.ReadFloat64() + if val > float64(math.MaxUint16) || val < 0 { + iter.ReportError("fuzzy decode uint16", "exceed range") + return + } + *((*uint16)(ptr)) = uint16(val) + } else { + *((*uint16)(ptr)) = iter.ReadUint16() + } + }}) + jsoniter.RegisterTypeDecoder("int32", &nullableFuzzyIntegerDecoder{func(isFloat bool, ptr unsafe.Pointer, iter *jsoniter.Iterator) { + if isFloat { + val := iter.ReadFloat64() + if val > float64(math.MaxInt32) || val < float64(math.MinInt32) { + iter.ReportError("fuzzy decode int32", "exceed range") + return + } + *((*int32)(ptr)) = int32(val) + } else { + *((*int32)(ptr)) = iter.ReadInt32() + } + }}) + jsoniter.RegisterTypeDecoder("uint32", &nullableFuzzyIntegerDecoder{func(isFloat bool, ptr unsafe.Pointer, iter *jsoniter.Iterator) { + if isFloat { + val := iter.ReadFloat64() + if val > float64(math.MaxUint32) || val < 0 { + iter.ReportError("fuzzy decode uint32", "exceed range") + return + } + *((*uint32)(ptr)) = uint32(val) + } else { + *((*uint32)(ptr)) = iter.ReadUint32() + } + }}) + jsoniter.RegisterTypeDecoder("int64", &nullableFuzzyIntegerDecoder{func(isFloat bool, ptr unsafe.Pointer, iter *jsoniter.Iterator) { + if isFloat { + val := iter.ReadFloat64() + if val > float64(math.MaxInt64) || val < float64(math.MinInt64) { + iter.ReportError("fuzzy decode int64", "exceed range") + return + } + *((*int64)(ptr)) = int64(val) + } else { + *((*int64)(ptr)) = iter.ReadInt64() + } + }}) + jsoniter.RegisterTypeDecoder("uint64", &nullableFuzzyIntegerDecoder{func(isFloat bool, ptr unsafe.Pointer, iter *jsoniter.Iterator) { + if isFloat { + val := iter.ReadFloat64() + if val > float64(math.MaxUint64) || val < 0 { + iter.ReportError("fuzzy decode uint64", "exceed range") + return + } + *((*uint64)(ptr)) = uint64(val) + } else { + *((*uint64)(ptr)) = iter.ReadUint64() + } + }}) +} + +type nullableFuzzyStringDecoder struct { +} + +func (decoder *nullableFuzzyStringDecoder) Decode(ptr unsafe.Pointer, iter *jsoniter.Iterator) { + valueType := iter.WhatIsNext() + switch valueType { + case jsoniter.NumberValue: + var number json.Number + iter.ReadVal(&number) + *((*string)(ptr)) = string(number) + case jsoniter.StringValue: + *((*string)(ptr)) = iter.ReadString() + case jsoniter.BoolValue: + *((*string)(ptr)) = strconv.FormatBool(iter.ReadBool()) + case jsoniter.NilValue: + iter.ReadNil() + *((*string)(ptr)) = "" + default: + iter.ReportError("fuzzyStringDecoder", "not number or string or bool") + } +} + +type fuzzyBoolDecoder struct { +} + +func (decoder *fuzzyBoolDecoder) Decode(ptr unsafe.Pointer, iter *jsoniter.Iterator) { + valueType := iter.WhatIsNext() + switch valueType { + case jsoniter.BoolValue: + *((*bool)(ptr)) = iter.ReadBool() + case jsoniter.NumberValue: + var number json.Number + iter.ReadVal(&number) + num, err := number.Int64() + if err != nil { + iter.ReportError("fuzzyBoolDecoder", "get value from json.number failed") + } + if num == 0 { + *((*bool)(ptr)) = false + } else { + *((*bool)(ptr)) = true + } + case jsoniter.StringValue: + strValue := strings.ToLower(iter.ReadString()) + if strValue == "true" { + *((*bool)(ptr)) = true + } else if strValue == "false" || strValue == "" { + *((*bool)(ptr)) = false + } else { + iter.ReportError("fuzzyBoolDecoder", "unsupported bool value: "+strValue) + } + case jsoniter.NilValue: + iter.ReadNil() + *((*bool)(ptr)) = false + default: + iter.ReportError("fuzzyBoolDecoder", "not number or string or nil") + } +} + +type nullableFuzzyIntegerDecoder struct { + fun func(isFloat bool, ptr unsafe.Pointer, iter *jsoniter.Iterator) +} + +func (decoder *nullableFuzzyIntegerDecoder) Decode(ptr unsafe.Pointer, iter *jsoniter.Iterator) { + valueType := iter.WhatIsNext() + var str string + switch valueType { + case jsoniter.NumberValue: + var number json.Number + iter.ReadVal(&number) + str = string(number) + case jsoniter.StringValue: + str = iter.ReadString() + // support empty string + if str == "" { + str = "0" + } + case jsoniter.BoolValue: + if iter.ReadBool() { + str = "1" + } else { + str = "0" + } + case jsoniter.NilValue: + iter.ReadNil() + str = "0" + default: + iter.ReportError("fuzzyIntegerDecoder", "not number or string") + } + newIter := iter.Pool().BorrowIterator([]byte(str)) + defer iter.Pool().ReturnIterator(newIter) + isFloat := strings.IndexByte(str, '.') != -1 + decoder.fun(isFloat, ptr, newIter) + if newIter.Error != nil && newIter.Error != io.EOF { + iter.Error = newIter.Error + } +} + +type nullableFuzzyFloat32Decoder struct { +} + +func (decoder *nullableFuzzyFloat32Decoder) Decode(ptr unsafe.Pointer, iter *jsoniter.Iterator) { + valueType := iter.WhatIsNext() + var str string + switch valueType { + case jsoniter.NumberValue: + *((*float32)(ptr)) = iter.ReadFloat32() + case jsoniter.StringValue: + str = iter.ReadString() + // support empty string + if str == "" { + *((*float32)(ptr)) = 0 + return + } + newIter := iter.Pool().BorrowIterator([]byte(str)) + defer iter.Pool().ReturnIterator(newIter) + *((*float32)(ptr)) = newIter.ReadFloat32() + if newIter.Error != nil && newIter.Error != io.EOF { + iter.Error = newIter.Error + } + case jsoniter.BoolValue: + // support bool to float32 + if iter.ReadBool() { + *((*float32)(ptr)) = 1 + } else { + *((*float32)(ptr)) = 0 + } + case jsoniter.NilValue: + iter.ReadNil() + *((*float32)(ptr)) = 0 + default: + iter.ReportError("nullableFuzzyFloat32Decoder", "not number or string") + } +} + +type nullableFuzzyFloat64Decoder struct { +} + +func (decoder *nullableFuzzyFloat64Decoder) Decode(ptr unsafe.Pointer, iter *jsoniter.Iterator) { + valueType := iter.WhatIsNext() + var str string + switch valueType { + case jsoniter.NumberValue: + *((*float64)(ptr)) = iter.ReadFloat64() + case jsoniter.StringValue: + str = iter.ReadString() + // support empty string + if str == "" { + *((*float64)(ptr)) = 0 + return + } + newIter := iter.Pool().BorrowIterator([]byte(str)) + defer iter.Pool().ReturnIterator(newIter) + *((*float64)(ptr)) = newIter.ReadFloat64() + if newIter.Error != nil && newIter.Error != io.EOF { + iter.Error = newIter.Error + } + case jsoniter.BoolValue: + // support bool to float64 + if iter.ReadBool() { + *((*float64)(ptr)) = 1 + } else { + *((*float64)(ptr)) = 0 + } + case jsoniter.NilValue: + // support empty string + iter.ReadNil() + *((*float64)(ptr)) = 0 + default: + iter.ReportError("nullableFuzzyFloat64Decoder", "not number or string") + } +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses/response.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses/response.go new file mode 100644 index 000000000..dd6ae5b4c --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses/response.go @@ -0,0 +1,152 @@ +/* + * 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. + */ + +package responses + +import ( + "bytes" + "encoding/xml" + "fmt" + "io/ioutil" + "net/http" + "strings" + + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils" +) + +type AcsResponse interface { + IsSuccess() bool + GetHttpStatus() int + GetHttpHeaders() map[string][]string + GetHttpContentString() string + GetHttpContentBytes() []byte + GetOriginHttpResponse() *http.Response + parseFromHttpResponse(httpResponse *http.Response) error +} + +var debug utils.Debug + +func init() { + debug = utils.Init("sdk") +} +// Unmarshal object from http response body to target Response +func Unmarshal(response AcsResponse, httpResponse *http.Response, format string) (err error) { + err = response.parseFromHttpResponse(httpResponse) + if err != nil { + return + } + if !response.IsSuccess() { + err = errors.NewServerError(response.GetHttpStatus(), response.GetHttpContentString(), "") + return + } + + if _, isCommonResponse := response.(*CommonResponse); isCommonResponse { + // common response need not unmarshal + return + } + + if len(response.GetHttpContentBytes()) == 0 { + return + } + + if strings.ToUpper(format) == "JSON" { + initJsonParserOnce() + err = jsonParser.Unmarshal(response.GetHttpContentBytes(), response) + if err != nil { + err = errors.NewClientError(errors.JsonUnmarshalErrorCode, errors.JsonUnmarshalErrorMessage, err) + } + } else if strings.ToUpper(format) == "XML" { + err = xml.Unmarshal(response.GetHttpContentBytes(), response) + } + return +} + +type BaseResponse struct { + httpStatus int + httpHeaders map[string][]string + httpContentString string + httpContentBytes []byte + originHttpResponse *http.Response +} + +func (baseResponse *BaseResponse) GetHttpStatus() int { + return baseResponse.httpStatus +} + +func (baseResponse *BaseResponse) GetHttpHeaders() map[string][]string { + return baseResponse.httpHeaders +} + +func (baseResponse *BaseResponse) GetHttpContentString() string { + return baseResponse.httpContentString +} + +func (baseResponse *BaseResponse) GetHttpContentBytes() []byte { + return baseResponse.httpContentBytes +} + +func (baseResponse *BaseResponse) GetOriginHttpResponse() *http.Response { + return baseResponse.originHttpResponse +} + +func (baseResponse *BaseResponse) IsSuccess() bool { + if baseResponse.GetHttpStatus() >= 200 && baseResponse.GetHttpStatus() < 300 { + return true + } + + return false +} + +func (baseResponse *BaseResponse) parseFromHttpResponse(httpResponse *http.Response) (err error) { + defer httpResponse.Body.Close() + body, err := ioutil.ReadAll(httpResponse.Body) + if err != nil { + return + } + debug("%s", string(body)) + baseResponse.httpStatus = httpResponse.StatusCode + baseResponse.httpHeaders = httpResponse.Header + baseResponse.httpContentBytes = body + baseResponse.httpContentString = string(body) + baseResponse.originHttpResponse = httpResponse + return +} + +func (baseResponse *BaseResponse) String() string { + resultBuilder := bytes.Buffer{} + // statusCode + // resultBuilder.WriteString("\n") + resultBuilder.WriteString(fmt.Sprintf("%s %s\n", baseResponse.originHttpResponse.Proto, baseResponse.originHttpResponse.Status)) + // httpHeaders + //resultBuilder.WriteString("Headers:\n") + for key, value := range baseResponse.httpHeaders { + resultBuilder.WriteString(key + ": " + strings.Join(value, ";") + "\n") + } + resultBuilder.WriteString("\n") + // content + //resultBuilder.WriteString("Content:\n") + resultBuilder.WriteString(baseResponse.httpContentString + "\n") + return resultBuilder.String() +} + +type CommonResponse struct { + *BaseResponse +} + +func NewCommonResponse() (response *CommonResponse) { + return &CommonResponse{ + BaseResponse: &BaseResponse{}, + } +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils/debug.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils/debug.go new file mode 100644 index 000000000..09440d27b --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils/debug.go @@ -0,0 +1,36 @@ +package utils + +import ( + "fmt" + "os" + "strings" +) + +type Debug func(format string, v ...interface{}) + +var hookGetEnv = func() string { + return os.Getenv("DEBUG") +} + +var hookPrint = func(input string) { + fmt.Println(input) +} + +func Init(flag string) Debug { + enable := false + + env := hookGetEnv() + parts := strings.Split(env, ",") + for _, part := range parts { + if part == flag { + enable = true + break + } + } + + return func(format string, v ...interface{}) { + if enable { + hookPrint(fmt.Sprintf(format, v...)) + } + } +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils/utils.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils/utils.go new file mode 100644 index 000000000..378e50106 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils/utils.go @@ -0,0 +1,87 @@ +/* + * 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. + */ + +package utils + +import ( + "crypto/md5" + "encoding/base64" + "encoding/hex" + "net/url" + "reflect" + "strconv" + "time" + + "github.com/satori/go.uuid" +) + +func GetUUIDV4() (uuidHex string) { + uuidV4 := uuid.NewV4() + uuidHex = hex.EncodeToString(uuidV4.Bytes()) + return +} + +func GetMD5Base64(bytes []byte) (base64Value string) { + md5Ctx := md5.New() + md5Ctx.Write(bytes) + md5Value := md5Ctx.Sum(nil) + base64Value = base64.StdEncoding.EncodeToString(md5Value) + return +} + +func GetTimeInFormatISO8601() (timeStr string) { + gmt := time.FixedZone("GMT", 0) + + return time.Now().In(gmt).Format("2006-01-02T15:04:05Z") +} + +func GetTimeInFormatRFC2616() (timeStr string) { + gmt := time.FixedZone("GMT", 0) + + return time.Now().In(gmt).Format("Mon, 02 Jan 2006 15:04:05 GMT") +} + +func GetUrlFormedMap(source map[string]string) (urlEncoded string) { + urlEncoder := url.Values{} + for key, value := range source { + urlEncoder.Add(key, value) + } + urlEncoded = urlEncoder.Encode() + return +} + +func InitStructWithDefaultTag(bean interface{}) { + configType := reflect.TypeOf(bean) + for i := 0; i < configType.Elem().NumField(); i++ { + field := configType.Elem().Field(i) + defaultValue := field.Tag.Get("default") + if defaultValue == "" { + continue + } + setter := reflect.ValueOf(bean).Elem().Field(i) + switch field.Type.String() { + case "int": + intValue, _ := strconv.ParseInt(defaultValue, 10, 64) + setter.SetInt(intValue) + case "time.Duration": + intValue, _ := strconv.ParseInt(defaultValue, 10, 64) + setter.SetInt(intValue) + case "string": + setter.SetString(defaultValue) + case "bool": + boolValue, _ := strconv.ParseBool(defaultValue) + setter.SetBool(boolValue) + } + } +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/accept_inquired_system_event.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/accept_inquired_system_event.go new file mode 100644 index 000000000..5bcd8d0ee --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/accept_inquired_system_event.go @@ -0,0 +1,107 @@ +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" +) + +// AcceptInquiredSystemEvent invokes the ecs.AcceptInquiredSystemEvent API synchronously +// api document: https://help.aliyun.com/api/ecs/acceptinquiredsystemevent.html +func (client *Client) AcceptInquiredSystemEvent(request *AcceptInquiredSystemEventRequest) (response *AcceptInquiredSystemEventResponse, err error) { + response = CreateAcceptInquiredSystemEventResponse() + err = client.DoAction(request, response) + return +} + +// AcceptInquiredSystemEventWithChan invokes the ecs.AcceptInquiredSystemEvent API asynchronously +// api document: https://help.aliyun.com/api/ecs/acceptinquiredsystemevent.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AcceptInquiredSystemEventWithChan(request *AcceptInquiredSystemEventRequest) (<-chan *AcceptInquiredSystemEventResponse, <-chan error) { + responseChan := make(chan *AcceptInquiredSystemEventResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.AcceptInquiredSystemEvent(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// AcceptInquiredSystemEventWithCallback invokes the ecs.AcceptInquiredSystemEvent API asynchronously +// api document: https://help.aliyun.com/api/ecs/acceptinquiredsystemevent.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AcceptInquiredSystemEventWithCallback(request *AcceptInquiredSystemEventRequest, callback func(response *AcceptInquiredSystemEventResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *AcceptInquiredSystemEventResponse + var err error + defer close(result) + response, err = client.AcceptInquiredSystemEvent(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// AcceptInquiredSystemEventRequest is the request struct for api AcceptInquiredSystemEvent +type AcceptInquiredSystemEventRequest struct { + *requests.RpcRequest + EventId string `position:"Query" name:"EventId"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// AcceptInquiredSystemEventResponse is the response struct for api AcceptInquiredSystemEvent +type AcceptInquiredSystemEventResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateAcceptInquiredSystemEventRequest creates a request to invoke AcceptInquiredSystemEvent API +func CreateAcceptInquiredSystemEventRequest() (request *AcceptInquiredSystemEventRequest) { + request = &AcceptInquiredSystemEventRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "AcceptInquiredSystemEvent", "ecs", "openAPI") + return +} + +// CreateAcceptInquiredSystemEventResponse creates a response to parse from AcceptInquiredSystemEvent response +func CreateAcceptInquiredSystemEventResponse() (response *AcceptInquiredSystemEventResponse) { + response = &AcceptInquiredSystemEventResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/activate_router_interface.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/activate_router_interface.go new file mode 100644 index 000000000..31e54c500 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/activate_router_interface.go @@ -0,0 +1,106 @@ +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" +) + +// ActivateRouterInterface invokes the ecs.ActivateRouterInterface API synchronously +// api document: https://help.aliyun.com/api/ecs/activaterouterinterface.html +func (client *Client) ActivateRouterInterface(request *ActivateRouterInterfaceRequest) (response *ActivateRouterInterfaceResponse, err error) { + response = CreateActivateRouterInterfaceResponse() + err = client.DoAction(request, response) + return +} + +// ActivateRouterInterfaceWithChan invokes the ecs.ActivateRouterInterface API asynchronously +// api document: https://help.aliyun.com/api/ecs/activaterouterinterface.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ActivateRouterInterfaceWithChan(request *ActivateRouterInterfaceRequest) (<-chan *ActivateRouterInterfaceResponse, <-chan error) { + responseChan := make(chan *ActivateRouterInterfaceResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ActivateRouterInterface(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ActivateRouterInterfaceWithCallback invokes the ecs.ActivateRouterInterface API asynchronously +// api document: https://help.aliyun.com/api/ecs/activaterouterinterface.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ActivateRouterInterfaceWithCallback(request *ActivateRouterInterfaceRequest, callback func(response *ActivateRouterInterfaceResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ActivateRouterInterfaceResponse + var err error + defer close(result) + response, err = client.ActivateRouterInterface(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ActivateRouterInterfaceRequest is the request struct for api ActivateRouterInterface +type ActivateRouterInterfaceRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + RouterInterfaceId string `position:"Query" name:"RouterInterfaceId"` +} + +// ActivateRouterInterfaceResponse is the response struct for api ActivateRouterInterface +type ActivateRouterInterfaceResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateActivateRouterInterfaceRequest creates a request to invoke ActivateRouterInterface API +func CreateActivateRouterInterfaceRequest() (request *ActivateRouterInterfaceRequest) { + request = &ActivateRouterInterfaceRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ActivateRouterInterface", "ecs", "openAPI") + return +} + +// CreateActivateRouterInterfaceResponse creates a response to parse from ActivateRouterInterface response +func CreateActivateRouterInterfaceResponse() (response *ActivateRouterInterfaceResponse) { + response = &ActivateRouterInterfaceResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/add_bandwidth_package_ips.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/add_bandwidth_package_ips.go new file mode 100644 index 000000000..f8ed2b008 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/add_bandwidth_package_ips.go @@ -0,0 +1,109 @@ +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" +) + +// AddBandwidthPackageIps invokes the ecs.AddBandwidthPackageIps API synchronously +// api document: https://help.aliyun.com/api/ecs/addbandwidthpackageips.html +func (client *Client) AddBandwidthPackageIps(request *AddBandwidthPackageIpsRequest) (response *AddBandwidthPackageIpsResponse, err error) { + response = CreateAddBandwidthPackageIpsResponse() + err = client.DoAction(request, response) + return +} + +// AddBandwidthPackageIpsWithChan invokes the ecs.AddBandwidthPackageIps API asynchronously +// api document: https://help.aliyun.com/api/ecs/addbandwidthpackageips.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AddBandwidthPackageIpsWithChan(request *AddBandwidthPackageIpsRequest) (<-chan *AddBandwidthPackageIpsResponse, <-chan error) { + responseChan := make(chan *AddBandwidthPackageIpsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.AddBandwidthPackageIps(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// AddBandwidthPackageIpsWithCallback invokes the ecs.AddBandwidthPackageIps API asynchronously +// api document: https://help.aliyun.com/api/ecs/addbandwidthpackageips.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AddBandwidthPackageIpsWithCallback(request *AddBandwidthPackageIpsRequest, callback func(response *AddBandwidthPackageIpsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *AddBandwidthPackageIpsResponse + var err error + defer close(result) + response, err = client.AddBandwidthPackageIps(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// AddBandwidthPackageIpsRequest is the request struct for api AddBandwidthPackageIps +type AddBandwidthPackageIpsRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + BandwidthPackageId string `position:"Query" name:"BandwidthPackageId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + IpCount string `position:"Query" name:"IpCount"` +} + +// AddBandwidthPackageIpsResponse is the response struct for api AddBandwidthPackageIps +type AddBandwidthPackageIpsResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateAddBandwidthPackageIpsRequest creates a request to invoke AddBandwidthPackageIps API +func CreateAddBandwidthPackageIpsRequest() (request *AddBandwidthPackageIpsRequest) { + request = &AddBandwidthPackageIpsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "AddBandwidthPackageIps", "ecs", "openAPI") + return +} + +// CreateAddBandwidthPackageIpsResponse creates a response to parse from AddBandwidthPackageIps response +func CreateAddBandwidthPackageIpsResponse() (response *AddBandwidthPackageIpsResponse) { + response = &AddBandwidthPackageIpsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/add_tags.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/add_tags.go new file mode 100644 index 000000000..4a3ea0243 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/add_tags.go @@ -0,0 +1,114 @@ +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" +) + +// AddTags invokes the ecs.AddTags API synchronously +// api document: https://help.aliyun.com/api/ecs/addtags.html +func (client *Client) AddTags(request *AddTagsRequest) (response *AddTagsResponse, err error) { + response = CreateAddTagsResponse() + err = client.DoAction(request, response) + return +} + +// AddTagsWithChan invokes the ecs.AddTags API asynchronously +// api document: https://help.aliyun.com/api/ecs/addtags.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AddTagsWithChan(request *AddTagsRequest) (<-chan *AddTagsResponse, <-chan error) { + responseChan := make(chan *AddTagsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.AddTags(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// AddTagsWithCallback invokes the ecs.AddTags API asynchronously +// api document: https://help.aliyun.com/api/ecs/addtags.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AddTagsWithCallback(request *AddTagsRequest, callback func(response *AddTagsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *AddTagsResponse + var err error + defer close(result) + response, err = client.AddTags(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// AddTagsRequest is the request struct for api AddTags +type AddTagsRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceId string `position:"Query" name:"ResourceId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + Tag *[]AddTagsTag `position:"Query" name:"Tag" type:"Repeated"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + ResourceType string `position:"Query" name:"ResourceType"` +} + +// AddTagsTag is a repeated param struct in AddTagsRequest +type AddTagsTag struct { + Value string `name:"Value"` + Key string `name:"Key"` +} + +// AddTagsResponse is the response struct for api AddTags +type AddTagsResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateAddTagsRequest creates a request to invoke AddTags API +func CreateAddTagsRequest() (request *AddTagsRequest) { + request = &AddTagsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "AddTags", "ecs", "openAPI") + return +} + +// CreateAddTagsResponse creates a response to parse from AddTags response +func CreateAddTagsResponse() (response *AddTagsResponse) { + response = &AddTagsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/allocate_dedicated_hosts.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/allocate_dedicated_hosts.go new file mode 100644 index 000000000..4a8de37dc --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/allocate_dedicated_hosts.go @@ -0,0 +1,130 @@ +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" +) + +// AllocateDedicatedHosts invokes the ecs.AllocateDedicatedHosts API synchronously +// api document: https://help.aliyun.com/api/ecs/allocatededicatedhosts.html +func (client *Client) AllocateDedicatedHosts(request *AllocateDedicatedHostsRequest) (response *AllocateDedicatedHostsResponse, err error) { + response = CreateAllocateDedicatedHostsResponse() + err = client.DoAction(request, response) + return +} + +// AllocateDedicatedHostsWithChan invokes the ecs.AllocateDedicatedHosts API asynchronously +// api document: https://help.aliyun.com/api/ecs/allocatededicatedhosts.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AllocateDedicatedHostsWithChan(request *AllocateDedicatedHostsRequest) (<-chan *AllocateDedicatedHostsResponse, <-chan error) { + responseChan := make(chan *AllocateDedicatedHostsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.AllocateDedicatedHosts(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// AllocateDedicatedHostsWithCallback invokes the ecs.AllocateDedicatedHosts API asynchronously +// api document: https://help.aliyun.com/api/ecs/allocatededicatedhosts.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AllocateDedicatedHostsWithCallback(request *AllocateDedicatedHostsRequest, callback func(response *AllocateDedicatedHostsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *AllocateDedicatedHostsResponse + var err error + defer close(result) + response, err = client.AllocateDedicatedHosts(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// AllocateDedicatedHostsRequest is the request struct for api AllocateDedicatedHosts +type AllocateDedicatedHostsRequest 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"` + ActionOnMaintenance string `position:"Query" name:"ActionOnMaintenance"` + Tag *[]AllocateDedicatedHostsTag `position:"Query" name:"Tag" type:"Repeated"` + DedicatedHostType string `position:"Query" name:"DedicatedHostType"` + AutoRenewPeriod requests.Integer `position:"Query" name:"AutoRenewPeriod"` + Period requests.Integer `position:"Query" name:"Period"` + Quantity requests.Integer `position:"Query" name:"Quantity"` + DedicatedHostName string `position:"Query" name:"DedicatedHostName"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + AutoReleaseTime string `position:"Query" name:"AutoReleaseTime"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PeriodUnit string `position:"Query" name:"PeriodUnit"` + AutoRenew requests.Boolean `position:"Query" name:"AutoRenew"` + NetworkAttributesSlbUdpTimeout requests.Integer `position:"Query" name:"NetworkAttributes.SlbUdpTimeout"` + ZoneId string `position:"Query" name:"ZoneId"` + ChargeType string `position:"Query" name:"ChargeType"` + NetworkAttributesUdpTimeout requests.Integer `position:"Query" name:"NetworkAttributes.UdpTimeout"` +} + +// AllocateDedicatedHostsTag is a repeated param struct in AllocateDedicatedHostsRequest +type AllocateDedicatedHostsTag struct { + Key string `name:"Key"` + Value string `name:"Value"` +} + +// AllocateDedicatedHostsResponse is the response struct for api AllocateDedicatedHosts +type AllocateDedicatedHostsResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + DedicatedHostIdSets DedicatedHostIdSets `json:"DedicatedHostIdSets" xml:"DedicatedHostIdSets"` +} + +// CreateAllocateDedicatedHostsRequest creates a request to invoke AllocateDedicatedHosts API +func CreateAllocateDedicatedHostsRequest() (request *AllocateDedicatedHostsRequest) { + request = &AllocateDedicatedHostsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "AllocateDedicatedHosts", "ecs", "openAPI") + return +} + +// CreateAllocateDedicatedHostsResponse creates a response to parse from AllocateDedicatedHosts response +func CreateAllocateDedicatedHostsResponse() (response *AllocateDedicatedHostsResponse) { + response = &AllocateDedicatedHostsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/allocate_eip_address.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/allocate_eip_address.go new file mode 100644 index 000000000..2cc3f4174 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/allocate_eip_address.go @@ -0,0 +1,112 @@ +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" +) + +// AllocateEipAddress invokes the ecs.AllocateEipAddress API synchronously +// api document: https://help.aliyun.com/api/ecs/allocateeipaddress.html +func (client *Client) AllocateEipAddress(request *AllocateEipAddressRequest) (response *AllocateEipAddressResponse, err error) { + response = CreateAllocateEipAddressResponse() + err = client.DoAction(request, response) + return +} + +// AllocateEipAddressWithChan invokes the ecs.AllocateEipAddress API asynchronously +// api document: https://help.aliyun.com/api/ecs/allocateeipaddress.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AllocateEipAddressWithChan(request *AllocateEipAddressRequest) (<-chan *AllocateEipAddressResponse, <-chan error) { + responseChan := make(chan *AllocateEipAddressResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.AllocateEipAddress(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// AllocateEipAddressWithCallback invokes the ecs.AllocateEipAddress API asynchronously +// api document: https://help.aliyun.com/api/ecs/allocateeipaddress.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AllocateEipAddressWithCallback(request *AllocateEipAddressRequest, callback func(response *AllocateEipAddressResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *AllocateEipAddressResponse + var err error + defer close(result) + response, err = client.AllocateEipAddress(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// AllocateEipAddressRequest is the request struct for api AllocateEipAddress +type AllocateEipAddressRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + Bandwidth string `position:"Query" name:"Bandwidth"` + ClientToken string `position:"Query" name:"ClientToken"` + InternetChargeType string `position:"Query" name:"InternetChargeType"` + ISP string `position:"Query" name:"ISP"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// AllocateEipAddressResponse is the response struct for api AllocateEipAddress +type AllocateEipAddressResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + AllocationId string `json:"AllocationId" xml:"AllocationId"` + EipAddress string `json:"EipAddress" xml:"EipAddress"` +} + +// CreateAllocateEipAddressRequest creates a request to invoke AllocateEipAddress API +func CreateAllocateEipAddressRequest() (request *AllocateEipAddressRequest) { + request = &AllocateEipAddressRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "AllocateEipAddress", "ecs", "openAPI") + return +} + +// CreateAllocateEipAddressResponse creates a response to parse from AllocateEipAddress response +func CreateAllocateEipAddressResponse() (response *AllocateEipAddressResponse) { + response = &AllocateEipAddressResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/allocate_public_ip_address.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/allocate_public_ip_address.go new file mode 100644 index 000000000..0e6f34e23 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/allocate_public_ip_address.go @@ -0,0 +1,110 @@ +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" +) + +// AllocatePublicIpAddress invokes the ecs.AllocatePublicIpAddress API synchronously +// api document: https://help.aliyun.com/api/ecs/allocatepublicipaddress.html +func (client *Client) AllocatePublicIpAddress(request *AllocatePublicIpAddressRequest) (response *AllocatePublicIpAddressResponse, err error) { + response = CreateAllocatePublicIpAddressResponse() + err = client.DoAction(request, response) + return +} + +// AllocatePublicIpAddressWithChan invokes the ecs.AllocatePublicIpAddress API asynchronously +// api document: https://help.aliyun.com/api/ecs/allocatepublicipaddress.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AllocatePublicIpAddressWithChan(request *AllocatePublicIpAddressRequest) (<-chan *AllocatePublicIpAddressResponse, <-chan error) { + responseChan := make(chan *AllocatePublicIpAddressResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.AllocatePublicIpAddress(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// AllocatePublicIpAddressWithCallback invokes the ecs.AllocatePublicIpAddress API asynchronously +// api document: https://help.aliyun.com/api/ecs/allocatepublicipaddress.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AllocatePublicIpAddressWithCallback(request *AllocatePublicIpAddressRequest, callback func(response *AllocatePublicIpAddressResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *AllocatePublicIpAddressResponse + var err error + defer close(result) + response, err = client.AllocatePublicIpAddress(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// AllocatePublicIpAddressRequest is the request struct for api AllocatePublicIpAddress +type AllocatePublicIpAddressRequest struct { + *requests.RpcRequest + IpAddress string `position:"Query" name:"IpAddress"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + InstanceId string `position:"Query" name:"InstanceId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + VlanId string `position:"Query" name:"VlanId"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// AllocatePublicIpAddressResponse is the response struct for api AllocatePublicIpAddress +type AllocatePublicIpAddressResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + IpAddress string `json:"IpAddress" xml:"IpAddress"` +} + +// CreateAllocatePublicIpAddressRequest creates a request to invoke AllocatePublicIpAddress API +func CreateAllocatePublicIpAddressRequest() (request *AllocatePublicIpAddressRequest) { + request = &AllocatePublicIpAddressRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "AllocatePublicIpAddress", "ecs", "openAPI") + return +} + +// CreateAllocatePublicIpAddressResponse creates a response to parse from AllocatePublicIpAddress response +func CreateAllocatePublicIpAddressResponse() (response *AllocatePublicIpAddressResponse) { + response = &AllocatePublicIpAddressResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/apply_auto_snapshot_policy.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/apply_auto_snapshot_policy.go new file mode 100644 index 000000000..ab2af4b9f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/apply_auto_snapshot_policy.go @@ -0,0 +1,107 @@ +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" +) + +// ApplyAutoSnapshotPolicy invokes the ecs.ApplyAutoSnapshotPolicy API synchronously +// api document: https://help.aliyun.com/api/ecs/applyautosnapshotpolicy.html +func (client *Client) ApplyAutoSnapshotPolicy(request *ApplyAutoSnapshotPolicyRequest) (response *ApplyAutoSnapshotPolicyResponse, err error) { + response = CreateApplyAutoSnapshotPolicyResponse() + err = client.DoAction(request, response) + return +} + +// ApplyAutoSnapshotPolicyWithChan invokes the ecs.ApplyAutoSnapshotPolicy API asynchronously +// api document: https://help.aliyun.com/api/ecs/applyautosnapshotpolicy.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ApplyAutoSnapshotPolicyWithChan(request *ApplyAutoSnapshotPolicyRequest) (<-chan *ApplyAutoSnapshotPolicyResponse, <-chan error) { + responseChan := make(chan *ApplyAutoSnapshotPolicyResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ApplyAutoSnapshotPolicy(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ApplyAutoSnapshotPolicyWithCallback invokes the ecs.ApplyAutoSnapshotPolicy API asynchronously +// api document: https://help.aliyun.com/api/ecs/applyautosnapshotpolicy.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ApplyAutoSnapshotPolicyWithCallback(request *ApplyAutoSnapshotPolicyRequest, callback func(response *ApplyAutoSnapshotPolicyResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ApplyAutoSnapshotPolicyResponse + var err error + defer close(result) + response, err = client.ApplyAutoSnapshotPolicy(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ApplyAutoSnapshotPolicyRequest is the request struct for api ApplyAutoSnapshotPolicy +type ApplyAutoSnapshotPolicyRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + AutoSnapshotPolicyId string `position:"Query" name:"autoSnapshotPolicyId"` + DiskIds string `position:"Query" name:"diskIds"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// ApplyAutoSnapshotPolicyResponse is the response struct for api ApplyAutoSnapshotPolicy +type ApplyAutoSnapshotPolicyResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateApplyAutoSnapshotPolicyRequest creates a request to invoke ApplyAutoSnapshotPolicy API +func CreateApplyAutoSnapshotPolicyRequest() (request *ApplyAutoSnapshotPolicyRequest) { + request = &ApplyAutoSnapshotPolicyRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ApplyAutoSnapshotPolicy", "ecs", "openAPI") + return +} + +// CreateApplyAutoSnapshotPolicyResponse creates a response to parse from ApplyAutoSnapshotPolicy response +func CreateApplyAutoSnapshotPolicyResponse() (response *ApplyAutoSnapshotPolicyResponse) { + response = &ApplyAutoSnapshotPolicyResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/assign_ipv6_addresses.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/assign_ipv6_addresses.go new file mode 100644 index 000000000..927cad5fd --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/assign_ipv6_addresses.go @@ -0,0 +1,109 @@ +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" +) + +// AssignIpv6Addresses invokes the ecs.AssignIpv6Addresses API synchronously +// api document: https://help.aliyun.com/api/ecs/assignipv6addresses.html +func (client *Client) AssignIpv6Addresses(request *AssignIpv6AddressesRequest) (response *AssignIpv6AddressesResponse, err error) { + response = CreateAssignIpv6AddressesResponse() + err = client.DoAction(request, response) + return +} + +// AssignIpv6AddressesWithChan invokes the ecs.AssignIpv6Addresses API asynchronously +// api document: https://help.aliyun.com/api/ecs/assignipv6addresses.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AssignIpv6AddressesWithChan(request *AssignIpv6AddressesRequest) (<-chan *AssignIpv6AddressesResponse, <-chan error) { + responseChan := make(chan *AssignIpv6AddressesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.AssignIpv6Addresses(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// AssignIpv6AddressesWithCallback invokes the ecs.AssignIpv6Addresses API asynchronously +// api document: https://help.aliyun.com/api/ecs/assignipv6addresses.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AssignIpv6AddressesWithCallback(request *AssignIpv6AddressesRequest, callback func(response *AssignIpv6AddressesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *AssignIpv6AddressesResponse + var err error + defer close(result) + response, err = client.AssignIpv6Addresses(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// AssignIpv6AddressesRequest is the request struct for api AssignIpv6Addresses +type AssignIpv6AddressesRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + Ipv6AddressCount requests.Integer `position:"Query" name:"Ipv6AddressCount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + NetworkInterfaceId string `position:"Query" name:"NetworkInterfaceId"` + Ipv6Address *[]string `position:"Query" name:"Ipv6Address" type:"Repeated"` +} + +// AssignIpv6AddressesResponse is the response struct for api AssignIpv6Addresses +type AssignIpv6AddressesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateAssignIpv6AddressesRequest creates a request to invoke AssignIpv6Addresses API +func CreateAssignIpv6AddressesRequest() (request *AssignIpv6AddressesRequest) { + request = &AssignIpv6AddressesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "AssignIpv6Addresses", "ecs", "openAPI") + return +} + +// CreateAssignIpv6AddressesResponse creates a response to parse from AssignIpv6Addresses response +func CreateAssignIpv6AddressesResponse() (response *AssignIpv6AddressesResponse) { + response = &AssignIpv6AddressesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/assign_private_ip_addresses.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/assign_private_ip_addresses.go new file mode 100644 index 000000000..b26f7eeca --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/assign_private_ip_addresses.go @@ -0,0 +1,109 @@ +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" +) + +// AssignPrivateIpAddresses invokes the ecs.AssignPrivateIpAddresses API synchronously +// api document: https://help.aliyun.com/api/ecs/assignprivateipaddresses.html +func (client *Client) AssignPrivateIpAddresses(request *AssignPrivateIpAddressesRequest) (response *AssignPrivateIpAddressesResponse, err error) { + response = CreateAssignPrivateIpAddressesResponse() + err = client.DoAction(request, response) + return +} + +// AssignPrivateIpAddressesWithChan invokes the ecs.AssignPrivateIpAddresses API asynchronously +// api document: https://help.aliyun.com/api/ecs/assignprivateipaddresses.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AssignPrivateIpAddressesWithChan(request *AssignPrivateIpAddressesRequest) (<-chan *AssignPrivateIpAddressesResponse, <-chan error) { + responseChan := make(chan *AssignPrivateIpAddressesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.AssignPrivateIpAddresses(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// AssignPrivateIpAddressesWithCallback invokes the ecs.AssignPrivateIpAddresses API asynchronously +// api document: https://help.aliyun.com/api/ecs/assignprivateipaddresses.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AssignPrivateIpAddressesWithCallback(request *AssignPrivateIpAddressesRequest, callback func(response *AssignPrivateIpAddressesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *AssignPrivateIpAddressesResponse + var err error + defer close(result) + response, err = client.AssignPrivateIpAddresses(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// AssignPrivateIpAddressesRequest is the request struct for api AssignPrivateIpAddresses +type AssignPrivateIpAddressesRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + SecondaryPrivateIpAddressCount requests.Integer `position:"Query" name:"SecondaryPrivateIpAddressCount"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PrivateIpAddress *[]string `position:"Query" name:"PrivateIpAddress" type:"Repeated"` + NetworkInterfaceId string `position:"Query" name:"NetworkInterfaceId"` +} + +// AssignPrivateIpAddressesResponse is the response struct for api AssignPrivateIpAddresses +type AssignPrivateIpAddressesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateAssignPrivateIpAddressesRequest creates a request to invoke AssignPrivateIpAddresses API +func CreateAssignPrivateIpAddressesRequest() (request *AssignPrivateIpAddressesRequest) { + request = &AssignPrivateIpAddressesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "AssignPrivateIpAddresses", "ecs", "openAPI") + return +} + +// CreateAssignPrivateIpAddressesResponse creates a response to parse from AssignPrivateIpAddresses response +func CreateAssignPrivateIpAddressesResponse() (response *AssignPrivateIpAddressesResponse) { + response = &AssignPrivateIpAddressesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/associate_eip_address.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/associate_eip_address.go new file mode 100644 index 000000000..cf7e9978f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/associate_eip_address.go @@ -0,0 +1,109 @@ +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" +) + +// AssociateEipAddress invokes the ecs.AssociateEipAddress API synchronously +// api document: https://help.aliyun.com/api/ecs/associateeipaddress.html +func (client *Client) AssociateEipAddress(request *AssociateEipAddressRequest) (response *AssociateEipAddressResponse, err error) { + response = CreateAssociateEipAddressResponse() + err = client.DoAction(request, response) + return +} + +// AssociateEipAddressWithChan invokes the ecs.AssociateEipAddress API asynchronously +// api document: https://help.aliyun.com/api/ecs/associateeipaddress.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AssociateEipAddressWithChan(request *AssociateEipAddressRequest) (<-chan *AssociateEipAddressResponse, <-chan error) { + responseChan := make(chan *AssociateEipAddressResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.AssociateEipAddress(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// AssociateEipAddressWithCallback invokes the ecs.AssociateEipAddress API asynchronously +// api document: https://help.aliyun.com/api/ecs/associateeipaddress.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AssociateEipAddressWithCallback(request *AssociateEipAddressRequest, callback func(response *AssociateEipAddressResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *AssociateEipAddressResponse + var err error + defer close(result) + response, err = client.AssociateEipAddress(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// AssociateEipAddressRequest is the request struct for api AssociateEipAddress +type AssociateEipAddressRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + InstanceId string `position:"Query" name:"InstanceId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + InstanceType string `position:"Query" name:"InstanceType"` + AllocationId string `position:"Query" name:"AllocationId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// AssociateEipAddressResponse is the response struct for api AssociateEipAddress +type AssociateEipAddressResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateAssociateEipAddressRequest creates a request to invoke AssociateEipAddress API +func CreateAssociateEipAddressRequest() (request *AssociateEipAddressRequest) { + request = &AssociateEipAddressRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "AssociateEipAddress", "ecs", "openAPI") + return +} + +// CreateAssociateEipAddressResponse creates a response to parse from AssociateEipAddress response +func CreateAssociateEipAddressResponse() (response *AssociateEipAddressResponse) { + response = &AssociateEipAddressResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/associate_ha_vip.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/associate_ha_vip.go new file mode 100644 index 000000000..b153aa8c5 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/associate_ha_vip.go @@ -0,0 +1,109 @@ +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" +) + +// AssociateHaVip invokes the ecs.AssociateHaVip API synchronously +// api document: https://help.aliyun.com/api/ecs/associatehavip.html +func (client *Client) AssociateHaVip(request *AssociateHaVipRequest) (response *AssociateHaVipResponse, err error) { + response = CreateAssociateHaVipResponse() + err = client.DoAction(request, response) + return +} + +// AssociateHaVipWithChan invokes the ecs.AssociateHaVip API asynchronously +// api document: https://help.aliyun.com/api/ecs/associatehavip.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AssociateHaVipWithChan(request *AssociateHaVipRequest) (<-chan *AssociateHaVipResponse, <-chan error) { + responseChan := make(chan *AssociateHaVipResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.AssociateHaVip(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// AssociateHaVipWithCallback invokes the ecs.AssociateHaVip API asynchronously +// api document: https://help.aliyun.com/api/ecs/associatehavip.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AssociateHaVipWithCallback(request *AssociateHaVipRequest, callback func(response *AssociateHaVipResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *AssociateHaVipResponse + var err error + defer close(result) + response, err = client.AssociateHaVip(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// AssociateHaVipRequest is the request struct for api AssociateHaVip +type AssociateHaVipRequest struct { + *requests.RpcRequest + HaVipId string `position:"Query" name:"HaVipId"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + InstanceId string `position:"Query" name:"InstanceId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// AssociateHaVipResponse is the response struct for api AssociateHaVip +type AssociateHaVipResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateAssociateHaVipRequest creates a request to invoke AssociateHaVip API +func CreateAssociateHaVipRequest() (request *AssociateHaVipRequest) { + request = &AssociateHaVipRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "AssociateHaVip", "ecs", "openAPI") + return +} + +// CreateAssociateHaVipResponse creates a response to parse from AssociateHaVip response +func CreateAssociateHaVipResponse() (response *AssociateHaVipResponse) { + response = &AssociateHaVipResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/attach_classic_link_vpc.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/attach_classic_link_vpc.go new file mode 100644 index 000000000..d07a41575 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/attach_classic_link_vpc.go @@ -0,0 +1,107 @@ +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" +) + +// AttachClassicLinkVpc invokes the ecs.AttachClassicLinkVpc API synchronously +// api document: https://help.aliyun.com/api/ecs/attachclassiclinkvpc.html +func (client *Client) AttachClassicLinkVpc(request *AttachClassicLinkVpcRequest) (response *AttachClassicLinkVpcResponse, err error) { + response = CreateAttachClassicLinkVpcResponse() + err = client.DoAction(request, response) + return +} + +// AttachClassicLinkVpcWithChan invokes the ecs.AttachClassicLinkVpc API asynchronously +// api document: https://help.aliyun.com/api/ecs/attachclassiclinkvpc.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AttachClassicLinkVpcWithChan(request *AttachClassicLinkVpcRequest) (<-chan *AttachClassicLinkVpcResponse, <-chan error) { + responseChan := make(chan *AttachClassicLinkVpcResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.AttachClassicLinkVpc(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// AttachClassicLinkVpcWithCallback invokes the ecs.AttachClassicLinkVpc API asynchronously +// api document: https://help.aliyun.com/api/ecs/attachclassiclinkvpc.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AttachClassicLinkVpcWithCallback(request *AttachClassicLinkVpcRequest, callback func(response *AttachClassicLinkVpcResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *AttachClassicLinkVpcResponse + var err error + defer close(result) + response, err = client.AttachClassicLinkVpc(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// AttachClassicLinkVpcRequest is the request struct for api AttachClassicLinkVpc +type AttachClassicLinkVpcRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + InstanceId string `position:"Query" name:"InstanceId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + VpcId string `position:"Query" name:"VpcId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// AttachClassicLinkVpcResponse is the response struct for api AttachClassicLinkVpc +type AttachClassicLinkVpcResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateAttachClassicLinkVpcRequest creates a request to invoke AttachClassicLinkVpc API +func CreateAttachClassicLinkVpcRequest() (request *AttachClassicLinkVpcRequest) { + request = &AttachClassicLinkVpcRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "AttachClassicLinkVpc", "ecs", "openAPI") + return +} + +// CreateAttachClassicLinkVpcResponse creates a response to parse from AttachClassicLinkVpc response +func CreateAttachClassicLinkVpcResponse() (response *AttachClassicLinkVpcResponse) { + response = &AttachClassicLinkVpcResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/attach_disk.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/attach_disk.go new file mode 100644 index 000000000..452f73f27 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/attach_disk.go @@ -0,0 +1,110 @@ +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" +) + +// AttachDisk invokes the ecs.AttachDisk API synchronously +// api document: https://help.aliyun.com/api/ecs/attachdisk.html +func (client *Client) AttachDisk(request *AttachDiskRequest) (response *AttachDiskResponse, err error) { + response = CreateAttachDiskResponse() + err = client.DoAction(request, response) + return +} + +// AttachDiskWithChan invokes the ecs.AttachDisk API asynchronously +// api document: https://help.aliyun.com/api/ecs/attachdisk.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AttachDiskWithChan(request *AttachDiskRequest) (<-chan *AttachDiskResponse, <-chan error) { + responseChan := make(chan *AttachDiskResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.AttachDisk(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// AttachDiskWithCallback invokes the ecs.AttachDisk API asynchronously +// api document: https://help.aliyun.com/api/ecs/attachdisk.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AttachDiskWithCallback(request *AttachDiskRequest, callback func(response *AttachDiskResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *AttachDiskResponse + var err error + defer close(result) + response, err = client.AttachDisk(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// AttachDiskRequest is the request struct for api AttachDisk +type AttachDiskRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + InstanceId string `position:"Query" name:"InstanceId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + DiskId string `position:"Query" name:"DiskId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Device string `position:"Query" name:"Device"` + DeleteWithInstance requests.Boolean `position:"Query" name:"DeleteWithInstance"` +} + +// AttachDiskResponse is the response struct for api AttachDisk +type AttachDiskResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateAttachDiskRequest creates a request to invoke AttachDisk API +func CreateAttachDiskRequest() (request *AttachDiskRequest) { + request = &AttachDiskRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "AttachDisk", "ecs", "openAPI") + return +} + +// CreateAttachDiskResponse creates a response to parse from AttachDisk response +func CreateAttachDiskResponse() (response *AttachDiskResponse) { + response = &AttachDiskResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/attach_instance_ram_role.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/attach_instance_ram_role.go new file mode 100644 index 000000000..7a697f522 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/attach_instance_ram_role.go @@ -0,0 +1,111 @@ +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" +) + +// AttachInstanceRamRole invokes the ecs.AttachInstanceRamRole API synchronously +// api document: https://help.aliyun.com/api/ecs/attachinstanceramrole.html +func (client *Client) AttachInstanceRamRole(request *AttachInstanceRamRoleRequest) (response *AttachInstanceRamRoleResponse, err error) { + response = CreateAttachInstanceRamRoleResponse() + err = client.DoAction(request, response) + return +} + +// AttachInstanceRamRoleWithChan invokes the ecs.AttachInstanceRamRole API asynchronously +// api document: https://help.aliyun.com/api/ecs/attachinstanceramrole.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AttachInstanceRamRoleWithChan(request *AttachInstanceRamRoleRequest) (<-chan *AttachInstanceRamRoleResponse, <-chan error) { + responseChan := make(chan *AttachInstanceRamRoleResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.AttachInstanceRamRole(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// AttachInstanceRamRoleWithCallback invokes the ecs.AttachInstanceRamRole API asynchronously +// api document: https://help.aliyun.com/api/ecs/attachinstanceramrole.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AttachInstanceRamRoleWithCallback(request *AttachInstanceRamRoleRequest, callback func(response *AttachInstanceRamRoleResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *AttachInstanceRamRoleResponse + var err error + defer close(result) + response, err = client.AttachInstanceRamRole(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// AttachInstanceRamRoleRequest is the request struct for api AttachInstanceRamRole +type AttachInstanceRamRoleRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + InstanceIds string `position:"Query" name:"InstanceIds"` + RamRoleName string `position:"Query" name:"RamRoleName"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// AttachInstanceRamRoleResponse is the response struct for api AttachInstanceRamRole +type AttachInstanceRamRoleResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + FailCount int `json:"FailCount" xml:"FailCount"` + RamRoleName string `json:"RamRoleName" xml:"RamRoleName"` + AttachInstanceRamRoleResults AttachInstanceRamRoleResults `json:"AttachInstanceRamRoleResults" xml:"AttachInstanceRamRoleResults"` +} + +// CreateAttachInstanceRamRoleRequest creates a request to invoke AttachInstanceRamRole API +func CreateAttachInstanceRamRoleRequest() (request *AttachInstanceRamRoleRequest) { + request = &AttachInstanceRamRoleRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "AttachInstanceRamRole", "ecs", "openAPI") + return +} + +// CreateAttachInstanceRamRoleResponse creates a response to parse from AttachInstanceRamRole response +func CreateAttachInstanceRamRoleResponse() (response *AttachInstanceRamRoleResponse) { + response = &AttachInstanceRamRoleResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/attach_key_pair.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/attach_key_pair.go new file mode 100644 index 000000000..275410fbb --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/attach_key_pair.go @@ -0,0 +1,111 @@ +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" +) + +// AttachKeyPair invokes the ecs.AttachKeyPair API synchronously +// api document: https://help.aliyun.com/api/ecs/attachkeypair.html +func (client *Client) AttachKeyPair(request *AttachKeyPairRequest) (response *AttachKeyPairResponse, err error) { + response = CreateAttachKeyPairResponse() + err = client.DoAction(request, response) + return +} + +// AttachKeyPairWithChan invokes the ecs.AttachKeyPair API asynchronously +// api document: https://help.aliyun.com/api/ecs/attachkeypair.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AttachKeyPairWithChan(request *AttachKeyPairRequest) (<-chan *AttachKeyPairResponse, <-chan error) { + responseChan := make(chan *AttachKeyPairResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.AttachKeyPair(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// AttachKeyPairWithCallback invokes the ecs.AttachKeyPair API asynchronously +// api document: https://help.aliyun.com/api/ecs/attachkeypair.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AttachKeyPairWithCallback(request *AttachKeyPairRequest, callback func(response *AttachKeyPairResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *AttachKeyPairResponse + var err error + defer close(result) + response, err = client.AttachKeyPair(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// AttachKeyPairRequest is the request struct for api AttachKeyPair +type AttachKeyPairRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + InstanceIds string `position:"Query" name:"InstanceIds"` + KeyPairName string `position:"Query" name:"KeyPairName"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// AttachKeyPairResponse is the response struct for api AttachKeyPair +type AttachKeyPairResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + TotalCount string `json:"TotalCount" xml:"TotalCount"` + FailCount string `json:"FailCount" xml:"FailCount"` + KeyPairName string `json:"KeyPairName" xml:"KeyPairName"` + Results ResultsInAttachKeyPair `json:"Results" xml:"Results"` +} + +// CreateAttachKeyPairRequest creates a request to invoke AttachKeyPair API +func CreateAttachKeyPairRequest() (request *AttachKeyPairRequest) { + request = &AttachKeyPairRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "AttachKeyPair", "ecs", "openAPI") + return +} + +// CreateAttachKeyPairResponse creates a response to parse from AttachKeyPair response +func CreateAttachKeyPairResponse() (response *AttachKeyPairResponse) { + response = &AttachKeyPairResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/attach_network_interface.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/attach_network_interface.go new file mode 100644 index 000000000..a65ec4e76 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/attach_network_interface.go @@ -0,0 +1,108 @@ +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" +) + +// AttachNetworkInterface invokes the ecs.AttachNetworkInterface API synchronously +// api document: https://help.aliyun.com/api/ecs/attachnetworkinterface.html +func (client *Client) AttachNetworkInterface(request *AttachNetworkInterfaceRequest) (response *AttachNetworkInterfaceResponse, err error) { + response = CreateAttachNetworkInterfaceResponse() + err = client.DoAction(request, response) + return +} + +// AttachNetworkInterfaceWithChan invokes the ecs.AttachNetworkInterface API asynchronously +// api document: https://help.aliyun.com/api/ecs/attachnetworkinterface.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AttachNetworkInterfaceWithChan(request *AttachNetworkInterfaceRequest) (<-chan *AttachNetworkInterfaceResponse, <-chan error) { + responseChan := make(chan *AttachNetworkInterfaceResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.AttachNetworkInterface(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// AttachNetworkInterfaceWithCallback invokes the ecs.AttachNetworkInterface API asynchronously +// api document: https://help.aliyun.com/api/ecs/attachnetworkinterface.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AttachNetworkInterfaceWithCallback(request *AttachNetworkInterfaceRequest, callback func(response *AttachNetworkInterfaceResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *AttachNetworkInterfaceResponse + var err error + defer close(result) + response, err = client.AttachNetworkInterface(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// AttachNetworkInterfaceRequest is the request struct for api AttachNetworkInterface +type AttachNetworkInterfaceRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + InstanceId string `position:"Query" name:"InstanceId"` + NetworkInterfaceId string `position:"Query" name:"NetworkInterfaceId"` +} + +// AttachNetworkInterfaceResponse is the response struct for api AttachNetworkInterface +type AttachNetworkInterfaceResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateAttachNetworkInterfaceRequest creates a request to invoke AttachNetworkInterface API +func CreateAttachNetworkInterfaceRequest() (request *AttachNetworkInterfaceRequest) { + request = &AttachNetworkInterfaceRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "AttachNetworkInterface", "ecs", "openAPI") + return +} + +// CreateAttachNetworkInterfaceResponse creates a response to parse from AttachNetworkInterface response +func CreateAttachNetworkInterfaceResponse() (response *AttachNetworkInterfaceResponse) { + response = &AttachNetworkInterfaceResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/authorize_security_group.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/authorize_security_group.go new file mode 100644 index 000000000..b1d7269b9 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/authorize_security_group.go @@ -0,0 +1,122 @@ +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" +) + +// AuthorizeSecurityGroup invokes the ecs.AuthorizeSecurityGroup API synchronously +// api document: https://help.aliyun.com/api/ecs/authorizesecuritygroup.html +func (client *Client) AuthorizeSecurityGroup(request *AuthorizeSecurityGroupRequest) (response *AuthorizeSecurityGroupResponse, err error) { + response = CreateAuthorizeSecurityGroupResponse() + err = client.DoAction(request, response) + return +} + +// AuthorizeSecurityGroupWithChan invokes the ecs.AuthorizeSecurityGroup API asynchronously +// api document: https://help.aliyun.com/api/ecs/authorizesecuritygroup.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AuthorizeSecurityGroupWithChan(request *AuthorizeSecurityGroupRequest) (<-chan *AuthorizeSecurityGroupResponse, <-chan error) { + responseChan := make(chan *AuthorizeSecurityGroupResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.AuthorizeSecurityGroup(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// AuthorizeSecurityGroupWithCallback invokes the ecs.AuthorizeSecurityGroup API asynchronously +// api document: https://help.aliyun.com/api/ecs/authorizesecuritygroup.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AuthorizeSecurityGroupWithCallback(request *AuthorizeSecurityGroupRequest, callback func(response *AuthorizeSecurityGroupResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *AuthorizeSecurityGroupResponse + var err error + defer close(result) + response, err = client.AuthorizeSecurityGroup(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// AuthorizeSecurityGroupRequest is the request struct for api AuthorizeSecurityGroup +type AuthorizeSecurityGroupRequest struct { + *requests.RpcRequest + NicType string `position:"Query" name:"NicType"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + SourcePortRange string `position:"Query" name:"SourcePortRange"` + ClientToken string `position:"Query" name:"ClientToken"` + SecurityGroupId string `position:"Query" name:"SecurityGroupId"` + Description string `position:"Query" name:"Description"` + SourceGroupOwnerId requests.Integer `position:"Query" name:"SourceGroupOwnerId"` + SourceGroupOwnerAccount string `position:"Query" name:"SourceGroupOwnerAccount"` + Ipv6SourceCidrIp string `position:"Query" name:"Ipv6SourceCidrIp"` + Ipv6DestCidrIp string `position:"Query" name:"Ipv6DestCidrIp"` + Policy string `position:"Query" name:"Policy"` + PortRange string `position:"Query" name:"PortRange"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + IpProtocol string `position:"Query" name:"IpProtocol"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + SourceCidrIp string `position:"Query" name:"SourceCidrIp"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Priority string `position:"Query" name:"Priority"` + DestCidrIp string `position:"Query" name:"DestCidrIp"` + SourceGroupId string `position:"Query" name:"SourceGroupId"` +} + +// AuthorizeSecurityGroupResponse is the response struct for api AuthorizeSecurityGroup +type AuthorizeSecurityGroupResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateAuthorizeSecurityGroupRequest creates a request to invoke AuthorizeSecurityGroup API +func CreateAuthorizeSecurityGroupRequest() (request *AuthorizeSecurityGroupRequest) { + request = &AuthorizeSecurityGroupRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "AuthorizeSecurityGroup", "ecs", "openAPI") + return +} + +// CreateAuthorizeSecurityGroupResponse creates a response to parse from AuthorizeSecurityGroup response +func CreateAuthorizeSecurityGroupResponse() (response *AuthorizeSecurityGroupResponse) { + response = &AuthorizeSecurityGroupResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/authorize_security_group_egress.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/authorize_security_group_egress.go new file mode 100644 index 000000000..379e0c354 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/authorize_security_group_egress.go @@ -0,0 +1,122 @@ +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" +) + +// AuthorizeSecurityGroupEgress invokes the ecs.AuthorizeSecurityGroupEgress API synchronously +// api document: https://help.aliyun.com/api/ecs/authorizesecuritygroupegress.html +func (client *Client) AuthorizeSecurityGroupEgress(request *AuthorizeSecurityGroupEgressRequest) (response *AuthorizeSecurityGroupEgressResponse, err error) { + response = CreateAuthorizeSecurityGroupEgressResponse() + err = client.DoAction(request, response) + return +} + +// AuthorizeSecurityGroupEgressWithChan invokes the ecs.AuthorizeSecurityGroupEgress API asynchronously +// api document: https://help.aliyun.com/api/ecs/authorizesecuritygroupegress.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AuthorizeSecurityGroupEgressWithChan(request *AuthorizeSecurityGroupEgressRequest) (<-chan *AuthorizeSecurityGroupEgressResponse, <-chan error) { + responseChan := make(chan *AuthorizeSecurityGroupEgressResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.AuthorizeSecurityGroupEgress(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// AuthorizeSecurityGroupEgressWithCallback invokes the ecs.AuthorizeSecurityGroupEgress API asynchronously +// api document: https://help.aliyun.com/api/ecs/authorizesecuritygroupegress.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AuthorizeSecurityGroupEgressWithCallback(request *AuthorizeSecurityGroupEgressRequest, callback func(response *AuthorizeSecurityGroupEgressResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *AuthorizeSecurityGroupEgressResponse + var err error + defer close(result) + response, err = client.AuthorizeSecurityGroupEgress(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// AuthorizeSecurityGroupEgressRequest is the request struct for api AuthorizeSecurityGroupEgress +type AuthorizeSecurityGroupEgressRequest struct { + *requests.RpcRequest + NicType string `position:"Query" name:"NicType"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + SourcePortRange string `position:"Query" name:"SourcePortRange"` + ClientToken string `position:"Query" name:"ClientToken"` + SecurityGroupId string `position:"Query" name:"SecurityGroupId"` + Description string `position:"Query" name:"Description"` + Ipv6DestCidrIp string `position:"Query" name:"Ipv6DestCidrIp"` + Ipv6SourceCidrIp string `position:"Query" name:"Ipv6SourceCidrIp"` + Policy string `position:"Query" name:"Policy"` + PortRange string `position:"Query" name:"PortRange"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + IpProtocol string `position:"Query" name:"IpProtocol"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + SourceCidrIp string `position:"Query" name:"SourceCidrIp"` + DestGroupId string `position:"Query" name:"DestGroupId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + DestGroupOwnerAccount string `position:"Query" name:"DestGroupOwnerAccount"` + Priority string `position:"Query" name:"Priority"` + DestCidrIp string `position:"Query" name:"DestCidrIp"` + DestGroupOwnerId requests.Integer `position:"Query" name:"DestGroupOwnerId"` +} + +// AuthorizeSecurityGroupEgressResponse is the response struct for api AuthorizeSecurityGroupEgress +type AuthorizeSecurityGroupEgressResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateAuthorizeSecurityGroupEgressRequest creates a request to invoke AuthorizeSecurityGroupEgress API +func CreateAuthorizeSecurityGroupEgressRequest() (request *AuthorizeSecurityGroupEgressRequest) { + request = &AuthorizeSecurityGroupEgressRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "AuthorizeSecurityGroupEgress", "ecs", "openAPI") + return +} + +// CreateAuthorizeSecurityGroupEgressResponse creates a response to parse from AuthorizeSecurityGroupEgress response +func CreateAuthorizeSecurityGroupEgressResponse() (response *AuthorizeSecurityGroupEgressResponse) { + response = &AuthorizeSecurityGroupEgressResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/cancel_auto_snapshot_policy.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/cancel_auto_snapshot_policy.go new file mode 100644 index 000000000..46fa77189 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/cancel_auto_snapshot_policy.go @@ -0,0 +1,106 @@ +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" +) + +// CancelAutoSnapshotPolicy invokes the ecs.CancelAutoSnapshotPolicy API synchronously +// api document: https://help.aliyun.com/api/ecs/cancelautosnapshotpolicy.html +func (client *Client) CancelAutoSnapshotPolicy(request *CancelAutoSnapshotPolicyRequest) (response *CancelAutoSnapshotPolicyResponse, err error) { + response = CreateCancelAutoSnapshotPolicyResponse() + err = client.DoAction(request, response) + return +} + +// CancelAutoSnapshotPolicyWithChan invokes the ecs.CancelAutoSnapshotPolicy API asynchronously +// api document: https://help.aliyun.com/api/ecs/cancelautosnapshotpolicy.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CancelAutoSnapshotPolicyWithChan(request *CancelAutoSnapshotPolicyRequest) (<-chan *CancelAutoSnapshotPolicyResponse, <-chan error) { + responseChan := make(chan *CancelAutoSnapshotPolicyResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CancelAutoSnapshotPolicy(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CancelAutoSnapshotPolicyWithCallback invokes the ecs.CancelAutoSnapshotPolicy API asynchronously +// api document: https://help.aliyun.com/api/ecs/cancelautosnapshotpolicy.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CancelAutoSnapshotPolicyWithCallback(request *CancelAutoSnapshotPolicyRequest, callback func(response *CancelAutoSnapshotPolicyResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CancelAutoSnapshotPolicyResponse + var err error + defer close(result) + response, err = client.CancelAutoSnapshotPolicy(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CancelAutoSnapshotPolicyRequest is the request struct for api CancelAutoSnapshotPolicy +type CancelAutoSnapshotPolicyRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + DiskIds string `position:"Query" name:"diskIds"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// CancelAutoSnapshotPolicyResponse is the response struct for api CancelAutoSnapshotPolicy +type CancelAutoSnapshotPolicyResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateCancelAutoSnapshotPolicyRequest creates a request to invoke CancelAutoSnapshotPolicy API +func CreateCancelAutoSnapshotPolicyRequest() (request *CancelAutoSnapshotPolicyRequest) { + request = &CancelAutoSnapshotPolicyRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "CancelAutoSnapshotPolicy", "ecs", "openAPI") + return +} + +// CreateCancelAutoSnapshotPolicyResponse creates a response to parse from CancelAutoSnapshotPolicy response +func CreateCancelAutoSnapshotPolicyResponse() (response *CancelAutoSnapshotPolicyResponse) { + response = &CancelAutoSnapshotPolicyResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/cancel_copy_image.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/cancel_copy_image.go new file mode 100644 index 000000000..c00421461 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/cancel_copy_image.go @@ -0,0 +1,107 @@ +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" +) + +// CancelCopyImage invokes the ecs.CancelCopyImage API synchronously +// api document: https://help.aliyun.com/api/ecs/cancelcopyimage.html +func (client *Client) CancelCopyImage(request *CancelCopyImageRequest) (response *CancelCopyImageResponse, err error) { + response = CreateCancelCopyImageResponse() + err = client.DoAction(request, response) + return +} + +// CancelCopyImageWithChan invokes the ecs.CancelCopyImage API asynchronously +// api document: https://help.aliyun.com/api/ecs/cancelcopyimage.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CancelCopyImageWithChan(request *CancelCopyImageRequest) (<-chan *CancelCopyImageResponse, <-chan error) { + responseChan := make(chan *CancelCopyImageResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CancelCopyImage(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CancelCopyImageWithCallback invokes the ecs.CancelCopyImage API asynchronously +// api document: https://help.aliyun.com/api/ecs/cancelcopyimage.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CancelCopyImageWithCallback(request *CancelCopyImageRequest, callback func(response *CancelCopyImageResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CancelCopyImageResponse + var err error + defer close(result) + response, err = client.CancelCopyImage(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CancelCopyImageRequest is the request struct for api CancelCopyImage +type CancelCopyImageRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ImageId string `position:"Query" name:"ImageId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// CancelCopyImageResponse is the response struct for api CancelCopyImage +type CancelCopyImageResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateCancelCopyImageRequest creates a request to invoke CancelCopyImage API +func CreateCancelCopyImageRequest() (request *CancelCopyImageRequest) { + request = &CancelCopyImageRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "CancelCopyImage", "ecs", "openAPI") + return +} + +// CreateCancelCopyImageResponse creates a response to parse from CancelCopyImage response +func CreateCancelCopyImageResponse() (response *CancelCopyImageResponse) { + response = &CancelCopyImageResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/cancel_physical_connection.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/cancel_physical_connection.go new file mode 100644 index 000000000..df2beb5a2 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/cancel_physical_connection.go @@ -0,0 +1,109 @@ +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" +) + +// CancelPhysicalConnection invokes the ecs.CancelPhysicalConnection API synchronously +// api document: https://help.aliyun.com/api/ecs/cancelphysicalconnection.html +func (client *Client) CancelPhysicalConnection(request *CancelPhysicalConnectionRequest) (response *CancelPhysicalConnectionResponse, err error) { + response = CreateCancelPhysicalConnectionResponse() + err = client.DoAction(request, response) + return +} + +// CancelPhysicalConnectionWithChan invokes the ecs.CancelPhysicalConnection API asynchronously +// api document: https://help.aliyun.com/api/ecs/cancelphysicalconnection.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CancelPhysicalConnectionWithChan(request *CancelPhysicalConnectionRequest) (<-chan *CancelPhysicalConnectionResponse, <-chan error) { + responseChan := make(chan *CancelPhysicalConnectionResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CancelPhysicalConnection(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CancelPhysicalConnectionWithCallback invokes the ecs.CancelPhysicalConnection API asynchronously +// api document: https://help.aliyun.com/api/ecs/cancelphysicalconnection.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CancelPhysicalConnectionWithCallback(request *CancelPhysicalConnectionRequest, callback func(response *CancelPhysicalConnectionResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CancelPhysicalConnectionResponse + var err error + defer close(result) + response, err = client.CancelPhysicalConnection(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CancelPhysicalConnectionRequest is the request struct for api CancelPhysicalConnection +type CancelPhysicalConnectionRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + PhysicalConnectionId string `position:"Query" name:"PhysicalConnectionId"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + UserCidr string `position:"Query" name:"UserCidr"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// CancelPhysicalConnectionResponse is the response struct for api CancelPhysicalConnection +type CancelPhysicalConnectionResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateCancelPhysicalConnectionRequest creates a request to invoke CancelPhysicalConnection API +func CreateCancelPhysicalConnectionRequest() (request *CancelPhysicalConnectionRequest) { + request = &CancelPhysicalConnectionRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "CancelPhysicalConnection", "ecs", "openAPI") + return +} + +// CreateCancelPhysicalConnectionResponse creates a response to parse from CancelPhysicalConnection response +func CreateCancelPhysicalConnectionResponse() (response *CancelPhysicalConnectionResponse) { + response = &CancelPhysicalConnectionResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/cancel_simulated_system_events.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/cancel_simulated_system_events.go new file mode 100644 index 000000000..b77f86d5c --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/cancel_simulated_system_events.go @@ -0,0 +1,107 @@ +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" +) + +// CancelSimulatedSystemEvents invokes the ecs.CancelSimulatedSystemEvents API synchronously +// api document: https://help.aliyun.com/api/ecs/cancelsimulatedsystemevents.html +func (client *Client) CancelSimulatedSystemEvents(request *CancelSimulatedSystemEventsRequest) (response *CancelSimulatedSystemEventsResponse, err error) { + response = CreateCancelSimulatedSystemEventsResponse() + err = client.DoAction(request, response) + return +} + +// CancelSimulatedSystemEventsWithChan invokes the ecs.CancelSimulatedSystemEvents API asynchronously +// api document: https://help.aliyun.com/api/ecs/cancelsimulatedsystemevents.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CancelSimulatedSystemEventsWithChan(request *CancelSimulatedSystemEventsRequest) (<-chan *CancelSimulatedSystemEventsResponse, <-chan error) { + responseChan := make(chan *CancelSimulatedSystemEventsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CancelSimulatedSystemEvents(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CancelSimulatedSystemEventsWithCallback invokes the ecs.CancelSimulatedSystemEvents API asynchronously +// api document: https://help.aliyun.com/api/ecs/cancelsimulatedsystemevents.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CancelSimulatedSystemEventsWithCallback(request *CancelSimulatedSystemEventsRequest, callback func(response *CancelSimulatedSystemEventsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CancelSimulatedSystemEventsResponse + var err error + defer close(result) + response, err = client.CancelSimulatedSystemEvents(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CancelSimulatedSystemEventsRequest is the request struct for api CancelSimulatedSystemEvents +type CancelSimulatedSystemEventsRequest struct { + *requests.RpcRequest + EventId *[]string `position:"Query" name:"EventId" type:"Repeated"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// CancelSimulatedSystemEventsResponse is the response struct for api CancelSimulatedSystemEvents +type CancelSimulatedSystemEventsResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateCancelSimulatedSystemEventsRequest creates a request to invoke CancelSimulatedSystemEvents API +func CreateCancelSimulatedSystemEventsRequest() (request *CancelSimulatedSystemEventsRequest) { + request = &CancelSimulatedSystemEventsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "CancelSimulatedSystemEvents", "ecs", "openAPI") + return +} + +// CreateCancelSimulatedSystemEventsResponse creates a response to parse from CancelSimulatedSystemEvents response +func CreateCancelSimulatedSystemEventsResponse() (response *CancelSimulatedSystemEventsResponse) { + response = &CancelSimulatedSystemEventsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/cancel_task.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/cancel_task.go new file mode 100644 index 000000000..1f83b02b1 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/cancel_task.go @@ -0,0 +1,106 @@ +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" +) + +// CancelTask invokes the ecs.CancelTask API synchronously +// api document: https://help.aliyun.com/api/ecs/canceltask.html +func (client *Client) CancelTask(request *CancelTaskRequest) (response *CancelTaskResponse, err error) { + response = CreateCancelTaskResponse() + err = client.DoAction(request, response) + return +} + +// CancelTaskWithChan invokes the ecs.CancelTask API asynchronously +// api document: https://help.aliyun.com/api/ecs/canceltask.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CancelTaskWithChan(request *CancelTaskRequest) (<-chan *CancelTaskResponse, <-chan error) { + responseChan := make(chan *CancelTaskResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CancelTask(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CancelTaskWithCallback invokes the ecs.CancelTask API asynchronously +// api document: https://help.aliyun.com/api/ecs/canceltask.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CancelTaskWithCallback(request *CancelTaskRequest, callback func(response *CancelTaskResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CancelTaskResponse + var err error + defer close(result) + response, err = client.CancelTask(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CancelTaskRequest is the request struct for api CancelTask +type CancelTaskRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + TaskId string `position:"Query" name:"TaskId"` +} + +// CancelTaskResponse is the response struct for api CancelTask +type CancelTaskResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateCancelTaskRequest creates a request to invoke CancelTask API +func CreateCancelTaskRequest() (request *CancelTaskRequest) { + request = &CancelTaskRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "CancelTask", "ecs", "openAPI") + return +} + +// CreateCancelTaskResponse creates a response to parse from CancelTask response +func CreateCancelTaskResponse() (response *CancelTaskResponse) { + response = &CancelTaskResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/client.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/client.go new file mode 100644 index 000000000..f2a10a3a5 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/client.go @@ -0,0 +1,81 @@ +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" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth" +) + +// 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 +} + +// 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://help.aliyun.com/document_detail/66217.html +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://help.aliyun.com/document_detail/66222.html +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://help.aliyun.com/document_detail/66222.html +func NewClientWithRamRoleArn(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (client *Client, err error) { + client = &Client{} + err = client.InitWithRamRoleArn(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName) + return +} + +// NewClientWithEcsRamRole is a shortcut to create sdk client with ecs ram role +// usage: https://help.aliyun.com/document_detail/66223.html +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 +// attention: rsa key pair auth is only Japan regions available +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/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/connect_router_interface.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/connect_router_interface.go new file mode 100644 index 000000000..46adafce6 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/connect_router_interface.go @@ -0,0 +1,106 @@ +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" +) + +// ConnectRouterInterface invokes the ecs.ConnectRouterInterface API synchronously +// api document: https://help.aliyun.com/api/ecs/connectrouterinterface.html +func (client *Client) ConnectRouterInterface(request *ConnectRouterInterfaceRequest) (response *ConnectRouterInterfaceResponse, err error) { + response = CreateConnectRouterInterfaceResponse() + err = client.DoAction(request, response) + return +} + +// ConnectRouterInterfaceWithChan invokes the ecs.ConnectRouterInterface API asynchronously +// api document: https://help.aliyun.com/api/ecs/connectrouterinterface.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ConnectRouterInterfaceWithChan(request *ConnectRouterInterfaceRequest) (<-chan *ConnectRouterInterfaceResponse, <-chan error) { + responseChan := make(chan *ConnectRouterInterfaceResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ConnectRouterInterface(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ConnectRouterInterfaceWithCallback invokes the ecs.ConnectRouterInterface API asynchronously +// api document: https://help.aliyun.com/api/ecs/connectrouterinterface.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ConnectRouterInterfaceWithCallback(request *ConnectRouterInterfaceRequest, callback func(response *ConnectRouterInterfaceResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ConnectRouterInterfaceResponse + var err error + defer close(result) + response, err = client.ConnectRouterInterface(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ConnectRouterInterfaceRequest is the request struct for api ConnectRouterInterface +type ConnectRouterInterfaceRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + RouterInterfaceId string `position:"Query" name:"RouterInterfaceId"` +} + +// ConnectRouterInterfaceResponse is the response struct for api ConnectRouterInterface +type ConnectRouterInterfaceResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateConnectRouterInterfaceRequest creates a request to invoke ConnectRouterInterface API +func CreateConnectRouterInterfaceRequest() (request *ConnectRouterInterfaceRequest) { + request = &ConnectRouterInterfaceRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ConnectRouterInterface", "ecs", "openAPI") + return +} + +// CreateConnectRouterInterfaceResponse creates a response to parse from ConnectRouterInterface response +func CreateConnectRouterInterfaceResponse() (response *ConnectRouterInterfaceResponse) { + response = &ConnectRouterInterfaceResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/convert_nat_public_ip_to_eip.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/convert_nat_public_ip_to_eip.go new file mode 100644 index 000000000..1934e1675 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/convert_nat_public_ip_to_eip.go @@ -0,0 +1,106 @@ +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" +) + +// ConvertNatPublicIpToEip invokes the ecs.ConvertNatPublicIpToEip API synchronously +// api document: https://help.aliyun.com/api/ecs/convertnatpubliciptoeip.html +func (client *Client) ConvertNatPublicIpToEip(request *ConvertNatPublicIpToEipRequest) (response *ConvertNatPublicIpToEipResponse, err error) { + response = CreateConvertNatPublicIpToEipResponse() + err = client.DoAction(request, response) + return +} + +// ConvertNatPublicIpToEipWithChan invokes the ecs.ConvertNatPublicIpToEip API asynchronously +// api document: https://help.aliyun.com/api/ecs/convertnatpubliciptoeip.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ConvertNatPublicIpToEipWithChan(request *ConvertNatPublicIpToEipRequest) (<-chan *ConvertNatPublicIpToEipResponse, <-chan error) { + responseChan := make(chan *ConvertNatPublicIpToEipResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ConvertNatPublicIpToEip(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ConvertNatPublicIpToEipWithCallback invokes the ecs.ConvertNatPublicIpToEip API asynchronously +// api document: https://help.aliyun.com/api/ecs/convertnatpubliciptoeip.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ConvertNatPublicIpToEipWithCallback(request *ConvertNatPublicIpToEipRequest, callback func(response *ConvertNatPublicIpToEipResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ConvertNatPublicIpToEipResponse + var err error + defer close(result) + response, err = client.ConvertNatPublicIpToEip(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ConvertNatPublicIpToEipRequest is the request struct for api ConvertNatPublicIpToEip +type ConvertNatPublicIpToEipRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + InstanceId string `position:"Query" name:"InstanceId"` +} + +// ConvertNatPublicIpToEipResponse is the response struct for api ConvertNatPublicIpToEip +type ConvertNatPublicIpToEipResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateConvertNatPublicIpToEipRequest creates a request to invoke ConvertNatPublicIpToEip API +func CreateConvertNatPublicIpToEipRequest() (request *ConvertNatPublicIpToEipRequest) { + request = &ConvertNatPublicIpToEipRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ConvertNatPublicIpToEip", "ecs", "openAPI") + return +} + +// CreateConvertNatPublicIpToEipResponse creates a response to parse from ConvertNatPublicIpToEip response +func CreateConvertNatPublicIpToEipResponse() (response *ConvertNatPublicIpToEipResponse) { + response = &ConvertNatPublicIpToEipResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/copy_image.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/copy_image.go new file mode 100644 index 000000000..74e26d4d5 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/copy_image.go @@ -0,0 +1,119 @@ +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" +) + +// CopyImage invokes the ecs.CopyImage API synchronously +// api document: https://help.aliyun.com/api/ecs/copyimage.html +func (client *Client) CopyImage(request *CopyImageRequest) (response *CopyImageResponse, err error) { + response = CreateCopyImageResponse() + err = client.DoAction(request, response) + return +} + +// CopyImageWithChan invokes the ecs.CopyImage API asynchronously +// api document: https://help.aliyun.com/api/ecs/copyimage.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CopyImageWithChan(request *CopyImageRequest) (<-chan *CopyImageResponse, <-chan error) { + responseChan := make(chan *CopyImageResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CopyImage(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CopyImageWithCallback invokes the ecs.CopyImage API asynchronously +// api document: https://help.aliyun.com/api/ecs/copyimage.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CopyImageWithCallback(request *CopyImageRequest, callback func(response *CopyImageResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CopyImageResponse + var err error + defer close(result) + response, err = client.CopyImage(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CopyImageRequest is the request struct for api CopyImage +type CopyImageRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ImageId string `position:"Query" name:"ImageId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + DestinationImageName string `position:"Query" name:"DestinationImageName"` + DestinationRegionId string `position:"Query" name:"DestinationRegionId"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Encrypted requests.Boolean `position:"Query" name:"Encrypted"` + Tag *[]CopyImageTag `position:"Query" name:"Tag" type:"Repeated"` + DestinationDescription string `position:"Query" name:"DestinationDescription"` +} + +// CopyImageTag is a repeated param struct in CopyImageRequest +type CopyImageTag struct { + Value string `name:"Value"` + Key string `name:"Key"` +} + +// CopyImageResponse is the response struct for api CopyImage +type CopyImageResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + ImageId string `json:"ImageId" xml:"ImageId"` +} + +// CreateCopyImageRequest creates a request to invoke CopyImage API +func CreateCopyImageRequest() (request *CopyImageRequest) { + request = &CopyImageRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "CopyImage", "ecs", "openAPI") + return +} + +// CreateCopyImageResponse creates a response to parse from CopyImage response +func CreateCopyImageResponse() (response *CopyImageResponse) { + response = &CopyImageResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_auto_snapshot_policy.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_auto_snapshot_policy.go new file mode 100644 index 000000000..011027099 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_auto_snapshot_policy.go @@ -0,0 +1,110 @@ +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" +) + +// CreateAutoSnapshotPolicy invokes the ecs.CreateAutoSnapshotPolicy API synchronously +// api document: https://help.aliyun.com/api/ecs/createautosnapshotpolicy.html +func (client *Client) CreateAutoSnapshotPolicy(request *CreateAutoSnapshotPolicyRequest) (response *CreateAutoSnapshotPolicyResponse, err error) { + response = CreateCreateAutoSnapshotPolicyResponse() + err = client.DoAction(request, response) + return +} + +// CreateAutoSnapshotPolicyWithChan invokes the ecs.CreateAutoSnapshotPolicy API asynchronously +// api document: https://help.aliyun.com/api/ecs/createautosnapshotpolicy.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateAutoSnapshotPolicyWithChan(request *CreateAutoSnapshotPolicyRequest) (<-chan *CreateAutoSnapshotPolicyResponse, <-chan error) { + responseChan := make(chan *CreateAutoSnapshotPolicyResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateAutoSnapshotPolicy(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateAutoSnapshotPolicyWithCallback invokes the ecs.CreateAutoSnapshotPolicy API asynchronously +// api document: https://help.aliyun.com/api/ecs/createautosnapshotpolicy.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateAutoSnapshotPolicyWithCallback(request *CreateAutoSnapshotPolicyRequest, callback func(response *CreateAutoSnapshotPolicyResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateAutoSnapshotPolicyResponse + var err error + defer close(result) + response, err = client.CreateAutoSnapshotPolicy(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateAutoSnapshotPolicyRequest is the request struct for api CreateAutoSnapshotPolicy +type CreateAutoSnapshotPolicyRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + TimePoints string `position:"Query" name:"timePoints"` + RetentionDays requests.Integer `position:"Query" name:"retentionDays"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + RepeatWeekdays string `position:"Query" name:"repeatWeekdays"` + AutoSnapshotPolicyName string `position:"Query" name:"autoSnapshotPolicyName"` +} + +// CreateAutoSnapshotPolicyResponse is the response struct for api CreateAutoSnapshotPolicy +type CreateAutoSnapshotPolicyResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + AutoSnapshotPolicyId string `json:"AutoSnapshotPolicyId" xml:"AutoSnapshotPolicyId"` +} + +// CreateCreateAutoSnapshotPolicyRequest creates a request to invoke CreateAutoSnapshotPolicy API +func CreateCreateAutoSnapshotPolicyRequest() (request *CreateAutoSnapshotPolicyRequest) { + request = &CreateAutoSnapshotPolicyRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "CreateAutoSnapshotPolicy", "ecs", "openAPI") + return +} + +// CreateCreateAutoSnapshotPolicyResponse creates a response to parse from CreateAutoSnapshotPolicy response +func CreateCreateAutoSnapshotPolicyResponse() (response *CreateAutoSnapshotPolicyResponse) { + response = &CreateAutoSnapshotPolicyResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_command.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_command.go new file mode 100644 index 000000000..1f4d0e6a2 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_command.go @@ -0,0 +1,113 @@ +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" +) + +// CreateCommand invokes the ecs.CreateCommand API synchronously +// api document: https://help.aliyun.com/api/ecs/createcommand.html +func (client *Client) CreateCommand(request *CreateCommandRequest) (response *CreateCommandResponse, err error) { + response = CreateCreateCommandResponse() + err = client.DoAction(request, response) + return +} + +// CreateCommandWithChan invokes the ecs.CreateCommand API asynchronously +// api document: https://help.aliyun.com/api/ecs/createcommand.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateCommandWithChan(request *CreateCommandRequest) (<-chan *CreateCommandResponse, <-chan error) { + responseChan := make(chan *CreateCommandResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateCommand(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateCommandWithCallback invokes the ecs.CreateCommand API asynchronously +// api document: https://help.aliyun.com/api/ecs/createcommand.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateCommandWithCallback(request *CreateCommandRequest, callback func(response *CreateCommandResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateCommandResponse + var err error + defer close(result) + response, err = client.CreateCommand(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateCommandRequest is the request struct for api CreateCommand +type CreateCommandRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + WorkingDir string `position:"Query" name:"WorkingDir"` + Description string `position:"Query" name:"Description"` + Type string `position:"Query" name:"Type"` + CommandContent string `position:"Query" name:"CommandContent"` + Timeout requests.Integer `position:"Query" name:"Timeout"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Name string `position:"Query" name:"Name"` +} + +// CreateCommandResponse is the response struct for api CreateCommand +type CreateCommandResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + CommandId string `json:"CommandId" xml:"CommandId"` +} + +// CreateCreateCommandRequest creates a request to invoke CreateCommand API +func CreateCreateCommandRequest() (request *CreateCommandRequest) { + request = &CreateCommandRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "CreateCommand", "ecs", "openAPI") + return +} + +// CreateCreateCommandResponse creates a response to parse from CreateCommand response +func CreateCreateCommandResponse() (response *CreateCommandResponse) { + response = &CreateCommandResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_deployment_set.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_deployment_set.go new file mode 100644 index 000000000..4c66fdfb6 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_deployment_set.go @@ -0,0 +1,114 @@ +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" +) + +// CreateDeploymentSet invokes the ecs.CreateDeploymentSet API synchronously +// api document: https://help.aliyun.com/api/ecs/createdeploymentset.html +func (client *Client) CreateDeploymentSet(request *CreateDeploymentSetRequest) (response *CreateDeploymentSetResponse, err error) { + response = CreateCreateDeploymentSetResponse() + err = client.DoAction(request, response) + return +} + +// CreateDeploymentSetWithChan invokes the ecs.CreateDeploymentSet API asynchronously +// api document: https://help.aliyun.com/api/ecs/createdeploymentset.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateDeploymentSetWithChan(request *CreateDeploymentSetRequest) (<-chan *CreateDeploymentSetResponse, <-chan error) { + responseChan := make(chan *CreateDeploymentSetResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateDeploymentSet(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateDeploymentSetWithCallback invokes the ecs.CreateDeploymentSet API asynchronously +// api document: https://help.aliyun.com/api/ecs/createdeploymentset.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateDeploymentSetWithCallback(request *CreateDeploymentSetRequest, callback func(response *CreateDeploymentSetResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateDeploymentSetResponse + var err error + defer close(result) + response, err = client.CreateDeploymentSet(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateDeploymentSetRequest is the request struct for api CreateDeploymentSet +type CreateDeploymentSetRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Description string `position:"Query" name:"Description"` + DeploymentSetName string `position:"Query" name:"DeploymentSetName"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + OnUnableToRedeployFailedInstance string `position:"Query" name:"OnUnableToRedeployFailedInstance"` + Granularity string `position:"Query" name:"Granularity"` + Domain string `position:"Query" name:"Domain"` + Strategy string `position:"Query" name:"Strategy"` +} + +// CreateDeploymentSetResponse is the response struct for api CreateDeploymentSet +type CreateDeploymentSetResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + DeploymentSetId string `json:"DeploymentSetId" xml:"DeploymentSetId"` +} + +// CreateCreateDeploymentSetRequest creates a request to invoke CreateDeploymentSet API +func CreateCreateDeploymentSetRequest() (request *CreateDeploymentSetRequest) { + request = &CreateDeploymentSetRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "CreateDeploymentSet", "ecs", "openAPI") + return +} + +// CreateCreateDeploymentSetResponse creates a response to parse from CreateDeploymentSet response +func CreateCreateDeploymentSetResponse() (response *CreateDeploymentSetResponse) { + response = &CreateDeploymentSetResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_disk.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_disk.go new file mode 100644 index 000000000..872950280 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_disk.go @@ -0,0 +1,133 @@ +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" +) + +// CreateDisk invokes the ecs.CreateDisk API synchronously +// api document: https://help.aliyun.com/api/ecs/createdisk.html +func (client *Client) CreateDisk(request *CreateDiskRequest) (response *CreateDiskResponse, err error) { + response = CreateCreateDiskResponse() + err = client.DoAction(request, response) + return +} + +// CreateDiskWithChan invokes the ecs.CreateDisk API asynchronously +// api document: https://help.aliyun.com/api/ecs/createdisk.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateDiskWithChan(request *CreateDiskRequest) (<-chan *CreateDiskResponse, <-chan error) { + responseChan := make(chan *CreateDiskResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateDisk(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateDiskWithCallback invokes the ecs.CreateDisk API asynchronously +// api document: https://help.aliyun.com/api/ecs/createdisk.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateDiskWithCallback(request *CreateDiskRequest, callback func(response *CreateDiskResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateDiskResponse + var err error + defer close(result) + response, err = client.CreateDisk(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateDiskRequest is the request struct for api CreateDisk +type CreateDiskRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + SnapshotId string `position:"Query" name:"SnapshotId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Description string `position:"Query" name:"Description"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + DiskName string `position:"Query" name:"DiskName"` + ResourceGroupId string `position:"Query" name:"ResourceGroupId"` + Size requests.Integer `position:"Query" name:"Size"` + Encrypted requests.Boolean `position:"Query" name:"Encrypted"` + DiskCategory string `position:"Query" name:"DiskCategory"` + ZoneId string `position:"Query" name:"ZoneId"` + Tag *[]CreateDiskTag `position:"Query" name:"Tag" type:"Repeated"` + Arn *[]CreateDiskArn `position:"Query" name:"Arn" type:"Repeated"` + KMSKeyId string `position:"Query" name:"KMSKeyId"` + AdvancedFeatures string `position:"Query" name:"AdvancedFeatures"` +} + +// CreateDiskTag is a repeated param struct in CreateDiskRequest +type CreateDiskTag struct { + Value string `name:"Value"` + Key string `name:"Key"` +} + +// CreateDiskArn is a repeated param struct in CreateDiskRequest +type CreateDiskArn struct { + Rolearn string `name:"Rolearn"` + RoleType string `name:"RoleType"` + AssumeRoleFor string `name:"AssumeRoleFor"` +} + +// CreateDiskResponse is the response struct for api CreateDisk +type CreateDiskResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + DiskId string `json:"DiskId" xml:"DiskId"` +} + +// CreateCreateDiskRequest creates a request to invoke CreateDisk API +func CreateCreateDiskRequest() (request *CreateDiskRequest) { + request = &CreateDiskRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "CreateDisk", "ecs", "openAPI") + return +} + +// CreateCreateDiskResponse creates a response to parse from CreateDisk response +func CreateCreateDiskResponse() (response *CreateDiskResponse) { + response = &CreateDiskResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_forward_entry.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_forward_entry.go new file mode 100644 index 000000000..e74f67bc9 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_forward_entry.go @@ -0,0 +1,113 @@ +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" +) + +// CreateForwardEntry invokes the ecs.CreateForwardEntry API synchronously +// api document: https://help.aliyun.com/api/ecs/createforwardentry.html +func (client *Client) CreateForwardEntry(request *CreateForwardEntryRequest) (response *CreateForwardEntryResponse, err error) { + response = CreateCreateForwardEntryResponse() + err = client.DoAction(request, response) + return +} + +// CreateForwardEntryWithChan invokes the ecs.CreateForwardEntry API asynchronously +// api document: https://help.aliyun.com/api/ecs/createforwardentry.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateForwardEntryWithChan(request *CreateForwardEntryRequest) (<-chan *CreateForwardEntryResponse, <-chan error) { + responseChan := make(chan *CreateForwardEntryResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateForwardEntry(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateForwardEntryWithCallback invokes the ecs.CreateForwardEntry API asynchronously +// api document: https://help.aliyun.com/api/ecs/createforwardentry.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateForwardEntryWithCallback(request *CreateForwardEntryRequest, callback func(response *CreateForwardEntryResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateForwardEntryResponse + var err error + defer close(result) + response, err = client.CreateForwardEntry(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateForwardEntryRequest is the request struct for api CreateForwardEntry +type CreateForwardEntryRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + IpProtocol string `position:"Query" name:"IpProtocol"` + InternalPort string `position:"Query" name:"InternalPort"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + ForwardTableId string `position:"Query" name:"ForwardTableId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + ExternalIp string `position:"Query" name:"ExternalIp"` + ExternalPort string `position:"Query" name:"ExternalPort"` + InternalIp string `position:"Query" name:"InternalIp"` +} + +// CreateForwardEntryResponse is the response struct for api CreateForwardEntry +type CreateForwardEntryResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + ForwardEntryId string `json:"ForwardEntryId" xml:"ForwardEntryId"` +} + +// CreateCreateForwardEntryRequest creates a request to invoke CreateForwardEntry API +func CreateCreateForwardEntryRequest() (request *CreateForwardEntryRequest) { + request = &CreateForwardEntryRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "CreateForwardEntry", "ecs", "openAPI") + return +} + +// CreateCreateForwardEntryResponse creates a response to parse from CreateForwardEntry response +func CreateCreateForwardEntryResponse() (response *CreateForwardEntryResponse) { + response = &CreateForwardEntryResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_ha_vip.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_ha_vip.go new file mode 100644 index 000000000..2ff08c36e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_ha_vip.go @@ -0,0 +1,111 @@ +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" +) + +// CreateHaVip invokes the ecs.CreateHaVip API synchronously +// api document: https://help.aliyun.com/api/ecs/createhavip.html +func (client *Client) CreateHaVip(request *CreateHaVipRequest) (response *CreateHaVipResponse, err error) { + response = CreateCreateHaVipResponse() + err = client.DoAction(request, response) + return +} + +// CreateHaVipWithChan invokes the ecs.CreateHaVip API asynchronously +// api document: https://help.aliyun.com/api/ecs/createhavip.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateHaVipWithChan(request *CreateHaVipRequest) (<-chan *CreateHaVipResponse, <-chan error) { + responseChan := make(chan *CreateHaVipResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateHaVip(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateHaVipWithCallback invokes the ecs.CreateHaVip API asynchronously +// api document: https://help.aliyun.com/api/ecs/createhavip.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateHaVipWithCallback(request *CreateHaVipRequest, callback func(response *CreateHaVipResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateHaVipResponse + var err error + defer close(result) + response, err = client.CreateHaVip(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateHaVipRequest is the request struct for api CreateHaVip +type CreateHaVipRequest struct { + *requests.RpcRequest + VSwitchId string `position:"Query" name:"VSwitchId"` + IpAddress string `position:"Query" name:"IpAddress"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Description string `position:"Query" name:"Description"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// CreateHaVipResponse is the response struct for api CreateHaVip +type CreateHaVipResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + HaVipId string `json:"HaVipId" xml:"HaVipId"` +} + +// CreateCreateHaVipRequest creates a request to invoke CreateHaVip API +func CreateCreateHaVipRequest() (request *CreateHaVipRequest) { + request = &CreateHaVipRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "CreateHaVip", "ecs", "openAPI") + return +} + +// CreateCreateHaVipResponse creates a response to parse from CreateHaVip response +func CreateCreateHaVipResponse() (response *CreateHaVipResponse) { + response = &CreateHaVipResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_hpc_cluster.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_hpc_cluster.go new file mode 100644 index 000000000..a1f479d67 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_hpc_cluster.go @@ -0,0 +1,110 @@ +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" +) + +// CreateHpcCluster invokes the ecs.CreateHpcCluster API synchronously +// api document: https://help.aliyun.com/api/ecs/createhpccluster.html +func (client *Client) CreateHpcCluster(request *CreateHpcClusterRequest) (response *CreateHpcClusterResponse, err error) { + response = CreateCreateHpcClusterResponse() + err = client.DoAction(request, response) + return +} + +// CreateHpcClusterWithChan invokes the ecs.CreateHpcCluster API asynchronously +// api document: https://help.aliyun.com/api/ecs/createhpccluster.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateHpcClusterWithChan(request *CreateHpcClusterRequest) (<-chan *CreateHpcClusterResponse, <-chan error) { + responseChan := make(chan *CreateHpcClusterResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateHpcCluster(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateHpcClusterWithCallback invokes the ecs.CreateHpcCluster API asynchronously +// api document: https://help.aliyun.com/api/ecs/createhpccluster.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateHpcClusterWithCallback(request *CreateHpcClusterRequest, callback func(response *CreateHpcClusterResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateHpcClusterResponse + var err error + defer close(result) + response, err = client.CreateHpcCluster(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateHpcClusterRequest is the request struct for api CreateHpcCluster +type CreateHpcClusterRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ClientToken string `position:"Query" name:"ClientToken"` + Description string `position:"Query" name:"Description"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Name string `position:"Query" name:"Name"` +} + +// CreateHpcClusterResponse is the response struct for api CreateHpcCluster +type CreateHpcClusterResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + HpcClusterId string `json:"HpcClusterId" xml:"HpcClusterId"` +} + +// CreateCreateHpcClusterRequest creates a request to invoke CreateHpcCluster API +func CreateCreateHpcClusterRequest() (request *CreateHpcClusterRequest) { + request = &CreateHpcClusterRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "CreateHpcCluster", "ecs", "openAPI") + return +} + +// CreateCreateHpcClusterResponse creates a response to parse from CreateHpcCluster response +func CreateCreateHpcClusterResponse() (response *CreateHpcClusterResponse) { + response = &CreateHpcClusterResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_image.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_image.go new file mode 100644 index 000000000..d4712af84 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_image.go @@ -0,0 +1,132 @@ +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" +) + +// CreateImage invokes the ecs.CreateImage API synchronously +// api document: https://help.aliyun.com/api/ecs/createimage.html +func (client *Client) CreateImage(request *CreateImageRequest) (response *CreateImageResponse, err error) { + response = CreateCreateImageResponse() + err = client.DoAction(request, response) + return +} + +// CreateImageWithChan invokes the ecs.CreateImage API asynchronously +// api document: https://help.aliyun.com/api/ecs/createimage.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateImageWithChan(request *CreateImageRequest) (<-chan *CreateImageResponse, <-chan error) { + responseChan := make(chan *CreateImageResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateImage(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateImageWithCallback invokes the ecs.CreateImage API asynchronously +// api document: https://help.aliyun.com/api/ecs/createimage.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateImageWithCallback(request *CreateImageRequest, callback func(response *CreateImageResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateImageResponse + var err error + defer close(result) + response, err = client.CreateImage(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateImageRequest is the request struct for api CreateImage +type CreateImageRequest struct { + *requests.RpcRequest + DiskDeviceMapping *[]CreateImageDiskDeviceMapping `position:"Query" name:"DiskDeviceMapping" type:"Repeated"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + SnapshotId string `position:"Query" name:"SnapshotId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Description string `position:"Query" name:"Description"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Platform string `position:"Query" name:"Platform"` + ResourceGroupId string `position:"Query" name:"ResourceGroupId"` + InstanceId string `position:"Query" name:"InstanceId"` + ImageName string `position:"Query" name:"ImageName"` + ImageVersion string `position:"Query" name:"ImageVersion"` + Tag *[]CreateImageTag `position:"Query" name:"Tag" type:"Repeated"` + Architecture string `position:"Query" name:"Architecture"` +} + +// CreateImageDiskDeviceMapping is a repeated param struct in CreateImageRequest +type CreateImageDiskDeviceMapping struct { + SnapshotId string `name:"SnapshotId"` + Size string `name:"Size"` + DiskType string `name:"DiskType"` + Device string `name:"Device"` +} + +// CreateImageTag is a repeated param struct in CreateImageRequest +type CreateImageTag struct { + Value string `name:"Value"` + Key string `name:"Key"` +} + +// CreateImageResponse is the response struct for api CreateImage +type CreateImageResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + ImageId string `json:"ImageId" xml:"ImageId"` +} + +// CreateCreateImageRequest creates a request to invoke CreateImage API +func CreateCreateImageRequest() (request *CreateImageRequest) { + request = &CreateImageRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "CreateImage", "ecs", "openAPI") + return +} + +// CreateCreateImageResponse creates a response to parse from CreateImage response +func CreateCreateImageResponse() (response *CreateImageResponse) { + response = &CreateImageResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_instance.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_instance.go new file mode 100644 index 000000000..6f491407b --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_instance.go @@ -0,0 +1,182 @@ +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" +) + +// CreateInstance invokes the ecs.CreateInstance API synchronously +// api document: https://help.aliyun.com/api/ecs/createinstance.html +func (client *Client) CreateInstance(request *CreateInstanceRequest) (response *CreateInstanceResponse, err error) { + response = CreateCreateInstanceResponse() + err = client.DoAction(request, response) + return +} + +// CreateInstanceWithChan invokes the ecs.CreateInstance API asynchronously +// api document: https://help.aliyun.com/api/ecs/createinstance.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +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) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateInstanceWithCallback invokes the ecs.CreateInstance API asynchronously +// api document: https://help.aliyun.com/api/ecs/createinstance.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +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 +} + +// CreateInstanceRequest is the request struct for api CreateInstance +type CreateInstanceRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + HpcClusterId string `position:"Query" name:"HpcClusterId"` + SecurityEnhancementStrategy string `position:"Query" name:"SecurityEnhancementStrategy"` + KeyPairName string `position:"Query" name:"KeyPairName"` + SpotPriceLimit requests.Float `position:"Query" name:"SpotPriceLimit"` + DeletionProtection requests.Boolean `position:"Query" name:"DeletionProtection"` + ResourceGroupId string `position:"Query" name:"ResourceGroupId"` + HostName string `position:"Query" name:"HostName"` + Password string `position:"Query" name:"Password"` + Tag *[]CreateInstanceTag `position:"Query" name:"Tag" type:"Repeated"` + AutoRenewPeriod requests.Integer `position:"Query" name:"AutoRenewPeriod"` + NodeControllerId string `position:"Query" name:"NodeControllerId"` + Period requests.Integer `position:"Query" name:"Period"` + DryRun requests.Boolean `position:"Query" name:"DryRun"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + CapacityReservationPreference string `position:"Query" name:"CapacityReservationPreference"` + 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"` + 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"` + SpotInterruptionBehavior string `position:"Query" name:"SpotInterruptionBehavior"` + 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"` + CapacityReservationId string `position:"Query" name:"CapacityReservationId"` + UserData string `position:"Query" name:"UserData"` + PasswordInherit requests.Boolean `position:"Query" name:"PasswordInherit"` + InstanceType string `position:"Query" name:"InstanceType"` + Arn *[]CreateInstanceArn `position:"Query" name:"Arn" type:"Repeated"` + InstanceChargeType string `position:"Query" name:"InstanceChargeType"` + 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"` + DedicatedHostId string `position:"Query" name:"DedicatedHostId"` + ClusterId string `position:"Query" name:"ClusterId"` + CreditSpecification string `position:"Query" name:"CreditSpecification"` + DataDisk *[]CreateInstanceDataDisk `position:"Query" name:"DataDisk" type:"Repeated"` + SystemDiskSize requests.Integer `position:"Query" name:"SystemDisk.Size"` + SystemDiskDescription string `position:"Query" name:"SystemDisk.Description"` +} + +// CreateInstanceTag is a repeated param struct in CreateInstanceRequest +type CreateInstanceTag struct { + Value string `name:"Value"` + Key string `name:"Key"` +} + +// CreateInstanceArn is a repeated param struct in CreateInstanceRequest +type CreateInstanceArn struct { + Rolearn string `name:"Rolearn"` + RoleType string `name:"RoleType"` + AssumeRoleFor string `name:"AssumeRoleFor"` +} + +// CreateInstanceDataDisk is a repeated param struct in CreateInstanceRequest +type CreateInstanceDataDisk struct { + DiskName string `name:"DiskName"` + SnapshotId string `name:"SnapshotId"` + Size string `name:"Size"` + Encrypted string `name:"Encrypted"` + Description string `name:"Description"` + Category string `name:"Category"` + KMSKeyId string `name:"KMSKeyId"` + Device string `name:"Device"` + DeleteWithInstance string `name:"DeleteWithInstance"` +} + +// CreateInstanceResponse is the response struct for api CreateInstance +type CreateInstanceResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + InstanceId string `json:"InstanceId" xml:"InstanceId"` +} + +// CreateCreateInstanceRequest creates a request to invoke CreateInstance API +func CreateCreateInstanceRequest() (request *CreateInstanceRequest) { + request = &CreateInstanceRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "CreateInstance", "ecs", "openAPI") + return +} + +// CreateCreateInstanceResponse creates a response to parse from CreateInstance response +func CreateCreateInstanceResponse() (response *CreateInstanceResponse) { + response = &CreateInstanceResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_key_pair.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_key_pair.go new file mode 100644 index 000000000..8625aa504 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_key_pair.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" +) + +// CreateKeyPair invokes the ecs.CreateKeyPair API synchronously +// api document: https://help.aliyun.com/api/ecs/createkeypair.html +func (client *Client) CreateKeyPair(request *CreateKeyPairRequest) (response *CreateKeyPairResponse, err error) { + response = CreateCreateKeyPairResponse() + err = client.DoAction(request, response) + return +} + +// CreateKeyPairWithChan invokes the ecs.CreateKeyPair API asynchronously +// api document: https://help.aliyun.com/api/ecs/createkeypair.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateKeyPairWithChan(request *CreateKeyPairRequest) (<-chan *CreateKeyPairResponse, <-chan error) { + responseChan := make(chan *CreateKeyPairResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateKeyPair(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateKeyPairWithCallback invokes the ecs.CreateKeyPair API asynchronously +// api document: https://help.aliyun.com/api/ecs/createkeypair.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateKeyPairWithCallback(request *CreateKeyPairRequest, callback func(response *CreateKeyPairResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateKeyPairResponse + var err error + defer close(result) + response, err = client.CreateKeyPair(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateKeyPairRequest is the request struct for api CreateKeyPair +type CreateKeyPairRequest struct { + *requests.RpcRequest + ResourceGroupId string `position:"Query" name:"ResourceGroupId"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + KeyPairName string `position:"Query" name:"KeyPairName"` + Tag *[]CreateKeyPairTag `position:"Query" name:"Tag" type:"Repeated"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// CreateKeyPairTag is a repeated param struct in CreateKeyPairRequest +type CreateKeyPairTag struct { + Value string `name:"Value"` + Key string `name:"Key"` +} + +// CreateKeyPairResponse is the response struct for api CreateKeyPair +type CreateKeyPairResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + KeyPairId string `json:"KeyPairId" xml:"KeyPairId"` + KeyPairName string `json:"KeyPairName" xml:"KeyPairName"` + KeyPairFingerPrint string `json:"KeyPairFingerPrint" xml:"KeyPairFingerPrint"` + PrivateKeyBody string `json:"PrivateKeyBody" xml:"PrivateKeyBody"` +} + +// CreateCreateKeyPairRequest creates a request to invoke CreateKeyPair API +func CreateCreateKeyPairRequest() (request *CreateKeyPairRequest) { + request = &CreateKeyPairRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "CreateKeyPair", "ecs", "openAPI") + return +} + +// CreateCreateKeyPairResponse creates a response to parse from CreateKeyPair response +func CreateCreateKeyPairResponse() (response *CreateKeyPairResponse) { + response = &CreateKeyPairResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_launch_template.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_launch_template.go new file mode 100644 index 000000000..bcc3fdcbb --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_launch_template.go @@ -0,0 +1,180 @@ +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" +) + +// CreateLaunchTemplate invokes the ecs.CreateLaunchTemplate API synchronously +// api document: https://help.aliyun.com/api/ecs/createlaunchtemplate.html +func (client *Client) CreateLaunchTemplate(request *CreateLaunchTemplateRequest) (response *CreateLaunchTemplateResponse, err error) { + response = CreateCreateLaunchTemplateResponse() + err = client.DoAction(request, response) + return +} + +// CreateLaunchTemplateWithChan invokes the ecs.CreateLaunchTemplate API asynchronously +// api document: https://help.aliyun.com/api/ecs/createlaunchtemplate.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateLaunchTemplateWithChan(request *CreateLaunchTemplateRequest) (<-chan *CreateLaunchTemplateResponse, <-chan error) { + responseChan := make(chan *CreateLaunchTemplateResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateLaunchTemplate(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateLaunchTemplateWithCallback invokes the ecs.CreateLaunchTemplate API asynchronously +// api document: https://help.aliyun.com/api/ecs/createlaunchtemplate.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateLaunchTemplateWithCallback(request *CreateLaunchTemplateRequest, callback func(response *CreateLaunchTemplateResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateLaunchTemplateResponse + var err error + defer close(result) + response, err = client.CreateLaunchTemplate(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateLaunchTemplateRequest is the request struct for api CreateLaunchTemplate +type CreateLaunchTemplateRequest struct { + *requests.RpcRequest + LaunchTemplateName string `position:"Query" name:"LaunchTemplateName"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + SecurityEnhancementStrategy string `position:"Query" name:"SecurityEnhancementStrategy"` + NetworkType string `position:"Query" name:"NetworkType"` + KeyPairName string `position:"Query" name:"KeyPairName"` + SpotPriceLimit requests.Float `position:"Query" name:"SpotPriceLimit"` + ImageOwnerAlias string `position:"Query" name:"ImageOwnerAlias"` + ResourceGroupId string `position:"Query" name:"ResourceGroupId"` + HostName string `position:"Query" name:"HostName"` + SystemDiskIops requests.Integer `position:"Query" name:"SystemDisk.Iops"` + TemplateTag *[]CreateLaunchTemplateTemplateTag `position:"Query" name:"TemplateTag" type:"Repeated"` + Tag *[]CreateLaunchTemplateTag `position:"Query" name:"Tag" type:"Repeated"` + Period requests.Integer `position:"Query" name:"Period"` + TemplateResourceGroupId string `position:"Query" name:"TemplateResourceGroupId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + VSwitchId string `position:"Query" name:"VSwitchId"` + SpotStrategy string `position:"Query" name:"SpotStrategy"` + InstanceName string `position:"Query" name:"InstanceName"` + InternetChargeType string `position:"Query" name:"InternetChargeType"` + ZoneId string `position:"Query" name:"ZoneId"` + InternetMaxBandwidthIn requests.Integer `position:"Query" name:"InternetMaxBandwidthIn"` + VersionDescription string `position:"Query" name:"VersionDescription"` + ImageId string `position:"Query" name:"ImageId"` + 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"` + PasswordInherit requests.Boolean `position:"Query" name:"PasswordInherit"` + InstanceType string `position:"Query" name:"InstanceType"` + InstanceChargeType string `position:"Query" name:"InstanceChargeType"` + EnableVmOsConfig requests.Boolean `position:"Query" name:"EnableVmOsConfig"` + NetworkInterface *[]CreateLaunchTemplateNetworkInterface `position:"Query" name:"NetworkInterface" type:"Repeated"` + 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"` + AutoReleaseTime string `position:"Query" name:"AutoReleaseTime"` + SpotDuration requests.Integer `position:"Query" name:"SpotDuration"` + DataDisk *[]CreateLaunchTemplateDataDisk `position:"Query" name:"DataDisk" type:"Repeated"` + SystemDiskSize requests.Integer `position:"Query" name:"SystemDisk.Size"` + VpcId string `position:"Query" name:"VpcId"` + SystemDiskDescription string `position:"Query" name:"SystemDisk.Description"` +} + +// CreateLaunchTemplateTemplateTag is a repeated param struct in CreateLaunchTemplateRequest +type CreateLaunchTemplateTemplateTag struct { + Key string `name:"Key"` + Value string `name:"Value"` +} + +// CreateLaunchTemplateTag is a repeated param struct in CreateLaunchTemplateRequest +type CreateLaunchTemplateTag struct { + Key string `name:"Key"` + Value string `name:"Value"` +} + +// CreateLaunchTemplateNetworkInterface is a repeated param struct in CreateLaunchTemplateRequest +type CreateLaunchTemplateNetworkInterface struct { + PrimaryIpAddress string `name:"PrimaryIpAddress"` + VSwitchId string `name:"VSwitchId"` + SecurityGroupId string `name:"SecurityGroupId"` + NetworkInterfaceName string `name:"NetworkInterfaceName"` + Description string `name:"Description"` +} + +// CreateLaunchTemplateDataDisk is a repeated param struct in CreateLaunchTemplateRequest +type CreateLaunchTemplateDataDisk struct { + Size string `name:"Size"` + SnapshotId string `name:"SnapshotId"` + Category string `name:"Category"` + Encrypted string `name:"Encrypted"` + DiskName string `name:"DiskName"` + Description string `name:"Description"` + DeleteWithInstance string `name:"DeleteWithInstance"` + Device string `name:"Device"` +} + +// CreateLaunchTemplateResponse is the response struct for api CreateLaunchTemplate +type CreateLaunchTemplateResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + LaunchTemplateId string `json:"LaunchTemplateId" xml:"LaunchTemplateId"` +} + +// CreateCreateLaunchTemplateRequest creates a request to invoke CreateLaunchTemplate API +func CreateCreateLaunchTemplateRequest() (request *CreateLaunchTemplateRequest) { + request = &CreateLaunchTemplateRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "CreateLaunchTemplate", "ecs", "openAPI") + return +} + +// CreateCreateLaunchTemplateResponse creates a response to parse from CreateLaunchTemplate response +func CreateCreateLaunchTemplateResponse() (response *CreateLaunchTemplateResponse) { + response = &CreateLaunchTemplateResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_launch_template_version.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_launch_template_version.go new file mode 100644 index 000000000..fcab7d749 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_launch_template_version.go @@ -0,0 +1,173 @@ +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" +) + +// CreateLaunchTemplateVersion invokes the ecs.CreateLaunchTemplateVersion API synchronously +// api document: https://help.aliyun.com/api/ecs/createlaunchtemplateversion.html +func (client *Client) CreateLaunchTemplateVersion(request *CreateLaunchTemplateVersionRequest) (response *CreateLaunchTemplateVersionResponse, err error) { + response = CreateCreateLaunchTemplateVersionResponse() + err = client.DoAction(request, response) + return +} + +// CreateLaunchTemplateVersionWithChan invokes the ecs.CreateLaunchTemplateVersion API asynchronously +// api document: https://help.aliyun.com/api/ecs/createlaunchtemplateversion.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateLaunchTemplateVersionWithChan(request *CreateLaunchTemplateVersionRequest) (<-chan *CreateLaunchTemplateVersionResponse, <-chan error) { + responseChan := make(chan *CreateLaunchTemplateVersionResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateLaunchTemplateVersion(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateLaunchTemplateVersionWithCallback invokes the ecs.CreateLaunchTemplateVersion API asynchronously +// api document: https://help.aliyun.com/api/ecs/createlaunchtemplateversion.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateLaunchTemplateVersionWithCallback(request *CreateLaunchTemplateVersionRequest, callback func(response *CreateLaunchTemplateVersionResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateLaunchTemplateVersionResponse + var err error + defer close(result) + response, err = client.CreateLaunchTemplateVersion(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateLaunchTemplateVersionRequest is the request struct for api CreateLaunchTemplateVersion +type CreateLaunchTemplateVersionRequest struct { + *requests.RpcRequest + LaunchTemplateName string `position:"Query" name:"LaunchTemplateName"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + SecurityEnhancementStrategy string `position:"Query" name:"SecurityEnhancementStrategy"` + NetworkType string `position:"Query" name:"NetworkType"` + KeyPairName string `position:"Query" name:"KeyPairName"` + SpotPriceLimit requests.Float `position:"Query" name:"SpotPriceLimit"` + ImageOwnerAlias string `position:"Query" name:"ImageOwnerAlias"` + ResourceGroupId string `position:"Query" name:"ResourceGroupId"` + HostName string `position:"Query" name:"HostName"` + SystemDiskIops requests.Integer `position:"Query" name:"SystemDisk.Iops"` + Tag *[]CreateLaunchTemplateVersionTag `position:"Query" name:"Tag" type:"Repeated"` + Period requests.Integer `position:"Query" name:"Period"` + LaunchTemplateId string `position:"Query" name:"LaunchTemplateId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + VSwitchId string `position:"Query" name:"VSwitchId"` + SpotStrategy string `position:"Query" name:"SpotStrategy"` + InstanceName string `position:"Query" name:"InstanceName"` + InternetChargeType string `position:"Query" name:"InternetChargeType"` + ZoneId string `position:"Query" name:"ZoneId"` + InternetMaxBandwidthIn requests.Integer `position:"Query" name:"InternetMaxBandwidthIn"` + VersionDescription string `position:"Query" name:"VersionDescription"` + ImageId string `position:"Query" name:"ImageId"` + 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"` + PasswordInherit requests.Boolean `position:"Query" name:"PasswordInherit"` + InstanceType string `position:"Query" name:"InstanceType"` + InstanceChargeType string `position:"Query" name:"InstanceChargeType"` + EnableVmOsConfig requests.Boolean `position:"Query" name:"EnableVmOsConfig"` + NetworkInterface *[]CreateLaunchTemplateVersionNetworkInterface `position:"Query" name:"NetworkInterface" type:"Repeated"` + 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"` + AutoReleaseTime string `position:"Query" name:"AutoReleaseTime"` + SpotDuration requests.Integer `position:"Query" name:"SpotDuration"` + DataDisk *[]CreateLaunchTemplateVersionDataDisk `position:"Query" name:"DataDisk" type:"Repeated"` + SystemDiskSize requests.Integer `position:"Query" name:"SystemDisk.Size"` + VpcId string `position:"Query" name:"VpcId"` + SystemDiskDescription string `position:"Query" name:"SystemDisk.Description"` +} + +// CreateLaunchTemplateVersionTag is a repeated param struct in CreateLaunchTemplateVersionRequest +type CreateLaunchTemplateVersionTag struct { + Key string `name:"Key"` + Value string `name:"Value"` +} + +// CreateLaunchTemplateVersionNetworkInterface is a repeated param struct in CreateLaunchTemplateVersionRequest +type CreateLaunchTemplateVersionNetworkInterface struct { + PrimaryIpAddress string `name:"PrimaryIpAddress"` + VSwitchId string `name:"VSwitchId"` + SecurityGroupId string `name:"SecurityGroupId"` + NetworkInterfaceName string `name:"NetworkInterfaceName"` + Description string `name:"Description"` +} + +// CreateLaunchTemplateVersionDataDisk is a repeated param struct in CreateLaunchTemplateVersionRequest +type CreateLaunchTemplateVersionDataDisk struct { + Size string `name:"Size"` + SnapshotId string `name:"SnapshotId"` + Category string `name:"Category"` + Encrypted string `name:"Encrypted"` + DiskName string `name:"DiskName"` + Description string `name:"Description"` + DeleteWithInstance string `name:"DeleteWithInstance"` + Device string `name:"Device"` +} + +// CreateLaunchTemplateVersionResponse is the response struct for api CreateLaunchTemplateVersion +type CreateLaunchTemplateVersionResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + LaunchTemplateVersionNumber int `json:"LaunchTemplateVersionNumber" xml:"LaunchTemplateVersionNumber"` +} + +// CreateCreateLaunchTemplateVersionRequest creates a request to invoke CreateLaunchTemplateVersion API +func CreateCreateLaunchTemplateVersionRequest() (request *CreateLaunchTemplateVersionRequest) { + request = &CreateLaunchTemplateVersionRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "CreateLaunchTemplateVersion", "ecs", "openAPI") + return +} + +// CreateCreateLaunchTemplateVersionResponse creates a response to parse from CreateLaunchTemplateVersion response +func CreateCreateLaunchTemplateVersionResponse() (response *CreateLaunchTemplateVersionResponse) { + response = &CreateLaunchTemplateVersionResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_nat_gateway.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_nat_gateway.go new file mode 100644 index 000000000..764af7bdb --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_nat_gateway.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" +) + +// CreateNatGateway invokes the ecs.CreateNatGateway API synchronously +// api document: https://help.aliyun.com/api/ecs/createnatgateway.html +func (client *Client) CreateNatGateway(request *CreateNatGatewayRequest) (response *CreateNatGatewayResponse, err error) { + response = CreateCreateNatGatewayResponse() + err = client.DoAction(request, response) + return +} + +// CreateNatGatewayWithChan invokes the ecs.CreateNatGateway API asynchronously +// api document: https://help.aliyun.com/api/ecs/createnatgateway.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateNatGatewayWithChan(request *CreateNatGatewayRequest) (<-chan *CreateNatGatewayResponse, <-chan error) { + responseChan := make(chan *CreateNatGatewayResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateNatGateway(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateNatGatewayWithCallback invokes the ecs.CreateNatGateway API asynchronously +// api document: https://help.aliyun.com/api/ecs/createnatgateway.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateNatGatewayWithCallback(request *CreateNatGatewayRequest, callback func(response *CreateNatGatewayResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateNatGatewayResponse + var err error + defer close(result) + response, err = client.CreateNatGateway(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateNatGatewayRequest is the request struct for api CreateNatGateway +type CreateNatGatewayRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + VpcId string `position:"Query" name:"VpcId"` + Name string `position:"Query" name:"Name"` + Description string `position:"Query" name:"Description"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + BandwidthPackage *[]CreateNatGatewayBandwidthPackage `position:"Query" name:"BandwidthPackage" type:"Repeated"` +} + +// CreateNatGatewayBandwidthPackage is a repeated param struct in CreateNatGatewayRequest +type CreateNatGatewayBandwidthPackage struct { + Bandwidth string `name:"Bandwidth"` + Zone string `name:"Zone"` + IpCount string `name:"IpCount"` +} + +// CreateNatGatewayResponse is the response struct for api CreateNatGateway +type CreateNatGatewayResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + NatGatewayId string `json:"NatGatewayId" xml:"NatGatewayId"` + ForwardTableIds ForwardTableIdsInCreateNatGateway `json:"ForwardTableIds" xml:"ForwardTableIds"` + BandwidthPackageIds BandwidthPackageIdsInCreateNatGateway `json:"BandwidthPackageIds" xml:"BandwidthPackageIds"` +} + +// CreateCreateNatGatewayRequest creates a request to invoke CreateNatGateway API +func CreateCreateNatGatewayRequest() (request *CreateNatGatewayRequest) { + request = &CreateNatGatewayRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "CreateNatGateway", "ecs", "openAPI") + return +} + +// CreateCreateNatGatewayResponse creates a response to parse from CreateNatGateway response +func CreateCreateNatGatewayResponse() (response *CreateNatGatewayResponse) { + response = &CreateNatGatewayResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_network_interface.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_network_interface.go new file mode 100644 index 000000000..45784bd78 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_network_interface.go @@ -0,0 +1,123 @@ +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" +) + +// CreateNetworkInterface invokes the ecs.CreateNetworkInterface API synchronously +// api document: https://help.aliyun.com/api/ecs/createnetworkinterface.html +func (client *Client) CreateNetworkInterface(request *CreateNetworkInterfaceRequest) (response *CreateNetworkInterfaceResponse, err error) { + response = CreateCreateNetworkInterfaceResponse() + err = client.DoAction(request, response) + return +} + +// CreateNetworkInterfaceWithChan invokes the ecs.CreateNetworkInterface API asynchronously +// api document: https://help.aliyun.com/api/ecs/createnetworkinterface.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateNetworkInterfaceWithChan(request *CreateNetworkInterfaceRequest) (<-chan *CreateNetworkInterfaceResponse, <-chan error) { + responseChan := make(chan *CreateNetworkInterfaceResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateNetworkInterface(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateNetworkInterfaceWithCallback invokes the ecs.CreateNetworkInterface API asynchronously +// api document: https://help.aliyun.com/api/ecs/createnetworkinterface.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateNetworkInterfaceWithCallback(request *CreateNetworkInterfaceRequest, callback func(response *CreateNetworkInterfaceResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateNetworkInterfaceResponse + var err error + defer close(result) + response, err = client.CreateNetworkInterface(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateNetworkInterfaceRequest is the request struct for api CreateNetworkInterface +type CreateNetworkInterfaceRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ClientToken string `position:"Query" name:"ClientToken"` + SecurityGroupId string `position:"Query" name:"SecurityGroupId"` + Description string `position:"Query" name:"Description"` + BusinessType string `position:"Query" name:"BusinessType"` + ResourceGroupId string `position:"Query" name:"ResourceGroupId"` + Tag *[]CreateNetworkInterfaceTag `position:"Query" name:"Tag" type:"Repeated"` + NetworkInterfaceName string `position:"Query" name:"NetworkInterfaceName"` + Visible requests.Boolean `position:"Query" name:"Visible"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + VSwitchId string `position:"Query" name:"VSwitchId"` + PrimaryIpAddress string `position:"Query" name:"PrimaryIpAddress"` +} + +// CreateNetworkInterfaceTag is a repeated param struct in CreateNetworkInterfaceRequest +type CreateNetworkInterfaceTag struct { + Key string `name:"Key"` + Value string `name:"Value"` +} + +// CreateNetworkInterfaceResponse is the response struct for api CreateNetworkInterface +type CreateNetworkInterfaceResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + NetworkInterfaceId string `json:"NetworkInterfaceId" xml:"NetworkInterfaceId"` +} + +// CreateCreateNetworkInterfaceRequest creates a request to invoke CreateNetworkInterface API +func CreateCreateNetworkInterfaceRequest() (request *CreateNetworkInterfaceRequest) { + request = &CreateNetworkInterfaceRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "CreateNetworkInterface", "ecs", "openAPI") + return +} + +// CreateCreateNetworkInterfaceResponse creates a response to parse from CreateNetworkInterface response +func CreateCreateNetworkInterfaceResponse() (response *CreateNetworkInterfaceResponse) { + response = &CreateNetworkInterfaceResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_network_interface_permission.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_network_interface_permission.go new file mode 100644 index 000000000..27e1e84a0 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_network_interface_permission.go @@ -0,0 +1,110 @@ +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" +) + +// CreateNetworkInterfacePermission invokes the ecs.CreateNetworkInterfacePermission API synchronously +// api document: https://help.aliyun.com/api/ecs/createnetworkinterfacepermission.html +func (client *Client) CreateNetworkInterfacePermission(request *CreateNetworkInterfacePermissionRequest) (response *CreateNetworkInterfacePermissionResponse, err error) { + response = CreateCreateNetworkInterfacePermissionResponse() + err = client.DoAction(request, response) + return +} + +// CreateNetworkInterfacePermissionWithChan invokes the ecs.CreateNetworkInterfacePermission API asynchronously +// api document: https://help.aliyun.com/api/ecs/createnetworkinterfacepermission.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateNetworkInterfacePermissionWithChan(request *CreateNetworkInterfacePermissionRequest) (<-chan *CreateNetworkInterfacePermissionResponse, <-chan error) { + responseChan := make(chan *CreateNetworkInterfacePermissionResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateNetworkInterfacePermission(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateNetworkInterfacePermissionWithCallback invokes the ecs.CreateNetworkInterfacePermission API asynchronously +// api document: https://help.aliyun.com/api/ecs/createnetworkinterfacepermission.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateNetworkInterfacePermissionWithCallback(request *CreateNetworkInterfacePermissionRequest, callback func(response *CreateNetworkInterfacePermissionResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateNetworkInterfacePermissionResponse + var err error + defer close(result) + response, err = client.CreateNetworkInterfacePermission(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateNetworkInterfacePermissionRequest is the request struct for api CreateNetworkInterfacePermission +type CreateNetworkInterfacePermissionRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + AccountId requests.Integer `position:"Query" name:"AccountId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Permission string `position:"Query" name:"Permission"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + NetworkInterfaceId string `position:"Query" name:"NetworkInterfaceId"` +} + +// CreateNetworkInterfacePermissionResponse is the response struct for api CreateNetworkInterfacePermission +type CreateNetworkInterfacePermissionResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + NetworkInterfacePermission NetworkInterfacePermission `json:"NetworkInterfacePermission" xml:"NetworkInterfacePermission"` +} + +// CreateCreateNetworkInterfacePermissionRequest creates a request to invoke CreateNetworkInterfacePermission API +func CreateCreateNetworkInterfacePermissionRequest() (request *CreateNetworkInterfacePermissionRequest) { + request = &CreateNetworkInterfacePermissionRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "CreateNetworkInterfacePermission", "ecs", "openAPI") + return +} + +// CreateCreateNetworkInterfacePermissionResponse creates a response to parse from CreateNetworkInterfacePermission response +func CreateCreateNetworkInterfacePermissionResponse() (response *CreateNetworkInterfacePermissionResponse) { + response = &CreateNetworkInterfacePermissionResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_physical_connection.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_physical_connection.go new file mode 100644 index 000000000..e160ca2d6 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_physical_connection.go @@ -0,0 +1,119 @@ +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" +) + +// CreatePhysicalConnection invokes the ecs.CreatePhysicalConnection API synchronously +// api document: https://help.aliyun.com/api/ecs/createphysicalconnection.html +func (client *Client) CreatePhysicalConnection(request *CreatePhysicalConnectionRequest) (response *CreatePhysicalConnectionResponse, err error) { + response = CreateCreatePhysicalConnectionResponse() + err = client.DoAction(request, response) + return +} + +// CreatePhysicalConnectionWithChan invokes the ecs.CreatePhysicalConnection API asynchronously +// api document: https://help.aliyun.com/api/ecs/createphysicalconnection.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreatePhysicalConnectionWithChan(request *CreatePhysicalConnectionRequest) (<-chan *CreatePhysicalConnectionResponse, <-chan error) { + responseChan := make(chan *CreatePhysicalConnectionResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreatePhysicalConnection(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreatePhysicalConnectionWithCallback invokes the ecs.CreatePhysicalConnection API asynchronously +// api document: https://help.aliyun.com/api/ecs/createphysicalconnection.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreatePhysicalConnectionWithCallback(request *CreatePhysicalConnectionRequest, callback func(response *CreatePhysicalConnectionResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreatePhysicalConnectionResponse + var err error + defer close(result) + response, err = client.CreatePhysicalConnection(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreatePhysicalConnectionRequest is the request struct for api CreatePhysicalConnection +type CreatePhysicalConnectionRequest struct { + *requests.RpcRequest + AccessPointId string `position:"Query" name:"AccessPointId"` + RedundantPhysicalConnectionId string `position:"Query" name:"RedundantPhysicalConnectionId"` + PeerLocation string `position:"Query" name:"PeerLocation"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + PortType string `position:"Query" name:"PortType"` + CircuitCode string `position:"Query" name:"CircuitCode"` + Bandwidth requests.Integer `position:"Query" name:"bandwidth"` + ClientToken string `position:"Query" name:"ClientToken"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Description string `position:"Query" name:"Description"` + Type string `position:"Query" name:"Type"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + LineOperator string `position:"Query" name:"LineOperator"` + Name string `position:"Query" name:"Name"` + UserCidr string `position:"Query" name:"UserCidr"` +} + +// CreatePhysicalConnectionResponse is the response struct for api CreatePhysicalConnection +type CreatePhysicalConnectionResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + PhysicalConnectionId string `json:"PhysicalConnectionId" xml:"PhysicalConnectionId"` +} + +// CreateCreatePhysicalConnectionRequest creates a request to invoke CreatePhysicalConnection API +func CreateCreatePhysicalConnectionRequest() (request *CreatePhysicalConnectionRequest) { + request = &CreatePhysicalConnectionRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "CreatePhysicalConnection", "ecs", "openAPI") + return +} + +// CreateCreatePhysicalConnectionResponse creates a response to parse from CreatePhysicalConnection response +func CreateCreatePhysicalConnectionResponse() (response *CreatePhysicalConnectionResponse) { + response = &CreatePhysicalConnectionResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_route_entry.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_route_entry.go new file mode 100644 index 000000000..c9dc38f1b --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_route_entry.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" +) + +// CreateRouteEntry invokes the ecs.CreateRouteEntry API synchronously +// api document: https://help.aliyun.com/api/ecs/createrouteentry.html +func (client *Client) CreateRouteEntry(request *CreateRouteEntryRequest) (response *CreateRouteEntryResponse, err error) { + response = CreateCreateRouteEntryResponse() + err = client.DoAction(request, response) + return +} + +// CreateRouteEntryWithChan invokes the ecs.CreateRouteEntry API asynchronously +// api document: https://help.aliyun.com/api/ecs/createrouteentry.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateRouteEntryWithChan(request *CreateRouteEntryRequest) (<-chan *CreateRouteEntryResponse, <-chan error) { + responseChan := make(chan *CreateRouteEntryResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateRouteEntry(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateRouteEntryWithCallback invokes the ecs.CreateRouteEntry API asynchronously +// api document: https://help.aliyun.com/api/ecs/createrouteentry.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateRouteEntryWithCallback(request *CreateRouteEntryRequest, callback func(response *CreateRouteEntryResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateRouteEntryResponse + var err error + defer close(result) + response, err = client.CreateRouteEntry(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateRouteEntryRequest is the request struct for api CreateRouteEntry +type CreateRouteEntryRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + DestinationCidrBlock string `position:"Query" name:"DestinationCidrBlock"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + NextHopId string `position:"Query" name:"NextHopId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + NextHopType string `position:"Query" name:"NextHopType"` + NextHopList *[]CreateRouteEntryNextHopList `position:"Query" name:"NextHopList" type:"Repeated"` + RouteTableId string `position:"Query" name:"RouteTableId"` +} + +// CreateRouteEntryNextHopList is a repeated param struct in CreateRouteEntryRequest +type CreateRouteEntryNextHopList struct { + NextHopId string `name:"NextHopId"` + NextHopType string `name:"NextHopType"` +} + +// CreateRouteEntryResponse is the response struct for api CreateRouteEntry +type CreateRouteEntryResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateCreateRouteEntryRequest creates a request to invoke CreateRouteEntry API +func CreateCreateRouteEntryRequest() (request *CreateRouteEntryRequest) { + request = &CreateRouteEntryRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "CreateRouteEntry", "ecs", "openAPI") + return +} + +// CreateCreateRouteEntryResponse creates a response to parse from CreateRouteEntry response +func CreateCreateRouteEntryResponse() (response *CreateRouteEntryResponse) { + response = &CreateRouteEntryResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_router_interface.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_router_interface.go new file mode 100644 index 000000000..5aef7f4f6 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_router_interface.go @@ -0,0 +1,129 @@ +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" +) + +// CreateRouterInterface invokes the ecs.CreateRouterInterface API synchronously +// api document: https://help.aliyun.com/api/ecs/createrouterinterface.html +func (client *Client) CreateRouterInterface(request *CreateRouterInterfaceRequest) (response *CreateRouterInterfaceResponse, err error) { + response = CreateCreateRouterInterfaceResponse() + err = client.DoAction(request, response) + return +} + +// CreateRouterInterfaceWithChan invokes the ecs.CreateRouterInterface API asynchronously +// api document: https://help.aliyun.com/api/ecs/createrouterinterface.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateRouterInterfaceWithChan(request *CreateRouterInterfaceRequest) (<-chan *CreateRouterInterfaceResponse, <-chan error) { + responseChan := make(chan *CreateRouterInterfaceResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateRouterInterface(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateRouterInterfaceWithCallback invokes the ecs.CreateRouterInterface API asynchronously +// api document: https://help.aliyun.com/api/ecs/createrouterinterface.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateRouterInterfaceWithCallback(request *CreateRouterInterfaceRequest, callback func(response *CreateRouterInterfaceResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateRouterInterfaceResponse + var err error + defer close(result) + response, err = client.CreateRouterInterface(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateRouterInterfaceRequest is the request struct for api CreateRouterInterface +type CreateRouterInterfaceRequest struct { + *requests.RpcRequest + AccessPointId string `position:"Query" name:"AccessPointId"` + OppositeRouterId string `position:"Query" name:"OppositeRouterId"` + OppositeAccessPointId string `position:"Query" name:"OppositeAccessPointId"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + Role string `position:"Query" name:"Role"` + ClientToken string `position:"Query" name:"ClientToken"` + HealthCheckTargetIp string `position:"Query" name:"HealthCheckTargetIp"` + Description string `position:"Query" name:"Description"` + Spec string `position:"Query" name:"Spec"` + UserCidr string `position:"Query" name:"UserCidr"` + OppositeInterfaceId string `position:"Query" name:"OppositeInterfaceId"` + InstanceChargeType string `position:"Query" name:"InstanceChargeType"` + Period requests.Integer `position:"Query" name:"Period"` + AutoPay requests.Boolean `position:"Query" name:"AutoPay"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OppositeRegionId string `position:"Query" name:"OppositeRegionId"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + OppositeInterfaceOwnerId string `position:"Query" name:"OppositeInterfaceOwnerId"` + RouterType string `position:"Query" name:"RouterType"` + HealthCheckSourceIp string `position:"Query" name:"HealthCheckSourceIp"` + RouterId string `position:"Query" name:"RouterId"` + OppositeRouterType string `position:"Query" name:"OppositeRouterType"` + Name string `position:"Query" name:"Name"` + PricingCycle string `position:"Query" name:"PricingCycle"` +} + +// CreateRouterInterfaceResponse is the response struct for api CreateRouterInterface +type CreateRouterInterfaceResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + RouterInterfaceId string `json:"RouterInterfaceId" xml:"RouterInterfaceId"` + OrderId int `json:"OrderId" xml:"OrderId"` +} + +// CreateCreateRouterInterfaceRequest creates a request to invoke CreateRouterInterface API +func CreateCreateRouterInterfaceRequest() (request *CreateRouterInterfaceRequest) { + request = &CreateRouterInterfaceRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "CreateRouterInterface", "ecs", "openAPI") + return +} + +// CreateCreateRouterInterfaceResponse creates a response to parse from CreateRouterInterface response +func CreateCreateRouterInterfaceResponse() (response *CreateRouterInterfaceResponse) { + response = &CreateRouterInterfaceResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_security_group.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_security_group.go new file mode 100644 index 000000000..5840defeb --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_security_group.go @@ -0,0 +1,119 @@ +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" +) + +// CreateSecurityGroup invokes the ecs.CreateSecurityGroup API synchronously +// api document: https://help.aliyun.com/api/ecs/createsecuritygroup.html +func (client *Client) CreateSecurityGroup(request *CreateSecurityGroupRequest) (response *CreateSecurityGroupResponse, err error) { + response = CreateCreateSecurityGroupResponse() + err = client.DoAction(request, response) + return +} + +// CreateSecurityGroupWithChan invokes the ecs.CreateSecurityGroup API asynchronously +// api document: https://help.aliyun.com/api/ecs/createsecuritygroup.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateSecurityGroupWithChan(request *CreateSecurityGroupRequest) (<-chan *CreateSecurityGroupResponse, <-chan error) { + responseChan := make(chan *CreateSecurityGroupResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateSecurityGroup(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateSecurityGroupWithCallback invokes the ecs.CreateSecurityGroup API asynchronously +// api document: https://help.aliyun.com/api/ecs/createsecuritygroup.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateSecurityGroupWithCallback(request *CreateSecurityGroupRequest, callback func(response *CreateSecurityGroupResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateSecurityGroupResponse + var err error + defer close(result) + response, err = client.CreateSecurityGroup(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateSecurityGroupRequest is the request struct for api CreateSecurityGroup +type CreateSecurityGroupRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Description string `position:"Query" name:"Description"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + SecurityGroupName string `position:"Query" name:"SecurityGroupName"` + ResourceGroupId string `position:"Query" name:"ResourceGroupId"` + VpcId string `position:"Query" name:"VpcId"` + Tag *[]CreateSecurityGroupTag `position:"Query" name:"Tag" type:"Repeated"` +} + +// CreateSecurityGroupTag is a repeated param struct in CreateSecurityGroupRequest +type CreateSecurityGroupTag struct { + Value string `name:"Value"` + Key string `name:"Key"` +} + +// CreateSecurityGroupResponse is the response struct for api CreateSecurityGroup +type CreateSecurityGroupResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + SecurityGroupId string `json:"SecurityGroupId" xml:"SecurityGroupId"` +} + +// CreateCreateSecurityGroupRequest creates a request to invoke CreateSecurityGroup API +func CreateCreateSecurityGroupRequest() (request *CreateSecurityGroupRequest) { + request = &CreateSecurityGroupRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "CreateSecurityGroup", "ecs", "openAPI") + return +} + +// CreateCreateSecurityGroupResponse creates a response to parse from CreateSecurityGroup response +func CreateCreateSecurityGroupResponse() (response *CreateSecurityGroupResponse) { + response = &CreateSecurityGroupResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_simulated_system_events.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_simulated_system_events.go new file mode 100644 index 000000000..3ce185f9d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_simulated_system_events.go @@ -0,0 +1,110 @@ +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" +) + +// CreateSimulatedSystemEvents invokes the ecs.CreateSimulatedSystemEvents API synchronously +// api document: https://help.aliyun.com/api/ecs/createsimulatedsystemevents.html +func (client *Client) CreateSimulatedSystemEvents(request *CreateSimulatedSystemEventsRequest) (response *CreateSimulatedSystemEventsResponse, err error) { + response = CreateCreateSimulatedSystemEventsResponse() + err = client.DoAction(request, response) + return +} + +// CreateSimulatedSystemEventsWithChan invokes the ecs.CreateSimulatedSystemEvents API asynchronously +// api document: https://help.aliyun.com/api/ecs/createsimulatedsystemevents.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateSimulatedSystemEventsWithChan(request *CreateSimulatedSystemEventsRequest) (<-chan *CreateSimulatedSystemEventsResponse, <-chan error) { + responseChan := make(chan *CreateSimulatedSystemEventsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateSimulatedSystemEvents(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateSimulatedSystemEventsWithCallback invokes the ecs.CreateSimulatedSystemEvents API asynchronously +// api document: https://help.aliyun.com/api/ecs/createsimulatedsystemevents.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateSimulatedSystemEventsWithCallback(request *CreateSimulatedSystemEventsRequest, callback func(response *CreateSimulatedSystemEventsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateSimulatedSystemEventsResponse + var err error + defer close(result) + response, err = client.CreateSimulatedSystemEvents(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateSimulatedSystemEventsRequest is the request struct for api CreateSimulatedSystemEvents +type CreateSimulatedSystemEventsRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + NotBefore string `position:"Query" name:"NotBefore"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + InstanceId *[]string `position:"Query" name:"InstanceId" type:"Repeated"` + EventType string `position:"Query" name:"EventType"` +} + +// CreateSimulatedSystemEventsResponse is the response struct for api CreateSimulatedSystemEvents +type CreateSimulatedSystemEventsResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + EventIdSet EventIdSet `json:"EventIdSet" xml:"EventIdSet"` +} + +// CreateCreateSimulatedSystemEventsRequest creates a request to invoke CreateSimulatedSystemEvents API +func CreateCreateSimulatedSystemEventsRequest() (request *CreateSimulatedSystemEventsRequest) { + request = &CreateSimulatedSystemEventsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "CreateSimulatedSystemEvents", "ecs", "openAPI") + return +} + +// CreateCreateSimulatedSystemEventsResponse creates a response to parse from CreateSimulatedSystemEvents response +func CreateCreateSimulatedSystemEventsResponse() (response *CreateSimulatedSystemEventsResponse) { + response = &CreateSimulatedSystemEventsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_snapshot.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_snapshot.go new file mode 100644 index 000000000..210cfcbcf --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_snapshot.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" +) + +// CreateSnapshot invokes the ecs.CreateSnapshot API synchronously +// api document: https://help.aliyun.com/api/ecs/createsnapshot.html +func (client *Client) CreateSnapshot(request *CreateSnapshotRequest) (response *CreateSnapshotResponse, err error) { + response = CreateCreateSnapshotResponse() + err = client.DoAction(request, response) + return +} + +// CreateSnapshotWithChan invokes the ecs.CreateSnapshot API asynchronously +// api document: https://help.aliyun.com/api/ecs/createsnapshot.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateSnapshotWithChan(request *CreateSnapshotRequest) (<-chan *CreateSnapshotResponse, <-chan error) { + responseChan := make(chan *CreateSnapshotResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateSnapshot(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateSnapshotWithCallback invokes the ecs.CreateSnapshot API asynchronously +// api document: https://help.aliyun.com/api/ecs/createsnapshot.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateSnapshotWithCallback(request *CreateSnapshotRequest, callback func(response *CreateSnapshotResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateSnapshotResponse + var err error + defer close(result) + response, err = client.CreateSnapshot(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateSnapshotRequest is the request struct for api CreateSnapshot +type CreateSnapshotRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Description string `position:"Query" name:"Description"` + DiskId string `position:"Query" name:"DiskId"` + SnapshotName string `position:"Query" name:"SnapshotName"` + Tag *[]CreateSnapshotTag `position:"Query" name:"Tag" type:"Repeated"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// CreateSnapshotTag is a repeated param struct in CreateSnapshotRequest +type CreateSnapshotTag struct { + Value string `name:"Value"` + Key string `name:"Key"` +} + +// CreateSnapshotResponse is the response struct for api CreateSnapshot +type CreateSnapshotResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + SnapshotId string `json:"SnapshotId" xml:"SnapshotId"` +} + +// CreateCreateSnapshotRequest creates a request to invoke CreateSnapshot API +func CreateCreateSnapshotRequest() (request *CreateSnapshotRequest) { + request = &CreateSnapshotRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "CreateSnapshot", "ecs", "openAPI") + return +} + +// CreateCreateSnapshotResponse creates a response to parse from CreateSnapshot response +func CreateCreateSnapshotResponse() (response *CreateSnapshotResponse) { + response = &CreateSnapshotResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_v_switch.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_v_switch.go new file mode 100644 index 000000000..718c1a54d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_v_switch.go @@ -0,0 +1,113 @@ +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" +) + +// CreateVSwitch invokes the ecs.CreateVSwitch API synchronously +// api document: https://help.aliyun.com/api/ecs/createvswitch.html +func (client *Client) CreateVSwitch(request *CreateVSwitchRequest) (response *CreateVSwitchResponse, err error) { + response = CreateCreateVSwitchResponse() + err = client.DoAction(request, response) + return +} + +// CreateVSwitchWithChan invokes the ecs.CreateVSwitch API asynchronously +// api document: https://help.aliyun.com/api/ecs/createvswitch.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateVSwitchWithChan(request *CreateVSwitchRequest) (<-chan *CreateVSwitchResponse, <-chan error) { + responseChan := make(chan *CreateVSwitchResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateVSwitch(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateVSwitchWithCallback invokes the ecs.CreateVSwitch API asynchronously +// api document: https://help.aliyun.com/api/ecs/createvswitch.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateVSwitchWithCallback(request *CreateVSwitchRequest, callback func(response *CreateVSwitchResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateVSwitchResponse + var err error + defer close(result) + response, err = client.CreateVSwitch(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateVSwitchRequest is the request struct for api CreateVSwitch +type CreateVSwitchRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + VpcId string `position:"Query" name:"VpcId"` + VSwitchName string `position:"Query" name:"VSwitchName"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + CidrBlock string `position:"Query" name:"CidrBlock"` + ZoneId string `position:"Query" name:"ZoneId"` + Description string `position:"Query" name:"Description"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// CreateVSwitchResponse is the response struct for api CreateVSwitch +type CreateVSwitchResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + VSwitchId string `json:"VSwitchId" xml:"VSwitchId"` +} + +// CreateCreateVSwitchRequest creates a request to invoke CreateVSwitch API +func CreateCreateVSwitchRequest() (request *CreateVSwitchRequest) { + request = &CreateVSwitchRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "CreateVSwitch", "ecs", "openAPI") + return +} + +// CreateCreateVSwitchResponse creates a response to parse from CreateVSwitch response +func CreateCreateVSwitchResponse() (response *CreateVSwitchResponse) { + response = &CreateVSwitchResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_virtual_border_router.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_virtual_border_router.go new file mode 100644 index 000000000..887da2b7e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_virtual_border_router.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" +) + +// CreateVirtualBorderRouter invokes the ecs.CreateVirtualBorderRouter API synchronously +// api document: https://help.aliyun.com/api/ecs/createvirtualborderrouter.html +func (client *Client) CreateVirtualBorderRouter(request *CreateVirtualBorderRouterRequest) (response *CreateVirtualBorderRouterResponse, err error) { + response = CreateCreateVirtualBorderRouterResponse() + err = client.DoAction(request, response) + return +} + +// CreateVirtualBorderRouterWithChan invokes the ecs.CreateVirtualBorderRouter API asynchronously +// api document: https://help.aliyun.com/api/ecs/createvirtualborderrouter.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateVirtualBorderRouterWithChan(request *CreateVirtualBorderRouterRequest) (<-chan *CreateVirtualBorderRouterResponse, <-chan error) { + responseChan := make(chan *CreateVirtualBorderRouterResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateVirtualBorderRouter(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateVirtualBorderRouterWithCallback invokes the ecs.CreateVirtualBorderRouter API asynchronously +// api document: https://help.aliyun.com/api/ecs/createvirtualborderrouter.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateVirtualBorderRouterWithCallback(request *CreateVirtualBorderRouterRequest, callback func(response *CreateVirtualBorderRouterResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateVirtualBorderRouterResponse + var err error + defer close(result) + response, err = client.CreateVirtualBorderRouter(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateVirtualBorderRouterRequest is the request struct for api CreateVirtualBorderRouter +type CreateVirtualBorderRouterRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + CircuitCode string `position:"Query" name:"CircuitCode"` + VlanId requests.Integer `position:"Query" name:"VlanId"` + ClientToken string `position:"Query" name:"ClientToken"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Description string `position:"Query" name:"Description"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PeerGatewayIp string `position:"Query" name:"PeerGatewayIp"` + PeeringSubnetMask string `position:"Query" name:"PeeringSubnetMask"` + PhysicalConnectionId string `position:"Query" name:"PhysicalConnectionId"` + Name string `position:"Query" name:"Name"` + LocalGatewayIp string `position:"Query" name:"LocalGatewayIp"` + UserCidr string `position:"Query" name:"UserCidr"` + VbrOwnerId requests.Integer `position:"Query" name:"VbrOwnerId"` +} + +// CreateVirtualBorderRouterResponse is the response struct for api CreateVirtualBorderRouter +type CreateVirtualBorderRouterResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + VbrId string `json:"VbrId" xml:"VbrId"` +} + +// CreateCreateVirtualBorderRouterRequest creates a request to invoke CreateVirtualBorderRouter API +func CreateCreateVirtualBorderRouterRequest() (request *CreateVirtualBorderRouterRequest) { + request = &CreateVirtualBorderRouterRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "CreateVirtualBorderRouter", "ecs", "openAPI") + return +} + +// CreateCreateVirtualBorderRouterResponse creates a response to parse from CreateVirtualBorderRouter response +func CreateCreateVirtualBorderRouterResponse() (response *CreateVirtualBorderRouterResponse) { + response = &CreateVirtualBorderRouterResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_vpc.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_vpc.go new file mode 100644 index 000000000..25eefd74e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_vpc.go @@ -0,0 +1,114 @@ +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" +) + +// CreateVpc invokes the ecs.CreateVpc API synchronously +// api document: https://help.aliyun.com/api/ecs/createvpc.html +func (client *Client) CreateVpc(request *CreateVpcRequest) (response *CreateVpcResponse, err error) { + response = CreateCreateVpcResponse() + err = client.DoAction(request, response) + return +} + +// CreateVpcWithChan invokes the ecs.CreateVpc API asynchronously +// api document: https://help.aliyun.com/api/ecs/createvpc.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateVpcWithChan(request *CreateVpcRequest) (<-chan *CreateVpcResponse, <-chan error) { + responseChan := make(chan *CreateVpcResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateVpc(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateVpcWithCallback invokes the ecs.CreateVpc API asynchronously +// api document: https://help.aliyun.com/api/ecs/createvpc.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateVpcWithCallback(request *CreateVpcRequest, callback func(response *CreateVpcResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateVpcResponse + var err error + defer close(result) + response, err = client.CreateVpc(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateVpcRequest is the request struct for api CreateVpc +type CreateVpcRequest struct { + *requests.RpcRequest + VpcName string `position:"Query" name:"VpcName"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + CidrBlock string `position:"Query" name:"CidrBlock"` + Description string `position:"Query" name:"Description"` + UserCidr string `position:"Query" name:"UserCidr"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// CreateVpcResponse is the response struct for api CreateVpc +type CreateVpcResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + VpcId string `json:"VpcId" xml:"VpcId"` + VRouterId string `json:"VRouterId" xml:"VRouterId"` + RouteTableId string `json:"RouteTableId" xml:"RouteTableId"` +} + +// CreateCreateVpcRequest creates a request to invoke CreateVpc API +func CreateCreateVpcRequest() (request *CreateVpcRequest) { + request = &CreateVpcRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "CreateVpc", "ecs", "openAPI") + return +} + +// CreateCreateVpcResponse creates a response to parse from CreateVpc response +func CreateCreateVpcResponse() (response *CreateVpcResponse) { + response = &CreateVpcResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/deactivate_router_interface.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/deactivate_router_interface.go new file mode 100644 index 000000000..4652f3adc --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/deactivate_router_interface.go @@ -0,0 +1,106 @@ +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" +) + +// DeactivateRouterInterface invokes the ecs.DeactivateRouterInterface API synchronously +// api document: https://help.aliyun.com/api/ecs/deactivaterouterinterface.html +func (client *Client) DeactivateRouterInterface(request *DeactivateRouterInterfaceRequest) (response *DeactivateRouterInterfaceResponse, err error) { + response = CreateDeactivateRouterInterfaceResponse() + err = client.DoAction(request, response) + return +} + +// DeactivateRouterInterfaceWithChan invokes the ecs.DeactivateRouterInterface API asynchronously +// api document: https://help.aliyun.com/api/ecs/deactivaterouterinterface.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeactivateRouterInterfaceWithChan(request *DeactivateRouterInterfaceRequest) (<-chan *DeactivateRouterInterfaceResponse, <-chan error) { + responseChan := make(chan *DeactivateRouterInterfaceResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeactivateRouterInterface(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeactivateRouterInterfaceWithCallback invokes the ecs.DeactivateRouterInterface API asynchronously +// api document: https://help.aliyun.com/api/ecs/deactivaterouterinterface.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeactivateRouterInterfaceWithCallback(request *DeactivateRouterInterfaceRequest, callback func(response *DeactivateRouterInterfaceResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeactivateRouterInterfaceResponse + var err error + defer close(result) + response, err = client.DeactivateRouterInterface(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeactivateRouterInterfaceRequest is the request struct for api DeactivateRouterInterface +type DeactivateRouterInterfaceRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + RouterInterfaceId string `position:"Query" name:"RouterInterfaceId"` +} + +// DeactivateRouterInterfaceResponse is the response struct for api DeactivateRouterInterface +type DeactivateRouterInterfaceResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeactivateRouterInterfaceRequest creates a request to invoke DeactivateRouterInterface API +func CreateDeactivateRouterInterfaceRequest() (request *DeactivateRouterInterfaceRequest) { + request = &DeactivateRouterInterfaceRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DeactivateRouterInterface", "ecs", "openAPI") + return +} + +// CreateDeactivateRouterInterfaceResponse creates a response to parse from DeactivateRouterInterface response +func CreateDeactivateRouterInterfaceResponse() (response *DeactivateRouterInterfaceResponse) { + response = &DeactivateRouterInterfaceResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_auto_snapshot_policy.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_auto_snapshot_policy.go new file mode 100644 index 000000000..17ced5d6b --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_auto_snapshot_policy.go @@ -0,0 +1,106 @@ +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" +) + +// DeleteAutoSnapshotPolicy invokes the ecs.DeleteAutoSnapshotPolicy API synchronously +// api document: https://help.aliyun.com/api/ecs/deleteautosnapshotpolicy.html +func (client *Client) DeleteAutoSnapshotPolicy(request *DeleteAutoSnapshotPolicyRequest) (response *DeleteAutoSnapshotPolicyResponse, err error) { + response = CreateDeleteAutoSnapshotPolicyResponse() + err = client.DoAction(request, response) + return +} + +// DeleteAutoSnapshotPolicyWithChan invokes the ecs.DeleteAutoSnapshotPolicy API asynchronously +// api document: https://help.aliyun.com/api/ecs/deleteautosnapshotpolicy.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteAutoSnapshotPolicyWithChan(request *DeleteAutoSnapshotPolicyRequest) (<-chan *DeleteAutoSnapshotPolicyResponse, <-chan error) { + responseChan := make(chan *DeleteAutoSnapshotPolicyResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteAutoSnapshotPolicy(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteAutoSnapshotPolicyWithCallback invokes the ecs.DeleteAutoSnapshotPolicy API asynchronously +// api document: https://help.aliyun.com/api/ecs/deleteautosnapshotpolicy.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteAutoSnapshotPolicyWithCallback(request *DeleteAutoSnapshotPolicyRequest, callback func(response *DeleteAutoSnapshotPolicyResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteAutoSnapshotPolicyResponse + var err error + defer close(result) + response, err = client.DeleteAutoSnapshotPolicy(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteAutoSnapshotPolicyRequest is the request struct for api DeleteAutoSnapshotPolicy +type DeleteAutoSnapshotPolicyRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + AutoSnapshotPolicyId string `position:"Query" name:"autoSnapshotPolicyId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DeleteAutoSnapshotPolicyResponse is the response struct for api DeleteAutoSnapshotPolicy +type DeleteAutoSnapshotPolicyResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteAutoSnapshotPolicyRequest creates a request to invoke DeleteAutoSnapshotPolicy API +func CreateDeleteAutoSnapshotPolicyRequest() (request *DeleteAutoSnapshotPolicyRequest) { + request = &DeleteAutoSnapshotPolicyRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DeleteAutoSnapshotPolicy", "ecs", "openAPI") + return +} + +// CreateDeleteAutoSnapshotPolicyResponse creates a response to parse from DeleteAutoSnapshotPolicy response +func CreateDeleteAutoSnapshotPolicyResponse() (response *DeleteAutoSnapshotPolicyResponse) { + response = &DeleteAutoSnapshotPolicyResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_bandwidth_package.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_bandwidth_package.go new file mode 100644 index 000000000..1e91f61d0 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_bandwidth_package.go @@ -0,0 +1,107 @@ +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" +) + +// DeleteBandwidthPackage invokes the ecs.DeleteBandwidthPackage API synchronously +// api document: https://help.aliyun.com/api/ecs/deletebandwidthpackage.html +func (client *Client) DeleteBandwidthPackage(request *DeleteBandwidthPackageRequest) (response *DeleteBandwidthPackageResponse, err error) { + response = CreateDeleteBandwidthPackageResponse() + err = client.DoAction(request, response) + return +} + +// DeleteBandwidthPackageWithChan invokes the ecs.DeleteBandwidthPackage API asynchronously +// api document: https://help.aliyun.com/api/ecs/deletebandwidthpackage.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteBandwidthPackageWithChan(request *DeleteBandwidthPackageRequest) (<-chan *DeleteBandwidthPackageResponse, <-chan error) { + responseChan := make(chan *DeleteBandwidthPackageResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteBandwidthPackage(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteBandwidthPackageWithCallback invokes the ecs.DeleteBandwidthPackage API asynchronously +// api document: https://help.aliyun.com/api/ecs/deletebandwidthpackage.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteBandwidthPackageWithCallback(request *DeleteBandwidthPackageRequest, callback func(response *DeleteBandwidthPackageResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteBandwidthPackageResponse + var err error + defer close(result) + response, err = client.DeleteBandwidthPackage(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteBandwidthPackageRequest is the request struct for api DeleteBandwidthPackage +type DeleteBandwidthPackageRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + BandwidthPackageId string `position:"Query" name:"BandwidthPackageId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DeleteBandwidthPackageResponse is the response struct for api DeleteBandwidthPackage +type DeleteBandwidthPackageResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteBandwidthPackageRequest creates a request to invoke DeleteBandwidthPackage API +func CreateDeleteBandwidthPackageRequest() (request *DeleteBandwidthPackageRequest) { + request = &DeleteBandwidthPackageRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DeleteBandwidthPackage", "ecs", "openAPI") + return +} + +// CreateDeleteBandwidthPackageResponse creates a response to parse from DeleteBandwidthPackage response +func CreateDeleteBandwidthPackageResponse() (response *DeleteBandwidthPackageResponse) { + response = &DeleteBandwidthPackageResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_command.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_command.go new file mode 100644 index 000000000..4bdf6e66f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_command.go @@ -0,0 +1,107 @@ +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" +) + +// DeleteCommand invokes the ecs.DeleteCommand API synchronously +// api document: https://help.aliyun.com/api/ecs/deletecommand.html +func (client *Client) DeleteCommand(request *DeleteCommandRequest) (response *DeleteCommandResponse, err error) { + response = CreateDeleteCommandResponse() + err = client.DoAction(request, response) + return +} + +// DeleteCommandWithChan invokes the ecs.DeleteCommand API asynchronously +// api document: https://help.aliyun.com/api/ecs/deletecommand.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteCommandWithChan(request *DeleteCommandRequest) (<-chan *DeleteCommandResponse, <-chan error) { + responseChan := make(chan *DeleteCommandResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteCommand(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteCommandWithCallback invokes the ecs.DeleteCommand API asynchronously +// api document: https://help.aliyun.com/api/ecs/deletecommand.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteCommandWithCallback(request *DeleteCommandRequest, callback func(response *DeleteCommandResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteCommandResponse + var err error + defer close(result) + response, err = client.DeleteCommand(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteCommandRequest is the request struct for api DeleteCommand +type DeleteCommandRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + CommandId string `position:"Query" name:"CommandId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DeleteCommandResponse is the response struct for api DeleteCommand +type DeleteCommandResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteCommandRequest creates a request to invoke DeleteCommand API +func CreateDeleteCommandRequest() (request *DeleteCommandRequest) { + request = &DeleteCommandRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DeleteCommand", "ecs", "openAPI") + return +} + +// CreateDeleteCommandResponse creates a response to parse from DeleteCommand response +func CreateDeleteCommandResponse() (response *DeleteCommandResponse) { + response = &DeleteCommandResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_deployment_set.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_deployment_set.go new file mode 100644 index 000000000..7cdfab37d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_deployment_set.go @@ -0,0 +1,107 @@ +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" +) + +// DeleteDeploymentSet invokes the ecs.DeleteDeploymentSet API synchronously +// api document: https://help.aliyun.com/api/ecs/deletedeploymentset.html +func (client *Client) DeleteDeploymentSet(request *DeleteDeploymentSetRequest) (response *DeleteDeploymentSetResponse, err error) { + response = CreateDeleteDeploymentSetResponse() + err = client.DoAction(request, response) + return +} + +// DeleteDeploymentSetWithChan invokes the ecs.DeleteDeploymentSet API asynchronously +// api document: https://help.aliyun.com/api/ecs/deletedeploymentset.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteDeploymentSetWithChan(request *DeleteDeploymentSetRequest) (<-chan *DeleteDeploymentSetResponse, <-chan error) { + responseChan := make(chan *DeleteDeploymentSetResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteDeploymentSet(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteDeploymentSetWithCallback invokes the ecs.DeleteDeploymentSet API asynchronously +// api document: https://help.aliyun.com/api/ecs/deletedeploymentset.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteDeploymentSetWithCallback(request *DeleteDeploymentSetRequest, callback func(response *DeleteDeploymentSetResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteDeploymentSetResponse + var err error + defer close(result) + response, err = client.DeleteDeploymentSet(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteDeploymentSetRequest is the request struct for api DeleteDeploymentSet +type DeleteDeploymentSetRequest struct { + *requests.RpcRequest + DeploymentSetId string `position:"Query" name:"DeploymentSetId"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DeleteDeploymentSetResponse is the response struct for api DeleteDeploymentSet +type DeleteDeploymentSetResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteDeploymentSetRequest creates a request to invoke DeleteDeploymentSet API +func CreateDeleteDeploymentSetRequest() (request *DeleteDeploymentSetRequest) { + request = &DeleteDeploymentSetRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DeleteDeploymentSet", "ecs", "openAPI") + return +} + +// CreateDeleteDeploymentSetResponse creates a response to parse from DeleteDeploymentSet response +func CreateDeleteDeploymentSetResponse() (response *DeleteDeploymentSetResponse) { + response = &DeleteDeploymentSetResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_disk.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_disk.go new file mode 100644 index 000000000..06e62e8f0 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_disk.go @@ -0,0 +1,107 @@ +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" +) + +// DeleteDisk invokes the ecs.DeleteDisk API synchronously +// api document: https://help.aliyun.com/api/ecs/deletedisk.html +func (client *Client) DeleteDisk(request *DeleteDiskRequest) (response *DeleteDiskResponse, err error) { + response = CreateDeleteDiskResponse() + err = client.DoAction(request, response) + return +} + +// DeleteDiskWithChan invokes the ecs.DeleteDisk API asynchronously +// api document: https://help.aliyun.com/api/ecs/deletedisk.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteDiskWithChan(request *DeleteDiskRequest) (<-chan *DeleteDiskResponse, <-chan error) { + responseChan := make(chan *DeleteDiskResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteDisk(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteDiskWithCallback invokes the ecs.DeleteDisk API asynchronously +// api document: https://help.aliyun.com/api/ecs/deletedisk.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteDiskWithCallback(request *DeleteDiskRequest, callback func(response *DeleteDiskResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteDiskResponse + var err error + defer close(result) + response, err = client.DeleteDisk(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteDiskRequest is the request struct for api DeleteDisk +type DeleteDiskRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + DiskId string `position:"Query" name:"DiskId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DeleteDiskResponse is the response struct for api DeleteDisk +type DeleteDiskResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteDiskRequest creates a request to invoke DeleteDisk API +func CreateDeleteDiskRequest() (request *DeleteDiskRequest) { + request = &DeleteDiskRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DeleteDisk", "ecs", "openAPI") + return +} + +// CreateDeleteDiskResponse creates a response to parse from DeleteDisk response +func CreateDeleteDiskResponse() (response *DeleteDiskResponse) { + response = &DeleteDiskResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_forward_entry.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_forward_entry.go new file mode 100644 index 000000000..6d6a27055 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_forward_entry.go @@ -0,0 +1,108 @@ +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" +) + +// DeleteForwardEntry invokes the ecs.DeleteForwardEntry API synchronously +// api document: https://help.aliyun.com/api/ecs/deleteforwardentry.html +func (client *Client) DeleteForwardEntry(request *DeleteForwardEntryRequest) (response *DeleteForwardEntryResponse, err error) { + response = CreateDeleteForwardEntryResponse() + err = client.DoAction(request, response) + return +} + +// DeleteForwardEntryWithChan invokes the ecs.DeleteForwardEntry API asynchronously +// api document: https://help.aliyun.com/api/ecs/deleteforwardentry.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteForwardEntryWithChan(request *DeleteForwardEntryRequest) (<-chan *DeleteForwardEntryResponse, <-chan error) { + responseChan := make(chan *DeleteForwardEntryResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteForwardEntry(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteForwardEntryWithCallback invokes the ecs.DeleteForwardEntry API asynchronously +// api document: https://help.aliyun.com/api/ecs/deleteforwardentry.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteForwardEntryWithCallback(request *DeleteForwardEntryRequest, callback func(response *DeleteForwardEntryResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteForwardEntryResponse + var err error + defer close(result) + response, err = client.DeleteForwardEntry(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteForwardEntryRequest is the request struct for api DeleteForwardEntry +type DeleteForwardEntryRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ForwardEntryId string `position:"Query" name:"ForwardEntryId"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + ForwardTableId string `position:"Query" name:"ForwardTableId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DeleteForwardEntryResponse is the response struct for api DeleteForwardEntry +type DeleteForwardEntryResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteForwardEntryRequest creates a request to invoke DeleteForwardEntry API +func CreateDeleteForwardEntryRequest() (request *DeleteForwardEntryRequest) { + request = &DeleteForwardEntryRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DeleteForwardEntry", "ecs", "openAPI") + return +} + +// CreateDeleteForwardEntryResponse creates a response to parse from DeleteForwardEntry response +func CreateDeleteForwardEntryResponse() (response *DeleteForwardEntryResponse) { + response = &DeleteForwardEntryResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_ha_vip.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_ha_vip.go new file mode 100644 index 000000000..e09fcb869 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_ha_vip.go @@ -0,0 +1,108 @@ +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" +) + +// DeleteHaVip invokes the ecs.DeleteHaVip API synchronously +// api document: https://help.aliyun.com/api/ecs/deletehavip.html +func (client *Client) DeleteHaVip(request *DeleteHaVipRequest) (response *DeleteHaVipResponse, err error) { + response = CreateDeleteHaVipResponse() + err = client.DoAction(request, response) + return +} + +// DeleteHaVipWithChan invokes the ecs.DeleteHaVip API asynchronously +// api document: https://help.aliyun.com/api/ecs/deletehavip.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteHaVipWithChan(request *DeleteHaVipRequest) (<-chan *DeleteHaVipResponse, <-chan error) { + responseChan := make(chan *DeleteHaVipResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteHaVip(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteHaVipWithCallback invokes the ecs.DeleteHaVip API asynchronously +// api document: https://help.aliyun.com/api/ecs/deletehavip.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteHaVipWithCallback(request *DeleteHaVipRequest, callback func(response *DeleteHaVipResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteHaVipResponse + var err error + defer close(result) + response, err = client.DeleteHaVip(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteHaVipRequest is the request struct for api DeleteHaVip +type DeleteHaVipRequest struct { + *requests.RpcRequest + HaVipId string `position:"Query" name:"HaVipId"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DeleteHaVipResponse is the response struct for api DeleteHaVip +type DeleteHaVipResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteHaVipRequest creates a request to invoke DeleteHaVip API +func CreateDeleteHaVipRequest() (request *DeleteHaVipRequest) { + request = &DeleteHaVipRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DeleteHaVip", "ecs", "openAPI") + return +} + +// CreateDeleteHaVipResponse creates a response to parse from DeleteHaVip response +func CreateDeleteHaVipResponse() (response *DeleteHaVipResponse) { + response = &DeleteHaVipResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_hpc_cluster.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_hpc_cluster.go new file mode 100644 index 000000000..50394a5de --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_hpc_cluster.go @@ -0,0 +1,108 @@ +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" +) + +// DeleteHpcCluster invokes the ecs.DeleteHpcCluster API synchronously +// api document: https://help.aliyun.com/api/ecs/deletehpccluster.html +func (client *Client) DeleteHpcCluster(request *DeleteHpcClusterRequest) (response *DeleteHpcClusterResponse, err error) { + response = CreateDeleteHpcClusterResponse() + err = client.DoAction(request, response) + return +} + +// DeleteHpcClusterWithChan invokes the ecs.DeleteHpcCluster API asynchronously +// api document: https://help.aliyun.com/api/ecs/deletehpccluster.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteHpcClusterWithChan(request *DeleteHpcClusterRequest) (<-chan *DeleteHpcClusterResponse, <-chan error) { + responseChan := make(chan *DeleteHpcClusterResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteHpcCluster(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteHpcClusterWithCallback invokes the ecs.DeleteHpcCluster API asynchronously +// api document: https://help.aliyun.com/api/ecs/deletehpccluster.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteHpcClusterWithCallback(request *DeleteHpcClusterRequest, callback func(response *DeleteHpcClusterResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteHpcClusterResponse + var err error + defer close(result) + response, err = client.DeleteHpcCluster(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteHpcClusterRequest is the request struct for api DeleteHpcCluster +type DeleteHpcClusterRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + HpcClusterId string `position:"Query" name:"HpcClusterId"` + ClientToken string `position:"Query" name:"ClientToken"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DeleteHpcClusterResponse is the response struct for api DeleteHpcCluster +type DeleteHpcClusterResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteHpcClusterRequest creates a request to invoke DeleteHpcCluster API +func CreateDeleteHpcClusterRequest() (request *DeleteHpcClusterRequest) { + request = &DeleteHpcClusterRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DeleteHpcCluster", "ecs", "openAPI") + return +} + +// CreateDeleteHpcClusterResponse creates a response to parse from DeleteHpcCluster response +func CreateDeleteHpcClusterResponse() (response *DeleteHpcClusterResponse) { + response = &DeleteHpcClusterResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_image.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_image.go new file mode 100644 index 000000000..37196a59b --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_image.go @@ -0,0 +1,108 @@ +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" +) + +// DeleteImage invokes the ecs.DeleteImage API synchronously +// api document: https://help.aliyun.com/api/ecs/deleteimage.html +func (client *Client) DeleteImage(request *DeleteImageRequest) (response *DeleteImageResponse, err error) { + response = CreateDeleteImageResponse() + err = client.DoAction(request, response) + return +} + +// DeleteImageWithChan invokes the ecs.DeleteImage API asynchronously +// api document: https://help.aliyun.com/api/ecs/deleteimage.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteImageWithChan(request *DeleteImageRequest) (<-chan *DeleteImageResponse, <-chan error) { + responseChan := make(chan *DeleteImageResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteImage(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteImageWithCallback invokes the ecs.DeleteImage API asynchronously +// api document: https://help.aliyun.com/api/ecs/deleteimage.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteImageWithCallback(request *DeleteImageRequest, callback func(response *DeleteImageResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteImageResponse + var err error + defer close(result) + response, err = client.DeleteImage(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteImageRequest is the request struct for api DeleteImage +type DeleteImageRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ImageId string `position:"Query" name:"ImageId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Force requests.Boolean `position:"Query" name:"Force"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DeleteImageResponse is the response struct for api DeleteImage +type DeleteImageResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteImageRequest creates a request to invoke DeleteImage API +func CreateDeleteImageRequest() (request *DeleteImageRequest) { + request = &DeleteImageRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DeleteImage", "ecs", "openAPI") + return +} + +// CreateDeleteImageResponse creates a response to parse from DeleteImage response +func CreateDeleteImageResponse() (response *DeleteImageResponse) { + response = &DeleteImageResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_instance.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_instance.go new file mode 100644 index 000000000..c761400cc --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_instance.go @@ -0,0 +1,109 @@ +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" +) + +// DeleteInstance invokes the ecs.DeleteInstance API synchronously +// api document: https://help.aliyun.com/api/ecs/deleteinstance.html +func (client *Client) DeleteInstance(request *DeleteInstanceRequest) (response *DeleteInstanceResponse, err error) { + response = CreateDeleteInstanceResponse() + err = client.DoAction(request, response) + return +} + +// DeleteInstanceWithChan invokes the ecs.DeleteInstance API asynchronously +// api document: https://help.aliyun.com/api/ecs/deleteinstance.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteInstanceWithChan(request *DeleteInstanceRequest) (<-chan *DeleteInstanceResponse, <-chan error) { + responseChan := make(chan *DeleteInstanceResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteInstance(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteInstanceWithCallback invokes the ecs.DeleteInstance API asynchronously +// api document: https://help.aliyun.com/api/ecs/deleteinstance.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteInstanceWithCallback(request *DeleteInstanceRequest, callback func(response *DeleteInstanceResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteInstanceResponse + var err error + defer close(result) + response, err = client.DeleteInstance(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteInstanceRequest is the request struct for api DeleteInstance +type DeleteInstanceRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + InstanceId string `position:"Query" name:"InstanceId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + TerminateSubscription requests.Boolean `position:"Query" name:"TerminateSubscription"` + Force requests.Boolean `position:"Query" name:"Force"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DeleteInstanceResponse is the response struct for api DeleteInstance +type DeleteInstanceResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteInstanceRequest creates a request to invoke DeleteInstance API +func CreateDeleteInstanceRequest() (request *DeleteInstanceRequest) { + request = &DeleteInstanceRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DeleteInstance", "ecs", "openAPI") + return +} + +// CreateDeleteInstanceResponse creates a response to parse from DeleteInstance response +func CreateDeleteInstanceResponse() (response *DeleteInstanceResponse) { + response = &DeleteInstanceResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_key_pairs.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_key_pairs.go new file mode 100644 index 000000000..114de0d6d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_key_pairs.go @@ -0,0 +1,106 @@ +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" +) + +// DeleteKeyPairs invokes the ecs.DeleteKeyPairs API synchronously +// api document: https://help.aliyun.com/api/ecs/deletekeypairs.html +func (client *Client) DeleteKeyPairs(request *DeleteKeyPairsRequest) (response *DeleteKeyPairsResponse, err error) { + response = CreateDeleteKeyPairsResponse() + err = client.DoAction(request, response) + return +} + +// DeleteKeyPairsWithChan invokes the ecs.DeleteKeyPairs API asynchronously +// api document: https://help.aliyun.com/api/ecs/deletekeypairs.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteKeyPairsWithChan(request *DeleteKeyPairsRequest) (<-chan *DeleteKeyPairsResponse, <-chan error) { + responseChan := make(chan *DeleteKeyPairsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteKeyPairs(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteKeyPairsWithCallback invokes the ecs.DeleteKeyPairs API asynchronously +// api document: https://help.aliyun.com/api/ecs/deletekeypairs.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteKeyPairsWithCallback(request *DeleteKeyPairsRequest, callback func(response *DeleteKeyPairsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteKeyPairsResponse + var err error + defer close(result) + response, err = client.DeleteKeyPairs(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteKeyPairsRequest is the request struct for api DeleteKeyPairs +type DeleteKeyPairsRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + KeyPairNames string `position:"Query" name:"KeyPairNames"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DeleteKeyPairsResponse is the response struct for api DeleteKeyPairs +type DeleteKeyPairsResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteKeyPairsRequest creates a request to invoke DeleteKeyPairs API +func CreateDeleteKeyPairsRequest() (request *DeleteKeyPairsRequest) { + request = &DeleteKeyPairsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DeleteKeyPairs", "ecs", "openAPI") + return +} + +// CreateDeleteKeyPairsResponse creates a response to parse from DeleteKeyPairs response +func CreateDeleteKeyPairsResponse() (response *DeleteKeyPairsResponse) { + response = &DeleteKeyPairsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_launch_template.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_launch_template.go new file mode 100644 index 000000000..8e18188bd --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_launch_template.go @@ -0,0 +1,108 @@ +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" +) + +// DeleteLaunchTemplate invokes the ecs.DeleteLaunchTemplate API synchronously +// api document: https://help.aliyun.com/api/ecs/deletelaunchtemplate.html +func (client *Client) DeleteLaunchTemplate(request *DeleteLaunchTemplateRequest) (response *DeleteLaunchTemplateResponse, err error) { + response = CreateDeleteLaunchTemplateResponse() + err = client.DoAction(request, response) + return +} + +// DeleteLaunchTemplateWithChan invokes the ecs.DeleteLaunchTemplate API asynchronously +// api document: https://help.aliyun.com/api/ecs/deletelaunchtemplate.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteLaunchTemplateWithChan(request *DeleteLaunchTemplateRequest) (<-chan *DeleteLaunchTemplateResponse, <-chan error) { + responseChan := make(chan *DeleteLaunchTemplateResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteLaunchTemplate(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteLaunchTemplateWithCallback invokes the ecs.DeleteLaunchTemplate API asynchronously +// api document: https://help.aliyun.com/api/ecs/deletelaunchtemplate.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteLaunchTemplateWithCallback(request *DeleteLaunchTemplateRequest, callback func(response *DeleteLaunchTemplateResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteLaunchTemplateResponse + var err error + defer close(result) + response, err = client.DeleteLaunchTemplate(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteLaunchTemplateRequest is the request struct for api DeleteLaunchTemplate +type DeleteLaunchTemplateRequest struct { + *requests.RpcRequest + LaunchTemplateName string `position:"Query" name:"LaunchTemplateName"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + LaunchTemplateId string `position:"Query" name:"LaunchTemplateId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DeleteLaunchTemplateResponse is the response struct for api DeleteLaunchTemplate +type DeleteLaunchTemplateResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteLaunchTemplateRequest creates a request to invoke DeleteLaunchTemplate API +func CreateDeleteLaunchTemplateRequest() (request *DeleteLaunchTemplateRequest) { + request = &DeleteLaunchTemplateRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DeleteLaunchTemplate", "ecs", "openAPI") + return +} + +// CreateDeleteLaunchTemplateResponse creates a response to parse from DeleteLaunchTemplate response +func CreateDeleteLaunchTemplateResponse() (response *DeleteLaunchTemplateResponse) { + response = &DeleteLaunchTemplateResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_launch_template_version.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_launch_template_version.go new file mode 100644 index 000000000..546f6c158 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_launch_template_version.go @@ -0,0 +1,109 @@ +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" +) + +// DeleteLaunchTemplateVersion invokes the ecs.DeleteLaunchTemplateVersion API synchronously +// api document: https://help.aliyun.com/api/ecs/deletelaunchtemplateversion.html +func (client *Client) DeleteLaunchTemplateVersion(request *DeleteLaunchTemplateVersionRequest) (response *DeleteLaunchTemplateVersionResponse, err error) { + response = CreateDeleteLaunchTemplateVersionResponse() + err = client.DoAction(request, response) + return +} + +// DeleteLaunchTemplateVersionWithChan invokes the ecs.DeleteLaunchTemplateVersion API asynchronously +// api document: https://help.aliyun.com/api/ecs/deletelaunchtemplateversion.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteLaunchTemplateVersionWithChan(request *DeleteLaunchTemplateVersionRequest) (<-chan *DeleteLaunchTemplateVersionResponse, <-chan error) { + responseChan := make(chan *DeleteLaunchTemplateVersionResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteLaunchTemplateVersion(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteLaunchTemplateVersionWithCallback invokes the ecs.DeleteLaunchTemplateVersion API asynchronously +// api document: https://help.aliyun.com/api/ecs/deletelaunchtemplateversion.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteLaunchTemplateVersionWithCallback(request *DeleteLaunchTemplateVersionRequest, callback func(response *DeleteLaunchTemplateVersionResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteLaunchTemplateVersionResponse + var err error + defer close(result) + response, err = client.DeleteLaunchTemplateVersion(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteLaunchTemplateVersionRequest is the request struct for api DeleteLaunchTemplateVersion +type DeleteLaunchTemplateVersionRequest struct { + *requests.RpcRequest + LaunchTemplateName string `position:"Query" name:"LaunchTemplateName"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + DeleteVersion *[]string `position:"Query" name:"DeleteVersion" type:"Repeated"` + LaunchTemplateId string `position:"Query" name:"LaunchTemplateId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DeleteLaunchTemplateVersionResponse is the response struct for api DeleteLaunchTemplateVersion +type DeleteLaunchTemplateVersionResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteLaunchTemplateVersionRequest creates a request to invoke DeleteLaunchTemplateVersion API +func CreateDeleteLaunchTemplateVersionRequest() (request *DeleteLaunchTemplateVersionRequest) { + request = &DeleteLaunchTemplateVersionRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DeleteLaunchTemplateVersion", "ecs", "openAPI") + return +} + +// CreateDeleteLaunchTemplateVersionResponse creates a response to parse from DeleteLaunchTemplateVersion response +func CreateDeleteLaunchTemplateVersionResponse() (response *DeleteLaunchTemplateVersionResponse) { + response = &DeleteLaunchTemplateVersionResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_nat_gateway.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_nat_gateway.go new file mode 100644 index 000000000..c468c85cc --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_nat_gateway.go @@ -0,0 +1,107 @@ +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" +) + +// DeleteNatGateway invokes the ecs.DeleteNatGateway API synchronously +// api document: https://help.aliyun.com/api/ecs/deletenatgateway.html +func (client *Client) DeleteNatGateway(request *DeleteNatGatewayRequest) (response *DeleteNatGatewayResponse, err error) { + response = CreateDeleteNatGatewayResponse() + err = client.DoAction(request, response) + return +} + +// DeleteNatGatewayWithChan invokes the ecs.DeleteNatGateway API asynchronously +// api document: https://help.aliyun.com/api/ecs/deletenatgateway.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteNatGatewayWithChan(request *DeleteNatGatewayRequest) (<-chan *DeleteNatGatewayResponse, <-chan error) { + responseChan := make(chan *DeleteNatGatewayResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteNatGateway(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteNatGatewayWithCallback invokes the ecs.DeleteNatGateway API asynchronously +// api document: https://help.aliyun.com/api/ecs/deletenatgateway.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteNatGatewayWithCallback(request *DeleteNatGatewayRequest, callback func(response *DeleteNatGatewayResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteNatGatewayResponse + var err error + defer close(result) + response, err = client.DeleteNatGateway(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteNatGatewayRequest is the request struct for api DeleteNatGateway +type DeleteNatGatewayRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + NatGatewayId string `position:"Query" name:"NatGatewayId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DeleteNatGatewayResponse is the response struct for api DeleteNatGateway +type DeleteNatGatewayResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteNatGatewayRequest creates a request to invoke DeleteNatGateway API +func CreateDeleteNatGatewayRequest() (request *DeleteNatGatewayRequest) { + request = &DeleteNatGatewayRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DeleteNatGateway", "ecs", "openAPI") + return +} + +// CreateDeleteNatGatewayResponse creates a response to parse from DeleteNatGateway response +func CreateDeleteNatGatewayResponse() (response *DeleteNatGatewayResponse) { + response = &DeleteNatGatewayResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_network_interface.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_network_interface.go new file mode 100644 index 000000000..2649458e1 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_network_interface.go @@ -0,0 +1,107 @@ +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" +) + +// DeleteNetworkInterface invokes the ecs.DeleteNetworkInterface API synchronously +// api document: https://help.aliyun.com/api/ecs/deletenetworkinterface.html +func (client *Client) DeleteNetworkInterface(request *DeleteNetworkInterfaceRequest) (response *DeleteNetworkInterfaceResponse, err error) { + response = CreateDeleteNetworkInterfaceResponse() + err = client.DoAction(request, response) + return +} + +// DeleteNetworkInterfaceWithChan invokes the ecs.DeleteNetworkInterface API asynchronously +// api document: https://help.aliyun.com/api/ecs/deletenetworkinterface.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteNetworkInterfaceWithChan(request *DeleteNetworkInterfaceRequest) (<-chan *DeleteNetworkInterfaceResponse, <-chan error) { + responseChan := make(chan *DeleteNetworkInterfaceResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteNetworkInterface(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteNetworkInterfaceWithCallback invokes the ecs.DeleteNetworkInterface API asynchronously +// api document: https://help.aliyun.com/api/ecs/deletenetworkinterface.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteNetworkInterfaceWithCallback(request *DeleteNetworkInterfaceRequest, callback func(response *DeleteNetworkInterfaceResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteNetworkInterfaceResponse + var err error + defer close(result) + response, err = client.DeleteNetworkInterface(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteNetworkInterfaceRequest is the request struct for api DeleteNetworkInterface +type DeleteNetworkInterfaceRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + NetworkInterfaceId string `position:"Query" name:"NetworkInterfaceId"` +} + +// DeleteNetworkInterfaceResponse is the response struct for api DeleteNetworkInterface +type DeleteNetworkInterfaceResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteNetworkInterfaceRequest creates a request to invoke DeleteNetworkInterface API +func CreateDeleteNetworkInterfaceRequest() (request *DeleteNetworkInterfaceRequest) { + request = &DeleteNetworkInterfaceRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DeleteNetworkInterface", "ecs", "openAPI") + return +} + +// CreateDeleteNetworkInterfaceResponse creates a response to parse from DeleteNetworkInterface response +func CreateDeleteNetworkInterfaceResponse() (response *DeleteNetworkInterfaceResponse) { + response = &DeleteNetworkInterfaceResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_network_interface_permission.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_network_interface_permission.go new file mode 100644 index 000000000..eaf566d6c --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_network_interface_permission.go @@ -0,0 +1,108 @@ +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" +) + +// DeleteNetworkInterfacePermission invokes the ecs.DeleteNetworkInterfacePermission API synchronously +// api document: https://help.aliyun.com/api/ecs/deletenetworkinterfacepermission.html +func (client *Client) DeleteNetworkInterfacePermission(request *DeleteNetworkInterfacePermissionRequest) (response *DeleteNetworkInterfacePermissionResponse, err error) { + response = CreateDeleteNetworkInterfacePermissionResponse() + err = client.DoAction(request, response) + return +} + +// DeleteNetworkInterfacePermissionWithChan invokes the ecs.DeleteNetworkInterfacePermission API asynchronously +// api document: https://help.aliyun.com/api/ecs/deletenetworkinterfacepermission.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteNetworkInterfacePermissionWithChan(request *DeleteNetworkInterfacePermissionRequest) (<-chan *DeleteNetworkInterfacePermissionResponse, <-chan error) { + responseChan := make(chan *DeleteNetworkInterfacePermissionResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteNetworkInterfacePermission(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteNetworkInterfacePermissionWithCallback invokes the ecs.DeleteNetworkInterfacePermission API asynchronously +// api document: https://help.aliyun.com/api/ecs/deletenetworkinterfacepermission.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteNetworkInterfacePermissionWithCallback(request *DeleteNetworkInterfacePermissionRequest, callback func(response *DeleteNetworkInterfacePermissionResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteNetworkInterfacePermissionResponse + var err error + defer close(result) + response, err = client.DeleteNetworkInterfacePermission(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteNetworkInterfacePermissionRequest is the request struct for api DeleteNetworkInterfacePermission +type DeleteNetworkInterfacePermissionRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + NetworkInterfacePermissionId string `position:"Query" name:"NetworkInterfacePermissionId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Force requests.Boolean `position:"Query" name:"Force"` +} + +// DeleteNetworkInterfacePermissionResponse is the response struct for api DeleteNetworkInterfacePermission +type DeleteNetworkInterfacePermissionResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteNetworkInterfacePermissionRequest creates a request to invoke DeleteNetworkInterfacePermission API +func CreateDeleteNetworkInterfacePermissionRequest() (request *DeleteNetworkInterfacePermissionRequest) { + request = &DeleteNetworkInterfacePermissionRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DeleteNetworkInterfacePermission", "ecs", "openAPI") + return +} + +// CreateDeleteNetworkInterfacePermissionResponse creates a response to parse from DeleteNetworkInterfacePermission response +func CreateDeleteNetworkInterfacePermissionResponse() (response *DeleteNetworkInterfacePermissionResponse) { + response = &DeleteNetworkInterfacePermissionResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_physical_connection.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_physical_connection.go new file mode 100644 index 000000000..82de412ab --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_physical_connection.go @@ -0,0 +1,108 @@ +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" +) + +// DeletePhysicalConnection invokes the ecs.DeletePhysicalConnection API synchronously +// api document: https://help.aliyun.com/api/ecs/deletephysicalconnection.html +func (client *Client) DeletePhysicalConnection(request *DeletePhysicalConnectionRequest) (response *DeletePhysicalConnectionResponse, err error) { + response = CreateDeletePhysicalConnectionResponse() + err = client.DoAction(request, response) + return +} + +// DeletePhysicalConnectionWithChan invokes the ecs.DeletePhysicalConnection API asynchronously +// api document: https://help.aliyun.com/api/ecs/deletephysicalconnection.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeletePhysicalConnectionWithChan(request *DeletePhysicalConnectionRequest) (<-chan *DeletePhysicalConnectionResponse, <-chan error) { + responseChan := make(chan *DeletePhysicalConnectionResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeletePhysicalConnection(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeletePhysicalConnectionWithCallback invokes the ecs.DeletePhysicalConnection API asynchronously +// api document: https://help.aliyun.com/api/ecs/deletephysicalconnection.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeletePhysicalConnectionWithCallback(request *DeletePhysicalConnectionRequest, callback func(response *DeletePhysicalConnectionResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeletePhysicalConnectionResponse + var err error + defer close(result) + response, err = client.DeletePhysicalConnection(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeletePhysicalConnectionRequest is the request struct for api DeletePhysicalConnection +type DeletePhysicalConnectionRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + PhysicalConnectionId string `position:"Query" name:"PhysicalConnectionId"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DeletePhysicalConnectionResponse is the response struct for api DeletePhysicalConnection +type DeletePhysicalConnectionResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeletePhysicalConnectionRequest creates a request to invoke DeletePhysicalConnection API +func CreateDeletePhysicalConnectionRequest() (request *DeletePhysicalConnectionRequest) { + request = &DeletePhysicalConnectionRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DeletePhysicalConnection", "ecs", "openAPI") + return +} + +// CreateDeletePhysicalConnectionResponse creates a response to parse from DeletePhysicalConnection response +func CreateDeletePhysicalConnectionResponse() (response *DeletePhysicalConnectionResponse) { + response = &DeletePhysicalConnectionResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_route_entry.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_route_entry.go new file mode 100644 index 000000000..a12f258a4 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_route_entry.go @@ -0,0 +1,116 @@ +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" +) + +// DeleteRouteEntry invokes the ecs.DeleteRouteEntry API synchronously +// api document: https://help.aliyun.com/api/ecs/deleterouteentry.html +func (client *Client) DeleteRouteEntry(request *DeleteRouteEntryRequest) (response *DeleteRouteEntryResponse, err error) { + response = CreateDeleteRouteEntryResponse() + err = client.DoAction(request, response) + return +} + +// DeleteRouteEntryWithChan invokes the ecs.DeleteRouteEntry API asynchronously +// api document: https://help.aliyun.com/api/ecs/deleterouteentry.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteRouteEntryWithChan(request *DeleteRouteEntryRequest) (<-chan *DeleteRouteEntryResponse, <-chan error) { + responseChan := make(chan *DeleteRouteEntryResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteRouteEntry(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteRouteEntryWithCallback invokes the ecs.DeleteRouteEntry API asynchronously +// api document: https://help.aliyun.com/api/ecs/deleterouteentry.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteRouteEntryWithCallback(request *DeleteRouteEntryRequest, callback func(response *DeleteRouteEntryResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteRouteEntryResponse + var err error + defer close(result) + response, err = client.DeleteRouteEntry(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteRouteEntryRequest is the request struct for api DeleteRouteEntry +type DeleteRouteEntryRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + DestinationCidrBlock string `position:"Query" name:"DestinationCidrBlock"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + NextHopId string `position:"Query" name:"NextHopId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + NextHopList *[]DeleteRouteEntryNextHopList `position:"Query" name:"NextHopList" type:"Repeated"` + RouteTableId string `position:"Query" name:"RouteTableId"` +} + +// DeleteRouteEntryNextHopList is a repeated param struct in DeleteRouteEntryRequest +type DeleteRouteEntryNextHopList struct { + NextHopId string `name:"NextHopId"` + NextHopType string `name:"NextHopType"` +} + +// DeleteRouteEntryResponse is the response struct for api DeleteRouteEntry +type DeleteRouteEntryResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteRouteEntryRequest creates a request to invoke DeleteRouteEntry API +func CreateDeleteRouteEntryRequest() (request *DeleteRouteEntryRequest) { + request = &DeleteRouteEntryRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DeleteRouteEntry", "ecs", "openAPI") + return +} + +// CreateDeleteRouteEntryResponse creates a response to parse from DeleteRouteEntry response +func CreateDeleteRouteEntryResponse() (response *DeleteRouteEntryResponse) { + response = &DeleteRouteEntryResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_router_interface.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_router_interface.go new file mode 100644 index 000000000..d889de590 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_router_interface.go @@ -0,0 +1,109 @@ +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" +) + +// DeleteRouterInterface invokes the ecs.DeleteRouterInterface API synchronously +// api document: https://help.aliyun.com/api/ecs/deleterouterinterface.html +func (client *Client) DeleteRouterInterface(request *DeleteRouterInterfaceRequest) (response *DeleteRouterInterfaceResponse, err error) { + response = CreateDeleteRouterInterfaceResponse() + err = client.DoAction(request, response) + return +} + +// DeleteRouterInterfaceWithChan invokes the ecs.DeleteRouterInterface API asynchronously +// api document: https://help.aliyun.com/api/ecs/deleterouterinterface.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteRouterInterfaceWithChan(request *DeleteRouterInterfaceRequest) (<-chan *DeleteRouterInterfaceResponse, <-chan error) { + responseChan := make(chan *DeleteRouterInterfaceResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteRouterInterface(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteRouterInterfaceWithCallback invokes the ecs.DeleteRouterInterface API asynchronously +// api document: https://help.aliyun.com/api/ecs/deleterouterinterface.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteRouterInterfaceWithCallback(request *DeleteRouterInterfaceRequest, callback func(response *DeleteRouterInterfaceResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteRouterInterfaceResponse + var err error + defer close(result) + response, err = client.DeleteRouterInterface(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteRouterInterfaceRequest is the request struct for api DeleteRouterInterface +type DeleteRouterInterfaceRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + UserCidr string `position:"Query" name:"UserCidr"` + RouterInterfaceId string `position:"Query" name:"RouterInterfaceId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DeleteRouterInterfaceResponse is the response struct for api DeleteRouterInterface +type DeleteRouterInterfaceResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteRouterInterfaceRequest creates a request to invoke DeleteRouterInterface API +func CreateDeleteRouterInterfaceRequest() (request *DeleteRouterInterfaceRequest) { + request = &DeleteRouterInterfaceRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DeleteRouterInterface", "ecs", "openAPI") + return +} + +// CreateDeleteRouterInterfaceResponse creates a response to parse from DeleteRouterInterface response +func CreateDeleteRouterInterfaceResponse() (response *DeleteRouterInterfaceResponse) { + response = &DeleteRouterInterfaceResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_security_group.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_security_group.go new file mode 100644 index 000000000..cea9e973d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_security_group.go @@ -0,0 +1,107 @@ +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" +) + +// DeleteSecurityGroup invokes the ecs.DeleteSecurityGroup API synchronously +// api document: https://help.aliyun.com/api/ecs/deletesecuritygroup.html +func (client *Client) DeleteSecurityGroup(request *DeleteSecurityGroupRequest) (response *DeleteSecurityGroupResponse, err error) { + response = CreateDeleteSecurityGroupResponse() + err = client.DoAction(request, response) + return +} + +// DeleteSecurityGroupWithChan invokes the ecs.DeleteSecurityGroup API asynchronously +// api document: https://help.aliyun.com/api/ecs/deletesecuritygroup.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteSecurityGroupWithChan(request *DeleteSecurityGroupRequest) (<-chan *DeleteSecurityGroupResponse, <-chan error) { + responseChan := make(chan *DeleteSecurityGroupResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteSecurityGroup(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteSecurityGroupWithCallback invokes the ecs.DeleteSecurityGroup API asynchronously +// api document: https://help.aliyun.com/api/ecs/deletesecuritygroup.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteSecurityGroupWithCallback(request *DeleteSecurityGroupRequest, callback func(response *DeleteSecurityGroupResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteSecurityGroupResponse + var err error + defer close(result) + response, err = client.DeleteSecurityGroup(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteSecurityGroupRequest is the request struct for api DeleteSecurityGroup +type DeleteSecurityGroupRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + SecurityGroupId string `position:"Query" name:"SecurityGroupId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DeleteSecurityGroupResponse is the response struct for api DeleteSecurityGroup +type DeleteSecurityGroupResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteSecurityGroupRequest creates a request to invoke DeleteSecurityGroup API +func CreateDeleteSecurityGroupRequest() (request *DeleteSecurityGroupRequest) { + request = &DeleteSecurityGroupRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DeleteSecurityGroup", "ecs", "openAPI") + return +} + +// CreateDeleteSecurityGroupResponse creates a response to parse from DeleteSecurityGroup response +func CreateDeleteSecurityGroupResponse() (response *DeleteSecurityGroupResponse) { + response = &DeleteSecurityGroupResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_snapshot.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_snapshot.go new file mode 100644 index 000000000..54dd0c261 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_snapshot.go @@ -0,0 +1,108 @@ +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" +) + +// DeleteSnapshot invokes the ecs.DeleteSnapshot API synchronously +// api document: https://help.aliyun.com/api/ecs/deletesnapshot.html +func (client *Client) DeleteSnapshot(request *DeleteSnapshotRequest) (response *DeleteSnapshotResponse, err error) { + response = CreateDeleteSnapshotResponse() + err = client.DoAction(request, response) + return +} + +// DeleteSnapshotWithChan invokes the ecs.DeleteSnapshot API asynchronously +// api document: https://help.aliyun.com/api/ecs/deletesnapshot.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteSnapshotWithChan(request *DeleteSnapshotRequest) (<-chan *DeleteSnapshotResponse, <-chan error) { + responseChan := make(chan *DeleteSnapshotResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteSnapshot(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteSnapshotWithCallback invokes the ecs.DeleteSnapshot API asynchronously +// api document: https://help.aliyun.com/api/ecs/deletesnapshot.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteSnapshotWithCallback(request *DeleteSnapshotRequest, callback func(response *DeleteSnapshotResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteSnapshotResponse + var err error + defer close(result) + response, err = client.DeleteSnapshot(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteSnapshotRequest is the request struct for api DeleteSnapshot +type DeleteSnapshotRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + SnapshotId string `position:"Query" name:"SnapshotId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Force requests.Boolean `position:"Query" name:"Force"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DeleteSnapshotResponse is the response struct for api DeleteSnapshot +type DeleteSnapshotResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteSnapshotRequest creates a request to invoke DeleteSnapshot API +func CreateDeleteSnapshotRequest() (request *DeleteSnapshotRequest) { + request = &DeleteSnapshotRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DeleteSnapshot", "ecs", "openAPI") + return +} + +// CreateDeleteSnapshotResponse creates a response to parse from DeleteSnapshot response +func CreateDeleteSnapshotResponse() (response *DeleteSnapshotResponse) { + response = &DeleteSnapshotResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_v_switch.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_v_switch.go new file mode 100644 index 000000000..e59305e35 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_v_switch.go @@ -0,0 +1,107 @@ +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" +) + +// DeleteVSwitch invokes the ecs.DeleteVSwitch API synchronously +// api document: https://help.aliyun.com/api/ecs/deletevswitch.html +func (client *Client) DeleteVSwitch(request *DeleteVSwitchRequest) (response *DeleteVSwitchResponse, err error) { + response = CreateDeleteVSwitchResponse() + err = client.DoAction(request, response) + return +} + +// DeleteVSwitchWithChan invokes the ecs.DeleteVSwitch API asynchronously +// api document: https://help.aliyun.com/api/ecs/deletevswitch.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteVSwitchWithChan(request *DeleteVSwitchRequest) (<-chan *DeleteVSwitchResponse, <-chan error) { + responseChan := make(chan *DeleteVSwitchResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteVSwitch(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteVSwitchWithCallback invokes the ecs.DeleteVSwitch API asynchronously +// api document: https://help.aliyun.com/api/ecs/deletevswitch.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteVSwitchWithCallback(request *DeleteVSwitchRequest, callback func(response *DeleteVSwitchResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteVSwitchResponse + var err error + defer close(result) + response, err = client.DeleteVSwitch(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteVSwitchRequest is the request struct for api DeleteVSwitch +type DeleteVSwitchRequest struct { + *requests.RpcRequest + VSwitchId string `position:"Query" name:"VSwitchId"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DeleteVSwitchResponse is the response struct for api DeleteVSwitch +type DeleteVSwitchResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteVSwitchRequest creates a request to invoke DeleteVSwitch API +func CreateDeleteVSwitchRequest() (request *DeleteVSwitchRequest) { + request = &DeleteVSwitchRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DeleteVSwitch", "ecs", "openAPI") + return +} + +// CreateDeleteVSwitchResponse creates a response to parse from DeleteVSwitch response +func CreateDeleteVSwitchResponse() (response *DeleteVSwitchResponse) { + response = &DeleteVSwitchResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_virtual_border_router.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_virtual_border_router.go new file mode 100644 index 000000000..eba1b78c9 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_virtual_border_router.go @@ -0,0 +1,109 @@ +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" +) + +// DeleteVirtualBorderRouter invokes the ecs.DeleteVirtualBorderRouter API synchronously +// api document: https://help.aliyun.com/api/ecs/deletevirtualborderrouter.html +func (client *Client) DeleteVirtualBorderRouter(request *DeleteVirtualBorderRouterRequest) (response *DeleteVirtualBorderRouterResponse, err error) { + response = CreateDeleteVirtualBorderRouterResponse() + err = client.DoAction(request, response) + return +} + +// DeleteVirtualBorderRouterWithChan invokes the ecs.DeleteVirtualBorderRouter API asynchronously +// api document: https://help.aliyun.com/api/ecs/deletevirtualborderrouter.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteVirtualBorderRouterWithChan(request *DeleteVirtualBorderRouterRequest) (<-chan *DeleteVirtualBorderRouterResponse, <-chan error) { + responseChan := make(chan *DeleteVirtualBorderRouterResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteVirtualBorderRouter(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteVirtualBorderRouterWithCallback invokes the ecs.DeleteVirtualBorderRouter API asynchronously +// api document: https://help.aliyun.com/api/ecs/deletevirtualborderrouter.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteVirtualBorderRouterWithCallback(request *DeleteVirtualBorderRouterRequest, callback func(response *DeleteVirtualBorderRouterResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteVirtualBorderRouterResponse + var err error + defer close(result) + response, err = client.DeleteVirtualBorderRouter(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteVirtualBorderRouterRequest is the request struct for api DeleteVirtualBorderRouter +type DeleteVirtualBorderRouterRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + UserCidr string `position:"Query" name:"UserCidr"` + VbrId string `position:"Query" name:"VbrId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DeleteVirtualBorderRouterResponse is the response struct for api DeleteVirtualBorderRouter +type DeleteVirtualBorderRouterResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteVirtualBorderRouterRequest creates a request to invoke DeleteVirtualBorderRouter API +func CreateDeleteVirtualBorderRouterRequest() (request *DeleteVirtualBorderRouterRequest) { + request = &DeleteVirtualBorderRouterRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DeleteVirtualBorderRouter", "ecs", "openAPI") + return +} + +// CreateDeleteVirtualBorderRouterResponse creates a response to parse from DeleteVirtualBorderRouter response +func CreateDeleteVirtualBorderRouterResponse() (response *DeleteVirtualBorderRouterResponse) { + response = &DeleteVirtualBorderRouterResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_vpc.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_vpc.go new file mode 100644 index 000000000..15378684a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_vpc.go @@ -0,0 +1,107 @@ +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" +) + +// DeleteVpc invokes the ecs.DeleteVpc API synchronously +// api document: https://help.aliyun.com/api/ecs/deletevpc.html +func (client *Client) DeleteVpc(request *DeleteVpcRequest) (response *DeleteVpcResponse, err error) { + response = CreateDeleteVpcResponse() + err = client.DoAction(request, response) + return +} + +// DeleteVpcWithChan invokes the ecs.DeleteVpc API asynchronously +// api document: https://help.aliyun.com/api/ecs/deletevpc.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteVpcWithChan(request *DeleteVpcRequest) (<-chan *DeleteVpcResponse, <-chan error) { + responseChan := make(chan *DeleteVpcResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteVpc(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteVpcWithCallback invokes the ecs.DeleteVpc API asynchronously +// api document: https://help.aliyun.com/api/ecs/deletevpc.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteVpcWithCallback(request *DeleteVpcRequest, callback func(response *DeleteVpcResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteVpcResponse + var err error + defer close(result) + response, err = client.DeleteVpc(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteVpcRequest is the request struct for api DeleteVpc +type DeleteVpcRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + VpcId string `position:"Query" name:"VpcId"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DeleteVpcResponse is the response struct for api DeleteVpc +type DeleteVpcResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteVpcRequest creates a request to invoke DeleteVpc API +func CreateDeleteVpcRequest() (request *DeleteVpcRequest) { + request = &DeleteVpcRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DeleteVpc", "ecs", "openAPI") + return +} + +// CreateDeleteVpcResponse creates a response to parse from DeleteVpc response +func CreateDeleteVpcResponse() (response *DeleteVpcResponse) { + response = &DeleteVpcResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_access_points.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_access_points.go new file mode 100644 index 000000000..35480d3cb --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_access_points.go @@ -0,0 +1,119 @@ +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" +) + +// DescribeAccessPoints invokes the ecs.DescribeAccessPoints API synchronously +// api document: https://help.aliyun.com/api/ecs/describeaccesspoints.html +func (client *Client) DescribeAccessPoints(request *DescribeAccessPointsRequest) (response *DescribeAccessPointsResponse, err error) { + response = CreateDescribeAccessPointsResponse() + err = client.DoAction(request, response) + return +} + +// DescribeAccessPointsWithChan invokes the ecs.DescribeAccessPoints API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeaccesspoints.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeAccessPointsWithChan(request *DescribeAccessPointsRequest) (<-chan *DescribeAccessPointsResponse, <-chan error) { + responseChan := make(chan *DescribeAccessPointsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeAccessPoints(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeAccessPointsWithCallback invokes the ecs.DescribeAccessPoints API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeaccesspoints.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeAccessPointsWithCallback(request *DescribeAccessPointsRequest, callback func(response *DescribeAccessPointsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeAccessPointsResponse + var err error + defer close(result) + response, err = client.DescribeAccessPoints(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeAccessPointsRequest is the request struct for api DescribeAccessPoints +type DescribeAccessPointsRequest struct { + *requests.RpcRequest + Filter *[]DescribeAccessPointsFilter `position:"Query" name:"Filter" type:"Repeated"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Type string `position:"Query" name:"Type"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` +} + +// DescribeAccessPointsFilter is a repeated param struct in DescribeAccessPointsRequest +type DescribeAccessPointsFilter struct { + Value *[]string `name:"Value" type:"Repeated"` + Key string `name:"Key"` +} + +// DescribeAccessPointsResponse is the response struct for api DescribeAccessPoints +type DescribeAccessPointsResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + PageNumber int `json:"PageNumber" xml:"PageNumber"` + PageSize int `json:"PageSize" xml:"PageSize"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + AccessPointSet AccessPointSet `json:"AccessPointSet" xml:"AccessPointSet"` +} + +// CreateDescribeAccessPointsRequest creates a request to invoke DescribeAccessPoints API +func CreateDescribeAccessPointsRequest() (request *DescribeAccessPointsRequest) { + request = &DescribeAccessPointsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeAccessPoints", "ecs", "openAPI") + return +} + +// CreateDescribeAccessPointsResponse creates a response to parse from DescribeAccessPoints response +func CreateDescribeAccessPointsResponse() (response *DescribeAccessPointsResponse) { + response = &DescribeAccessPointsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_account_attributes.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_account_attributes.go new file mode 100644 index 000000000..0a7fa8c7d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_account_attributes.go @@ -0,0 +1,108 @@ +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" +) + +// DescribeAccountAttributes invokes the ecs.DescribeAccountAttributes API synchronously +// api document: https://help.aliyun.com/api/ecs/describeaccountattributes.html +func (client *Client) DescribeAccountAttributes(request *DescribeAccountAttributesRequest) (response *DescribeAccountAttributesResponse, err error) { + response = CreateDescribeAccountAttributesResponse() + err = client.DoAction(request, response) + return +} + +// DescribeAccountAttributesWithChan invokes the ecs.DescribeAccountAttributes API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeaccountattributes.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeAccountAttributesWithChan(request *DescribeAccountAttributesRequest) (<-chan *DescribeAccountAttributesResponse, <-chan error) { + responseChan := make(chan *DescribeAccountAttributesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeAccountAttributes(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeAccountAttributesWithCallback invokes the ecs.DescribeAccountAttributes API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeaccountattributes.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeAccountAttributesWithCallback(request *DescribeAccountAttributesRequest, callback func(response *DescribeAccountAttributesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeAccountAttributesResponse + var err error + defer close(result) + response, err = client.DescribeAccountAttributes(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeAccountAttributesRequest is the request struct for api DescribeAccountAttributes +type DescribeAccountAttributesRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + AttributeName *[]string `position:"Query" name:"AttributeName" type:"Repeated"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + ZoneId string `position:"Query" name:"ZoneId"` +} + +// DescribeAccountAttributesResponse is the response struct for api DescribeAccountAttributes +type DescribeAccountAttributesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + AccountAttributeItems AccountAttributeItems `json:"AccountAttributeItems" xml:"AccountAttributeItems"` +} + +// CreateDescribeAccountAttributesRequest creates a request to invoke DescribeAccountAttributes API +func CreateDescribeAccountAttributesRequest() (request *DescribeAccountAttributesRequest) { + request = &DescribeAccountAttributesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeAccountAttributes", "ecs", "openAPI") + return +} + +// CreateDescribeAccountAttributesResponse creates a response to parse from DescribeAccountAttributes response +func CreateDescribeAccountAttributesResponse() (response *DescribeAccountAttributesResponse) { + response = &DescribeAccountAttributesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_auto_snapshot_policy_ex.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_auto_snapshot_policy_ex.go new file mode 100644 index 000000000..fd1d652ac --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_auto_snapshot_policy_ex.go @@ -0,0 +1,113 @@ +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" +) + +// DescribeAutoSnapshotPolicyEx invokes the ecs.DescribeAutoSnapshotPolicyEx API synchronously +// api document: https://help.aliyun.com/api/ecs/describeautosnapshotpolicyex.html +func (client *Client) DescribeAutoSnapshotPolicyEx(request *DescribeAutoSnapshotPolicyExRequest) (response *DescribeAutoSnapshotPolicyExResponse, err error) { + response = CreateDescribeAutoSnapshotPolicyExResponse() + err = client.DoAction(request, response) + return +} + +// DescribeAutoSnapshotPolicyExWithChan invokes the ecs.DescribeAutoSnapshotPolicyEx API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeautosnapshotpolicyex.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeAutoSnapshotPolicyExWithChan(request *DescribeAutoSnapshotPolicyExRequest) (<-chan *DescribeAutoSnapshotPolicyExResponse, <-chan error) { + responseChan := make(chan *DescribeAutoSnapshotPolicyExResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeAutoSnapshotPolicyEx(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeAutoSnapshotPolicyExWithCallback invokes the ecs.DescribeAutoSnapshotPolicyEx API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeautosnapshotpolicyex.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeAutoSnapshotPolicyExWithCallback(request *DescribeAutoSnapshotPolicyExRequest, callback func(response *DescribeAutoSnapshotPolicyExResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeAutoSnapshotPolicyExResponse + var err error + defer close(result) + response, err = client.DescribeAutoSnapshotPolicyEx(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeAutoSnapshotPolicyExRequest is the request struct for api DescribeAutoSnapshotPolicyEx +type DescribeAutoSnapshotPolicyExRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + AutoSnapshotPolicyId string `position:"Query" name:"AutoSnapshotPolicyId"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` +} + +// DescribeAutoSnapshotPolicyExResponse is the response struct for api DescribeAutoSnapshotPolicyEx +type DescribeAutoSnapshotPolicyExResponse 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"` + AutoSnapshotPolicies AutoSnapshotPolicies `json:"AutoSnapshotPolicies" xml:"AutoSnapshotPolicies"` +} + +// CreateDescribeAutoSnapshotPolicyExRequest creates a request to invoke DescribeAutoSnapshotPolicyEx API +func CreateDescribeAutoSnapshotPolicyExRequest() (request *DescribeAutoSnapshotPolicyExRequest) { + request = &DescribeAutoSnapshotPolicyExRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeAutoSnapshotPolicyEx", "ecs", "openAPI") + return +} + +// CreateDescribeAutoSnapshotPolicyExResponse creates a response to parse from DescribeAutoSnapshotPolicyEx response +func CreateDescribeAutoSnapshotPolicyExResponse() (response *DescribeAutoSnapshotPolicyExResponse) { + response = &DescribeAutoSnapshotPolicyExResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_available_resource.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_available_resource.go new file mode 100644 index 000000000..8a99f38de --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_available_resource.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" +) + +// DescribeAvailableResource invokes the ecs.DescribeAvailableResource API synchronously +// api document: https://help.aliyun.com/api/ecs/describeavailableresource.html +func (client *Client) DescribeAvailableResource(request *DescribeAvailableResourceRequest) (response *DescribeAvailableResourceResponse, err error) { + response = CreateDescribeAvailableResourceResponse() + err = client.DoAction(request, response) + return +} + +// DescribeAvailableResourceWithChan invokes the ecs.DescribeAvailableResource API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeavailableresource.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeAvailableResourceWithChan(request *DescribeAvailableResourceRequest) (<-chan *DescribeAvailableResourceResponse, <-chan error) { + responseChan := make(chan *DescribeAvailableResourceResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeAvailableResource(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeAvailableResourceWithCallback invokes the ecs.DescribeAvailableResource API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeavailableresource.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeAvailableResourceWithCallback(request *DescribeAvailableResourceRequest, callback func(response *DescribeAvailableResourceResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeAvailableResourceResponse + var err error + defer close(result) + response, err = client.DescribeAvailableResource(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeAvailableResourceRequest is the request struct for api DescribeAvailableResource +type DescribeAvailableResourceRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + Memory requests.Float `position:"Query" name:"Memory"` + IoOptimized string `position:"Query" name:"IoOptimized"` + DataDiskCategory string `position:"Query" name:"DataDiskCategory"` + Cores requests.Integer `position:"Query" name:"Cores"` + SystemDiskCategory string `position:"Query" name:"SystemDiskCategory"` + Scope string `position:"Query" name:"Scope"` + InstanceType string `position:"Query" name:"InstanceType"` + NetworkCategory string `position:"Query" name:"NetworkCategory"` + InstanceChargeType string `position:"Query" name:"InstanceChargeType"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + DedicatedHostId string `position:"Query" name:"DedicatedHostId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + ResourceType string `position:"Query" name:"ResourceType"` + SpotStrategy string `position:"Query" name:"SpotStrategy"` + DestinationResource string `position:"Query" name:"DestinationResource"` + ZoneId string `position:"Query" name:"ZoneId"` +} + +// DescribeAvailableResourceResponse is the response struct for api DescribeAvailableResource +type DescribeAvailableResourceResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + AvailableZones AvailableZonesInDescribeAvailableResource `json:"AvailableZones" xml:"AvailableZones"` +} + +// CreateDescribeAvailableResourceRequest creates a request to invoke DescribeAvailableResource API +func CreateDescribeAvailableResourceRequest() (request *DescribeAvailableResourceRequest) { + request = &DescribeAvailableResourceRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeAvailableResource", "ecs", "openAPI") + return +} + +// CreateDescribeAvailableResourceResponse creates a response to parse from DescribeAvailableResource response +func CreateDescribeAvailableResourceResponse() (response *DescribeAvailableResourceResponse) { + response = &DescribeAvailableResourceResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_bandwidth_limitation.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_bandwidth_limitation.go new file mode 100644 index 000000000..4fc98a4f6 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_bandwidth_limitation.go @@ -0,0 +1,112 @@ +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" +) + +// DescribeBandwidthLimitation invokes the ecs.DescribeBandwidthLimitation API synchronously +// api document: https://help.aliyun.com/api/ecs/describebandwidthlimitation.html +func (client *Client) DescribeBandwidthLimitation(request *DescribeBandwidthLimitationRequest) (response *DescribeBandwidthLimitationResponse, err error) { + response = CreateDescribeBandwidthLimitationResponse() + err = client.DoAction(request, response) + return +} + +// DescribeBandwidthLimitationWithChan invokes the ecs.DescribeBandwidthLimitation API asynchronously +// api document: https://help.aliyun.com/api/ecs/describebandwidthlimitation.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeBandwidthLimitationWithChan(request *DescribeBandwidthLimitationRequest) (<-chan *DescribeBandwidthLimitationResponse, <-chan error) { + responseChan := make(chan *DescribeBandwidthLimitationResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeBandwidthLimitation(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeBandwidthLimitationWithCallback invokes the ecs.DescribeBandwidthLimitation API asynchronously +// api document: https://help.aliyun.com/api/ecs/describebandwidthlimitation.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeBandwidthLimitationWithCallback(request *DescribeBandwidthLimitationRequest, callback func(response *DescribeBandwidthLimitationResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeBandwidthLimitationResponse + var err error + defer close(result) + response, err = client.DescribeBandwidthLimitation(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeBandwidthLimitationRequest is the request struct for api DescribeBandwidthLimitation +type DescribeBandwidthLimitationRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + InstanceType string `position:"Query" name:"InstanceType"` + InstanceChargeType string `position:"Query" name:"InstanceChargeType"` + ResourceId string `position:"Query" name:"ResourceId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OperationType string `position:"Query" name:"OperationType"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + SpotStrategy string `position:"Query" name:"SpotStrategy"` +} + +// DescribeBandwidthLimitationResponse is the response struct for api DescribeBandwidthLimitation +type DescribeBandwidthLimitationResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Bandwidths Bandwidths `json:"Bandwidths" xml:"Bandwidths"` +} + +// CreateDescribeBandwidthLimitationRequest creates a request to invoke DescribeBandwidthLimitation API +func CreateDescribeBandwidthLimitationRequest() (request *DescribeBandwidthLimitationRequest) { + request = &DescribeBandwidthLimitationRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeBandwidthLimitation", "ecs", "openAPI") + return +} + +// CreateDescribeBandwidthLimitationResponse creates a response to parse from DescribeBandwidthLimitation response +func CreateDescribeBandwidthLimitationResponse() (response *DescribeBandwidthLimitationResponse) { + response = &DescribeBandwidthLimitationResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_bandwidth_packages.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_bandwidth_packages.go new file mode 100644 index 000000000..b42218d5f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_bandwidth_packages.go @@ -0,0 +1,114 @@ +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" +) + +// DescribeBandwidthPackages invokes the ecs.DescribeBandwidthPackages API synchronously +// api document: https://help.aliyun.com/api/ecs/describebandwidthpackages.html +func (client *Client) DescribeBandwidthPackages(request *DescribeBandwidthPackagesRequest) (response *DescribeBandwidthPackagesResponse, err error) { + response = CreateDescribeBandwidthPackagesResponse() + err = client.DoAction(request, response) + return +} + +// DescribeBandwidthPackagesWithChan invokes the ecs.DescribeBandwidthPackages API asynchronously +// api document: https://help.aliyun.com/api/ecs/describebandwidthpackages.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeBandwidthPackagesWithChan(request *DescribeBandwidthPackagesRequest) (<-chan *DescribeBandwidthPackagesResponse, <-chan error) { + responseChan := make(chan *DescribeBandwidthPackagesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeBandwidthPackages(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeBandwidthPackagesWithCallback invokes the ecs.DescribeBandwidthPackages API asynchronously +// api document: https://help.aliyun.com/api/ecs/describebandwidthpackages.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeBandwidthPackagesWithCallback(request *DescribeBandwidthPackagesRequest, callback func(response *DescribeBandwidthPackagesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeBandwidthPackagesResponse + var err error + defer close(result) + response, err = client.DescribeBandwidthPackages(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeBandwidthPackagesRequest is the request struct for api DescribeBandwidthPackages +type DescribeBandwidthPackagesRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + BandwidthPackageId string `position:"Query" name:"BandwidthPackageId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + NatGatewayId string `position:"Query" name:"NatGatewayId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` +} + +// DescribeBandwidthPackagesResponse is the response struct for api DescribeBandwidthPackages +type DescribeBandwidthPackagesResponse 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"` + BandwidthPackages BandwidthPackages `json:"BandwidthPackages" xml:"BandwidthPackages"` +} + +// CreateDescribeBandwidthPackagesRequest creates a request to invoke DescribeBandwidthPackages API +func CreateDescribeBandwidthPackagesRequest() (request *DescribeBandwidthPackagesRequest) { + request = &DescribeBandwidthPackagesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeBandwidthPackages", "ecs", "openAPI") + return +} + +// CreateDescribeBandwidthPackagesResponse creates a response to parse from DescribeBandwidthPackages response +func CreateDescribeBandwidthPackagesResponse() (response *DescribeBandwidthPackagesResponse) { + response = &DescribeBandwidthPackagesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_classic_link_instances.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_classic_link_instances.go new file mode 100644 index 000000000..ac277cdaf --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_classic_link_instances.go @@ -0,0 +1,113 @@ +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" +) + +// DescribeClassicLinkInstances invokes the ecs.DescribeClassicLinkInstances API synchronously +// api document: https://help.aliyun.com/api/ecs/describeclassiclinkinstances.html +func (client *Client) DescribeClassicLinkInstances(request *DescribeClassicLinkInstancesRequest) (response *DescribeClassicLinkInstancesResponse, err error) { + response = CreateDescribeClassicLinkInstancesResponse() + err = client.DoAction(request, response) + return +} + +// DescribeClassicLinkInstancesWithChan invokes the ecs.DescribeClassicLinkInstances API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeclassiclinkinstances.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeClassicLinkInstancesWithChan(request *DescribeClassicLinkInstancesRequest) (<-chan *DescribeClassicLinkInstancesResponse, <-chan error) { + responseChan := make(chan *DescribeClassicLinkInstancesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeClassicLinkInstances(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeClassicLinkInstancesWithCallback invokes the ecs.DescribeClassicLinkInstances API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeclassiclinkinstances.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeClassicLinkInstancesWithCallback(request *DescribeClassicLinkInstancesRequest, callback func(response *DescribeClassicLinkInstancesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeClassicLinkInstancesResponse + var err error + defer close(result) + response, err = client.DescribeClassicLinkInstances(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeClassicLinkInstancesRequest is the request struct for api DescribeClassicLinkInstances +type DescribeClassicLinkInstancesRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + InstanceId string `position:"Query" name:"InstanceId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + VpcId string `position:"Query" name:"VpcId"` + PageSize string `position:"Query" name:"PageSize"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PageNumber string `position:"Query" name:"PageNumber"` +} + +// DescribeClassicLinkInstancesResponse is the response struct for api DescribeClassicLinkInstances +type DescribeClassicLinkInstancesResponse 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"` + Links Links `json:"Links" xml:"Links"` +} + +// CreateDescribeClassicLinkInstancesRequest creates a request to invoke DescribeClassicLinkInstances API +func CreateDescribeClassicLinkInstancesRequest() (request *DescribeClassicLinkInstancesRequest) { + request = &DescribeClassicLinkInstancesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeClassicLinkInstances", "ecs", "openAPI") + return +} + +// CreateDescribeClassicLinkInstancesResponse creates a response to parse from DescribeClassicLinkInstances response +func CreateDescribeClassicLinkInstancesResponse() (response *DescribeClassicLinkInstancesResponse) { + response = &DescribeClassicLinkInstancesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_cloud_assistant_status.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_cloud_assistant_status.go new file mode 100644 index 000000000..94f60a951 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_cloud_assistant_status.go @@ -0,0 +1,108 @@ +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" +) + +// DescribeCloudAssistantStatus invokes the ecs.DescribeCloudAssistantStatus API synchronously +// api document: https://help.aliyun.com/api/ecs/describecloudassistantstatus.html +func (client *Client) DescribeCloudAssistantStatus(request *DescribeCloudAssistantStatusRequest) (response *DescribeCloudAssistantStatusResponse, err error) { + response = CreateDescribeCloudAssistantStatusResponse() + err = client.DoAction(request, response) + return +} + +// DescribeCloudAssistantStatusWithChan invokes the ecs.DescribeCloudAssistantStatus API asynchronously +// api document: https://help.aliyun.com/api/ecs/describecloudassistantstatus.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeCloudAssistantStatusWithChan(request *DescribeCloudAssistantStatusRequest) (<-chan *DescribeCloudAssistantStatusResponse, <-chan error) { + responseChan := make(chan *DescribeCloudAssistantStatusResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeCloudAssistantStatus(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeCloudAssistantStatusWithCallback invokes the ecs.DescribeCloudAssistantStatus API asynchronously +// api document: https://help.aliyun.com/api/ecs/describecloudassistantstatus.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeCloudAssistantStatusWithCallback(request *DescribeCloudAssistantStatusRequest, callback func(response *DescribeCloudAssistantStatusResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeCloudAssistantStatusResponse + var err error + defer close(result) + response, err = client.DescribeCloudAssistantStatus(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeCloudAssistantStatusRequest is the request struct for api DescribeCloudAssistantStatus +type DescribeCloudAssistantStatusRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + InstanceId *[]string `position:"Query" name:"InstanceId" type:"Repeated"` +} + +// DescribeCloudAssistantStatusResponse is the response struct for api DescribeCloudAssistantStatus +type DescribeCloudAssistantStatusResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + InstanceCloudAssistantStatusSet InstanceCloudAssistantStatusSet `json:"InstanceCloudAssistantStatusSet" xml:"InstanceCloudAssistantStatusSet"` +} + +// CreateDescribeCloudAssistantStatusRequest creates a request to invoke DescribeCloudAssistantStatus API +func CreateDescribeCloudAssistantStatusRequest() (request *DescribeCloudAssistantStatusRequest) { + request = &DescribeCloudAssistantStatusRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeCloudAssistantStatus", "ecs", "openAPI") + return +} + +// CreateDescribeCloudAssistantStatusResponse creates a response to parse from DescribeCloudAssistantStatus response +func CreateDescribeCloudAssistantStatusResponse() (response *DescribeCloudAssistantStatusResponse) { + response = &DescribeCloudAssistantStatusResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_clusters.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_clusters.go new file mode 100644 index 000000000..e6307d9e9 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_clusters.go @@ -0,0 +1,107 @@ +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" +) + +// DescribeClusters invokes the ecs.DescribeClusters API synchronously +// api document: https://help.aliyun.com/api/ecs/describeclusters.html +func (client *Client) DescribeClusters(request *DescribeClustersRequest) (response *DescribeClustersResponse, err error) { + response = CreateDescribeClustersResponse() + err = client.DoAction(request, response) + return +} + +// DescribeClustersWithChan invokes the ecs.DescribeClusters API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeclusters.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeClustersWithChan(request *DescribeClustersRequest) (<-chan *DescribeClustersResponse, <-chan error) { + responseChan := make(chan *DescribeClustersResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeClusters(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeClustersWithCallback invokes the ecs.DescribeClusters API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeclusters.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeClustersWithCallback(request *DescribeClustersRequest, callback func(response *DescribeClustersResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeClustersResponse + var err error + defer close(result) + response, err = client.DescribeClusters(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeClustersRequest is the request struct for api DescribeClusters +type DescribeClustersRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DescribeClustersResponse is the response struct for api DescribeClusters +type DescribeClustersResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Clusters Clusters `json:"Clusters" xml:"Clusters"` +} + +// CreateDescribeClustersRequest creates a request to invoke DescribeClusters API +func CreateDescribeClustersRequest() (request *DescribeClustersRequest) { + request = &DescribeClustersRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeClusters", "ecs", "openAPI") + return +} + +// CreateDescribeClustersResponse creates a response to parse from DescribeClusters response +func CreateDescribeClustersResponse() (response *DescribeClustersResponse) { + response = &DescribeClustersResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_commands.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_commands.go new file mode 100644 index 000000000..bddf8f404 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_commands.go @@ -0,0 +1,116 @@ +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" +) + +// DescribeCommands invokes the ecs.DescribeCommands API synchronously +// api document: https://help.aliyun.com/api/ecs/describecommands.html +func (client *Client) DescribeCommands(request *DescribeCommandsRequest) (response *DescribeCommandsResponse, err error) { + response = CreateDescribeCommandsResponse() + err = client.DoAction(request, response) + return +} + +// DescribeCommandsWithChan invokes the ecs.DescribeCommands API asynchronously +// api document: https://help.aliyun.com/api/ecs/describecommands.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeCommandsWithChan(request *DescribeCommandsRequest) (<-chan *DescribeCommandsResponse, <-chan error) { + responseChan := make(chan *DescribeCommandsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeCommands(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeCommandsWithCallback invokes the ecs.DescribeCommands API asynchronously +// api document: https://help.aliyun.com/api/ecs/describecommands.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeCommandsWithCallback(request *DescribeCommandsRequest, callback func(response *DescribeCommandsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeCommandsResponse + var err error + defer close(result) + response, err = client.DescribeCommands(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeCommandsRequest is the request struct for api DescribeCommands +type DescribeCommandsRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + Description string `position:"Query" name:"Description"` + Type string `position:"Query" name:"Type"` + CommandId string `position:"Query" name:"CommandId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Name string `position:"Query" name:"Name"` +} + +// DescribeCommandsResponse is the response struct for api DescribeCommands +type DescribeCommandsResponse 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"` + Commands Commands `json:"Commands" xml:"Commands"` +} + +// CreateDescribeCommandsRequest creates a request to invoke DescribeCommands API +func CreateDescribeCommandsRequest() (request *DescribeCommandsRequest) { + request = &DescribeCommandsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeCommands", "ecs", "openAPI") + return +} + +// CreateDescribeCommandsResponse creates a response to parse from DescribeCommands response +func CreateDescribeCommandsResponse() (response *DescribeCommandsResponse) { + response = &DescribeCommandsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_dedicated_host_auto_renew.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_dedicated_host_auto_renew.go new file mode 100644 index 000000000..5ce5dfca6 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_dedicated_host_auto_renew.go @@ -0,0 +1,108 @@ +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" +) + +// DescribeDedicatedHostAutoRenew invokes the ecs.DescribeDedicatedHostAutoRenew API synchronously +// api document: https://help.aliyun.com/api/ecs/describededicatedhostautorenew.html +func (client *Client) DescribeDedicatedHostAutoRenew(request *DescribeDedicatedHostAutoRenewRequest) (response *DescribeDedicatedHostAutoRenewResponse, err error) { + response = CreateDescribeDedicatedHostAutoRenewResponse() + err = client.DoAction(request, response) + return +} + +// DescribeDedicatedHostAutoRenewWithChan invokes the ecs.DescribeDedicatedHostAutoRenew API asynchronously +// api document: https://help.aliyun.com/api/ecs/describededicatedhostautorenew.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeDedicatedHostAutoRenewWithChan(request *DescribeDedicatedHostAutoRenewRequest) (<-chan *DescribeDedicatedHostAutoRenewResponse, <-chan error) { + responseChan := make(chan *DescribeDedicatedHostAutoRenewResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeDedicatedHostAutoRenew(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeDedicatedHostAutoRenewWithCallback invokes the ecs.DescribeDedicatedHostAutoRenew API asynchronously +// api document: https://help.aliyun.com/api/ecs/describededicatedhostautorenew.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeDedicatedHostAutoRenewWithCallback(request *DescribeDedicatedHostAutoRenewRequest, callback func(response *DescribeDedicatedHostAutoRenewResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeDedicatedHostAutoRenewResponse + var err error + defer close(result) + response, err = client.DescribeDedicatedHostAutoRenew(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeDedicatedHostAutoRenewRequest is the request struct for api DescribeDedicatedHostAutoRenew +type DescribeDedicatedHostAutoRenewRequest struct { + *requests.RpcRequest + DedicatedHostIds string `position:"Query" name:"DedicatedHostIds"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DescribeDedicatedHostAutoRenewResponse is the response struct for api DescribeDedicatedHostAutoRenew +type DescribeDedicatedHostAutoRenewResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + DedicatedHostRenewAttributes DedicatedHostRenewAttributes `json:"DedicatedHostRenewAttributes" xml:"DedicatedHostRenewAttributes"` +} + +// CreateDescribeDedicatedHostAutoRenewRequest creates a request to invoke DescribeDedicatedHostAutoRenew API +func CreateDescribeDedicatedHostAutoRenewRequest() (request *DescribeDedicatedHostAutoRenewRequest) { + request = &DescribeDedicatedHostAutoRenewRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeDedicatedHostAutoRenew", "ecs", "openAPI") + return +} + +// CreateDescribeDedicatedHostAutoRenewResponse creates a response to parse from DescribeDedicatedHostAutoRenew response +func CreateDescribeDedicatedHostAutoRenewResponse() (response *DescribeDedicatedHostAutoRenewResponse) { + response = &DescribeDedicatedHostAutoRenewResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_dedicated_host_types.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_dedicated_host_types.go new file mode 100644 index 000000000..d708f87d7 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_dedicated_host_types.go @@ -0,0 +1,109 @@ +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" +) + +// DescribeDedicatedHostTypes invokes the ecs.DescribeDedicatedHostTypes API synchronously +// api document: https://help.aliyun.com/api/ecs/describededicatedhosttypes.html +func (client *Client) DescribeDedicatedHostTypes(request *DescribeDedicatedHostTypesRequest) (response *DescribeDedicatedHostTypesResponse, err error) { + response = CreateDescribeDedicatedHostTypesResponse() + err = client.DoAction(request, response) + return +} + +// DescribeDedicatedHostTypesWithChan invokes the ecs.DescribeDedicatedHostTypes API asynchronously +// api document: https://help.aliyun.com/api/ecs/describededicatedhosttypes.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeDedicatedHostTypesWithChan(request *DescribeDedicatedHostTypesRequest) (<-chan *DescribeDedicatedHostTypesResponse, <-chan error) { + responseChan := make(chan *DescribeDedicatedHostTypesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeDedicatedHostTypes(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeDedicatedHostTypesWithCallback invokes the ecs.DescribeDedicatedHostTypes API asynchronously +// api document: https://help.aliyun.com/api/ecs/describededicatedhosttypes.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeDedicatedHostTypesWithCallback(request *DescribeDedicatedHostTypesRequest, callback func(response *DescribeDedicatedHostTypesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeDedicatedHostTypesResponse + var err error + defer close(result) + response, err = client.DescribeDedicatedHostTypes(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeDedicatedHostTypesRequest is the request struct for api DescribeDedicatedHostTypes +type DescribeDedicatedHostTypesRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + SupportedInstanceTypeFamily string `position:"Query" name:"SupportedInstanceTypeFamily"` + DedicatedHostType string `position:"Query" name:"DedicatedHostType"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DescribeDedicatedHostTypesResponse is the response struct for api DescribeDedicatedHostTypes +type DescribeDedicatedHostTypesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + DedicatedHostTypes DedicatedHostTypes `json:"DedicatedHostTypes" xml:"DedicatedHostTypes"` +} + +// CreateDescribeDedicatedHostTypesRequest creates a request to invoke DescribeDedicatedHostTypes API +func CreateDescribeDedicatedHostTypesRequest() (request *DescribeDedicatedHostTypesRequest) { + request = &DescribeDedicatedHostTypesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeDedicatedHostTypes", "ecs", "openAPI") + return +} + +// CreateDescribeDedicatedHostTypesResponse creates a response to parse from DescribeDedicatedHostTypes response +func CreateDescribeDedicatedHostTypesResponse() (response *DescribeDedicatedHostTypesResponse) { + response = &DescribeDedicatedHostTypesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_dedicated_hosts.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_dedicated_hosts.go new file mode 100644 index 000000000..ae0363c3e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_dedicated_hosts.go @@ -0,0 +1,126 @@ +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" +) + +// DescribeDedicatedHosts invokes the ecs.DescribeDedicatedHosts API synchronously +// api document: https://help.aliyun.com/api/ecs/describededicatedhosts.html +func (client *Client) DescribeDedicatedHosts(request *DescribeDedicatedHostsRequest) (response *DescribeDedicatedHostsResponse, err error) { + response = CreateDescribeDedicatedHostsResponse() + err = client.DoAction(request, response) + return +} + +// DescribeDedicatedHostsWithChan invokes the ecs.DescribeDedicatedHosts API asynchronously +// api document: https://help.aliyun.com/api/ecs/describededicatedhosts.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeDedicatedHostsWithChan(request *DescribeDedicatedHostsRequest) (<-chan *DescribeDedicatedHostsResponse, <-chan error) { + responseChan := make(chan *DescribeDedicatedHostsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeDedicatedHosts(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeDedicatedHostsWithCallback invokes the ecs.DescribeDedicatedHosts API asynchronously +// api document: https://help.aliyun.com/api/ecs/describededicatedhosts.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeDedicatedHostsWithCallback(request *DescribeDedicatedHostsRequest, callback func(response *DescribeDedicatedHostsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeDedicatedHostsResponse + var err error + defer close(result) + response, err = client.DescribeDedicatedHosts(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeDedicatedHostsRequest is the request struct for api DescribeDedicatedHosts +type DescribeDedicatedHostsRequest struct { + *requests.RpcRequest + DedicatedHostIds string `position:"Query" name:"DedicatedHostIds"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + DedicatedHostName string `position:"Query" name:"DedicatedHostName"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` + ResourceGroupId string `position:"Query" name:"ResourceGroupId"` + LockReason string `position:"Query" name:"LockReason"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + ZoneId string `position:"Query" name:"ZoneId"` + DedicatedHostType string `position:"Query" name:"DedicatedHostType"` + Tag *[]DescribeDedicatedHostsTag `position:"Query" name:"Tag" type:"Repeated"` + Status string `position:"Query" name:"Status"` +} + +// DescribeDedicatedHostsTag is a repeated param struct in DescribeDedicatedHostsRequest +type DescribeDedicatedHostsTag struct { + Value string `name:"Value"` + Key string `name:"Key"` +} + +// DescribeDedicatedHostsResponse is the response struct for api DescribeDedicatedHosts +type DescribeDedicatedHostsResponse 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"` + DedicatedHosts DedicatedHosts `json:"DedicatedHosts" xml:"DedicatedHosts"` +} + +// CreateDescribeDedicatedHostsRequest creates a request to invoke DescribeDedicatedHosts API +func CreateDescribeDedicatedHostsRequest() (request *DescribeDedicatedHostsRequest) { + request = &DescribeDedicatedHostsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeDedicatedHosts", "ecs", "openAPI") + return +} + +// CreateDescribeDedicatedHostsResponse creates a response to parse from DescribeDedicatedHosts response +func CreateDescribeDedicatedHostsResponse() (response *DescribeDedicatedHostsResponse) { + response = &DescribeDedicatedHostsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_demands.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_demands.go new file mode 100644 index 000000000..f7f07e2a4 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_demands.go @@ -0,0 +1,126 @@ +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" +) + +// DescribeDemands invokes the ecs.DescribeDemands API synchronously +// api document: https://help.aliyun.com/api/ecs/describedemands.html +func (client *Client) DescribeDemands(request *DescribeDemandsRequest) (response *DescribeDemandsResponse, err error) { + response = CreateDescribeDemandsResponse() + err = client.DoAction(request, response) + return +} + +// DescribeDemandsWithChan invokes the ecs.DescribeDemands API asynchronously +// api document: https://help.aliyun.com/api/ecs/describedemands.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeDemandsWithChan(request *DescribeDemandsRequest) (<-chan *DescribeDemandsResponse, <-chan error) { + responseChan := make(chan *DescribeDemandsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeDemands(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeDemandsWithCallback invokes the ecs.DescribeDemands API asynchronously +// api document: https://help.aliyun.com/api/ecs/describedemands.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeDemandsWithCallback(request *DescribeDemandsRequest, callback func(response *DescribeDemandsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeDemandsResponse + var err error + defer close(result) + response, err = client.DescribeDemands(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeDemandsRequest is the request struct for api DescribeDemands +type DescribeDemandsRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + InstanceType string `position:"Query" name:"InstanceType"` + Tag *[]DescribeDemandsTag `position:"Query" name:"Tag" type:"Repeated"` + InstanceChargeType string `position:"Query" name:"InstanceChargeType"` + DryRun requests.Boolean `position:"Query" name:"DryRun"` + 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"` + DemandStatus *[]string `position:"Query" name:"DemandStatus" type:"Repeated"` + ZoneId string `position:"Query" name:"ZoneId"` +} + +// DescribeDemandsTag is a repeated param struct in DescribeDemandsRequest +type DescribeDemandsTag struct { + Key string `name:"Key"` + Value string `name:"Value"` +} + +// DescribeDemandsResponse is the response struct for api DescribeDemands +type DescribeDemandsResponse 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"` + RegionId string `json:"RegionId" xml:"RegionId"` + Demands Demands `json:"Demands" xml:"Demands"` +} + +// CreateDescribeDemandsRequest creates a request to invoke DescribeDemands API +func CreateDescribeDemandsRequest() (request *DescribeDemandsRequest) { + request = &DescribeDemandsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeDemands", "ecs", "openAPI") + return +} + +// CreateDescribeDemandsResponse creates a response to parse from DescribeDemands response +func CreateDescribeDemandsResponse() (response *DescribeDemandsResponse) { + response = &DescribeDemandsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_deployment_sets.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_deployment_sets.go new file mode 100644 index 000000000..05ed0b56b --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_deployment_sets.go @@ -0,0 +1,119 @@ +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" +) + +// DescribeDeploymentSets invokes the ecs.DescribeDeploymentSets API synchronously +// api document: https://help.aliyun.com/api/ecs/describedeploymentsets.html +func (client *Client) DescribeDeploymentSets(request *DescribeDeploymentSetsRequest) (response *DescribeDeploymentSetsResponse, err error) { + response = CreateDescribeDeploymentSetsResponse() + err = client.DoAction(request, response) + return +} + +// DescribeDeploymentSetsWithChan invokes the ecs.DescribeDeploymentSets API asynchronously +// api document: https://help.aliyun.com/api/ecs/describedeploymentsets.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeDeploymentSetsWithChan(request *DescribeDeploymentSetsRequest) (<-chan *DescribeDeploymentSetsResponse, <-chan error) { + responseChan := make(chan *DescribeDeploymentSetsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeDeploymentSets(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeDeploymentSetsWithCallback invokes the ecs.DescribeDeploymentSets API asynchronously +// api document: https://help.aliyun.com/api/ecs/describedeploymentsets.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeDeploymentSetsWithCallback(request *DescribeDeploymentSetsRequest, callback func(response *DescribeDeploymentSetsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeDeploymentSetsResponse + var err error + defer close(result) + response, err = client.DescribeDeploymentSets(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeDeploymentSetsRequest is the request struct for api DescribeDeploymentSets +type DescribeDeploymentSetsRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + NetworkType string `position:"Query" name:"NetworkType"` + DeploymentSetName string `position:"Query" name:"DeploymentSetName"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` + DeploymentSetIds string `position:"Query" name:"DeploymentSetIds"` + Granularity string `position:"Query" name:"Granularity"` + Domain string `position:"Query" name:"Domain"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + Strategy string `position:"Query" name:"Strategy"` +} + +// DescribeDeploymentSetsResponse is the response struct for api DescribeDeploymentSets +type DescribeDeploymentSetsResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + RegionId string `json:"RegionId" xml:"RegionId"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + PageNumber int `json:"PageNumber" xml:"PageNumber"` + PageSize int `json:"PageSize" xml:"PageSize"` + DeploymentSets DeploymentSets `json:"DeploymentSets" xml:"DeploymentSets"` +} + +// CreateDescribeDeploymentSetsRequest creates a request to invoke DescribeDeploymentSets API +func CreateDescribeDeploymentSetsRequest() (request *DescribeDeploymentSetsRequest) { + request = &DescribeDeploymentSetsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeDeploymentSets", "ecs", "openAPI") + return +} + +// CreateDescribeDeploymentSetsResponse creates a response to parse from DescribeDeploymentSets response +func CreateDescribeDeploymentSetsResponse() (response *DescribeDeploymentSetsResponse) { + response = &DescribeDeploymentSetsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_disk_monitor_data.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_disk_monitor_data.go new file mode 100644 index 000000000..ee9ed6ea4 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_disk_monitor_data.go @@ -0,0 +1,112 @@ +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" +) + +// DescribeDiskMonitorData invokes the ecs.DescribeDiskMonitorData API synchronously +// api document: https://help.aliyun.com/api/ecs/describediskmonitordata.html +func (client *Client) DescribeDiskMonitorData(request *DescribeDiskMonitorDataRequest) (response *DescribeDiskMonitorDataResponse, err error) { + response = CreateDescribeDiskMonitorDataResponse() + err = client.DoAction(request, response) + return +} + +// DescribeDiskMonitorDataWithChan invokes the ecs.DescribeDiskMonitorData API asynchronously +// api document: https://help.aliyun.com/api/ecs/describediskmonitordata.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeDiskMonitorDataWithChan(request *DescribeDiskMonitorDataRequest) (<-chan *DescribeDiskMonitorDataResponse, <-chan error) { + responseChan := make(chan *DescribeDiskMonitorDataResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeDiskMonitorData(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeDiskMonitorDataWithCallback invokes the ecs.DescribeDiskMonitorData API asynchronously +// api document: https://help.aliyun.com/api/ecs/describediskmonitordata.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeDiskMonitorDataWithCallback(request *DescribeDiskMonitorDataRequest, callback func(response *DescribeDiskMonitorDataResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeDiskMonitorDataResponse + var err error + defer close(result) + response, err = client.DescribeDiskMonitorData(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeDiskMonitorDataRequest is the request struct for api DescribeDiskMonitorData +type DescribeDiskMonitorDataRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + StartTime string `position:"Query" name:"StartTime"` + DiskId string `position:"Query" name:"DiskId"` + Period requests.Integer `position:"Query" name:"Period"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + EndTime string `position:"Query" name:"EndTime"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DescribeDiskMonitorDataResponse is the response struct for api DescribeDiskMonitorData +type DescribeDiskMonitorDataResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + MonitorData MonitorDataInDescribeDiskMonitorData `json:"MonitorData" xml:"MonitorData"` +} + +// CreateDescribeDiskMonitorDataRequest creates a request to invoke DescribeDiskMonitorData API +func CreateDescribeDiskMonitorDataRequest() (request *DescribeDiskMonitorDataRequest) { + request = &DescribeDiskMonitorDataRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeDiskMonitorData", "ecs", "openAPI") + return +} + +// CreateDescribeDiskMonitorDataResponse creates a response to parse from DescribeDiskMonitorData response +func CreateDescribeDiskMonitorDataResponse() (response *DescribeDiskMonitorDataResponse) { + response = &DescribeDiskMonitorDataResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_disks.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_disks.go new file mode 100644 index 000000000..7eab79e63 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_disks.go @@ -0,0 +1,145 @@ +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" +) + +// DescribeDisks invokes the ecs.DescribeDisks API synchronously +// api document: https://help.aliyun.com/api/ecs/describedisks.html +func (client *Client) DescribeDisks(request *DescribeDisksRequest) (response *DescribeDisksResponse, err error) { + response = CreateDescribeDisksResponse() + err = client.DoAction(request, response) + return +} + +// DescribeDisksWithChan invokes the ecs.DescribeDisks API asynchronously +// api document: https://help.aliyun.com/api/ecs/describedisks.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeDisksWithChan(request *DescribeDisksRequest) (<-chan *DescribeDisksResponse, <-chan error) { + responseChan := make(chan *DescribeDisksResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeDisks(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeDisksWithCallback invokes the ecs.DescribeDisks API asynchronously +// api document: https://help.aliyun.com/api/ecs/describedisks.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeDisksWithCallback(request *DescribeDisksRequest, callback func(response *DescribeDisksResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeDisksResponse + var err error + defer close(result) + response, err = client.DescribeDisks(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeDisksRequest is the request struct for api DescribeDisks +type DescribeDisksRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + SnapshotId string `position:"Query" name:"SnapshotId"` + Filter2Value string `position:"Query" name:"Filter.2.Value"` + AutoSnapshotPolicyId string `position:"Query" name:"AutoSnapshotPolicyId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` + DiskName string `position:"Query" name:"DiskName"` + DeleteAutoSnapshot requests.Boolean `position:"Query" name:"DeleteAutoSnapshot"` + ResourceGroupId string `position:"Query" name:"ResourceGroupId"` + DiskChargeType string `position:"Query" name:"DiskChargeType"` + LockReason string `position:"Query" name:"LockReason"` + Filter1Key string `position:"Query" name:"Filter.1.Key"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + DiskIds string `position:"Query" name:"DiskIds"` + Tag *[]DescribeDisksTag `position:"Query" name:"Tag" type:"Repeated"` + DeleteWithInstance requests.Boolean `position:"Query" name:"DeleteWithInstance"` + EnableAutoSnapshot requests.Boolean `position:"Query" name:"EnableAutoSnapshot"` + DryRun requests.Boolean `position:"Query" name:"DryRun"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Filter1Value string `position:"Query" name:"Filter.1.Value"` + Portable requests.Boolean `position:"Query" name:"Portable"` + EnableAutomatedSnapshotPolicy requests.Boolean `position:"Query" name:"EnableAutomatedSnapshotPolicy"` + Filter2Key string `position:"Query" name:"Filter.2.Key"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + DiskType string `position:"Query" name:"DiskType"` + AdditionalAttributes *[]string `position:"Query" name:"AdditionalAttributes" type:"Repeated"` + EnableShared requests.Boolean `position:"Query" name:"EnableShared"` + InstanceId string `position:"Query" name:"InstanceId"` + Encrypted requests.Boolean `position:"Query" name:"Encrypted"` + ZoneId string `position:"Query" name:"ZoneId"` + Category string `position:"Query" name:"Category"` + KMSKeyId string `position:"Query" name:"KMSKeyId"` + Status string `position:"Query" name:"Status"` +} + +// DescribeDisksTag is a repeated param struct in DescribeDisksRequest +type DescribeDisksTag struct { + Value string `name:"Value"` + Key string `name:"Key"` +} + +// DescribeDisksResponse is the response struct for api DescribeDisks +type DescribeDisksResponse 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"` + Disks Disks `json:"Disks" xml:"Disks"` +} + +// CreateDescribeDisksRequest creates a request to invoke DescribeDisks API +func CreateDescribeDisksRequest() (request *DescribeDisksRequest) { + request = &DescribeDisksRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeDisks", "ecs", "openAPI") + return +} + +// CreateDescribeDisksResponse creates a response to parse from DescribeDisks response +func CreateDescribeDisksResponse() (response *DescribeDisksResponse) { + response = &DescribeDisksResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_disks_full_status.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_disks_full_status.go new file mode 100644 index 000000000..d9ec70e3f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_disks_full_status.go @@ -0,0 +1,119 @@ +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" +) + +// DescribeDisksFullStatus invokes the ecs.DescribeDisksFullStatus API synchronously +// api document: https://help.aliyun.com/api/ecs/describedisksfullstatus.html +func (client *Client) DescribeDisksFullStatus(request *DescribeDisksFullStatusRequest) (response *DescribeDisksFullStatusResponse, err error) { + response = CreateDescribeDisksFullStatusResponse() + err = client.DoAction(request, response) + return +} + +// DescribeDisksFullStatusWithChan invokes the ecs.DescribeDisksFullStatus API asynchronously +// api document: https://help.aliyun.com/api/ecs/describedisksfullstatus.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeDisksFullStatusWithChan(request *DescribeDisksFullStatusRequest) (<-chan *DescribeDisksFullStatusResponse, <-chan error) { + responseChan := make(chan *DescribeDisksFullStatusResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeDisksFullStatus(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeDisksFullStatusWithCallback invokes the ecs.DescribeDisksFullStatus API asynchronously +// api document: https://help.aliyun.com/api/ecs/describedisksfullstatus.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeDisksFullStatusWithCallback(request *DescribeDisksFullStatusRequest, callback func(response *DescribeDisksFullStatusResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeDisksFullStatusResponse + var err error + defer close(result) + response, err = client.DescribeDisksFullStatus(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeDisksFullStatusRequest is the request struct for api DescribeDisksFullStatus +type DescribeDisksFullStatusRequest struct { + *requests.RpcRequest + EventId *[]string `position:"Query" name:"EventId" type:"Repeated"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` + EventTimeStart string `position:"Query" name:"EventTime.Start"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + DiskId *[]string `position:"Query" name:"DiskId" type:"Repeated"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + EventTimeEnd string `position:"Query" name:"EventTime.End"` + HealthStatus string `position:"Query" name:"HealthStatus"` + EventType string `position:"Query" name:"EventType"` + Status string `position:"Query" name:"Status"` +} + +// DescribeDisksFullStatusResponse is the response struct for api DescribeDisksFullStatus +type DescribeDisksFullStatusResponse 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"` + DiskFullStatusSet DiskFullStatusSet `json:"DiskFullStatusSet" xml:"DiskFullStatusSet"` +} + +// CreateDescribeDisksFullStatusRequest creates a request to invoke DescribeDisksFullStatus API +func CreateDescribeDisksFullStatusRequest() (request *DescribeDisksFullStatusRequest) { + request = &DescribeDisksFullStatusRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeDisksFullStatus", "ecs", "openAPI") + return +} + +// CreateDescribeDisksFullStatusResponse creates a response to parse from DescribeDisksFullStatus response +func CreateDescribeDisksFullStatusResponse() (response *DescribeDisksFullStatusResponse) { + response = &DescribeDisksFullStatusResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_eip_addresses.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_eip_addresses.go new file mode 100644 index 000000000..6f72aff39 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_eip_addresses.go @@ -0,0 +1,124 @@ +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" +) + +// DescribeEipAddresses invokes the ecs.DescribeEipAddresses API synchronously +// api document: https://help.aliyun.com/api/ecs/describeeipaddresses.html +func (client *Client) DescribeEipAddresses(request *DescribeEipAddressesRequest) (response *DescribeEipAddressesResponse, err error) { + response = CreateDescribeEipAddressesResponse() + err = client.DoAction(request, response) + return +} + +// DescribeEipAddressesWithChan invokes the ecs.DescribeEipAddresses API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeeipaddresses.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeEipAddressesWithChan(request *DescribeEipAddressesRequest) (<-chan *DescribeEipAddressesResponse, <-chan error) { + responseChan := make(chan *DescribeEipAddressesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeEipAddresses(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeEipAddressesWithCallback invokes the ecs.DescribeEipAddresses API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeeipaddresses.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeEipAddressesWithCallback(request *DescribeEipAddressesRequest, callback func(response *DescribeEipAddressesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeEipAddressesResponse + var err error + defer close(result) + response, err = client.DescribeEipAddresses(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeEipAddressesRequest is the request struct for api DescribeEipAddresses +type DescribeEipAddressesRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + Filter2Value string `position:"Query" name:"Filter.2.Value"` + ISP string `position:"Query" name:"ISP"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + AllocationId string `position:"Query" name:"AllocationId"` + Filter1Value string `position:"Query" name:"Filter.1.Value"` + Filter2Key string `position:"Query" name:"Filter.2.Key"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + EipAddress string `position:"Query" name:"EipAddress"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` + LockReason string `position:"Query" name:"LockReason"` + Filter1Key string `position:"Query" name:"Filter.1.Key"` + AssociatedInstanceType string `position:"Query" name:"AssociatedInstanceType"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + ChargeType string `position:"Query" name:"ChargeType"` + AssociatedInstanceId string `position:"Query" name:"AssociatedInstanceId"` + Status string `position:"Query" name:"Status"` +} + +// DescribeEipAddressesResponse is the response struct for api DescribeEipAddresses +type DescribeEipAddressesResponse 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"` + EipAddresses EipAddresses `json:"EipAddresses" xml:"EipAddresses"` +} + +// CreateDescribeEipAddressesRequest creates a request to invoke DescribeEipAddresses API +func CreateDescribeEipAddressesRequest() (request *DescribeEipAddressesRequest) { + request = &DescribeEipAddressesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeEipAddresses", "ecs", "openAPI") + return +} + +// CreateDescribeEipAddressesResponse creates a response to parse from DescribeEipAddresses response +func CreateDescribeEipAddressesResponse() (response *DescribeEipAddressesResponse) { + response = &DescribeEipAddressesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_eip_monitor_data.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_eip_monitor_data.go new file mode 100644 index 000000000..4efa1d896 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_eip_monitor_data.go @@ -0,0 +1,111 @@ +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" +) + +// DescribeEipMonitorData invokes the ecs.DescribeEipMonitorData API synchronously +// api document: https://help.aliyun.com/api/ecs/describeeipmonitordata.html +func (client *Client) DescribeEipMonitorData(request *DescribeEipMonitorDataRequest) (response *DescribeEipMonitorDataResponse, err error) { + response = CreateDescribeEipMonitorDataResponse() + err = client.DoAction(request, response) + return +} + +// DescribeEipMonitorDataWithChan invokes the ecs.DescribeEipMonitorData API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeeipmonitordata.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeEipMonitorDataWithChan(request *DescribeEipMonitorDataRequest) (<-chan *DescribeEipMonitorDataResponse, <-chan error) { + responseChan := make(chan *DescribeEipMonitorDataResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeEipMonitorData(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeEipMonitorDataWithCallback invokes the ecs.DescribeEipMonitorData API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeeipmonitordata.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeEipMonitorDataWithCallback(request *DescribeEipMonitorDataRequest, callback func(response *DescribeEipMonitorDataResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeEipMonitorDataResponse + var err error + defer close(result) + response, err = client.DescribeEipMonitorData(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeEipMonitorDataRequest is the request struct for api DescribeEipMonitorData +type DescribeEipMonitorDataRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + Period requests.Integer `position:"Query" name:"Period"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + EndTime string `position:"Query" name:"EndTime"` + AllocationId string `position:"Query" name:"AllocationId"` + StartTime string `position:"Query" name:"StartTime"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DescribeEipMonitorDataResponse is the response struct for api DescribeEipMonitorData +type DescribeEipMonitorDataResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + EipMonitorDatas EipMonitorDatasInDescribeEipMonitorData `json:"EipMonitorDatas" xml:"EipMonitorDatas"` +} + +// CreateDescribeEipMonitorDataRequest creates a request to invoke DescribeEipMonitorData API +func CreateDescribeEipMonitorDataRequest() (request *DescribeEipMonitorDataRequest) { + request = &DescribeEipMonitorDataRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeEipMonitorData", "ecs", "openAPI") + return +} + +// CreateDescribeEipMonitorDataResponse creates a response to parse from DescribeEipMonitorData response +func CreateDescribeEipMonitorDataResponse() (response *DescribeEipMonitorDataResponse) { + response = &DescribeEipMonitorDataResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_eni_monitor_data.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_eni_monitor_data.go new file mode 100644 index 000000000..75c143c8b --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_eni_monitor_data.go @@ -0,0 +1,113 @@ +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" +) + +// DescribeEniMonitorData invokes the ecs.DescribeEniMonitorData API synchronously +// api document: https://help.aliyun.com/api/ecs/describeenimonitordata.html +func (client *Client) DescribeEniMonitorData(request *DescribeEniMonitorDataRequest) (response *DescribeEniMonitorDataResponse, err error) { + response = CreateDescribeEniMonitorDataResponse() + err = client.DoAction(request, response) + return +} + +// DescribeEniMonitorDataWithChan invokes the ecs.DescribeEniMonitorData API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeenimonitordata.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeEniMonitorDataWithChan(request *DescribeEniMonitorDataRequest) (<-chan *DescribeEniMonitorDataResponse, <-chan error) { + responseChan := make(chan *DescribeEniMonitorDataResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeEniMonitorData(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeEniMonitorDataWithCallback invokes the ecs.DescribeEniMonitorData API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeenimonitordata.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeEniMonitorDataWithCallback(request *DescribeEniMonitorDataRequest, callback func(response *DescribeEniMonitorDataResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeEniMonitorDataResponse + var err error + defer close(result) + response, err = client.DescribeEniMonitorData(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeEniMonitorDataRequest is the request struct for api DescribeEniMonitorData +type DescribeEniMonitorDataRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + StartTime string `position:"Query" name:"StartTime"` + Period requests.Integer `position:"Query" name:"Period"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + EndTime string `position:"Query" name:"EndTime"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + InstanceId string `position:"Query" name:"InstanceId"` + EniId string `position:"Query" name:"EniId"` +} + +// DescribeEniMonitorDataResponse is the response struct for api DescribeEniMonitorData +type DescribeEniMonitorDataResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + MonitorData MonitorDataInDescribeEniMonitorData `json:"MonitorData" xml:"MonitorData"` +} + +// CreateDescribeEniMonitorDataRequest creates a request to invoke DescribeEniMonitorData API +func CreateDescribeEniMonitorDataRequest() (request *DescribeEniMonitorDataRequest) { + request = &DescribeEniMonitorDataRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeEniMonitorData", "ecs", "openAPI") + return +} + +// CreateDescribeEniMonitorDataResponse creates a response to parse from DescribeEniMonitorData response +func CreateDescribeEniMonitorDataResponse() (response *DescribeEniMonitorDataResponse) { + response = &DescribeEniMonitorDataResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_forward_table_entries.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_forward_table_entries.go new file mode 100644 index 000000000..674c92966 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_forward_table_entries.go @@ -0,0 +1,114 @@ +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" +) + +// DescribeForwardTableEntries invokes the ecs.DescribeForwardTableEntries API synchronously +// api document: https://help.aliyun.com/api/ecs/describeforwardtableentries.html +func (client *Client) DescribeForwardTableEntries(request *DescribeForwardTableEntriesRequest) (response *DescribeForwardTableEntriesResponse, err error) { + response = CreateDescribeForwardTableEntriesResponse() + err = client.DoAction(request, response) + return +} + +// DescribeForwardTableEntriesWithChan invokes the ecs.DescribeForwardTableEntries API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeforwardtableentries.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeForwardTableEntriesWithChan(request *DescribeForwardTableEntriesRequest) (<-chan *DescribeForwardTableEntriesResponse, <-chan error) { + responseChan := make(chan *DescribeForwardTableEntriesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeForwardTableEntries(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeForwardTableEntriesWithCallback invokes the ecs.DescribeForwardTableEntries API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeforwardtableentries.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeForwardTableEntriesWithCallback(request *DescribeForwardTableEntriesRequest, callback func(response *DescribeForwardTableEntriesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeForwardTableEntriesResponse + var err error + defer close(result) + response, err = client.DescribeForwardTableEntries(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeForwardTableEntriesRequest is the request struct for api DescribeForwardTableEntries +type DescribeForwardTableEntriesRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ForwardEntryId string `position:"Query" name:"ForwardEntryId"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + ForwardTableId string `position:"Query" name:"ForwardTableId"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` +} + +// DescribeForwardTableEntriesResponse is the response struct for api DescribeForwardTableEntries +type DescribeForwardTableEntriesResponse 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"` + ForwardTableEntries ForwardTableEntries `json:"ForwardTableEntries" xml:"ForwardTableEntries"` +} + +// CreateDescribeForwardTableEntriesRequest creates a request to invoke DescribeForwardTableEntries API +func CreateDescribeForwardTableEntriesRequest() (request *DescribeForwardTableEntriesRequest) { + request = &DescribeForwardTableEntriesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeForwardTableEntries", "ecs", "openAPI") + return +} + +// CreateDescribeForwardTableEntriesResponse creates a response to parse from DescribeForwardTableEntries response +func CreateDescribeForwardTableEntriesResponse() (response *DescribeForwardTableEntriesResponse) { + response = &DescribeForwardTableEntriesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_ha_vips.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_ha_vips.go new file mode 100644 index 000000000..9dbe5b13c --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_ha_vips.go @@ -0,0 +1,119 @@ +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" +) + +// DescribeHaVips invokes the ecs.DescribeHaVips API synchronously +// api document: https://help.aliyun.com/api/ecs/describehavips.html +func (client *Client) DescribeHaVips(request *DescribeHaVipsRequest) (response *DescribeHaVipsResponse, err error) { + response = CreateDescribeHaVipsResponse() + err = client.DoAction(request, response) + return +} + +// DescribeHaVipsWithChan invokes the ecs.DescribeHaVips API asynchronously +// api document: https://help.aliyun.com/api/ecs/describehavips.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeHaVipsWithChan(request *DescribeHaVipsRequest) (<-chan *DescribeHaVipsResponse, <-chan error) { + responseChan := make(chan *DescribeHaVipsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeHaVips(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeHaVipsWithCallback invokes the ecs.DescribeHaVips API asynchronously +// api document: https://help.aliyun.com/api/ecs/describehavips.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeHaVipsWithCallback(request *DescribeHaVipsRequest, callback func(response *DescribeHaVipsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeHaVipsResponse + var err error + defer close(result) + response, err = client.DescribeHaVips(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeHaVipsRequest is the request struct for api DescribeHaVips +type DescribeHaVipsRequest struct { + *requests.RpcRequest + Filter *[]DescribeHaVipsFilter `position:"Query" name:"Filter" type:"Repeated"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` +} + +// DescribeHaVipsFilter is a repeated param struct in DescribeHaVipsRequest +type DescribeHaVipsFilter struct { + Value *[]string `name:"Value" type:"Repeated"` + Key string `name:"Key"` +} + +// DescribeHaVipsResponse is the response struct for api DescribeHaVips +type DescribeHaVipsResponse 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"` + HaVips HaVips `json:"HaVips" xml:"HaVips"` +} + +// CreateDescribeHaVipsRequest creates a request to invoke DescribeHaVips API +func CreateDescribeHaVipsRequest() (request *DescribeHaVipsRequest) { + request = &DescribeHaVipsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeHaVips", "ecs", "openAPI") + return +} + +// CreateDescribeHaVipsResponse creates a response to parse from DescribeHaVips response +func CreateDescribeHaVipsResponse() (response *DescribeHaVipsResponse) { + response = &DescribeHaVipsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_hpc_clusters.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_hpc_clusters.go new file mode 100644 index 000000000..637ddc073 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_hpc_clusters.go @@ -0,0 +1,114 @@ +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" +) + +// DescribeHpcClusters invokes the ecs.DescribeHpcClusters API synchronously +// api document: https://help.aliyun.com/api/ecs/describehpcclusters.html +func (client *Client) DescribeHpcClusters(request *DescribeHpcClustersRequest) (response *DescribeHpcClustersResponse, err error) { + response = CreateDescribeHpcClustersResponse() + err = client.DoAction(request, response) + return +} + +// DescribeHpcClustersWithChan invokes the ecs.DescribeHpcClusters API asynchronously +// api document: https://help.aliyun.com/api/ecs/describehpcclusters.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeHpcClustersWithChan(request *DescribeHpcClustersRequest) (<-chan *DescribeHpcClustersResponse, <-chan error) { + responseChan := make(chan *DescribeHpcClustersResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeHpcClusters(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeHpcClustersWithCallback invokes the ecs.DescribeHpcClusters API asynchronously +// api document: https://help.aliyun.com/api/ecs/describehpcclusters.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeHpcClustersWithCallback(request *DescribeHpcClustersRequest, callback func(response *DescribeHpcClustersResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeHpcClustersResponse + var err error + defer close(result) + response, err = client.DescribeHpcClusters(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeHpcClustersRequest is the request struct for api DescribeHpcClusters +type DescribeHpcClustersRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ClientToken string `position:"Query" name:"ClientToken"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + HpcClusterIds string `position:"Query" name:"HpcClusterIds"` +} + +// DescribeHpcClustersResponse is the response struct for api DescribeHpcClusters +type DescribeHpcClustersResponse 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"` + HpcClusters HpcClusters `json:"HpcClusters" xml:"HpcClusters"` +} + +// CreateDescribeHpcClustersRequest creates a request to invoke DescribeHpcClusters API +func CreateDescribeHpcClustersRequest() (request *DescribeHpcClustersRequest) { + request = &DescribeHpcClustersRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeHpcClusters", "ecs", "openAPI") + return +} + +// CreateDescribeHpcClustersResponse creates a response to parse from DescribeHpcClusters response +func CreateDescribeHpcClustersResponse() (response *DescribeHpcClustersResponse) { + response = &DescribeHpcClustersResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_image_share_permission.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_image_share_permission.go new file mode 100644 index 000000000..ff10b8d4b --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_image_share_permission.go @@ -0,0 +1,116 @@ +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" +) + +// DescribeImageSharePermission invokes the ecs.DescribeImageSharePermission API synchronously +// api document: https://help.aliyun.com/api/ecs/describeimagesharepermission.html +func (client *Client) DescribeImageSharePermission(request *DescribeImageSharePermissionRequest) (response *DescribeImageSharePermissionResponse, err error) { + response = CreateDescribeImageSharePermissionResponse() + err = client.DoAction(request, response) + return +} + +// DescribeImageSharePermissionWithChan invokes the ecs.DescribeImageSharePermission API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeimagesharepermission.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeImageSharePermissionWithChan(request *DescribeImageSharePermissionRequest) (<-chan *DescribeImageSharePermissionResponse, <-chan error) { + responseChan := make(chan *DescribeImageSharePermissionResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeImageSharePermission(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeImageSharePermissionWithCallback invokes the ecs.DescribeImageSharePermission API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeimagesharepermission.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeImageSharePermissionWithCallback(request *DescribeImageSharePermissionRequest, callback func(response *DescribeImageSharePermissionResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeImageSharePermissionResponse + var err error + defer close(result) + response, err = client.DescribeImageSharePermission(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeImageSharePermissionRequest is the request struct for api DescribeImageSharePermission +type DescribeImageSharePermissionRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ImageId string `position:"Query" name:"ImageId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` +} + +// DescribeImageSharePermissionResponse is the response struct for api DescribeImageSharePermission +type DescribeImageSharePermissionResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + RegionId string `json:"RegionId" xml:"RegionId"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + PageNumber int `json:"PageNumber" xml:"PageNumber"` + PageSize int `json:"PageSize" xml:"PageSize"` + ImageId string `json:"ImageId" xml:"ImageId"` + ShareGroups ShareGroups `json:"ShareGroups" xml:"ShareGroups"` + Accounts Accounts `json:"Accounts" xml:"Accounts"` +} + +// CreateDescribeImageSharePermissionRequest creates a request to invoke DescribeImageSharePermission API +func CreateDescribeImageSharePermissionRequest() (request *DescribeImageSharePermissionRequest) { + request = &DescribeImageSharePermissionRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeImageSharePermission", "ecs", "openAPI") + return +} + +// CreateDescribeImageSharePermissionResponse creates a response to parse from DescribeImageSharePermission response +func CreateDescribeImageSharePermissionResponse() (response *DescribeImageSharePermissionResponse) { + response = &DescribeImageSharePermissionResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_image_support_instance_types.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_image_support_instance_types.go new file mode 100644 index 000000000..bb11efd6c --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_image_support_instance_types.go @@ -0,0 +1,117 @@ +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" +) + +// DescribeImageSupportInstanceTypes invokes the ecs.DescribeImageSupportInstanceTypes API synchronously +// api document: https://help.aliyun.com/api/ecs/describeimagesupportinstancetypes.html +func (client *Client) DescribeImageSupportInstanceTypes(request *DescribeImageSupportInstanceTypesRequest) (response *DescribeImageSupportInstanceTypesResponse, err error) { + response = CreateDescribeImageSupportInstanceTypesResponse() + err = client.DoAction(request, response) + return +} + +// DescribeImageSupportInstanceTypesWithChan invokes the ecs.DescribeImageSupportInstanceTypes API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeimagesupportinstancetypes.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeImageSupportInstanceTypesWithChan(request *DescribeImageSupportInstanceTypesRequest) (<-chan *DescribeImageSupportInstanceTypesResponse, <-chan error) { + responseChan := make(chan *DescribeImageSupportInstanceTypesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeImageSupportInstanceTypes(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeImageSupportInstanceTypesWithCallback invokes the ecs.DescribeImageSupportInstanceTypes API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeimagesupportinstancetypes.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeImageSupportInstanceTypesWithCallback(request *DescribeImageSupportInstanceTypesRequest, callback func(response *DescribeImageSupportInstanceTypesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeImageSupportInstanceTypesResponse + var err error + defer close(result) + response, err = client.DescribeImageSupportInstanceTypes(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeImageSupportInstanceTypesRequest is the request struct for api DescribeImageSupportInstanceTypes +type DescribeImageSupportInstanceTypesRequest struct { + *requests.RpcRequest + ActionType string `position:"Query" name:"ActionType"` + Filter *[]DescribeImageSupportInstanceTypesFilter `position:"Query" name:"Filter" type:"Repeated"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ImageId string `position:"Query" name:"ImageId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DescribeImageSupportInstanceTypesFilter is a repeated param struct in DescribeImageSupportInstanceTypesRequest +type DescribeImageSupportInstanceTypesFilter struct { + Value string `name:"Value"` + Key string `name:"Key"` +} + +// DescribeImageSupportInstanceTypesResponse is the response struct for api DescribeImageSupportInstanceTypes +type DescribeImageSupportInstanceTypesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + RegionId string `json:"RegionId" xml:"RegionId"` + ImageId string `json:"ImageId" xml:"ImageId"` + InstanceTypes InstanceTypesInDescribeImageSupportInstanceTypes `json:"InstanceTypes" xml:"InstanceTypes"` +} + +// CreateDescribeImageSupportInstanceTypesRequest creates a request to invoke DescribeImageSupportInstanceTypes API +func CreateDescribeImageSupportInstanceTypesRequest() (request *DescribeImageSupportInstanceTypesRequest) { + request = &DescribeImageSupportInstanceTypesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeImageSupportInstanceTypes", "ecs", "openAPI") + return +} + +// CreateDescribeImageSupportInstanceTypesResponse creates a response to parse from DescribeImageSupportInstanceTypes response +func CreateDescribeImageSupportInstanceTypesResponse() (response *DescribeImageSupportInstanceTypesResponse) { + response = &DescribeImageSupportInstanceTypesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_images.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_images.go new file mode 100644 index 000000000..d0b64ab64 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_images.go @@ -0,0 +1,142 @@ +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" +) + +// DescribeImages invokes the ecs.DescribeImages API synchronously +// api document: https://help.aliyun.com/api/ecs/describeimages.html +func (client *Client) DescribeImages(request *DescribeImagesRequest) (response *DescribeImagesResponse, err error) { + response = CreateDescribeImagesResponse() + err = client.DoAction(request, response) + return +} + +// DescribeImagesWithChan invokes the ecs.DescribeImages API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeimages.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeImagesWithChan(request *DescribeImagesRequest) (<-chan *DescribeImagesResponse, <-chan error) { + responseChan := make(chan *DescribeImagesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeImages(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeImagesWithCallback invokes the ecs.DescribeImages API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeimages.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeImagesWithCallback(request *DescribeImagesRequest, callback func(response *DescribeImagesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeImagesResponse + var err error + defer close(result) + response, err = client.DescribeImages(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeImagesRequest is the request struct for api DescribeImages +type DescribeImagesRequest struct { + *requests.RpcRequest + ActionType string `position:"Query" name:"ActionType"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ImageId string `position:"Query" name:"ImageId"` + SnapshotId string `position:"Query" name:"SnapshotId"` + Usage string `position:"Query" name:"Usage"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` + ImageOwnerAlias string `position:"Query" name:"ImageOwnerAlias"` + ResourceGroupId string `position:"Query" name:"ResourceGroupId"` + IsSupportIoOptimized requests.Boolean `position:"Query" name:"IsSupportIoOptimized"` + ImageName string `position:"Query" name:"ImageName"` + IsSupportCloudinit requests.Boolean `position:"Query" name:"IsSupportCloudinit"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + InstanceType string `position:"Query" name:"InstanceType"` + Tag *[]DescribeImagesTag `position:"Query" name:"Tag" type:"Repeated"` + Architecture string `position:"Query" name:"Architecture"` + DryRun requests.Boolean `position:"Query" name:"DryRun"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + ShowExpired requests.Boolean `position:"Query" name:"ShowExpired"` + OSType string `position:"Query" name:"OSType"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Filter *[]DescribeImagesFilter `position:"Query" name:"Filter" type:"Repeated"` + Status string `position:"Query" name:"Status"` +} + +// DescribeImagesTag is a repeated param struct in DescribeImagesRequest +type DescribeImagesTag struct { + Value string `name:"Value"` + Key string `name:"Key"` +} + +// DescribeImagesFilter is a repeated param struct in DescribeImagesRequest +type DescribeImagesFilter struct { + Value string `name:"Value"` + Key string `name:"Key"` +} + +// DescribeImagesResponse is the response struct for api DescribeImages +type DescribeImagesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + RegionId string `json:"RegionId" xml:"RegionId"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + PageNumber int `json:"PageNumber" xml:"PageNumber"` + PageSize int `json:"PageSize" xml:"PageSize"` + Images Images `json:"Images" xml:"Images"` +} + +// CreateDescribeImagesRequest creates a request to invoke DescribeImages API +func CreateDescribeImagesRequest() (request *DescribeImagesRequest) { + request = &DescribeImagesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeImages", "ecs", "openAPI") + return +} + +// CreateDescribeImagesResponse creates a response to parse from DescribeImages response +func CreateDescribeImagesResponse() (response *DescribeImagesResponse) { + response = &DescribeImagesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_instance_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_instance_attribute.go new file mode 100644 index 000000000..66d399089 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_instance_attribute.go @@ -0,0 +1,138 @@ +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" +) + +// DescribeInstanceAttribute invokes the ecs.DescribeInstanceAttribute API synchronously +// api document: https://help.aliyun.com/api/ecs/describeinstanceattribute.html +func (client *Client) DescribeInstanceAttribute(request *DescribeInstanceAttributeRequest) (response *DescribeInstanceAttributeResponse, err error) { + response = CreateDescribeInstanceAttributeResponse() + err = client.DoAction(request, response) + return +} + +// DescribeInstanceAttributeWithChan invokes the ecs.DescribeInstanceAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeinstanceattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeInstanceAttributeWithChan(request *DescribeInstanceAttributeRequest) (<-chan *DescribeInstanceAttributeResponse, <-chan error) { + responseChan := make(chan *DescribeInstanceAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeInstanceAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeInstanceAttributeWithCallback invokes the ecs.DescribeInstanceAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeinstanceattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeInstanceAttributeWithCallback(request *DescribeInstanceAttributeRequest, callback func(response *DescribeInstanceAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeInstanceAttributeResponse + var err error + defer close(result) + response, err = client.DescribeInstanceAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeInstanceAttributeRequest is the request struct for api DescribeInstanceAttribute +type DescribeInstanceAttributeRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + InstanceId string `position:"Query" name:"InstanceId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DescribeInstanceAttributeResponse is the response struct for api DescribeInstanceAttribute +type DescribeInstanceAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + InstanceId string `json:"InstanceId" xml:"InstanceId"` + InstanceName string `json:"InstanceName" xml:"InstanceName"` + ImageId string `json:"ImageId" xml:"ImageId"` + RegionId string `json:"RegionId" xml:"RegionId"` + ZoneId string `json:"ZoneId" xml:"ZoneId"` + ClusterId string `json:"ClusterId" xml:"ClusterId"` + InstanceType string `json:"InstanceType" xml:"InstanceType"` + Cpu int `json:"Cpu" xml:"Cpu"` + Memory int `json:"Memory" xml:"Memory"` + HostName string `json:"HostName" xml:"HostName"` + Status string `json:"Status" xml:"Status"` + InternetChargeType string `json:"InternetChargeType" xml:"InternetChargeType"` + InternetMaxBandwidthIn int `json:"InternetMaxBandwidthIn" xml:"InternetMaxBandwidthIn"` + InternetMaxBandwidthOut int `json:"InternetMaxBandwidthOut" xml:"InternetMaxBandwidthOut"` + VlanId string `json:"VlanId" xml:"VlanId"` + SerialNumber string `json:"SerialNumber" xml:"SerialNumber"` + CreationTime string `json:"CreationTime" xml:"CreationTime"` + Description string `json:"Description" xml:"Description"` + InstanceNetworkType string `json:"InstanceNetworkType" xml:"InstanceNetworkType"` + IoOptimized string `json:"IoOptimized" xml:"IoOptimized"` + InstanceChargeType string `json:"InstanceChargeType" xml:"InstanceChargeType"` + ExpiredTime string `json:"ExpiredTime" xml:"ExpiredTime"` + StoppedMode string `json:"StoppedMode" xml:"StoppedMode"` + CreditSpecification string `json:"CreditSpecification" xml:"CreditSpecification"` + SecurityGroupIds SecurityGroupIdsInDescribeInstanceAttribute `json:"SecurityGroupIds" xml:"SecurityGroupIds"` + PublicIpAddress PublicIpAddressInDescribeInstanceAttribute `json:"PublicIpAddress" xml:"PublicIpAddress"` + InnerIpAddress InnerIpAddressInDescribeInstanceAttribute `json:"InnerIpAddress" xml:"InnerIpAddress"` + VpcAttributes VpcAttributes `json:"VpcAttributes" xml:"VpcAttributes"` + EipAddress EipAddress `json:"EipAddress" xml:"EipAddress"` + DedicatedHostAttribute DedicatedHostAttribute `json:"DedicatedHostAttribute" xml:"DedicatedHostAttribute"` + OperationLocks OperationLocksInDescribeInstanceAttribute `json:"OperationLocks" xml:"OperationLocks"` +} + +// CreateDescribeInstanceAttributeRequest creates a request to invoke DescribeInstanceAttribute API +func CreateDescribeInstanceAttributeRequest() (request *DescribeInstanceAttributeRequest) { + request = &DescribeInstanceAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeInstanceAttribute", "ecs", "openAPI") + return +} + +// CreateDescribeInstanceAttributeResponse creates a response to parse from DescribeInstanceAttribute response +func CreateDescribeInstanceAttributeResponse() (response *DescribeInstanceAttributeResponse) { + response = &DescribeInstanceAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_instance_auto_renew_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_instance_auto_renew_attribute.go new file mode 100644 index 000000000..7f04ff3de --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_instance_auto_renew_attribute.go @@ -0,0 +1,114 @@ +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" +) + +// DescribeInstanceAutoRenewAttribute invokes the ecs.DescribeInstanceAutoRenewAttribute API synchronously +// api document: https://help.aliyun.com/api/ecs/describeinstanceautorenewattribute.html +func (client *Client) DescribeInstanceAutoRenewAttribute(request *DescribeInstanceAutoRenewAttributeRequest) (response *DescribeInstanceAutoRenewAttributeResponse, err error) { + response = CreateDescribeInstanceAutoRenewAttributeResponse() + err = client.DoAction(request, response) + return +} + +// DescribeInstanceAutoRenewAttributeWithChan invokes the ecs.DescribeInstanceAutoRenewAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeinstanceautorenewattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeInstanceAutoRenewAttributeWithChan(request *DescribeInstanceAutoRenewAttributeRequest) (<-chan *DescribeInstanceAutoRenewAttributeResponse, <-chan error) { + responseChan := make(chan *DescribeInstanceAutoRenewAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeInstanceAutoRenewAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeInstanceAutoRenewAttributeWithCallback invokes the ecs.DescribeInstanceAutoRenewAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeinstanceautorenewattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeInstanceAutoRenewAttributeWithCallback(request *DescribeInstanceAutoRenewAttributeRequest, callback func(response *DescribeInstanceAutoRenewAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeInstanceAutoRenewAttributeResponse + var err error + defer close(result) + response, err = client.DescribeInstanceAutoRenewAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeInstanceAutoRenewAttributeRequest is the request struct for api DescribeInstanceAutoRenewAttribute +type DescribeInstanceAutoRenewAttributeRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + InstanceId string `position:"Query" name:"InstanceId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + RenewalStatus string `position:"Query" name:"RenewalStatus"` + PageSize string `position:"Query" name:"PageSize"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PageNumber string `position:"Query" name:"PageNumber"` +} + +// DescribeInstanceAutoRenewAttributeResponse is the response struct for api DescribeInstanceAutoRenewAttribute +type DescribeInstanceAutoRenewAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + PageNumber int `json:"PageNumber" xml:"PageNumber"` + PageSize int `json:"PageSize" xml:"PageSize"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + InstanceRenewAttributes InstanceRenewAttributes `json:"InstanceRenewAttributes" xml:"InstanceRenewAttributes"` +} + +// CreateDescribeInstanceAutoRenewAttributeRequest creates a request to invoke DescribeInstanceAutoRenewAttribute API +func CreateDescribeInstanceAutoRenewAttributeRequest() (request *DescribeInstanceAutoRenewAttributeRequest) { + request = &DescribeInstanceAutoRenewAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeInstanceAutoRenewAttribute", "ecs", "openAPI") + return +} + +// CreateDescribeInstanceAutoRenewAttributeResponse creates a response to parse from DescribeInstanceAutoRenewAttribute response +func CreateDescribeInstanceAutoRenewAttributeResponse() (response *DescribeInstanceAutoRenewAttributeResponse) { + response = &DescribeInstanceAutoRenewAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_instance_history_events.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_instance_history_events.go new file mode 100644 index 000000000..b4ab9f06b --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_instance_history_events.go @@ -0,0 +1,122 @@ +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" +) + +// DescribeInstanceHistoryEvents invokes the ecs.DescribeInstanceHistoryEvents API synchronously +// api document: https://help.aliyun.com/api/ecs/describeinstancehistoryevents.html +func (client *Client) DescribeInstanceHistoryEvents(request *DescribeInstanceHistoryEventsRequest) (response *DescribeInstanceHistoryEventsResponse, err error) { + response = CreateDescribeInstanceHistoryEventsResponse() + err = client.DoAction(request, response) + return +} + +// DescribeInstanceHistoryEventsWithChan invokes the ecs.DescribeInstanceHistoryEvents API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeinstancehistoryevents.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeInstanceHistoryEventsWithChan(request *DescribeInstanceHistoryEventsRequest) (<-chan *DescribeInstanceHistoryEventsResponse, <-chan error) { + responseChan := make(chan *DescribeInstanceHistoryEventsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeInstanceHistoryEvents(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeInstanceHistoryEventsWithCallback invokes the ecs.DescribeInstanceHistoryEvents API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeinstancehistoryevents.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeInstanceHistoryEventsWithCallback(request *DescribeInstanceHistoryEventsRequest, callback func(response *DescribeInstanceHistoryEventsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeInstanceHistoryEventsResponse + var err error + defer close(result) + response, err = client.DescribeInstanceHistoryEvents(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeInstanceHistoryEventsRequest is the request struct for api DescribeInstanceHistoryEvents +type DescribeInstanceHistoryEventsRequest struct { + *requests.RpcRequest + EventId *[]string `position:"Query" name:"EventId" type:"Repeated"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + EventCycleStatus string `position:"Query" name:"EventCycleStatus"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + InstanceEventCycleStatus *[]string `position:"Query" name:"InstanceEventCycleStatus" type:"Repeated"` + EventPublishTimeEnd string `position:"Query" name:"EventPublishTime.End"` + InstanceEventType *[]string `position:"Query" name:"InstanceEventType" type:"Repeated"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + NotBeforeStart string `position:"Query" name:"NotBefore.Start"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + EventPublishTimeStart string `position:"Query" name:"EventPublishTime.Start"` + InstanceId string `position:"Query" name:"InstanceId"` + NotBeforeEnd string `position:"Query" name:"NotBefore.End"` + EventType string `position:"Query" name:"EventType"` +} + +// DescribeInstanceHistoryEventsResponse is the response struct for api DescribeInstanceHistoryEvents +type DescribeInstanceHistoryEventsResponse 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"` + InstanceSystemEventSet InstanceSystemEventSet `json:"InstanceSystemEventSet" xml:"InstanceSystemEventSet"` +} + +// CreateDescribeInstanceHistoryEventsRequest creates a request to invoke DescribeInstanceHistoryEvents API +func CreateDescribeInstanceHistoryEventsRequest() (request *DescribeInstanceHistoryEventsRequest) { + request = &DescribeInstanceHistoryEventsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeInstanceHistoryEvents", "ecs", "openAPI") + return +} + +// CreateDescribeInstanceHistoryEventsResponse creates a response to parse from DescribeInstanceHistoryEvents response +func CreateDescribeInstanceHistoryEventsResponse() (response *DescribeInstanceHistoryEventsResponse) { + response = &DescribeInstanceHistoryEventsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_instance_monitor_data.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_instance_monitor_data.go new file mode 100644 index 000000000..e9636eef6 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_instance_monitor_data.go @@ -0,0 +1,111 @@ +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" +) + +// DescribeInstanceMonitorData invokes the ecs.DescribeInstanceMonitorData API synchronously +// api document: https://help.aliyun.com/api/ecs/describeinstancemonitordata.html +func (client *Client) DescribeInstanceMonitorData(request *DescribeInstanceMonitorDataRequest) (response *DescribeInstanceMonitorDataResponse, err error) { + response = CreateDescribeInstanceMonitorDataResponse() + err = client.DoAction(request, response) + return +} + +// DescribeInstanceMonitorDataWithChan invokes the ecs.DescribeInstanceMonitorData API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeinstancemonitordata.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeInstanceMonitorDataWithChan(request *DescribeInstanceMonitorDataRequest) (<-chan *DescribeInstanceMonitorDataResponse, <-chan error) { + responseChan := make(chan *DescribeInstanceMonitorDataResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeInstanceMonitorData(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeInstanceMonitorDataWithCallback invokes the ecs.DescribeInstanceMonitorData API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeinstancemonitordata.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeInstanceMonitorDataWithCallback(request *DescribeInstanceMonitorDataRequest, callback func(response *DescribeInstanceMonitorDataResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeInstanceMonitorDataResponse + var err error + defer close(result) + response, err = client.DescribeInstanceMonitorData(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeInstanceMonitorDataRequest is the request struct for api DescribeInstanceMonitorData +type DescribeInstanceMonitorDataRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + StartTime string `position:"Query" name:"StartTime"` + Period requests.Integer `position:"Query" name:"Period"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + EndTime string `position:"Query" name:"EndTime"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + InstanceId string `position:"Query" name:"InstanceId"` +} + +// DescribeInstanceMonitorDataResponse is the response struct for api DescribeInstanceMonitorData +type DescribeInstanceMonitorDataResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + MonitorData MonitorDataInDescribeInstanceMonitorData `json:"MonitorData" xml:"MonitorData"` +} + +// CreateDescribeInstanceMonitorDataRequest creates a request to invoke DescribeInstanceMonitorData API +func CreateDescribeInstanceMonitorDataRequest() (request *DescribeInstanceMonitorDataRequest) { + request = &DescribeInstanceMonitorDataRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeInstanceMonitorData", "ecs", "openAPI") + return +} + +// CreateDescribeInstanceMonitorDataResponse creates a response to parse from DescribeInstanceMonitorData response +func CreateDescribeInstanceMonitorDataResponse() (response *DescribeInstanceMonitorDataResponse) { + response = &DescribeInstanceMonitorDataResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_instance_physical_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_instance_physical_attribute.go new file mode 100644 index 000000000..b5299bb42 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_instance_physical_attribute.go @@ -0,0 +1,111 @@ +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" +) + +// DescribeInstancePhysicalAttribute invokes the ecs.DescribeInstancePhysicalAttribute API synchronously +// api document: https://help.aliyun.com/api/ecs/describeinstancephysicalattribute.html +func (client *Client) DescribeInstancePhysicalAttribute(request *DescribeInstancePhysicalAttributeRequest) (response *DescribeInstancePhysicalAttributeResponse, err error) { + response = CreateDescribeInstancePhysicalAttributeResponse() + err = client.DoAction(request, response) + return +} + +// DescribeInstancePhysicalAttributeWithChan invokes the ecs.DescribeInstancePhysicalAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeinstancephysicalattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeInstancePhysicalAttributeWithChan(request *DescribeInstancePhysicalAttributeRequest) (<-chan *DescribeInstancePhysicalAttributeResponse, <-chan error) { + responseChan := make(chan *DescribeInstancePhysicalAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeInstancePhysicalAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeInstancePhysicalAttributeWithCallback invokes the ecs.DescribeInstancePhysicalAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeinstancephysicalattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeInstancePhysicalAttributeWithCallback(request *DescribeInstancePhysicalAttributeRequest, callback func(response *DescribeInstancePhysicalAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeInstancePhysicalAttributeResponse + var err error + defer close(result) + response, err = client.DescribeInstancePhysicalAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeInstancePhysicalAttributeRequest is the request struct for api DescribeInstancePhysicalAttribute +type DescribeInstancePhysicalAttributeRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + InstanceId string `position:"Query" name:"InstanceId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DescribeInstancePhysicalAttributeResponse is the response struct for api DescribeInstancePhysicalAttribute +type DescribeInstancePhysicalAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + InstanceId string `json:"InstanceId" xml:"InstanceId"` + VlanId string `json:"VlanId" xml:"VlanId"` + NodeControllerId string `json:"NodeControllerId" xml:"NodeControllerId"` + RackId string `json:"RackId" xml:"RackId"` +} + +// CreateDescribeInstancePhysicalAttributeRequest creates a request to invoke DescribeInstancePhysicalAttribute API +func CreateDescribeInstancePhysicalAttributeRequest() (request *DescribeInstancePhysicalAttributeRequest) { + request = &DescribeInstancePhysicalAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeInstancePhysicalAttribute", "ecs", "openAPI") + return +} + +// CreateDescribeInstancePhysicalAttributeResponse creates a response to parse from DescribeInstancePhysicalAttribute response +func CreateDescribeInstancePhysicalAttributeResponse() (response *DescribeInstancePhysicalAttributeResponse) { + response = &DescribeInstancePhysicalAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_instance_ram_role.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_instance_ram_role.go new file mode 100644 index 000000000..19257b827 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_instance_ram_role.go @@ -0,0 +1,112 @@ +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" +) + +// DescribeInstanceRamRole invokes the ecs.DescribeInstanceRamRole API synchronously +// api document: https://help.aliyun.com/api/ecs/describeinstanceramrole.html +func (client *Client) DescribeInstanceRamRole(request *DescribeInstanceRamRoleRequest) (response *DescribeInstanceRamRoleResponse, err error) { + response = CreateDescribeInstanceRamRoleResponse() + err = client.DoAction(request, response) + return +} + +// DescribeInstanceRamRoleWithChan invokes the ecs.DescribeInstanceRamRole API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeinstanceramrole.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeInstanceRamRoleWithChan(request *DescribeInstanceRamRoleRequest) (<-chan *DescribeInstanceRamRoleResponse, <-chan error) { + responseChan := make(chan *DescribeInstanceRamRoleResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeInstanceRamRole(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeInstanceRamRoleWithCallback invokes the ecs.DescribeInstanceRamRole API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeinstanceramrole.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeInstanceRamRoleWithCallback(request *DescribeInstanceRamRoleRequest, callback func(response *DescribeInstanceRamRoleResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeInstanceRamRoleResponse + var err error + defer close(result) + response, err = client.DescribeInstanceRamRole(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeInstanceRamRoleRequest is the request struct for api DescribeInstanceRamRole +type DescribeInstanceRamRoleRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + InstanceIds string `position:"Query" name:"InstanceIds"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + RamRoleName string `position:"Query" name:"RamRoleName"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` +} + +// DescribeInstanceRamRoleResponse is the response struct for api DescribeInstanceRamRole +type DescribeInstanceRamRoleResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + RegionId string `json:"RegionId" xml:"RegionId"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + InstanceRamRoleSets InstanceRamRoleSetsInDescribeInstanceRamRole `json:"InstanceRamRoleSets" xml:"InstanceRamRoleSets"` +} + +// CreateDescribeInstanceRamRoleRequest creates a request to invoke DescribeInstanceRamRole API +func CreateDescribeInstanceRamRoleRequest() (request *DescribeInstanceRamRoleRequest) { + request = &DescribeInstanceRamRoleRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeInstanceRamRole", "ecs", "openAPI") + return +} + +// CreateDescribeInstanceRamRoleResponse creates a response to parse from DescribeInstanceRamRole response +func CreateDescribeInstanceRamRoleResponse() (response *DescribeInstanceRamRoleResponse) { + response = &DescribeInstanceRamRoleResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_instance_status.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_instance_status.go new file mode 100644 index 000000000..6e759dcd6 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_instance_status.go @@ -0,0 +1,114 @@ +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" +) + +// DescribeInstanceStatus invokes the ecs.DescribeInstanceStatus API synchronously +// api document: https://help.aliyun.com/api/ecs/describeinstancestatus.html +func (client *Client) DescribeInstanceStatus(request *DescribeInstanceStatusRequest) (response *DescribeInstanceStatusResponse, err error) { + response = CreateDescribeInstanceStatusResponse() + err = client.DoAction(request, response) + return +} + +// DescribeInstanceStatusWithChan invokes the ecs.DescribeInstanceStatus API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeinstancestatus.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeInstanceStatusWithChan(request *DescribeInstanceStatusRequest) (<-chan *DescribeInstanceStatusResponse, <-chan error) { + responseChan := make(chan *DescribeInstanceStatusResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeInstanceStatus(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeInstanceStatusWithCallback invokes the ecs.DescribeInstanceStatus API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeinstancestatus.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeInstanceStatusWithCallback(request *DescribeInstanceStatusRequest, callback func(response *DescribeInstanceStatusResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeInstanceStatusResponse + var err error + defer close(result) + response, err = client.DescribeInstanceStatus(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeInstanceStatusRequest is the request struct for api DescribeInstanceStatus +type DescribeInstanceStatusRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + ZoneId string `position:"Query" name:"ZoneId"` + ClusterId string `position:"Query" name:"ClusterId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` +} + +// DescribeInstanceStatusResponse is the response struct for api DescribeInstanceStatus +type DescribeInstanceStatusResponse 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"` + InstanceStatuses InstanceStatuses `json:"InstanceStatuses" xml:"InstanceStatuses"` +} + +// CreateDescribeInstanceStatusRequest creates a request to invoke DescribeInstanceStatus API +func CreateDescribeInstanceStatusRequest() (request *DescribeInstanceStatusRequest) { + request = &DescribeInstanceStatusRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeInstanceStatus", "ecs", "openAPI") + return +} + +// CreateDescribeInstanceStatusResponse creates a response to parse from DescribeInstanceStatus response +func CreateDescribeInstanceStatusResponse() (response *DescribeInstanceStatusResponse) { + response = &DescribeInstanceStatusResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_instance_topology.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_instance_topology.go new file mode 100644 index 000000000..e0ba69e9f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_instance_topology.go @@ -0,0 +1,107 @@ +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" +) + +// DescribeInstanceTopology invokes the ecs.DescribeInstanceTopology API synchronously +// api document: https://help.aliyun.com/api/ecs/describeinstancetopology.html +func (client *Client) DescribeInstanceTopology(request *DescribeInstanceTopologyRequest) (response *DescribeInstanceTopologyResponse, err error) { + response = CreateDescribeInstanceTopologyResponse() + err = client.DoAction(request, response) + return +} + +// DescribeInstanceTopologyWithChan invokes the ecs.DescribeInstanceTopology API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeinstancetopology.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeInstanceTopologyWithChan(request *DescribeInstanceTopologyRequest) (<-chan *DescribeInstanceTopologyResponse, <-chan error) { + responseChan := make(chan *DescribeInstanceTopologyResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeInstanceTopology(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeInstanceTopologyWithCallback invokes the ecs.DescribeInstanceTopology API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeinstancetopology.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeInstanceTopologyWithCallback(request *DescribeInstanceTopologyRequest, callback func(response *DescribeInstanceTopologyResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeInstanceTopologyResponse + var err error + defer close(result) + response, err = client.DescribeInstanceTopology(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeInstanceTopologyRequest is the request struct for api DescribeInstanceTopology +type DescribeInstanceTopologyRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + InstanceIds string `position:"Query" name:"InstanceIds"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DescribeInstanceTopologyResponse is the response struct for api DescribeInstanceTopology +type DescribeInstanceTopologyResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Topologys Topologys `json:"Topologys" xml:"Topologys"` +} + +// CreateDescribeInstanceTopologyRequest creates a request to invoke DescribeInstanceTopology API +func CreateDescribeInstanceTopologyRequest() (request *DescribeInstanceTopologyRequest) { + request = &DescribeInstanceTopologyRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeInstanceTopology", "ecs", "openAPI") + return +} + +// CreateDescribeInstanceTopologyResponse creates a response to parse from DescribeInstanceTopology response +func CreateDescribeInstanceTopologyResponse() (response *DescribeInstanceTopologyResponse) { + response = &DescribeInstanceTopologyResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_instance_type_families.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_instance_type_families.go new file mode 100644 index 000000000..672eb232f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_instance_type_families.go @@ -0,0 +1,108 @@ +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" +) + +// DescribeInstanceTypeFamilies invokes the ecs.DescribeInstanceTypeFamilies API synchronously +// api document: https://help.aliyun.com/api/ecs/describeinstancetypefamilies.html +func (client *Client) DescribeInstanceTypeFamilies(request *DescribeInstanceTypeFamiliesRequest) (response *DescribeInstanceTypeFamiliesResponse, err error) { + response = CreateDescribeInstanceTypeFamiliesResponse() + err = client.DoAction(request, response) + return +} + +// DescribeInstanceTypeFamiliesWithChan invokes the ecs.DescribeInstanceTypeFamilies API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeinstancetypefamilies.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeInstanceTypeFamiliesWithChan(request *DescribeInstanceTypeFamiliesRequest) (<-chan *DescribeInstanceTypeFamiliesResponse, <-chan error) { + responseChan := make(chan *DescribeInstanceTypeFamiliesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeInstanceTypeFamilies(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeInstanceTypeFamiliesWithCallback invokes the ecs.DescribeInstanceTypeFamilies API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeinstancetypefamilies.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeInstanceTypeFamiliesWithCallback(request *DescribeInstanceTypeFamiliesRequest, callback func(response *DescribeInstanceTypeFamiliesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeInstanceTypeFamiliesResponse + var err error + defer close(result) + response, err = client.DescribeInstanceTypeFamilies(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeInstanceTypeFamiliesRequest is the request struct for api DescribeInstanceTypeFamilies +type DescribeInstanceTypeFamiliesRequest struct { + *requests.RpcRequest + Generation string `position:"Query" name:"Generation"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DescribeInstanceTypeFamiliesResponse is the response struct for api DescribeInstanceTypeFamilies +type DescribeInstanceTypeFamiliesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + InstanceTypeFamilies InstanceTypeFamiliesInDescribeInstanceTypeFamilies `json:"InstanceTypeFamilies" xml:"InstanceTypeFamilies"` +} + +// CreateDescribeInstanceTypeFamiliesRequest creates a request to invoke DescribeInstanceTypeFamilies API +func CreateDescribeInstanceTypeFamiliesRequest() (request *DescribeInstanceTypeFamiliesRequest) { + request = &DescribeInstanceTypeFamiliesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeInstanceTypeFamilies", "ecs", "openAPI") + return +} + +// CreateDescribeInstanceTypeFamiliesResponse creates a response to parse from DescribeInstanceTypeFamilies response +func CreateDescribeInstanceTypeFamiliesResponse() (response *DescribeInstanceTypeFamiliesResponse) { + response = &DescribeInstanceTypeFamiliesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_instance_types.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_instance_types.go new file mode 100644 index 000000000..fbfdc8f31 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_instance_types.go @@ -0,0 +1,108 @@ +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" +) + +// DescribeInstanceTypes invokes the ecs.DescribeInstanceTypes API synchronously +// api document: https://help.aliyun.com/api/ecs/describeinstancetypes.html +func (client *Client) DescribeInstanceTypes(request *DescribeInstanceTypesRequest) (response *DescribeInstanceTypesResponse, err error) { + response = CreateDescribeInstanceTypesResponse() + err = client.DoAction(request, response) + return +} + +// DescribeInstanceTypesWithChan invokes the ecs.DescribeInstanceTypes API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeinstancetypes.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeInstanceTypesWithChan(request *DescribeInstanceTypesRequest) (<-chan *DescribeInstanceTypesResponse, <-chan error) { + responseChan := make(chan *DescribeInstanceTypesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeInstanceTypes(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeInstanceTypesWithCallback invokes the ecs.DescribeInstanceTypes API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeinstancetypes.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeInstanceTypesWithCallback(request *DescribeInstanceTypesRequest, callback func(response *DescribeInstanceTypesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeInstanceTypesResponse + var err error + defer close(result) + response, err = client.DescribeInstanceTypes(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeInstanceTypesRequest is the request struct for api DescribeInstanceTypes +type DescribeInstanceTypesRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + 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"` +} + +// DescribeInstanceTypesResponse is the response struct for api DescribeInstanceTypes +type DescribeInstanceTypesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + InstanceTypes InstanceTypesInDescribeInstanceTypes `json:"InstanceTypes" xml:"InstanceTypes"` +} + +// CreateDescribeInstanceTypesRequest creates a request to invoke DescribeInstanceTypes API +func CreateDescribeInstanceTypesRequest() (request *DescribeInstanceTypesRequest) { + request = &DescribeInstanceTypesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeInstanceTypes", "ecs", "openAPI") + return +} + +// CreateDescribeInstanceTypesResponse creates a response to parse from DescribeInstanceTypes response +func CreateDescribeInstanceTypesResponse() (response *DescribeInstanceTypesResponse) { + response = &DescribeInstanceTypesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_instance_vnc_passwd.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_instance_vnc_passwd.go new file mode 100644 index 000000000..cfc19b2fd --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_instance_vnc_passwd.go @@ -0,0 +1,108 @@ +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" +) + +// DescribeInstanceVncPasswd invokes the ecs.DescribeInstanceVncPasswd API synchronously +// api document: https://help.aliyun.com/api/ecs/describeinstancevncpasswd.html +func (client *Client) DescribeInstanceVncPasswd(request *DescribeInstanceVncPasswdRequest) (response *DescribeInstanceVncPasswdResponse, err error) { + response = CreateDescribeInstanceVncPasswdResponse() + err = client.DoAction(request, response) + return +} + +// DescribeInstanceVncPasswdWithChan invokes the ecs.DescribeInstanceVncPasswd API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeinstancevncpasswd.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeInstanceVncPasswdWithChan(request *DescribeInstanceVncPasswdRequest) (<-chan *DescribeInstanceVncPasswdResponse, <-chan error) { + responseChan := make(chan *DescribeInstanceVncPasswdResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeInstanceVncPasswd(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeInstanceVncPasswdWithCallback invokes the ecs.DescribeInstanceVncPasswd API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeinstancevncpasswd.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeInstanceVncPasswdWithCallback(request *DescribeInstanceVncPasswdRequest, callback func(response *DescribeInstanceVncPasswdResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeInstanceVncPasswdResponse + var err error + defer close(result) + response, err = client.DescribeInstanceVncPasswd(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeInstanceVncPasswdRequest is the request struct for api DescribeInstanceVncPasswd +type DescribeInstanceVncPasswdRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + InstanceId string `position:"Query" name:"InstanceId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DescribeInstanceVncPasswdResponse is the response struct for api DescribeInstanceVncPasswd +type DescribeInstanceVncPasswdResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + VncPasswd string `json:"VncPasswd" xml:"VncPasswd"` +} + +// CreateDescribeInstanceVncPasswdRequest creates a request to invoke DescribeInstanceVncPasswd API +func CreateDescribeInstanceVncPasswdRequest() (request *DescribeInstanceVncPasswdRequest) { + request = &DescribeInstanceVncPasswdRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeInstanceVncPasswd", "ecs", "openAPI") + return +} + +// CreateDescribeInstanceVncPasswdResponse creates a response to parse from DescribeInstanceVncPasswd response +func CreateDescribeInstanceVncPasswdResponse() (response *DescribeInstanceVncPasswdResponse) { + response = &DescribeInstanceVncPasswdResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_instance_vnc_url.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_instance_vnc_url.go new file mode 100644 index 000000000..d1b483d31 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_instance_vnc_url.go @@ -0,0 +1,108 @@ +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" +) + +// DescribeInstanceVncUrl invokes the ecs.DescribeInstanceVncUrl API synchronously +// api document: https://help.aliyun.com/api/ecs/describeinstancevncurl.html +func (client *Client) DescribeInstanceVncUrl(request *DescribeInstanceVncUrlRequest) (response *DescribeInstanceVncUrlResponse, err error) { + response = CreateDescribeInstanceVncUrlResponse() + err = client.DoAction(request, response) + return +} + +// DescribeInstanceVncUrlWithChan invokes the ecs.DescribeInstanceVncUrl API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeinstancevncurl.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeInstanceVncUrlWithChan(request *DescribeInstanceVncUrlRequest) (<-chan *DescribeInstanceVncUrlResponse, <-chan error) { + responseChan := make(chan *DescribeInstanceVncUrlResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeInstanceVncUrl(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeInstanceVncUrlWithCallback invokes the ecs.DescribeInstanceVncUrl API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeinstancevncurl.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeInstanceVncUrlWithCallback(request *DescribeInstanceVncUrlRequest, callback func(response *DescribeInstanceVncUrlResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeInstanceVncUrlResponse + var err error + defer close(result) + response, err = client.DescribeInstanceVncUrl(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeInstanceVncUrlRequest is the request struct for api DescribeInstanceVncUrl +type DescribeInstanceVncUrlRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + InstanceId string `position:"Query" name:"InstanceId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DescribeInstanceVncUrlResponse is the response struct for api DescribeInstanceVncUrl +type DescribeInstanceVncUrlResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + VncUrl string `json:"VncUrl" xml:"VncUrl"` +} + +// CreateDescribeInstanceVncUrlRequest creates a request to invoke DescribeInstanceVncUrl API +func CreateDescribeInstanceVncUrlRequest() (request *DescribeInstanceVncUrlRequest) { + request = &DescribeInstanceVncUrlRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeInstanceVncUrl", "ecs", "openAPI") + return +} + +// CreateDescribeInstanceVncUrlResponse creates a response to parse from DescribeInstanceVncUrl response +func CreateDescribeInstanceVncUrlResponse() (response *DescribeInstanceVncUrlResponse) { + response = &DescribeInstanceVncUrlResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_instances.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_instances.go new file mode 100644 index 000000000..5bfbf4140 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_instances.go @@ -0,0 +1,153 @@ +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" +) + +// DescribeInstances invokes the ecs.DescribeInstances API synchronously +// api document: https://help.aliyun.com/api/ecs/describeinstances.html +func (client *Client) DescribeInstances(request *DescribeInstancesRequest) (response *DescribeInstancesResponse, err error) { + response = CreateDescribeInstancesResponse() + err = client.DoAction(request, response) + return +} + +// DescribeInstancesWithChan invokes the ecs.DescribeInstances API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeinstances.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeInstancesWithChan(request *DescribeInstancesRequest) (<-chan *DescribeInstancesResponse, <-chan error) { + responseChan := make(chan *DescribeInstancesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeInstances(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeInstancesWithCallback invokes the ecs.DescribeInstances API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeinstances.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeInstancesWithCallback(request *DescribeInstancesRequest, callback func(response *DescribeInstancesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeInstancesResponse + var err error + defer close(result) + response, err = client.DescribeInstances(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeInstancesRequest is the request struct for api DescribeInstances +type DescribeInstancesRequest struct { + *requests.RpcRequest + InnerIpAddresses string `position:"Query" name:"InnerIpAddresses"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ImageId string `position:"Query" name:"ImageId"` + PrivateIpAddresses string `position:"Query" name:"PrivateIpAddresses"` + HpcClusterId string `position:"Query" name:"HpcClusterId"` + Filter2Value string `position:"Query" name:"Filter.2.Value"` + Filter4Value string `position:"Query" name:"Filter.4.Value"` + IoOptimized requests.Boolean `position:"Query" name:"IoOptimized"` + SecurityGroupId string `position:"Query" name:"SecurityGroupId"` + KeyPairName string `position:"Query" name:"KeyPairName"` + Filter4Key string `position:"Query" name:"Filter.4.Key"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` + ResourceGroupId string `position:"Query" name:"ResourceGroupId"` + LockReason string `position:"Query" name:"LockReason"` + Filter1Key string `position:"Query" name:"Filter.1.Key"` + RdmaIpAddresses string `position:"Query" name:"RdmaIpAddresses"` + DeviceAvailable requests.Boolean `position:"Query" name:"DeviceAvailable"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + PublicIpAddresses string `position:"Query" name:"PublicIpAddresses"` + InstanceType string `position:"Query" name:"InstanceType"` + Tag *[]DescribeInstancesTag `position:"Query" name:"Tag" type:"Repeated"` + InstanceChargeType string `position:"Query" name:"InstanceChargeType"` + Filter3Value string `position:"Query" name:"Filter.3.Value"` + DryRun requests.Boolean `position:"Query" name:"DryRun"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + InstanceTypeFamily string `position:"Query" name:"InstanceTypeFamily"` + Filter1Value string `position:"Query" name:"Filter.1.Value"` + NeedSaleCycle requests.Boolean `position:"Query" name:"NeedSaleCycle"` + Filter2Key string `position:"Query" name:"Filter.2.Key"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + VSwitchId string `position:"Query" name:"VSwitchId"` + EipAddresses string `position:"Query" name:"EipAddresses"` + InstanceName string `position:"Query" name:"InstanceName"` + InstanceIds string `position:"Query" name:"InstanceIds"` + InternetChargeType string `position:"Query" name:"InternetChargeType"` + VpcId string `position:"Query" name:"VpcId"` + ZoneId string `position:"Query" name:"ZoneId"` + Filter3Key string `position:"Query" name:"Filter.3.Key"` + InstanceNetworkType string `position:"Query" name:"InstanceNetworkType"` + Status string `position:"Query" name:"Status"` +} + +// DescribeInstancesTag is a repeated param struct in DescribeInstancesRequest +type DescribeInstancesTag struct { + Value string `name:"Value"` + Key string `name:"Key"` +} + +// DescribeInstancesResponse is the response struct for api DescribeInstances +type DescribeInstancesResponse 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"` + Instances InstancesInDescribeInstances `json:"Instances" xml:"Instances"` +} + +// CreateDescribeInstancesRequest creates a request to invoke DescribeInstances API +func CreateDescribeInstancesRequest() (request *DescribeInstancesRequest) { + request = &DescribeInstancesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeInstances", "ecs", "openAPI") + return +} + +// CreateDescribeInstancesResponse creates a response to parse from DescribeInstances response +func CreateDescribeInstancesResponse() (response *DescribeInstancesResponse) { + response = &DescribeInstancesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_instances_full_status.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_instances_full_status.go new file mode 100644 index 000000000..136907a87 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_instances_full_status.go @@ -0,0 +1,122 @@ +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" +) + +// DescribeInstancesFullStatus invokes the ecs.DescribeInstancesFullStatus API synchronously +// api document: https://help.aliyun.com/api/ecs/describeinstancesfullstatus.html +func (client *Client) DescribeInstancesFullStatus(request *DescribeInstancesFullStatusRequest) (response *DescribeInstancesFullStatusResponse, err error) { + response = CreateDescribeInstancesFullStatusResponse() + err = client.DoAction(request, response) + return +} + +// DescribeInstancesFullStatusWithChan invokes the ecs.DescribeInstancesFullStatus API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeinstancesfullstatus.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeInstancesFullStatusWithChan(request *DescribeInstancesFullStatusRequest) (<-chan *DescribeInstancesFullStatusResponse, <-chan error) { + responseChan := make(chan *DescribeInstancesFullStatusResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeInstancesFullStatus(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeInstancesFullStatusWithCallback invokes the ecs.DescribeInstancesFullStatus API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeinstancesfullstatus.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeInstancesFullStatusWithCallback(request *DescribeInstancesFullStatusRequest, callback func(response *DescribeInstancesFullStatusResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeInstancesFullStatusResponse + var err error + defer close(result) + response, err = client.DescribeInstancesFullStatus(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeInstancesFullStatusRequest is the request struct for api DescribeInstancesFullStatus +type DescribeInstancesFullStatusRequest struct { + *requests.RpcRequest + EventId *[]string `position:"Query" name:"EventId" type:"Repeated"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + EventPublishTimeEnd string `position:"Query" name:"EventPublishTime.End"` + InstanceEventType *[]string `position:"Query" name:"InstanceEventType" type:"Repeated"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + NotBeforeStart string `position:"Query" name:"NotBefore.Start"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + EventPublishTimeStart string `position:"Query" name:"EventPublishTime.Start"` + InstanceId *[]string `position:"Query" name:"InstanceId" type:"Repeated"` + NotBeforeEnd string `position:"Query" name:"NotBefore.End"` + HealthStatus string `position:"Query" name:"HealthStatus"` + EventType string `position:"Query" name:"EventType"` + Status string `position:"Query" name:"Status"` +} + +// DescribeInstancesFullStatusResponse is the response struct for api DescribeInstancesFullStatus +type DescribeInstancesFullStatusResponse 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"` + InstanceFullStatusSet InstanceFullStatusSet `json:"InstanceFullStatusSet" xml:"InstanceFullStatusSet"` +} + +// CreateDescribeInstancesFullStatusRequest creates a request to invoke DescribeInstancesFullStatus API +func CreateDescribeInstancesFullStatusRequest() (request *DescribeInstancesFullStatusRequest) { + request = &DescribeInstancesFullStatusRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeInstancesFullStatus", "ecs", "openAPI") + return +} + +// CreateDescribeInstancesFullStatusResponse creates a response to parse from DescribeInstancesFullStatus response +func CreateDescribeInstancesFullStatusResponse() (response *DescribeInstancesFullStatusResponse) { + response = &DescribeInstancesFullStatusResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_invocation_results.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_invocation_results.go new file mode 100644 index 000000000..6a108d746 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_invocation_results.go @@ -0,0 +1,113 @@ +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" +) + +// DescribeInvocationResults invokes the ecs.DescribeInvocationResults API synchronously +// api document: https://help.aliyun.com/api/ecs/describeinvocationresults.html +func (client *Client) DescribeInvocationResults(request *DescribeInvocationResultsRequest) (response *DescribeInvocationResultsResponse, err error) { + response = CreateDescribeInvocationResultsResponse() + err = client.DoAction(request, response) + return +} + +// DescribeInvocationResultsWithChan invokes the ecs.DescribeInvocationResults API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeinvocationresults.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeInvocationResultsWithChan(request *DescribeInvocationResultsRequest) (<-chan *DescribeInvocationResultsResponse, <-chan error) { + responseChan := make(chan *DescribeInvocationResultsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeInvocationResults(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeInvocationResultsWithCallback invokes the ecs.DescribeInvocationResults API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeinvocationresults.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeInvocationResultsWithCallback(request *DescribeInvocationResultsRequest, callback func(response *DescribeInvocationResultsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeInvocationResultsResponse + var err error + defer close(result) + response, err = client.DescribeInvocationResults(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeInvocationResultsRequest is the request struct for api DescribeInvocationResults +type DescribeInvocationResultsRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + CommandId string `position:"Query" name:"CommandId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + InvokeId string `position:"Query" name:"InvokeId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + InstanceId string `position:"Query" name:"InstanceId"` + InvokeRecordStatus string `position:"Query" name:"InvokeRecordStatus"` +} + +// DescribeInvocationResultsResponse is the response struct for api DescribeInvocationResults +type DescribeInvocationResultsResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Invocation Invocation `json:"Invocation" xml:"Invocation"` +} + +// CreateDescribeInvocationResultsRequest creates a request to invoke DescribeInvocationResults API +func CreateDescribeInvocationResultsRequest() (request *DescribeInvocationResultsRequest) { + request = &DescribeInvocationResultsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeInvocationResults", "ecs", "openAPI") + return +} + +// CreateDescribeInvocationResultsResponse creates a response to parse from DescribeInvocationResults response +func CreateDescribeInvocationResultsResponse() (response *DescribeInvocationResultsResponse) { + response = &DescribeInvocationResultsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_invocations.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_invocations.go new file mode 100644 index 000000000..027c80feb --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_invocations.go @@ -0,0 +1,119 @@ +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" +) + +// DescribeInvocations invokes the ecs.DescribeInvocations API synchronously +// api document: https://help.aliyun.com/api/ecs/describeinvocations.html +func (client *Client) DescribeInvocations(request *DescribeInvocationsRequest) (response *DescribeInvocationsResponse, err error) { + response = CreateDescribeInvocationsResponse() + err = client.DoAction(request, response) + return +} + +// DescribeInvocationsWithChan invokes the ecs.DescribeInvocations API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeinvocations.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeInvocationsWithChan(request *DescribeInvocationsRequest) (<-chan *DescribeInvocationsResponse, <-chan error) { + responseChan := make(chan *DescribeInvocationsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeInvocations(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeInvocationsWithCallback invokes the ecs.DescribeInvocations API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeinvocations.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeInvocationsWithCallback(request *DescribeInvocationsRequest, callback func(response *DescribeInvocationsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeInvocationsResponse + var err error + defer close(result) + response, err = client.DescribeInvocations(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeInvocationsRequest is the request struct for api DescribeInvocations +type DescribeInvocationsRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + InvokeStatus string `position:"Query" name:"InvokeStatus"` + CommandId string `position:"Query" name:"CommandId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + InvokeId string `position:"Query" name:"InvokeId"` + Timed requests.Boolean `position:"Query" name:"Timed"` + CommandName string `position:"Query" name:"CommandName"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + CommandType string `position:"Query" name:"CommandType"` + InstanceId string `position:"Query" name:"InstanceId"` +} + +// DescribeInvocationsResponse is the response struct for api DescribeInvocations +type DescribeInvocationsResponse 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"` + Invocations Invocations `json:"Invocations" xml:"Invocations"` +} + +// CreateDescribeInvocationsRequest creates a request to invoke DescribeInvocations API +func CreateDescribeInvocationsRequest() (request *DescribeInvocationsRequest) { + request = &DescribeInvocationsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeInvocations", "ecs", "openAPI") + return +} + +// CreateDescribeInvocationsResponse creates a response to parse from DescribeInvocations response +func CreateDescribeInvocationsResponse() (response *DescribeInvocationsResponse) { + response = &DescribeInvocationsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_key_pairs.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_key_pairs.go new file mode 100644 index 000000000..0a687d00d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_key_pairs.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" +) + +// DescribeKeyPairs invokes the ecs.DescribeKeyPairs API synchronously +// api document: https://help.aliyun.com/api/ecs/describekeypairs.html +func (client *Client) DescribeKeyPairs(request *DescribeKeyPairsRequest) (response *DescribeKeyPairsResponse, err error) { + response = CreateDescribeKeyPairsResponse() + err = client.DoAction(request, response) + return +} + +// DescribeKeyPairsWithChan invokes the ecs.DescribeKeyPairs API asynchronously +// api document: https://help.aliyun.com/api/ecs/describekeypairs.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeKeyPairsWithChan(request *DescribeKeyPairsRequest) (<-chan *DescribeKeyPairsResponse, <-chan error) { + responseChan := make(chan *DescribeKeyPairsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeKeyPairs(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeKeyPairsWithCallback invokes the ecs.DescribeKeyPairs API asynchronously +// api document: https://help.aliyun.com/api/ecs/describekeypairs.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeKeyPairsWithCallback(request *DescribeKeyPairsRequest, callback func(response *DescribeKeyPairsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeKeyPairsResponse + var err error + defer close(result) + response, err = client.DescribeKeyPairs(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeKeyPairsRequest is the request struct for api DescribeKeyPairs +type DescribeKeyPairsRequest struct { + *requests.RpcRequest + ResourceGroupId string `position:"Query" name:"ResourceGroupId"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + KeyPairFingerPrint string `position:"Query" name:"KeyPairFingerPrint"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + KeyPairName string `position:"Query" name:"KeyPairName"` + Tag *[]DescribeKeyPairsTag `position:"Query" name:"Tag" type:"Repeated"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` +} + +// DescribeKeyPairsTag is a repeated param struct in DescribeKeyPairsRequest +type DescribeKeyPairsTag struct { + Value string `name:"Value"` + Key string `name:"Key"` +} + +// DescribeKeyPairsResponse is the response struct for api DescribeKeyPairs +type DescribeKeyPairsResponse 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"` + KeyPairs KeyPairs `json:"KeyPairs" xml:"KeyPairs"` +} + +// CreateDescribeKeyPairsRequest creates a request to invoke DescribeKeyPairs API +func CreateDescribeKeyPairsRequest() (request *DescribeKeyPairsRequest) { + request = &DescribeKeyPairsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeKeyPairs", "ecs", "openAPI") + return +} + +// CreateDescribeKeyPairsResponse creates a response to parse from DescribeKeyPairs response +func CreateDescribeKeyPairsResponse() (response *DescribeKeyPairsResponse) { + response = &DescribeKeyPairsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_launch_template_versions.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_launch_template_versions.go new file mode 100644 index 000000000..4082a2b51 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_launch_template_versions.go @@ -0,0 +1,119 @@ +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" +) + +// DescribeLaunchTemplateVersions invokes the ecs.DescribeLaunchTemplateVersions API synchronously +// api document: https://help.aliyun.com/api/ecs/describelaunchtemplateversions.html +func (client *Client) DescribeLaunchTemplateVersions(request *DescribeLaunchTemplateVersionsRequest) (response *DescribeLaunchTemplateVersionsResponse, err error) { + response = CreateDescribeLaunchTemplateVersionsResponse() + err = client.DoAction(request, response) + return +} + +// DescribeLaunchTemplateVersionsWithChan invokes the ecs.DescribeLaunchTemplateVersions API asynchronously +// api document: https://help.aliyun.com/api/ecs/describelaunchtemplateversions.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeLaunchTemplateVersionsWithChan(request *DescribeLaunchTemplateVersionsRequest) (<-chan *DescribeLaunchTemplateVersionsResponse, <-chan error) { + responseChan := make(chan *DescribeLaunchTemplateVersionsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeLaunchTemplateVersions(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeLaunchTemplateVersionsWithCallback invokes the ecs.DescribeLaunchTemplateVersions API asynchronously +// api document: https://help.aliyun.com/api/ecs/describelaunchtemplateversions.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeLaunchTemplateVersionsWithCallback(request *DescribeLaunchTemplateVersionsRequest, callback func(response *DescribeLaunchTemplateVersionsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeLaunchTemplateVersionsResponse + var err error + defer close(result) + response, err = client.DescribeLaunchTemplateVersions(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeLaunchTemplateVersionsRequest is the request struct for api DescribeLaunchTemplateVersions +type DescribeLaunchTemplateVersionsRequest struct { + *requests.RpcRequest + LaunchTemplateName string `position:"Query" name:"LaunchTemplateName"` + MaxVersion requests.Integer `position:"Query" name:"MaxVersion"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + DefaultVersion requests.Boolean `position:"Query" name:"DefaultVersion"` + MinVersion requests.Integer `position:"Query" name:"MinVersion"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + LaunchTemplateId string `position:"Query" name:"LaunchTemplateId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + LaunchTemplateVersion *[]string `position:"Query" name:"LaunchTemplateVersion" type:"Repeated"` + DetailFlag requests.Boolean `position:"Query" name:"DetailFlag"` +} + +// DescribeLaunchTemplateVersionsResponse is the response struct for api DescribeLaunchTemplateVersions +type DescribeLaunchTemplateVersionsResponse 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"` + LaunchTemplateVersionSets LaunchTemplateVersionSets `json:"LaunchTemplateVersionSets" xml:"LaunchTemplateVersionSets"` +} + +// CreateDescribeLaunchTemplateVersionsRequest creates a request to invoke DescribeLaunchTemplateVersions API +func CreateDescribeLaunchTemplateVersionsRequest() (request *DescribeLaunchTemplateVersionsRequest) { + request = &DescribeLaunchTemplateVersionsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeLaunchTemplateVersions", "ecs", "openAPI") + return +} + +// CreateDescribeLaunchTemplateVersionsResponse creates a response to parse from DescribeLaunchTemplateVersions response +func CreateDescribeLaunchTemplateVersionsResponse() (response *DescribeLaunchTemplateVersionsResponse) { + response = &DescribeLaunchTemplateVersionsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_launch_templates.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_launch_templates.go new file mode 100644 index 000000000..fa45eabc4 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_launch_templates.go @@ -0,0 +1,122 @@ +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" +) + +// DescribeLaunchTemplates invokes the ecs.DescribeLaunchTemplates API synchronously +// api document: https://help.aliyun.com/api/ecs/describelaunchtemplates.html +func (client *Client) DescribeLaunchTemplates(request *DescribeLaunchTemplatesRequest) (response *DescribeLaunchTemplatesResponse, err error) { + response = CreateDescribeLaunchTemplatesResponse() + err = client.DoAction(request, response) + return +} + +// DescribeLaunchTemplatesWithChan invokes the ecs.DescribeLaunchTemplates API asynchronously +// api document: https://help.aliyun.com/api/ecs/describelaunchtemplates.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeLaunchTemplatesWithChan(request *DescribeLaunchTemplatesRequest) (<-chan *DescribeLaunchTemplatesResponse, <-chan error) { + responseChan := make(chan *DescribeLaunchTemplatesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeLaunchTemplates(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeLaunchTemplatesWithCallback invokes the ecs.DescribeLaunchTemplates API asynchronously +// api document: https://help.aliyun.com/api/ecs/describelaunchtemplates.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeLaunchTemplatesWithCallback(request *DescribeLaunchTemplatesRequest, callback func(response *DescribeLaunchTemplatesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeLaunchTemplatesResponse + var err error + defer close(result) + response, err = client.DescribeLaunchTemplates(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeLaunchTemplatesRequest is the request struct for api DescribeLaunchTemplates +type DescribeLaunchTemplatesRequest struct { + *requests.RpcRequest + LaunchTemplateName *[]string `position:"Query" name:"LaunchTemplateName" type:"Repeated"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + TemplateTag *[]DescribeLaunchTemplatesTemplateTag `position:"Query" name:"TemplateTag" type:"Repeated"` + LaunchTemplateId *[]string `position:"Query" name:"LaunchTemplateId" type:"Repeated"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + TemplateResourceGroupId string `position:"Query" name:"TemplateResourceGroupId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DescribeLaunchTemplatesTemplateTag is a repeated param struct in DescribeLaunchTemplatesRequest +type DescribeLaunchTemplatesTemplateTag struct { + Key string `name:"Key"` + Value string `name:"Value"` +} + +// DescribeLaunchTemplatesResponse is the response struct for api DescribeLaunchTemplates +type DescribeLaunchTemplatesResponse 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"` + LaunchTemplateSets LaunchTemplateSets `json:"LaunchTemplateSets" xml:"LaunchTemplateSets"` +} + +// CreateDescribeLaunchTemplatesRequest creates a request to invoke DescribeLaunchTemplates API +func CreateDescribeLaunchTemplatesRequest() (request *DescribeLaunchTemplatesRequest) { + request = &DescribeLaunchTemplatesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeLaunchTemplates", "ecs", "openAPI") + return +} + +// CreateDescribeLaunchTemplatesResponse creates a response to parse from DescribeLaunchTemplates response +func CreateDescribeLaunchTemplatesResponse() (response *DescribeLaunchTemplatesResponse) { + response = &DescribeLaunchTemplatesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_limitation.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_limitation.go new file mode 100644 index 000000000..592776be0 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_limitation.go @@ -0,0 +1,109 @@ +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" +) + +// DescribeLimitation invokes the ecs.DescribeLimitation API synchronously +// api document: https://help.aliyun.com/api/ecs/describelimitation.html +func (client *Client) DescribeLimitation(request *DescribeLimitationRequest) (response *DescribeLimitationResponse, err error) { + response = CreateDescribeLimitationResponse() + err = client.DoAction(request, response) + return +} + +// DescribeLimitationWithChan invokes the ecs.DescribeLimitation API asynchronously +// api document: https://help.aliyun.com/api/ecs/describelimitation.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeLimitationWithChan(request *DescribeLimitationRequest) (<-chan *DescribeLimitationResponse, <-chan error) { + responseChan := make(chan *DescribeLimitationResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeLimitation(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeLimitationWithCallback invokes the ecs.DescribeLimitation API asynchronously +// api document: https://help.aliyun.com/api/ecs/describelimitation.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeLimitationWithCallback(request *DescribeLimitationRequest, callback func(response *DescribeLimitationResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeLimitationResponse + var err error + defer close(result) + response, err = client.DescribeLimitation(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeLimitationRequest is the request struct for api DescribeLimitation +type DescribeLimitationRequest struct { + *requests.RpcRequest + Limitation string `position:"Query" name:"Limitation"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DescribeLimitationResponse is the response struct for api DescribeLimitation +type DescribeLimitationResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Limitation string `json:"Limitation" xml:"Limitation"` + Value string `json:"Value" xml:"Value"` +} + +// CreateDescribeLimitationRequest creates a request to invoke DescribeLimitation API +func CreateDescribeLimitationRequest() (request *DescribeLimitationRequest) { + request = &DescribeLimitationRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeLimitation", "ecs", "openAPI") + return +} + +// CreateDescribeLimitationResponse creates a response to parse from DescribeLimitation response +func CreateDescribeLimitationResponse() (response *DescribeLimitationResponse) { + response = &DescribeLimitationResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_nat_gateways.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_nat_gateways.go new file mode 100644 index 000000000..306108a33 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_nat_gateways.go @@ -0,0 +1,114 @@ +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" +) + +// DescribeNatGateways invokes the ecs.DescribeNatGateways API synchronously +// api document: https://help.aliyun.com/api/ecs/describenatgateways.html +func (client *Client) DescribeNatGateways(request *DescribeNatGatewaysRequest) (response *DescribeNatGatewaysResponse, err error) { + response = CreateDescribeNatGatewaysResponse() + err = client.DoAction(request, response) + return +} + +// DescribeNatGatewaysWithChan invokes the ecs.DescribeNatGateways API asynchronously +// api document: https://help.aliyun.com/api/ecs/describenatgateways.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeNatGatewaysWithChan(request *DescribeNatGatewaysRequest) (<-chan *DescribeNatGatewaysResponse, <-chan error) { + responseChan := make(chan *DescribeNatGatewaysResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeNatGateways(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeNatGatewaysWithCallback invokes the ecs.DescribeNatGateways API asynchronously +// api document: https://help.aliyun.com/api/ecs/describenatgateways.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeNatGatewaysWithCallback(request *DescribeNatGatewaysRequest, callback func(response *DescribeNatGatewaysResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeNatGatewaysResponse + var err error + defer close(result) + response, err = client.DescribeNatGateways(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeNatGatewaysRequest is the request struct for api DescribeNatGateways +type DescribeNatGatewaysRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + VpcId string `position:"Query" name:"VpcId"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + NatGatewayId string `position:"Query" name:"NatGatewayId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` +} + +// DescribeNatGatewaysResponse is the response struct for api DescribeNatGateways +type DescribeNatGatewaysResponse 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"` + NatGateways NatGateways `json:"NatGateways" xml:"NatGateways"` +} + +// CreateDescribeNatGatewaysRequest creates a request to invoke DescribeNatGateways API +func CreateDescribeNatGatewaysRequest() (request *DescribeNatGatewaysRequest) { + request = &DescribeNatGatewaysRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeNatGateways", "ecs", "openAPI") + return +} + +// CreateDescribeNatGatewaysResponse creates a response to parse from DescribeNatGateways response +func CreateDescribeNatGatewaysResponse() (response *DescribeNatGatewaysResponse) { + response = &DescribeNatGatewaysResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_network_interface_permissions.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_network_interface_permissions.go new file mode 100644 index 000000000..15ad33d77 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_network_interface_permissions.go @@ -0,0 +1,114 @@ +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" +) + +// DescribeNetworkInterfacePermissions invokes the ecs.DescribeNetworkInterfacePermissions API synchronously +// api document: https://help.aliyun.com/api/ecs/describenetworkinterfacepermissions.html +func (client *Client) DescribeNetworkInterfacePermissions(request *DescribeNetworkInterfacePermissionsRequest) (response *DescribeNetworkInterfacePermissionsResponse, err error) { + response = CreateDescribeNetworkInterfacePermissionsResponse() + err = client.DoAction(request, response) + return +} + +// DescribeNetworkInterfacePermissionsWithChan invokes the ecs.DescribeNetworkInterfacePermissions API asynchronously +// api document: https://help.aliyun.com/api/ecs/describenetworkinterfacepermissions.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeNetworkInterfacePermissionsWithChan(request *DescribeNetworkInterfacePermissionsRequest) (<-chan *DescribeNetworkInterfacePermissionsResponse, <-chan error) { + responseChan := make(chan *DescribeNetworkInterfacePermissionsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeNetworkInterfacePermissions(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeNetworkInterfacePermissionsWithCallback invokes the ecs.DescribeNetworkInterfacePermissions API asynchronously +// api document: https://help.aliyun.com/api/ecs/describenetworkinterfacepermissions.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeNetworkInterfacePermissionsWithCallback(request *DescribeNetworkInterfacePermissionsRequest, callback func(response *DescribeNetworkInterfacePermissionsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeNetworkInterfacePermissionsResponse + var err error + defer close(result) + response, err = client.DescribeNetworkInterfacePermissions(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeNetworkInterfacePermissionsRequest is the request struct for api DescribeNetworkInterfacePermissions +type DescribeNetworkInterfacePermissionsRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + NetworkInterfacePermissionId *[]string `position:"Query" name:"NetworkInterfacePermissionId" type:"Repeated"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + NetworkInterfaceId string `position:"Query" name:"NetworkInterfaceId"` +} + +// DescribeNetworkInterfacePermissionsResponse is the response struct for api DescribeNetworkInterfacePermissions +type DescribeNetworkInterfacePermissionsResponse 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"` + NetworkInterfacePermissions NetworkInterfacePermissions `json:"NetworkInterfacePermissions" xml:"NetworkInterfacePermissions"` +} + +// CreateDescribeNetworkInterfacePermissionsRequest creates a request to invoke DescribeNetworkInterfacePermissions API +func CreateDescribeNetworkInterfacePermissionsRequest() (request *DescribeNetworkInterfacePermissionsRequest) { + request = &DescribeNetworkInterfacePermissionsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeNetworkInterfacePermissions", "ecs", "openAPI") + return +} + +// CreateDescribeNetworkInterfacePermissionsResponse creates a response to parse from DescribeNetworkInterfacePermissions response +func CreateDescribeNetworkInterfacePermissionsResponse() (response *DescribeNetworkInterfacePermissionsResponse) { + response = &DescribeNetworkInterfacePermissionsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_network_interfaces.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_network_interfaces.go new file mode 100644 index 000000000..26f4f01ee --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_network_interfaces.go @@ -0,0 +1,129 @@ +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" +) + +// DescribeNetworkInterfaces invokes the ecs.DescribeNetworkInterfaces API synchronously +// api document: https://help.aliyun.com/api/ecs/describenetworkinterfaces.html +func (client *Client) DescribeNetworkInterfaces(request *DescribeNetworkInterfacesRequest) (response *DescribeNetworkInterfacesResponse, err error) { + response = CreateDescribeNetworkInterfacesResponse() + err = client.DoAction(request, response) + return +} + +// DescribeNetworkInterfacesWithChan invokes the ecs.DescribeNetworkInterfaces API asynchronously +// api document: https://help.aliyun.com/api/ecs/describenetworkinterfaces.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeNetworkInterfacesWithChan(request *DescribeNetworkInterfacesRequest) (<-chan *DescribeNetworkInterfacesResponse, <-chan error) { + responseChan := make(chan *DescribeNetworkInterfacesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeNetworkInterfaces(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeNetworkInterfacesWithCallback invokes the ecs.DescribeNetworkInterfaces API asynchronously +// api document: https://help.aliyun.com/api/ecs/describenetworkinterfaces.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeNetworkInterfacesWithCallback(request *DescribeNetworkInterfacesRequest, callback func(response *DescribeNetworkInterfacesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeNetworkInterfacesResponse + var err error + defer close(result) + response, err = client.DescribeNetworkInterfaces(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeNetworkInterfacesRequest is the request struct for api DescribeNetworkInterfaces +type DescribeNetworkInterfacesRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ServiceManaged requests.Boolean `position:"Query" name:"ServiceManaged"` + SecurityGroupId string `position:"Query" name:"SecurityGroupId"` + Type string `position:"Query" name:"Type"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` + ResourceGroupId string `position:"Query" name:"ResourceGroupId"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + Tag *[]DescribeNetworkInterfacesTag `position:"Query" name:"Tag" type:"Repeated"` + NetworkInterfaceName string `position:"Query" name:"NetworkInterfaceName"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + VSwitchId string `position:"Query" name:"VSwitchId"` + InstanceId string `position:"Query" name:"InstanceId"` + VpcId string `position:"Query" name:"VpcId"` + PrimaryIpAddress string `position:"Query" name:"PrimaryIpAddress"` + NetworkInterfaceId *[]string `position:"Query" name:"NetworkInterfaceId" type:"Repeated"` +} + +// DescribeNetworkInterfacesTag is a repeated param struct in DescribeNetworkInterfacesRequest +type DescribeNetworkInterfacesTag struct { + Key string `name:"Key"` + Value string `name:"Value"` +} + +// DescribeNetworkInterfacesResponse is the response struct for api DescribeNetworkInterfaces +type DescribeNetworkInterfacesResponse 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"` + NetworkInterfaceSets NetworkInterfaceSets `json:"NetworkInterfaceSets" xml:"NetworkInterfaceSets"` +} + +// CreateDescribeNetworkInterfacesRequest creates a request to invoke DescribeNetworkInterfaces API +func CreateDescribeNetworkInterfacesRequest() (request *DescribeNetworkInterfacesRequest) { + request = &DescribeNetworkInterfacesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeNetworkInterfaces", "ecs", "openAPI") + return +} + +// CreateDescribeNetworkInterfacesResponse creates a response to parse from DescribeNetworkInterfaces response +func CreateDescribeNetworkInterfacesResponse() (response *DescribeNetworkInterfacesResponse) { + response = &DescribeNetworkInterfacesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_new_project_eip_monitor_data.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_new_project_eip_monitor_data.go new file mode 100644 index 000000000..71377c089 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_new_project_eip_monitor_data.go @@ -0,0 +1,111 @@ +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" +) + +// DescribeNewProjectEipMonitorData invokes the ecs.DescribeNewProjectEipMonitorData API synchronously +// api document: https://help.aliyun.com/api/ecs/describenewprojecteipmonitordata.html +func (client *Client) DescribeNewProjectEipMonitorData(request *DescribeNewProjectEipMonitorDataRequest) (response *DescribeNewProjectEipMonitorDataResponse, err error) { + response = CreateDescribeNewProjectEipMonitorDataResponse() + err = client.DoAction(request, response) + return +} + +// DescribeNewProjectEipMonitorDataWithChan invokes the ecs.DescribeNewProjectEipMonitorData API asynchronously +// api document: https://help.aliyun.com/api/ecs/describenewprojecteipmonitordata.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeNewProjectEipMonitorDataWithChan(request *DescribeNewProjectEipMonitorDataRequest) (<-chan *DescribeNewProjectEipMonitorDataResponse, <-chan error) { + responseChan := make(chan *DescribeNewProjectEipMonitorDataResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeNewProjectEipMonitorData(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeNewProjectEipMonitorDataWithCallback invokes the ecs.DescribeNewProjectEipMonitorData API asynchronously +// api document: https://help.aliyun.com/api/ecs/describenewprojecteipmonitordata.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeNewProjectEipMonitorDataWithCallback(request *DescribeNewProjectEipMonitorDataRequest, callback func(response *DescribeNewProjectEipMonitorDataResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeNewProjectEipMonitorDataResponse + var err error + defer close(result) + response, err = client.DescribeNewProjectEipMonitorData(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeNewProjectEipMonitorDataRequest is the request struct for api DescribeNewProjectEipMonitorData +type DescribeNewProjectEipMonitorDataRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + Period requests.Integer `position:"Query" name:"Period"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + EndTime string `position:"Query" name:"EndTime"` + AllocationId string `position:"Query" name:"AllocationId"` + StartTime string `position:"Query" name:"StartTime"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DescribeNewProjectEipMonitorDataResponse is the response struct for api DescribeNewProjectEipMonitorData +type DescribeNewProjectEipMonitorDataResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + EipMonitorDatas EipMonitorDatasInDescribeNewProjectEipMonitorData `json:"EipMonitorDatas" xml:"EipMonitorDatas"` +} + +// CreateDescribeNewProjectEipMonitorDataRequest creates a request to invoke DescribeNewProjectEipMonitorData API +func CreateDescribeNewProjectEipMonitorDataRequest() (request *DescribeNewProjectEipMonitorDataRequest) { + request = &DescribeNewProjectEipMonitorDataRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeNewProjectEipMonitorData", "ecs", "openAPI") + return +} + +// CreateDescribeNewProjectEipMonitorDataResponse creates a response to parse from DescribeNewProjectEipMonitorData response +func CreateDescribeNewProjectEipMonitorDataResponse() (response *DescribeNewProjectEipMonitorDataResponse) { + response = &DescribeNewProjectEipMonitorDataResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_physical_connections.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_physical_connections.go new file mode 100644 index 000000000..f65a68419 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_physical_connections.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" +) + +// DescribePhysicalConnections invokes the ecs.DescribePhysicalConnections API synchronously +// api document: https://help.aliyun.com/api/ecs/describephysicalconnections.html +func (client *Client) DescribePhysicalConnections(request *DescribePhysicalConnectionsRequest) (response *DescribePhysicalConnectionsResponse, err error) { + response = CreateDescribePhysicalConnectionsResponse() + err = client.DoAction(request, response) + return +} + +// DescribePhysicalConnectionsWithChan invokes the ecs.DescribePhysicalConnections API asynchronously +// api document: https://help.aliyun.com/api/ecs/describephysicalconnections.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribePhysicalConnectionsWithChan(request *DescribePhysicalConnectionsRequest) (<-chan *DescribePhysicalConnectionsResponse, <-chan error) { + responseChan := make(chan *DescribePhysicalConnectionsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribePhysicalConnections(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribePhysicalConnectionsWithCallback invokes the ecs.DescribePhysicalConnections API asynchronously +// api document: https://help.aliyun.com/api/ecs/describephysicalconnections.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribePhysicalConnectionsWithCallback(request *DescribePhysicalConnectionsRequest, callback func(response *DescribePhysicalConnectionsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribePhysicalConnectionsResponse + var err error + defer close(result) + response, err = client.DescribePhysicalConnections(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribePhysicalConnectionsRequest is the request struct for api DescribePhysicalConnections +type DescribePhysicalConnectionsRequest struct { + *requests.RpcRequest + Filter *[]DescribePhysicalConnectionsFilter `position:"Query" name:"Filter" type:"Repeated"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + UserCidr string `position:"Query" name:"UserCidr"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` +} + +// DescribePhysicalConnectionsFilter is a repeated param struct in DescribePhysicalConnectionsRequest +type DescribePhysicalConnectionsFilter struct { + Value *[]string `name:"Value" type:"Repeated"` + Key string `name:"Key"` +} + +// DescribePhysicalConnectionsResponse is the response struct for api DescribePhysicalConnections +type DescribePhysicalConnectionsResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + PageNumber int `json:"PageNumber" xml:"PageNumber"` + PageSize int `json:"PageSize" xml:"PageSize"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + PhysicalConnectionSet PhysicalConnectionSet `json:"PhysicalConnectionSet" xml:"PhysicalConnectionSet"` +} + +// CreateDescribePhysicalConnectionsRequest creates a request to invoke DescribePhysicalConnections API +func CreateDescribePhysicalConnectionsRequest() (request *DescribePhysicalConnectionsRequest) { + request = &DescribePhysicalConnectionsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribePhysicalConnections", "ecs", "openAPI") + return +} + +// CreateDescribePhysicalConnectionsResponse creates a response to parse from DescribePhysicalConnections response +func CreateDescribePhysicalConnectionsResponse() (response *DescribePhysicalConnectionsResponse) { + response = &DescribePhysicalConnectionsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_price.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_price.go new file mode 100644 index 000000000..e1cf62dad --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_price.go @@ -0,0 +1,127 @@ +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" +) + +// DescribePrice invokes the ecs.DescribePrice API synchronously +// api document: https://help.aliyun.com/api/ecs/describeprice.html +func (client *Client) DescribePrice(request *DescribePriceRequest) (response *DescribePriceResponse, err error) { + response = CreateDescribePriceResponse() + err = client.DoAction(request, response) + return +} + +// DescribePriceWithChan invokes the ecs.DescribePrice API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeprice.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribePriceWithChan(request *DescribePriceRequest) (<-chan *DescribePriceResponse, <-chan error) { + responseChan := make(chan *DescribePriceResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribePrice(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribePriceWithCallback invokes the ecs.DescribePrice API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeprice.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribePriceWithCallback(request *DescribePriceRequest, callback func(response *DescribePriceResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribePriceResponse + var err error + defer close(result) + response, err = client.DescribePrice(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribePriceRequest is the request struct for api DescribePrice +type DescribePriceRequest struct { + *requests.RpcRequest + DataDisk3Size requests.Integer `position:"Query" name:"DataDisk.3.Size"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ImageId string `position:"Query" name:"ImageId"` + DataDisk3Category string `position:"Query" name:"DataDisk.3.Category"` + IoOptimized string `position:"Query" name:"IoOptimized"` + InternetMaxBandwidthOut requests.Integer `position:"Query" name:"InternetMaxBandwidthOut"` + SystemDiskCategory string `position:"Query" name:"SystemDisk.Category"` + DataDisk4Category string `position:"Query" name:"DataDisk.4.Category"` + DataDisk4Size requests.Integer `position:"Query" name:"DataDisk.4.Size"` + PriceUnit string `position:"Query" name:"PriceUnit"` + InstanceType string `position:"Query" name:"InstanceType"` + DataDisk2Category string `position:"Query" name:"DataDisk.2.Category"` + DataDisk1Size requests.Integer `position:"Query" name:"DataDisk.1.Size"` + Period requests.Integer `position:"Query" name:"Period"` + Amount requests.Integer `position:"Query" name:"Amount"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + DataDisk2Size requests.Integer `position:"Query" name:"DataDisk.2.Size"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + ResourceType string `position:"Query" name:"ResourceType"` + DataDisk1Category string `position:"Query" name:"DataDisk.1.Category"` + SystemDiskSize requests.Integer `position:"Query" name:"SystemDisk.Size"` + InternetChargeType string `position:"Query" name:"InternetChargeType"` + InstanceNetworkType string `position:"Query" name:"InstanceNetworkType"` +} + +// DescribePriceResponse is the response struct for api DescribePrice +type DescribePriceResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + PriceInfo PriceInfo `json:"PriceInfo" xml:"PriceInfo"` +} + +// CreateDescribePriceRequest creates a request to invoke DescribePrice API +func CreateDescribePriceRequest() (request *DescribePriceRequest) { + request = &DescribePriceRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribePrice", "ecs", "openAPI") + return +} + +// CreateDescribePriceResponse creates a response to parse from DescribePrice response +func CreateDescribePriceResponse() (response *DescribePriceResponse) { + response = &DescribePriceResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_recommend_instance_type.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_recommend_instance_type.go new file mode 100644 index 000000000..3e09ef4ee --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_recommend_instance_type.go @@ -0,0 +1,114 @@ +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" +) + +// DescribeRecommendInstanceType invokes the ecs.DescribeRecommendInstanceType API synchronously +// api document: https://help.aliyun.com/api/ecs/describerecommendinstancetype.html +func (client *Client) DescribeRecommendInstanceType(request *DescribeRecommendInstanceTypeRequest) (response *DescribeRecommendInstanceTypeResponse, err error) { + response = CreateDescribeRecommendInstanceTypeResponse() + err = client.DoAction(request, response) + return +} + +// DescribeRecommendInstanceTypeWithChan invokes the ecs.DescribeRecommendInstanceType API asynchronously +// api document: https://help.aliyun.com/api/ecs/describerecommendinstancetype.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeRecommendInstanceTypeWithChan(request *DescribeRecommendInstanceTypeRequest) (<-chan *DescribeRecommendInstanceTypeResponse, <-chan error) { + responseChan := make(chan *DescribeRecommendInstanceTypeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeRecommendInstanceType(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeRecommendInstanceTypeWithCallback invokes the ecs.DescribeRecommendInstanceType API asynchronously +// api document: https://help.aliyun.com/api/ecs/describerecommendinstancetype.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeRecommendInstanceTypeWithCallback(request *DescribeRecommendInstanceTypeRequest, callback func(response *DescribeRecommendInstanceTypeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeRecommendInstanceTypeResponse + var err error + defer close(result) + response, err = client.DescribeRecommendInstanceType(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeRecommendInstanceTypeRequest is the request struct for api DescribeRecommendInstanceType +type DescribeRecommendInstanceTypeRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Channel string `position:"Query" name:"channel"` + NetworkType string `position:"Query" name:"NetworkType"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Operator string `position:"Query" name:"operator"` + Token string `position:"Query" name:"token"` + Scene string `position:"Query" name:"Scene"` + InstanceType string `position:"Query" name:"InstanceType"` + ProxyId string `position:"Query" name:"proxyId"` +} + +// DescribeRecommendInstanceTypeResponse is the response struct for api DescribeRecommendInstanceType +type DescribeRecommendInstanceTypeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Data Data `json:"Data" xml:"Data"` +} + +// CreateDescribeRecommendInstanceTypeRequest creates a request to invoke DescribeRecommendInstanceType API +func CreateDescribeRecommendInstanceTypeRequest() (request *DescribeRecommendInstanceTypeRequest) { + request = &DescribeRecommendInstanceTypeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeRecommendInstanceType", "ecs", "openAPI") + return +} + +// CreateDescribeRecommendInstanceTypeResponse creates a response to parse from DescribeRecommendInstanceType response +func CreateDescribeRecommendInstanceTypeResponse() (response *DescribeRecommendInstanceTypeResponse) { + response = &DescribeRecommendInstanceTypeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_regions.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_regions.go new file mode 100644 index 000000000..89637c7e8 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_regions.go @@ -0,0 +1,110 @@ +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" +) + +// DescribeRegions invokes the ecs.DescribeRegions API synchronously +// api document: https://help.aliyun.com/api/ecs/describeregions.html +func (client *Client) DescribeRegions(request *DescribeRegionsRequest) (response *DescribeRegionsResponse, err error) { + response = CreateDescribeRegionsResponse() + err = client.DoAction(request, response) + return +} + +// DescribeRegionsWithChan invokes the ecs.DescribeRegions API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeregions.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeRegionsWithChan(request *DescribeRegionsRequest) (<-chan *DescribeRegionsResponse, <-chan error) { + responseChan := make(chan *DescribeRegionsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeRegions(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeRegionsWithCallback invokes the ecs.DescribeRegions API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeregions.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeRegionsWithCallback(request *DescribeRegionsRequest, callback func(response *DescribeRegionsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeRegionsResponse + var err error + defer close(result) + response, err = client.DescribeRegions(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeRegionsRequest is the request struct for api DescribeRegions +type DescribeRegionsRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + AcceptLanguage string `position:"Query" name:"AcceptLanguage"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + InstanceChargeType string `position:"Query" name:"InstanceChargeType"` + ResourceType string `position:"Query" name:"ResourceType"` +} + +// DescribeRegionsResponse is the response struct for api DescribeRegions +type DescribeRegionsResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Regions Regions `json:"Regions" xml:"Regions"` +} + +// CreateDescribeRegionsRequest creates a request to invoke DescribeRegions API +func CreateDescribeRegionsRequest() (request *DescribeRegionsRequest) { + request = &DescribeRegionsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeRegions", "ecs", "openAPI") + return +} + +// CreateDescribeRegionsResponse creates a response to parse from DescribeRegions response +func CreateDescribeRegionsResponse() (response *DescribeRegionsResponse) { + response = &DescribeRegionsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_renewal_price.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_renewal_price.go new file mode 100644 index 000000000..5fc0767c8 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_renewal_price.go @@ -0,0 +1,111 @@ +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" +) + +// DescribeRenewalPrice invokes the ecs.DescribeRenewalPrice API synchronously +// api document: https://help.aliyun.com/api/ecs/describerenewalprice.html +func (client *Client) DescribeRenewalPrice(request *DescribeRenewalPriceRequest) (response *DescribeRenewalPriceResponse, err error) { + response = CreateDescribeRenewalPriceResponse() + err = client.DoAction(request, response) + return +} + +// DescribeRenewalPriceWithChan invokes the ecs.DescribeRenewalPrice API asynchronously +// api document: https://help.aliyun.com/api/ecs/describerenewalprice.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeRenewalPriceWithChan(request *DescribeRenewalPriceRequest) (<-chan *DescribeRenewalPriceResponse, <-chan error) { + responseChan := make(chan *DescribeRenewalPriceResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeRenewalPrice(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeRenewalPriceWithCallback invokes the ecs.DescribeRenewalPrice API asynchronously +// api document: https://help.aliyun.com/api/ecs/describerenewalprice.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeRenewalPriceWithCallback(request *DescribeRenewalPriceRequest, callback func(response *DescribeRenewalPriceResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeRenewalPriceResponse + var err error + defer close(result) + response, err = client.DescribeRenewalPrice(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeRenewalPriceRequest is the request struct for api DescribeRenewalPrice +type DescribeRenewalPriceRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceId string `position:"Query" name:"ResourceId"` + Period requests.Integer `position:"Query" name:"Period"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + PriceUnit string `position:"Query" name:"PriceUnit"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + ResourceType string `position:"Query" name:"ResourceType"` +} + +// DescribeRenewalPriceResponse is the response struct for api DescribeRenewalPrice +type DescribeRenewalPriceResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + PriceInfo PriceInfo `json:"PriceInfo" xml:"PriceInfo"` +} + +// CreateDescribeRenewalPriceRequest creates a request to invoke DescribeRenewalPrice API +func CreateDescribeRenewalPriceRequest() (request *DescribeRenewalPriceRequest) { + request = &DescribeRenewalPriceRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeRenewalPrice", "ecs", "openAPI") + return +} + +// CreateDescribeRenewalPriceResponse creates a response to parse from DescribeRenewalPrice response +func CreateDescribeRenewalPriceResponse() (response *DescribeRenewalPriceResponse) { + response = &DescribeRenewalPriceResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_reserved_instances.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_reserved_instances.go new file mode 100644 index 000000000..5ef48623f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/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 +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_resource_by_tags.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_resource_by_tags.go new file mode 100644 index 000000000..c962092a1 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_resource_by_tags.go @@ -0,0 +1,119 @@ +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" +) + +// DescribeResourceByTags invokes the ecs.DescribeResourceByTags API synchronously +// api document: https://help.aliyun.com/api/ecs/describeresourcebytags.html +func (client *Client) DescribeResourceByTags(request *DescribeResourceByTagsRequest) (response *DescribeResourceByTagsResponse, err error) { + response = CreateDescribeResourceByTagsResponse() + err = client.DoAction(request, response) + return +} + +// DescribeResourceByTagsWithChan invokes the ecs.DescribeResourceByTags API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeresourcebytags.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeResourceByTagsWithChan(request *DescribeResourceByTagsRequest) (<-chan *DescribeResourceByTagsResponse, <-chan error) { + responseChan := make(chan *DescribeResourceByTagsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeResourceByTags(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeResourceByTagsWithCallback invokes the ecs.DescribeResourceByTags API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeresourcebytags.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeResourceByTagsWithCallback(request *DescribeResourceByTagsRequest, callback func(response *DescribeResourceByTagsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeResourceByTagsResponse + var err error + defer close(result) + response, err = client.DescribeResourceByTags(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeResourceByTagsRequest is the request struct for api DescribeResourceByTags +type DescribeResourceByTagsRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + Tag *[]DescribeResourceByTagsTag `position:"Query" name:"Tag" type:"Repeated"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + ResourceType string `position:"Query" name:"ResourceType"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` +} + +// DescribeResourceByTagsTag is a repeated param struct in DescribeResourceByTagsRequest +type DescribeResourceByTagsTag struct { + Value string `name:"Value"` + Key string `name:"Key"` +} + +// DescribeResourceByTagsResponse is the response struct for api DescribeResourceByTags +type DescribeResourceByTagsResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + PageSize int `json:"PageSize" xml:"PageSize"` + PageNumber int `json:"PageNumber" xml:"PageNumber"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + Resources Resources `json:"Resources" xml:"Resources"` +} + +// CreateDescribeResourceByTagsRequest creates a request to invoke DescribeResourceByTags API +func CreateDescribeResourceByTagsRequest() (request *DescribeResourceByTagsRequest) { + request = &DescribeResourceByTagsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeResourceByTags", "ecs", "openAPI") + return +} + +// CreateDescribeResourceByTagsResponse creates a response to parse from DescribeResourceByTags response +func CreateDescribeResourceByTagsResponse() (response *DescribeResourceByTagsResponse) { + response = &DescribeResourceByTagsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_resources_modification.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_resources_modification.go new file mode 100644 index 000000000..5b258235f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_resources_modification.go @@ -0,0 +1,114 @@ +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" +) + +// DescribeResourcesModification invokes the ecs.DescribeResourcesModification API synchronously +// api document: https://help.aliyun.com/api/ecs/describeresourcesmodification.html +func (client *Client) DescribeResourcesModification(request *DescribeResourcesModificationRequest) (response *DescribeResourcesModificationResponse, err error) { + response = CreateDescribeResourcesModificationResponse() + err = client.DoAction(request, response) + return +} + +// DescribeResourcesModificationWithChan invokes the ecs.DescribeResourcesModification API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeresourcesmodification.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeResourcesModificationWithChan(request *DescribeResourcesModificationRequest) (<-chan *DescribeResourcesModificationResponse, <-chan error) { + responseChan := make(chan *DescribeResourcesModificationResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeResourcesModification(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeResourcesModificationWithCallback invokes the ecs.DescribeResourcesModification API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeresourcesmodification.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeResourcesModificationWithCallback(request *DescribeResourcesModificationRequest, callback func(response *DescribeResourcesModificationResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeResourcesModificationResponse + var err error + defer close(result) + response, err = client.DescribeResourcesModification(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeResourcesModificationRequest is the request struct for api DescribeResourcesModification +type DescribeResourcesModificationRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + Memory requests.Float `position:"Query" name:"Memory"` + Cores requests.Integer `position:"Query" name:"Cores"` + MigrateAcrossZone requests.Boolean `position:"Query" name:"MigrateAcrossZone"` + InstanceType string `position:"Query" name:"InstanceType"` + ResourceId string `position:"Query" name:"ResourceId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OperationType string `position:"Query" name:"OperationType"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + DestinationResource string `position:"Query" name:"DestinationResource"` +} + +// DescribeResourcesModificationResponse is the response struct for api DescribeResourcesModification +type DescribeResourcesModificationResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + AvailableZones AvailableZonesInDescribeResourcesModification `json:"AvailableZones" xml:"AvailableZones"` +} + +// CreateDescribeResourcesModificationRequest creates a request to invoke DescribeResourcesModification API +func CreateDescribeResourcesModificationRequest() (request *DescribeResourcesModificationRequest) { + request = &DescribeResourcesModificationRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeResourcesModification", "ecs", "openAPI") + return +} + +// CreateDescribeResourcesModificationResponse creates a response to parse from DescribeResourcesModification response +func CreateDescribeResourcesModificationResponse() (response *DescribeResourcesModificationResponse) { + response = &DescribeResourcesModificationResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_route_tables.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_route_tables.go new file mode 100644 index 000000000..977570992 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_route_tables.go @@ -0,0 +1,117 @@ +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" +) + +// DescribeRouteTables invokes the ecs.DescribeRouteTables API synchronously +// api document: https://help.aliyun.com/api/ecs/describeroutetables.html +func (client *Client) DescribeRouteTables(request *DescribeRouteTablesRequest) (response *DescribeRouteTablesResponse, err error) { + response = CreateDescribeRouteTablesResponse() + err = client.DoAction(request, response) + return +} + +// DescribeRouteTablesWithChan invokes the ecs.DescribeRouteTables API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeroutetables.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeRouteTablesWithChan(request *DescribeRouteTablesRequest) (<-chan *DescribeRouteTablesResponse, <-chan error) { + responseChan := make(chan *DescribeRouteTablesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeRouteTables(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeRouteTablesWithCallback invokes the ecs.DescribeRouteTables API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeroutetables.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeRouteTablesWithCallback(request *DescribeRouteTablesRequest, callback func(response *DescribeRouteTablesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeRouteTablesResponse + var err error + defer close(result) + response, err = client.DescribeRouteTables(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeRouteTablesRequest is the request struct for api DescribeRouteTables +type DescribeRouteTablesRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + VRouterId string `position:"Query" name:"VRouterId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` + RouterType string `position:"Query" name:"RouterType"` + RouteTableName string `position:"Query" name:"RouteTableName"` + RouterId string `position:"Query" name:"RouterId"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + RouteTableId string `position:"Query" name:"RouteTableId"` +} + +// DescribeRouteTablesResponse is the response struct for api DescribeRouteTables +type DescribeRouteTablesResponse 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"` + RouteTables RouteTables `json:"RouteTables" xml:"RouteTables"` +} + +// CreateDescribeRouteTablesRequest creates a request to invoke DescribeRouteTables API +func CreateDescribeRouteTablesRequest() (request *DescribeRouteTablesRequest) { + request = &DescribeRouteTablesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeRouteTables", "ecs", "openAPI") + return +} + +// CreateDescribeRouteTablesResponse creates a response to parse from DescribeRouteTables response +func CreateDescribeRouteTablesResponse() (response *DescribeRouteTablesResponse) { + response = &DescribeRouteTablesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_router_interfaces.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_router_interfaces.go new file mode 100644 index 000000000..7cbc26223 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_router_interfaces.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" +) + +// DescribeRouterInterfaces invokes the ecs.DescribeRouterInterfaces API synchronously +// api document: https://help.aliyun.com/api/ecs/describerouterinterfaces.html +func (client *Client) DescribeRouterInterfaces(request *DescribeRouterInterfacesRequest) (response *DescribeRouterInterfacesResponse, err error) { + response = CreateDescribeRouterInterfacesResponse() + err = client.DoAction(request, response) + return +} + +// DescribeRouterInterfacesWithChan invokes the ecs.DescribeRouterInterfaces API asynchronously +// api document: https://help.aliyun.com/api/ecs/describerouterinterfaces.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeRouterInterfacesWithChan(request *DescribeRouterInterfacesRequest) (<-chan *DescribeRouterInterfacesResponse, <-chan error) { + responseChan := make(chan *DescribeRouterInterfacesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeRouterInterfaces(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeRouterInterfacesWithCallback invokes the ecs.DescribeRouterInterfaces API asynchronously +// api document: https://help.aliyun.com/api/ecs/describerouterinterfaces.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeRouterInterfacesWithCallback(request *DescribeRouterInterfacesRequest, callback func(response *DescribeRouterInterfacesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeRouterInterfacesResponse + var err error + defer close(result) + response, err = client.DescribeRouterInterfaces(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeRouterInterfacesRequest is the request struct for api DescribeRouterInterfaces +type DescribeRouterInterfacesRequest struct { + *requests.RpcRequest + Filter *[]DescribeRouterInterfacesFilter `position:"Query" name:"Filter" type:"Repeated"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` +} + +// DescribeRouterInterfacesFilter is a repeated param struct in DescribeRouterInterfacesRequest +type DescribeRouterInterfacesFilter struct { + Value *[]string `name:"Value" type:"Repeated"` + Key string `name:"Key"` +} + +// DescribeRouterInterfacesResponse is the response struct for api DescribeRouterInterfaces +type DescribeRouterInterfacesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + PageNumber int `json:"PageNumber" xml:"PageNumber"` + PageSize int `json:"PageSize" xml:"PageSize"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + RouterInterfaceSet RouterInterfaceSet `json:"RouterInterfaceSet" xml:"RouterInterfaceSet"` +} + +// CreateDescribeRouterInterfacesRequest creates a request to invoke DescribeRouterInterfaces API +func CreateDescribeRouterInterfacesRequest() (request *DescribeRouterInterfacesRequest) { + request = &DescribeRouterInterfacesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeRouterInterfaces", "ecs", "openAPI") + return +} + +// CreateDescribeRouterInterfacesResponse creates a response to parse from DescribeRouterInterfaces response +func CreateDescribeRouterInterfacesResponse() (response *DescribeRouterInterfacesResponse) { + response = &DescribeRouterInterfacesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_security_group_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_security_group_attribute.go new file mode 100644 index 000000000..74006029c --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_security_group_attribute.go @@ -0,0 +1,116 @@ +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" +) + +// DescribeSecurityGroupAttribute invokes the ecs.DescribeSecurityGroupAttribute API synchronously +// api document: https://help.aliyun.com/api/ecs/describesecuritygroupattribute.html +func (client *Client) DescribeSecurityGroupAttribute(request *DescribeSecurityGroupAttributeRequest) (response *DescribeSecurityGroupAttributeResponse, err error) { + response = CreateDescribeSecurityGroupAttributeResponse() + err = client.DoAction(request, response) + return +} + +// DescribeSecurityGroupAttributeWithChan invokes the ecs.DescribeSecurityGroupAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/describesecuritygroupattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeSecurityGroupAttributeWithChan(request *DescribeSecurityGroupAttributeRequest) (<-chan *DescribeSecurityGroupAttributeResponse, <-chan error) { + responseChan := make(chan *DescribeSecurityGroupAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeSecurityGroupAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeSecurityGroupAttributeWithCallback invokes the ecs.DescribeSecurityGroupAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/describesecuritygroupattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeSecurityGroupAttributeWithCallback(request *DescribeSecurityGroupAttributeRequest, callback func(response *DescribeSecurityGroupAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeSecurityGroupAttributeResponse + var err error + defer close(result) + response, err = client.DescribeSecurityGroupAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeSecurityGroupAttributeRequest is the request struct for api DescribeSecurityGroupAttribute +type DescribeSecurityGroupAttributeRequest struct { + *requests.RpcRequest + NicType string `position:"Query" name:"NicType"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + SecurityGroupId string `position:"Query" name:"SecurityGroupId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Direction string `position:"Query" name:"Direction"` +} + +// DescribeSecurityGroupAttributeResponse is the response struct for api DescribeSecurityGroupAttribute +type DescribeSecurityGroupAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + RegionId string `json:"RegionId" xml:"RegionId"` + SecurityGroupId string `json:"SecurityGroupId" xml:"SecurityGroupId"` + Description string `json:"Description" xml:"Description"` + SecurityGroupName string `json:"SecurityGroupName" xml:"SecurityGroupName"` + VpcId string `json:"VpcId" xml:"VpcId"` + InnerAccessPolicy string `json:"InnerAccessPolicy" xml:"InnerAccessPolicy"` + Permissions Permissions `json:"Permissions" xml:"Permissions"` +} + +// CreateDescribeSecurityGroupAttributeRequest creates a request to invoke DescribeSecurityGroupAttribute API +func CreateDescribeSecurityGroupAttributeRequest() (request *DescribeSecurityGroupAttributeRequest) { + request = &DescribeSecurityGroupAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeSecurityGroupAttribute", "ecs", "openAPI") + return +} + +// CreateDescribeSecurityGroupAttributeResponse creates a response to parse from DescribeSecurityGroupAttribute response +func CreateDescribeSecurityGroupAttributeResponse() (response *DescribeSecurityGroupAttributeResponse) { + response = &DescribeSecurityGroupAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_security_group_references.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_security_group_references.go new file mode 100644 index 000000000..74a0c86a0 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_security_group_references.go @@ -0,0 +1,108 @@ +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" +) + +// DescribeSecurityGroupReferences invokes the ecs.DescribeSecurityGroupReferences API synchronously +// api document: https://help.aliyun.com/api/ecs/describesecuritygroupreferences.html +func (client *Client) DescribeSecurityGroupReferences(request *DescribeSecurityGroupReferencesRequest) (response *DescribeSecurityGroupReferencesResponse, err error) { + response = CreateDescribeSecurityGroupReferencesResponse() + err = client.DoAction(request, response) + return +} + +// DescribeSecurityGroupReferencesWithChan invokes the ecs.DescribeSecurityGroupReferences API asynchronously +// api document: https://help.aliyun.com/api/ecs/describesecuritygroupreferences.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeSecurityGroupReferencesWithChan(request *DescribeSecurityGroupReferencesRequest) (<-chan *DescribeSecurityGroupReferencesResponse, <-chan error) { + responseChan := make(chan *DescribeSecurityGroupReferencesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeSecurityGroupReferences(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeSecurityGroupReferencesWithCallback invokes the ecs.DescribeSecurityGroupReferences API asynchronously +// api document: https://help.aliyun.com/api/ecs/describesecuritygroupreferences.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeSecurityGroupReferencesWithCallback(request *DescribeSecurityGroupReferencesRequest, callback func(response *DescribeSecurityGroupReferencesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeSecurityGroupReferencesResponse + var err error + defer close(result) + response, err = client.DescribeSecurityGroupReferences(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeSecurityGroupReferencesRequest is the request struct for api DescribeSecurityGroupReferences +type DescribeSecurityGroupReferencesRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + SecurityGroupId *[]string `position:"Query" name:"SecurityGroupId" type:"Repeated"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DescribeSecurityGroupReferencesResponse is the response struct for api DescribeSecurityGroupReferences +type DescribeSecurityGroupReferencesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + SecurityGroupReferences SecurityGroupReferences `json:"SecurityGroupReferences" xml:"SecurityGroupReferences"` +} + +// CreateDescribeSecurityGroupReferencesRequest creates a request to invoke DescribeSecurityGroupReferences API +func CreateDescribeSecurityGroupReferencesRequest() (request *DescribeSecurityGroupReferencesRequest) { + request = &DescribeSecurityGroupReferencesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeSecurityGroupReferences", "ecs", "openAPI") + return +} + +// CreateDescribeSecurityGroupReferencesResponse creates a response to parse from DescribeSecurityGroupReferences response +func CreateDescribeSecurityGroupReferencesResponse() (response *DescribeSecurityGroupReferencesResponse) { + response = &DescribeSecurityGroupReferencesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_security_groups.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_security_groups.go new file mode 100644 index 000000000..15eecaf8f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_security_groups.go @@ -0,0 +1,129 @@ +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" +) + +// DescribeSecurityGroups invokes the ecs.DescribeSecurityGroups API synchronously +// api document: https://help.aliyun.com/api/ecs/describesecuritygroups.html +func (client *Client) DescribeSecurityGroups(request *DescribeSecurityGroupsRequest) (response *DescribeSecurityGroupsResponse, err error) { + response = CreateDescribeSecurityGroupsResponse() + err = client.DoAction(request, response) + return +} + +// DescribeSecurityGroupsWithChan invokes the ecs.DescribeSecurityGroups API asynchronously +// api document: https://help.aliyun.com/api/ecs/describesecuritygroups.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeSecurityGroupsWithChan(request *DescribeSecurityGroupsRequest) (<-chan *DescribeSecurityGroupsResponse, <-chan error) { + responseChan := make(chan *DescribeSecurityGroupsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeSecurityGroups(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeSecurityGroupsWithCallback invokes the ecs.DescribeSecurityGroups API asynchronously +// api document: https://help.aliyun.com/api/ecs/describesecuritygroups.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeSecurityGroupsWithCallback(request *DescribeSecurityGroupsRequest, callback func(response *DescribeSecurityGroupsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeSecurityGroupsResponse + var err error + defer close(result) + response, err = client.DescribeSecurityGroups(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeSecurityGroupsRequest is the request struct for api DescribeSecurityGroups +type DescribeSecurityGroupsRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + DryRun requests.Boolean `position:"Query" name:"DryRun"` + FuzzyQuery requests.Boolean `position:"Query" name:"FuzzyQuery"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + SecurityGroupId string `position:"Query" name:"SecurityGroupId"` + IsQueryEcsCount requests.Boolean `position:"Query" name:"IsQueryEcsCount"` + NetworkType string `position:"Query" name:"NetworkType"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + SecurityGroupIds string `position:"Query" name:"SecurityGroupIds"` + SecurityGroupName string `position:"Query" name:"SecurityGroupName"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` + ResourceGroupId string `position:"Query" name:"ResourceGroupId"` + VpcId string `position:"Query" name:"VpcId"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + Tag *[]DescribeSecurityGroupsTag `position:"Query" name:"Tag" type:"Repeated"` +} + +// DescribeSecurityGroupsTag is a repeated param struct in DescribeSecurityGroupsRequest +type DescribeSecurityGroupsTag struct { + Value string `name:"Value"` + Key string `name:"Key"` +} + +// DescribeSecurityGroupsResponse is the response struct for api DescribeSecurityGroups +type DescribeSecurityGroupsResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + RegionId string `json:"RegionId" xml:"RegionId"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + PageNumber int `json:"PageNumber" xml:"PageNumber"` + PageSize int `json:"PageSize" xml:"PageSize"` + SecurityGroups SecurityGroups `json:"SecurityGroups" xml:"SecurityGroups"` +} + +// CreateDescribeSecurityGroupsRequest creates a request to invoke DescribeSecurityGroups API +func CreateDescribeSecurityGroupsRequest() (request *DescribeSecurityGroupsRequest) { + request = &DescribeSecurityGroupsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeSecurityGroups", "ecs", "openAPI") + return +} + +// CreateDescribeSecurityGroupsResponse creates a response to parse from DescribeSecurityGroups response +func CreateDescribeSecurityGroupsResponse() (response *DescribeSecurityGroupsResponse) { + response = &DescribeSecurityGroupsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_snapshot_links.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_snapshot_links.go new file mode 100644 index 000000000..322f4efeb --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_snapshot_links.go @@ -0,0 +1,115 @@ +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" +) + +// DescribeSnapshotLinks invokes the ecs.DescribeSnapshotLinks API synchronously +// api document: https://help.aliyun.com/api/ecs/describesnapshotlinks.html +func (client *Client) DescribeSnapshotLinks(request *DescribeSnapshotLinksRequest) (response *DescribeSnapshotLinksResponse, err error) { + response = CreateDescribeSnapshotLinksResponse() + err = client.DoAction(request, response) + return +} + +// DescribeSnapshotLinksWithChan invokes the ecs.DescribeSnapshotLinks API asynchronously +// api document: https://help.aliyun.com/api/ecs/describesnapshotlinks.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeSnapshotLinksWithChan(request *DescribeSnapshotLinksRequest) (<-chan *DescribeSnapshotLinksResponse, <-chan error) { + responseChan := make(chan *DescribeSnapshotLinksResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeSnapshotLinks(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeSnapshotLinksWithCallback invokes the ecs.DescribeSnapshotLinks API asynchronously +// api document: https://help.aliyun.com/api/ecs/describesnapshotlinks.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeSnapshotLinksWithCallback(request *DescribeSnapshotLinksRequest, callback func(response *DescribeSnapshotLinksResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeSnapshotLinksResponse + var err error + defer close(result) + response, err = client.DescribeSnapshotLinks(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeSnapshotLinksRequest is the request struct for api DescribeSnapshotLinks +type DescribeSnapshotLinksRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + InstanceId string `position:"Query" name:"InstanceId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + DiskIds string `position:"Query" name:"DiskIds"` + SnapshotLinkIds string `position:"Query" name:"SnapshotLinkIds"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` +} + +// DescribeSnapshotLinksResponse is the response struct for api DescribeSnapshotLinks +type DescribeSnapshotLinksResponse 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"` + SnapshotLinks SnapshotLinks `json:"SnapshotLinks" xml:"SnapshotLinks"` +} + +// CreateDescribeSnapshotLinksRequest creates a request to invoke DescribeSnapshotLinks API +func CreateDescribeSnapshotLinksRequest() (request *DescribeSnapshotLinksRequest) { + request = &DescribeSnapshotLinksRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeSnapshotLinks", "ecs", "openAPI") + return +} + +// CreateDescribeSnapshotLinksResponse creates a response to parse from DescribeSnapshotLinks response +func CreateDescribeSnapshotLinksResponse() (response *DescribeSnapshotLinksResponse) { + response = &DescribeSnapshotLinksResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_snapshot_monitor_data.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_snapshot_monitor_data.go new file mode 100644 index 000000000..cd42e3a36 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_snapshot_monitor_data.go @@ -0,0 +1,110 @@ +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" +) + +// DescribeSnapshotMonitorData invokes the ecs.DescribeSnapshotMonitorData API synchronously +// api document: https://help.aliyun.com/api/ecs/describesnapshotmonitordata.html +func (client *Client) DescribeSnapshotMonitorData(request *DescribeSnapshotMonitorDataRequest) (response *DescribeSnapshotMonitorDataResponse, err error) { + response = CreateDescribeSnapshotMonitorDataResponse() + err = client.DoAction(request, response) + return +} + +// DescribeSnapshotMonitorDataWithChan invokes the ecs.DescribeSnapshotMonitorData API asynchronously +// api document: https://help.aliyun.com/api/ecs/describesnapshotmonitordata.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeSnapshotMonitorDataWithChan(request *DescribeSnapshotMonitorDataRequest) (<-chan *DescribeSnapshotMonitorDataResponse, <-chan error) { + responseChan := make(chan *DescribeSnapshotMonitorDataResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeSnapshotMonitorData(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeSnapshotMonitorDataWithCallback invokes the ecs.DescribeSnapshotMonitorData API asynchronously +// api document: https://help.aliyun.com/api/ecs/describesnapshotmonitordata.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeSnapshotMonitorDataWithCallback(request *DescribeSnapshotMonitorDataRequest, callback func(response *DescribeSnapshotMonitorDataResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeSnapshotMonitorDataResponse + var err error + defer close(result) + response, err = client.DescribeSnapshotMonitorData(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeSnapshotMonitorDataRequest is the request struct for api DescribeSnapshotMonitorData +type DescribeSnapshotMonitorDataRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + Period requests.Integer `position:"Query" name:"Period"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + EndTime string `position:"Query" name:"EndTime"` + StartTime string `position:"Query" name:"StartTime"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DescribeSnapshotMonitorDataResponse is the response struct for api DescribeSnapshotMonitorData +type DescribeSnapshotMonitorDataResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + MonitorData MonitorDataInDescribeSnapshotMonitorData `json:"MonitorData" xml:"MonitorData"` +} + +// CreateDescribeSnapshotMonitorDataRequest creates a request to invoke DescribeSnapshotMonitorData API +func CreateDescribeSnapshotMonitorDataRequest() (request *DescribeSnapshotMonitorDataRequest) { + request = &DescribeSnapshotMonitorDataRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeSnapshotMonitorData", "ecs", "openAPI") + return +} + +// CreateDescribeSnapshotMonitorDataResponse creates a response to parse from DescribeSnapshotMonitorData response +func CreateDescribeSnapshotMonitorDataResponse() (response *DescribeSnapshotMonitorDataResponse) { + response = &DescribeSnapshotMonitorDataResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_snapshot_package.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_snapshot_package.go new file mode 100644 index 000000000..b4fefc344 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_snapshot_package.go @@ -0,0 +1,112 @@ +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" +) + +// DescribeSnapshotPackage invokes the ecs.DescribeSnapshotPackage API synchronously +// api document: https://help.aliyun.com/api/ecs/describesnapshotpackage.html +func (client *Client) DescribeSnapshotPackage(request *DescribeSnapshotPackageRequest) (response *DescribeSnapshotPackageResponse, err error) { + response = CreateDescribeSnapshotPackageResponse() + err = client.DoAction(request, response) + return +} + +// DescribeSnapshotPackageWithChan invokes the ecs.DescribeSnapshotPackage API asynchronously +// api document: https://help.aliyun.com/api/ecs/describesnapshotpackage.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeSnapshotPackageWithChan(request *DescribeSnapshotPackageRequest) (<-chan *DescribeSnapshotPackageResponse, <-chan error) { + responseChan := make(chan *DescribeSnapshotPackageResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeSnapshotPackage(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeSnapshotPackageWithCallback invokes the ecs.DescribeSnapshotPackage API asynchronously +// api document: https://help.aliyun.com/api/ecs/describesnapshotpackage.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeSnapshotPackageWithCallback(request *DescribeSnapshotPackageRequest, callback func(response *DescribeSnapshotPackageResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeSnapshotPackageResponse + var err error + defer close(result) + response, err = client.DescribeSnapshotPackage(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeSnapshotPackageRequest is the request struct for api DescribeSnapshotPackage +type DescribeSnapshotPackageRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` +} + +// DescribeSnapshotPackageResponse is the response struct for api DescribeSnapshotPackage +type DescribeSnapshotPackageResponse 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"` + SnapshotPackages SnapshotPackages `json:"SnapshotPackages" xml:"SnapshotPackages"` +} + +// CreateDescribeSnapshotPackageRequest creates a request to invoke DescribeSnapshotPackage API +func CreateDescribeSnapshotPackageRequest() (request *DescribeSnapshotPackageRequest) { + request = &DescribeSnapshotPackageRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeSnapshotPackage", "ecs", "openAPI") + return +} + +// CreateDescribeSnapshotPackageResponse creates a response to parse from DescribeSnapshotPackage response +func CreateDescribeSnapshotPackageResponse() (response *DescribeSnapshotPackageResponse) { + response = &DescribeSnapshotPackageResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_snapshots.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_snapshots.go new file mode 100644 index 000000000..cad590c20 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_snapshots.go @@ -0,0 +1,136 @@ +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" +) + +// DescribeSnapshots invokes the ecs.DescribeSnapshots API synchronously +// api document: https://help.aliyun.com/api/ecs/describesnapshots.html +func (client *Client) DescribeSnapshots(request *DescribeSnapshotsRequest) (response *DescribeSnapshotsResponse, err error) { + response = CreateDescribeSnapshotsResponse() + err = client.DoAction(request, response) + return +} + +// DescribeSnapshotsWithChan invokes the ecs.DescribeSnapshots API asynchronously +// api document: https://help.aliyun.com/api/ecs/describesnapshots.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeSnapshotsWithChan(request *DescribeSnapshotsRequest) (<-chan *DescribeSnapshotsResponse, <-chan error) { + responseChan := make(chan *DescribeSnapshotsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeSnapshots(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeSnapshotsWithCallback invokes the ecs.DescribeSnapshots API asynchronously +// api document: https://help.aliyun.com/api/ecs/describesnapshots.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeSnapshotsWithCallback(request *DescribeSnapshotsRequest, callback func(response *DescribeSnapshotsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeSnapshotsResponse + var err error + defer close(result) + response, err = client.DescribeSnapshots(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeSnapshotsRequest is the request struct for api DescribeSnapshots +type DescribeSnapshotsRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + Filter2Value string `position:"Query" name:"Filter.2.Value"` + SnapshotIds string `position:"Query" name:"SnapshotIds"` + Usage string `position:"Query" name:"Usage"` + SnapshotLinkId string `position:"Query" name:"SnapshotLinkId"` + SnapshotName string `position:"Query" name:"SnapshotName"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` + ResourceGroupId string `position:"Query" name:"ResourceGroupId"` + Filter1Key string `position:"Query" name:"Filter.1.Key"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + DiskId string `position:"Query" name:"DiskId"` + Tag *[]DescribeSnapshotsTag `position:"Query" name:"Tag" type:"Repeated"` + DryRun requests.Boolean `position:"Query" name:"DryRun"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + SourceDiskType string `position:"Query" name:"SourceDiskType"` + Filter1Value string `position:"Query" name:"Filter.1.Value"` + Filter2Key string `position:"Query" name:"Filter.2.Key"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + InstanceId string `position:"Query" name:"InstanceId"` + Encrypted requests.Boolean `position:"Query" name:"Encrypted"` + SnapshotType string `position:"Query" name:"SnapshotType"` + KMSKeyId string `position:"Query" name:"KMSKeyId"` + Status string `position:"Query" name:"Status"` +} + +// DescribeSnapshotsTag is a repeated param struct in DescribeSnapshotsRequest +type DescribeSnapshotsTag struct { + Value string `name:"Value"` + Key string `name:"Key"` +} + +// DescribeSnapshotsResponse is the response struct for api DescribeSnapshots +type DescribeSnapshotsResponse 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"` + Snapshots Snapshots `json:"Snapshots" xml:"Snapshots"` +} + +// CreateDescribeSnapshotsRequest creates a request to invoke DescribeSnapshots API +func CreateDescribeSnapshotsRequest() (request *DescribeSnapshotsRequest) { + request = &DescribeSnapshotsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeSnapshots", "ecs", "openAPI") + return +} + +// CreateDescribeSnapshotsResponse creates a response to parse from DescribeSnapshots response +func CreateDescribeSnapshotsResponse() (response *DescribeSnapshotsResponse) { + response = &DescribeSnapshotsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_snapshots_usage.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_snapshots_usage.go new file mode 100644 index 000000000..769579cd4 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_snapshots_usage.go @@ -0,0 +1,108 @@ +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" +) + +// DescribeSnapshotsUsage invokes the ecs.DescribeSnapshotsUsage API synchronously +// api document: https://help.aliyun.com/api/ecs/describesnapshotsusage.html +func (client *Client) DescribeSnapshotsUsage(request *DescribeSnapshotsUsageRequest) (response *DescribeSnapshotsUsageResponse, err error) { + response = CreateDescribeSnapshotsUsageResponse() + err = client.DoAction(request, response) + return +} + +// DescribeSnapshotsUsageWithChan invokes the ecs.DescribeSnapshotsUsage API asynchronously +// api document: https://help.aliyun.com/api/ecs/describesnapshotsusage.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeSnapshotsUsageWithChan(request *DescribeSnapshotsUsageRequest) (<-chan *DescribeSnapshotsUsageResponse, <-chan error) { + responseChan := make(chan *DescribeSnapshotsUsageResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeSnapshotsUsage(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeSnapshotsUsageWithCallback invokes the ecs.DescribeSnapshotsUsage API asynchronously +// api document: https://help.aliyun.com/api/ecs/describesnapshotsusage.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeSnapshotsUsageWithCallback(request *DescribeSnapshotsUsageRequest, callback func(response *DescribeSnapshotsUsageResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeSnapshotsUsageResponse + var err error + defer close(result) + response, err = client.DescribeSnapshotsUsage(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeSnapshotsUsageRequest is the request struct for api DescribeSnapshotsUsage +type DescribeSnapshotsUsageRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DescribeSnapshotsUsageResponse is the response struct for api DescribeSnapshotsUsage +type DescribeSnapshotsUsageResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + SnapshotCount int `json:"SnapshotCount" xml:"SnapshotCount"` + SnapshotSize int `json:"SnapshotSize" xml:"SnapshotSize"` +} + +// CreateDescribeSnapshotsUsageRequest creates a request to invoke DescribeSnapshotsUsage API +func CreateDescribeSnapshotsUsageRequest() (request *DescribeSnapshotsUsageRequest) { + request = &DescribeSnapshotsUsageRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeSnapshotsUsage", "ecs", "openAPI") + return +} + +// CreateDescribeSnapshotsUsageResponse creates a response to parse from DescribeSnapshotsUsage response +func CreateDescribeSnapshotsUsageResponse() (response *DescribeSnapshotsUsageResponse) { + response = &DescribeSnapshotsUsageResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_spot_price_history.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_spot_price_history.go new file mode 100644 index 000000000..b8cdc63a6 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_spot_price_history.go @@ -0,0 +1,117 @@ +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" +) + +// DescribeSpotPriceHistory invokes the ecs.DescribeSpotPriceHistory API synchronously +// api document: https://help.aliyun.com/api/ecs/describespotpricehistory.html +func (client *Client) DescribeSpotPriceHistory(request *DescribeSpotPriceHistoryRequest) (response *DescribeSpotPriceHistoryResponse, err error) { + response = CreateDescribeSpotPriceHistoryResponse() + err = client.DoAction(request, response) + return +} + +// DescribeSpotPriceHistoryWithChan invokes the ecs.DescribeSpotPriceHistory API asynchronously +// api document: https://help.aliyun.com/api/ecs/describespotpricehistory.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeSpotPriceHistoryWithChan(request *DescribeSpotPriceHistoryRequest) (<-chan *DescribeSpotPriceHistoryResponse, <-chan error) { + responseChan := make(chan *DescribeSpotPriceHistoryResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeSpotPriceHistory(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeSpotPriceHistoryWithCallback invokes the ecs.DescribeSpotPriceHistory API asynchronously +// api document: https://help.aliyun.com/api/ecs/describespotpricehistory.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeSpotPriceHistoryWithCallback(request *DescribeSpotPriceHistoryRequest, callback func(response *DescribeSpotPriceHistoryResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeSpotPriceHistoryResponse + var err error + defer close(result) + response, err = client.DescribeSpotPriceHistory(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeSpotPriceHistoryRequest is the request struct for api DescribeSpotPriceHistory +type DescribeSpotPriceHistoryRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + IoOptimized string `position:"Query" name:"IoOptimized"` + NetworkType string `position:"Query" name:"NetworkType"` + StartTime string `position:"Query" name:"StartTime"` + InstanceType string `position:"Query" name:"InstanceType"` + Offset requests.Integer `position:"Query" name:"Offset"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + EndTime string `position:"Query" name:"EndTime"` + OSType string `position:"Query" name:"OSType"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + ZoneId string `position:"Query" name:"ZoneId"` +} + +// DescribeSpotPriceHistoryResponse is the response struct for api DescribeSpotPriceHistory +type DescribeSpotPriceHistoryResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + NextOffset int `json:"NextOffset" xml:"NextOffset"` + Currency string `json:"Currency" xml:"Currency"` + SpotPrices SpotPrices `json:"SpotPrices" xml:"SpotPrices"` +} + +// CreateDescribeSpotPriceHistoryRequest creates a request to invoke DescribeSpotPriceHistory API +func CreateDescribeSpotPriceHistoryRequest() (request *DescribeSpotPriceHistoryRequest) { + request = &DescribeSpotPriceHistoryRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeSpotPriceHistory", "ecs", "openAPI") + return +} + +// CreateDescribeSpotPriceHistoryResponse creates a response to parse from DescribeSpotPriceHistory response +func CreateDescribeSpotPriceHistoryResponse() (response *DescribeSpotPriceHistoryResponse) { + response = &DescribeSpotPriceHistoryResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_tags.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_tags.go new file mode 100644 index 000000000..37f553650 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_tags.go @@ -0,0 +1,120 @@ +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" +) + +// DescribeTags invokes the ecs.DescribeTags API synchronously +// api document: https://help.aliyun.com/api/ecs/describetags.html +func (client *Client) DescribeTags(request *DescribeTagsRequest) (response *DescribeTagsResponse, err error) { + response = CreateDescribeTagsResponse() + err = client.DoAction(request, response) + return +} + +// DescribeTagsWithChan invokes the ecs.DescribeTags API asynchronously +// api document: https://help.aliyun.com/api/ecs/describetags.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeTagsWithChan(request *DescribeTagsRequest) (<-chan *DescribeTagsResponse, <-chan error) { + responseChan := make(chan *DescribeTagsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeTags(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeTagsWithCallback invokes the ecs.DescribeTags API asynchronously +// api document: https://help.aliyun.com/api/ecs/describetags.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeTagsWithCallback(request *DescribeTagsRequest, callback func(response *DescribeTagsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeTagsResponse + var err error + defer close(result) + response, err = client.DescribeTags(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeTagsRequest is the request struct for api DescribeTags +type DescribeTagsRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceId string `position:"Query" name:"ResourceId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + Tag *[]DescribeTagsTag `position:"Query" name:"Tag" type:"Repeated"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + ResourceType string `position:"Query" name:"ResourceType"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` +} + +// DescribeTagsTag is a repeated param struct in DescribeTagsRequest +type DescribeTagsTag struct { + Value string `name:"Value"` + Key string `name:"Key"` +} + +// DescribeTagsResponse is the response struct for api DescribeTags +type DescribeTagsResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + PageSize int `json:"PageSize" xml:"PageSize"` + PageNumber int `json:"PageNumber" xml:"PageNumber"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + Tags TagsInDescribeTags `json:"Tags" xml:"Tags"` +} + +// CreateDescribeTagsRequest creates a request to invoke DescribeTags API +func CreateDescribeTagsRequest() (request *DescribeTagsRequest) { + request = &DescribeTagsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeTags", "ecs", "openAPI") + return +} + +// CreateDescribeTagsResponse creates a response to parse from DescribeTags response +func CreateDescribeTagsResponse() (response *DescribeTagsResponse) { + response = &DescribeTagsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_task_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_task_attribute.go new file mode 100644 index 000000000..ccfbf54ad --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_task_attribute.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" +) + +// DescribeTaskAttribute invokes the ecs.DescribeTaskAttribute API synchronously +// api document: https://help.aliyun.com/api/ecs/describetaskattribute.html +func (client *Client) DescribeTaskAttribute(request *DescribeTaskAttributeRequest) (response *DescribeTaskAttributeResponse, err error) { + response = CreateDescribeTaskAttributeResponse() + err = client.DoAction(request, response) + return +} + +// DescribeTaskAttributeWithChan invokes the ecs.DescribeTaskAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/describetaskattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeTaskAttributeWithChan(request *DescribeTaskAttributeRequest) (<-chan *DescribeTaskAttributeResponse, <-chan error) { + responseChan := make(chan *DescribeTaskAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeTaskAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeTaskAttributeWithCallback invokes the ecs.DescribeTaskAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/describetaskattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeTaskAttributeWithCallback(request *DescribeTaskAttributeRequest, callback func(response *DescribeTaskAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeTaskAttributeResponse + var err error + defer close(result) + response, err = client.DescribeTaskAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeTaskAttributeRequest is the request struct for api DescribeTaskAttribute +type DescribeTaskAttributeRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + TaskId string `position:"Query" name:"TaskId"` +} + +// DescribeTaskAttributeResponse is the response struct for api DescribeTaskAttribute +type DescribeTaskAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + TaskId string `json:"TaskId" xml:"TaskId"` + RegionId string `json:"RegionId" xml:"RegionId"` + TaskAction string `json:"TaskAction" xml:"TaskAction"` + TaskStatus string `json:"TaskStatus" xml:"TaskStatus"` + TaskProcess string `json:"TaskProcess" xml:"TaskProcess"` + SupportCancel string `json:"SupportCancel" xml:"SupportCancel"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + SuccessCount int `json:"SuccessCount" xml:"SuccessCount"` + FailedCount int `json:"FailedCount" xml:"FailedCount"` + CreationTime string `json:"CreationTime" xml:"CreationTime"` + FinishedTime string `json:"FinishedTime" xml:"FinishedTime"` + OperationProgressSet OperationProgressSet `json:"OperationProgressSet" xml:"OperationProgressSet"` +} + +// CreateDescribeTaskAttributeRequest creates a request to invoke DescribeTaskAttribute API +func CreateDescribeTaskAttributeRequest() (request *DescribeTaskAttributeRequest) { + request = &DescribeTaskAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeTaskAttribute", "ecs", "openAPI") + return +} + +// CreateDescribeTaskAttributeResponse creates a response to parse from DescribeTaskAttribute response +func CreateDescribeTaskAttributeResponse() (response *DescribeTaskAttributeResponse) { + response = &DescribeTaskAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_tasks.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_tasks.go new file mode 100644 index 000000000..b59c3c517 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_tasks.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" +) + +// DescribeTasks invokes the ecs.DescribeTasks API synchronously +// api document: https://help.aliyun.com/api/ecs/describetasks.html +func (client *Client) DescribeTasks(request *DescribeTasksRequest) (response *DescribeTasksResponse, err error) { + response = CreateDescribeTasksResponse() + err = client.DoAction(request, response) + return +} + +// DescribeTasksWithChan invokes the ecs.DescribeTasks API asynchronously +// api document: https://help.aliyun.com/api/ecs/describetasks.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeTasksWithChan(request *DescribeTasksRequest) (<-chan *DescribeTasksResponse, <-chan error) { + responseChan := make(chan *DescribeTasksResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeTasks(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeTasksWithCallback invokes the ecs.DescribeTasks API asynchronously +// api document: https://help.aliyun.com/api/ecs/describetasks.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeTasksWithCallback(request *DescribeTasksRequest, callback func(response *DescribeTasksResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeTasksResponse + var err error + defer close(result) + response, err = client.DescribeTasks(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeTasksRequest is the request struct for api DescribeTasks +type DescribeTasksRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + EndTime string `position:"Query" name:"EndTime"` + StartTime string `position:"Query" name:"StartTime"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + TaskIds string `position:"Query" name:"TaskIds"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` + TaskStatus string `position:"Query" name:"TaskStatus"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + TaskAction string `position:"Query" name:"TaskAction"` +} + +// DescribeTasksResponse is the response struct for api DescribeTasks +type DescribeTasksResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + RegionId string `json:"RegionId" xml:"RegionId"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + PageNumber int `json:"PageNumber" xml:"PageNumber"` + PageSize int `json:"PageSize" xml:"PageSize"` + TaskSet TaskSet `json:"TaskSet" xml:"TaskSet"` +} + +// CreateDescribeTasksRequest creates a request to invoke DescribeTasks API +func CreateDescribeTasksRequest() (request *DescribeTasksRequest) { + request = &DescribeTasksRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeTasks", "ecs", "openAPI") + return +} + +// CreateDescribeTasksResponse creates a response to parse from DescribeTasks response +func CreateDescribeTasksResponse() (response *DescribeTasksResponse) { + response = &DescribeTasksResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_user_business_behavior.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_user_business_behavior.go new file mode 100644 index 000000000..0070a582d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_user_business_behavior.go @@ -0,0 +1,108 @@ +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" +) + +// DescribeUserBusinessBehavior invokes the ecs.DescribeUserBusinessBehavior API synchronously +// api document: https://help.aliyun.com/api/ecs/describeuserbusinessbehavior.html +func (client *Client) DescribeUserBusinessBehavior(request *DescribeUserBusinessBehaviorRequest) (response *DescribeUserBusinessBehaviorResponse, err error) { + response = CreateDescribeUserBusinessBehaviorResponse() + err = client.DoAction(request, response) + return +} + +// DescribeUserBusinessBehaviorWithChan invokes the ecs.DescribeUserBusinessBehavior API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeuserbusinessbehavior.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeUserBusinessBehaviorWithChan(request *DescribeUserBusinessBehaviorRequest) (<-chan *DescribeUserBusinessBehaviorResponse, <-chan error) { + responseChan := make(chan *DescribeUserBusinessBehaviorResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeUserBusinessBehavior(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeUserBusinessBehaviorWithCallback invokes the ecs.DescribeUserBusinessBehavior API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeuserbusinessbehavior.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeUserBusinessBehaviorWithCallback(request *DescribeUserBusinessBehaviorRequest, callback func(response *DescribeUserBusinessBehaviorResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeUserBusinessBehaviorResponse + var err error + defer close(result) + response, err = client.DescribeUserBusinessBehavior(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeUserBusinessBehaviorRequest is the request struct for api DescribeUserBusinessBehavior +type DescribeUserBusinessBehaviorRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + StatusKey string `position:"Query" name:"statusKey"` +} + +// DescribeUserBusinessBehaviorResponse is the response struct for api DescribeUserBusinessBehavior +type DescribeUserBusinessBehaviorResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + StatusValue string `json:"StatusValue" xml:"StatusValue"` +} + +// CreateDescribeUserBusinessBehaviorRequest creates a request to invoke DescribeUserBusinessBehavior API +func CreateDescribeUserBusinessBehaviorRequest() (request *DescribeUserBusinessBehaviorRequest) { + request = &DescribeUserBusinessBehaviorRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeUserBusinessBehavior", "ecs", "openAPI") + return +} + +// CreateDescribeUserBusinessBehaviorResponse creates a response to parse from DescribeUserBusinessBehavior response +func CreateDescribeUserBusinessBehaviorResponse() (response *DescribeUserBusinessBehaviorResponse) { + response = &DescribeUserBusinessBehaviorResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_user_data.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_user_data.go new file mode 100644 index 000000000..63e80e148 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_user_data.go @@ -0,0 +1,109 @@ +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" +) + +// DescribeUserData invokes the ecs.DescribeUserData API synchronously +// api document: https://help.aliyun.com/api/ecs/describeuserdata.html +func (client *Client) DescribeUserData(request *DescribeUserDataRequest) (response *DescribeUserDataResponse, err error) { + response = CreateDescribeUserDataResponse() + err = client.DoAction(request, response) + return +} + +// DescribeUserDataWithChan invokes the ecs.DescribeUserData API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeuserdata.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeUserDataWithChan(request *DescribeUserDataRequest) (<-chan *DescribeUserDataResponse, <-chan error) { + responseChan := make(chan *DescribeUserDataResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeUserData(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeUserDataWithCallback invokes the ecs.DescribeUserData API asynchronously +// api document: https://help.aliyun.com/api/ecs/describeuserdata.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeUserDataWithCallback(request *DescribeUserDataRequest, callback func(response *DescribeUserDataResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeUserDataResponse + var err error + defer close(result) + response, err = client.DescribeUserData(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeUserDataRequest is the request struct for api DescribeUserData +type DescribeUserDataRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + InstanceId string `position:"Query" name:"InstanceId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DescribeUserDataResponse is the response struct for api DescribeUserData +type DescribeUserDataResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + RegionId string `json:"RegionId" xml:"RegionId"` + InstanceId string `json:"InstanceId" xml:"InstanceId"` + UserData string `json:"UserData" xml:"UserData"` +} + +// CreateDescribeUserDataRequest creates a request to invoke DescribeUserData API +func CreateDescribeUserDataRequest() (request *DescribeUserDataRequest) { + request = &DescribeUserDataRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeUserData", "ecs", "openAPI") + return +} + +// CreateDescribeUserDataResponse creates a response to parse from DescribeUserData response +func CreateDescribeUserDataResponse() (response *DescribeUserDataResponse) { + response = &DescribeUserDataResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_v_routers.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_v_routers.go new file mode 100644 index 000000000..110d0f791 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_v_routers.go @@ -0,0 +1,113 @@ +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" +) + +// DescribeVRouters invokes the ecs.DescribeVRouters API synchronously +// api document: https://help.aliyun.com/api/ecs/describevrouters.html +func (client *Client) DescribeVRouters(request *DescribeVRoutersRequest) (response *DescribeVRoutersResponse, err error) { + response = CreateDescribeVRoutersResponse() + err = client.DoAction(request, response) + return +} + +// DescribeVRoutersWithChan invokes the ecs.DescribeVRouters API asynchronously +// api document: https://help.aliyun.com/api/ecs/describevrouters.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeVRoutersWithChan(request *DescribeVRoutersRequest) (<-chan *DescribeVRoutersResponse, <-chan error) { + responseChan := make(chan *DescribeVRoutersResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeVRouters(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeVRoutersWithCallback invokes the ecs.DescribeVRouters API asynchronously +// api document: https://help.aliyun.com/api/ecs/describevrouters.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeVRoutersWithCallback(request *DescribeVRoutersRequest, callback func(response *DescribeVRoutersResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeVRoutersResponse + var err error + defer close(result) + response, err = client.DescribeVRouters(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeVRoutersRequest is the request struct for api DescribeVRouters +type DescribeVRoutersRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + VRouterId string `position:"Query" name:"VRouterId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` +} + +// DescribeVRoutersResponse is the response struct for api DescribeVRouters +type DescribeVRoutersResponse 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"` + VRouters VRouters `json:"VRouters" xml:"VRouters"` +} + +// CreateDescribeVRoutersRequest creates a request to invoke DescribeVRouters API +func CreateDescribeVRoutersRequest() (request *DescribeVRoutersRequest) { + request = &DescribeVRoutersRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeVRouters", "ecs", "openAPI") + return +} + +// CreateDescribeVRoutersResponse creates a response to parse from DescribeVRouters response +func CreateDescribeVRoutersResponse() (response *DescribeVRoutersResponse) { + response = &DescribeVRoutersResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_v_switches.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_v_switches.go new file mode 100644 index 000000000..26c77f2f6 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_v_switches.go @@ -0,0 +1,116 @@ +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" +) + +// DescribeVSwitches invokes the ecs.DescribeVSwitches API synchronously +// api document: https://help.aliyun.com/api/ecs/describevswitches.html +func (client *Client) DescribeVSwitches(request *DescribeVSwitchesRequest) (response *DescribeVSwitchesResponse, err error) { + response = CreateDescribeVSwitchesResponse() + err = client.DoAction(request, response) + return +} + +// DescribeVSwitchesWithChan invokes the ecs.DescribeVSwitches API asynchronously +// api document: https://help.aliyun.com/api/ecs/describevswitches.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeVSwitchesWithChan(request *DescribeVSwitchesRequest) (<-chan *DescribeVSwitchesResponse, <-chan error) { + responseChan := make(chan *DescribeVSwitchesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeVSwitches(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeVSwitchesWithCallback invokes the ecs.DescribeVSwitches API asynchronously +// api document: https://help.aliyun.com/api/ecs/describevswitches.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeVSwitchesWithCallback(request *DescribeVSwitchesRequest, callback func(response *DescribeVSwitchesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeVSwitchesResponse + var err error + defer close(result) + response, err = client.DescribeVSwitches(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeVSwitchesRequest is the request struct for api DescribeVSwitches +type DescribeVSwitchesRequest struct { + *requests.RpcRequest + VSwitchId string `position:"Query" name:"VSwitchId"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + VpcId string `position:"Query" name:"VpcId"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + ZoneId string `position:"Query" name:"ZoneId"` + IsDefault requests.Boolean `position:"Query" name:"IsDefault"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` +} + +// DescribeVSwitchesResponse is the response struct for api DescribeVSwitches +type DescribeVSwitchesResponse 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"` + VSwitches VSwitches `json:"VSwitches" xml:"VSwitches"` +} + +// CreateDescribeVSwitchesRequest creates a request to invoke DescribeVSwitches API +func CreateDescribeVSwitchesRequest() (request *DescribeVSwitchesRequest) { + request = &DescribeVSwitchesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeVSwitches", "ecs", "openAPI") + return +} + +// CreateDescribeVSwitchesResponse creates a response to parse from DescribeVSwitches response +func CreateDescribeVSwitchesResponse() (response *DescribeVSwitchesResponse) { + response = &DescribeVSwitchesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_virtual_border_routers.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_virtual_border_routers.go new file mode 100644 index 000000000..0b03b0336 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_virtual_border_routers.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" +) + +// DescribeVirtualBorderRouters invokes the ecs.DescribeVirtualBorderRouters API synchronously +// api document: https://help.aliyun.com/api/ecs/describevirtualborderrouters.html +func (client *Client) DescribeVirtualBorderRouters(request *DescribeVirtualBorderRoutersRequest) (response *DescribeVirtualBorderRoutersResponse, err error) { + response = CreateDescribeVirtualBorderRoutersResponse() + err = client.DoAction(request, response) + return +} + +// DescribeVirtualBorderRoutersWithChan invokes the ecs.DescribeVirtualBorderRouters API asynchronously +// api document: https://help.aliyun.com/api/ecs/describevirtualborderrouters.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeVirtualBorderRoutersWithChan(request *DescribeVirtualBorderRoutersRequest) (<-chan *DescribeVirtualBorderRoutersResponse, <-chan error) { + responseChan := make(chan *DescribeVirtualBorderRoutersResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeVirtualBorderRouters(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeVirtualBorderRoutersWithCallback invokes the ecs.DescribeVirtualBorderRouters API asynchronously +// api document: https://help.aliyun.com/api/ecs/describevirtualborderrouters.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeVirtualBorderRoutersWithCallback(request *DescribeVirtualBorderRoutersRequest, callback func(response *DescribeVirtualBorderRoutersResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeVirtualBorderRoutersResponse + var err error + defer close(result) + response, err = client.DescribeVirtualBorderRouters(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeVirtualBorderRoutersRequest is the request struct for api DescribeVirtualBorderRouters +type DescribeVirtualBorderRoutersRequest struct { + *requests.RpcRequest + Filter *[]DescribeVirtualBorderRoutersFilter `position:"Query" name:"Filter" type:"Repeated"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` +} + +// DescribeVirtualBorderRoutersFilter is a repeated param struct in DescribeVirtualBorderRoutersRequest +type DescribeVirtualBorderRoutersFilter struct { + Value *[]string `name:"Value" type:"Repeated"` + Key string `name:"Key"` +} + +// DescribeVirtualBorderRoutersResponse is the response struct for api DescribeVirtualBorderRouters +type DescribeVirtualBorderRoutersResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + PageNumber int `json:"PageNumber" xml:"PageNumber"` + PageSize int `json:"PageSize" xml:"PageSize"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + VirtualBorderRouterSet VirtualBorderRouterSet `json:"VirtualBorderRouterSet" xml:"VirtualBorderRouterSet"` +} + +// CreateDescribeVirtualBorderRoutersRequest creates a request to invoke DescribeVirtualBorderRouters API +func CreateDescribeVirtualBorderRoutersRequest() (request *DescribeVirtualBorderRoutersRequest) { + request = &DescribeVirtualBorderRoutersRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeVirtualBorderRouters", "ecs", "openAPI") + return +} + +// CreateDescribeVirtualBorderRoutersResponse creates a response to parse from DescribeVirtualBorderRouters response +func CreateDescribeVirtualBorderRoutersResponse() (response *DescribeVirtualBorderRoutersResponse) { + response = &DescribeVirtualBorderRoutersResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_virtual_border_routers_for_physical_connection.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_virtual_border_routers_for_physical_connection.go new file mode 100644 index 000000000..2596e9f47 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_virtual_border_routers_for_physical_connection.go @@ -0,0 +1,119 @@ +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" +) + +// DescribeVirtualBorderRoutersForPhysicalConnection invokes the ecs.DescribeVirtualBorderRoutersForPhysicalConnection API synchronously +// api document: https://help.aliyun.com/api/ecs/describevirtualborderroutersforphysicalconnection.html +func (client *Client) DescribeVirtualBorderRoutersForPhysicalConnection(request *DescribeVirtualBorderRoutersForPhysicalConnectionRequest) (response *DescribeVirtualBorderRoutersForPhysicalConnectionResponse, err error) { + response = CreateDescribeVirtualBorderRoutersForPhysicalConnectionResponse() + err = client.DoAction(request, response) + return +} + +// DescribeVirtualBorderRoutersForPhysicalConnectionWithChan invokes the ecs.DescribeVirtualBorderRoutersForPhysicalConnection API asynchronously +// api document: https://help.aliyun.com/api/ecs/describevirtualborderroutersforphysicalconnection.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeVirtualBorderRoutersForPhysicalConnectionWithChan(request *DescribeVirtualBorderRoutersForPhysicalConnectionRequest) (<-chan *DescribeVirtualBorderRoutersForPhysicalConnectionResponse, <-chan error) { + responseChan := make(chan *DescribeVirtualBorderRoutersForPhysicalConnectionResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeVirtualBorderRoutersForPhysicalConnection(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeVirtualBorderRoutersForPhysicalConnectionWithCallback invokes the ecs.DescribeVirtualBorderRoutersForPhysicalConnection API asynchronously +// api document: https://help.aliyun.com/api/ecs/describevirtualborderroutersforphysicalconnection.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeVirtualBorderRoutersForPhysicalConnectionWithCallback(request *DescribeVirtualBorderRoutersForPhysicalConnectionRequest, callback func(response *DescribeVirtualBorderRoutersForPhysicalConnectionResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeVirtualBorderRoutersForPhysicalConnectionResponse + var err error + defer close(result) + response, err = client.DescribeVirtualBorderRoutersForPhysicalConnection(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeVirtualBorderRoutersForPhysicalConnectionRequest is the request struct for api DescribeVirtualBorderRoutersForPhysicalConnection +type DescribeVirtualBorderRoutersForPhysicalConnectionRequest struct { + *requests.RpcRequest + Filter *[]DescribeVirtualBorderRoutersForPhysicalConnectionFilter `position:"Query" name:"Filter" type:"Repeated"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + PhysicalConnectionId string `position:"Query" name:"PhysicalConnectionId"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` +} + +// DescribeVirtualBorderRoutersForPhysicalConnectionFilter is a repeated param struct in DescribeVirtualBorderRoutersForPhysicalConnectionRequest +type DescribeVirtualBorderRoutersForPhysicalConnectionFilter struct { + Value *[]string `name:"Value" type:"Repeated"` + Key string `name:"Key"` +} + +// DescribeVirtualBorderRoutersForPhysicalConnectionResponse is the response struct for api DescribeVirtualBorderRoutersForPhysicalConnection +type DescribeVirtualBorderRoutersForPhysicalConnectionResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + PageNumber int `json:"PageNumber" xml:"PageNumber"` + PageSize int `json:"PageSize" xml:"PageSize"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + VirtualBorderRouterForPhysicalConnectionSet VirtualBorderRouterForPhysicalConnectionSet `json:"VirtualBorderRouterForPhysicalConnectionSet" xml:"VirtualBorderRouterForPhysicalConnectionSet"` +} + +// CreateDescribeVirtualBorderRoutersForPhysicalConnectionRequest creates a request to invoke DescribeVirtualBorderRoutersForPhysicalConnection API +func CreateDescribeVirtualBorderRoutersForPhysicalConnectionRequest() (request *DescribeVirtualBorderRoutersForPhysicalConnectionRequest) { + request = &DescribeVirtualBorderRoutersForPhysicalConnectionRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeVirtualBorderRoutersForPhysicalConnection", "ecs", "openAPI") + return +} + +// CreateDescribeVirtualBorderRoutersForPhysicalConnectionResponse creates a response to parse from DescribeVirtualBorderRoutersForPhysicalConnection response +func CreateDescribeVirtualBorderRoutersForPhysicalConnectionResponse() (response *DescribeVirtualBorderRoutersForPhysicalConnectionResponse) { + response = &DescribeVirtualBorderRoutersForPhysicalConnectionResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_vpcs.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_vpcs.go new file mode 100644 index 000000000..097da600d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_vpcs.go @@ -0,0 +1,114 @@ +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" +) + +// DescribeVpcs invokes the ecs.DescribeVpcs API synchronously +// api document: https://help.aliyun.com/api/ecs/describevpcs.html +func (client *Client) DescribeVpcs(request *DescribeVpcsRequest) (response *DescribeVpcsResponse, err error) { + response = CreateDescribeVpcsResponse() + err = client.DoAction(request, response) + return +} + +// DescribeVpcsWithChan invokes the ecs.DescribeVpcs API asynchronously +// api document: https://help.aliyun.com/api/ecs/describevpcs.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeVpcsWithChan(request *DescribeVpcsRequest) (<-chan *DescribeVpcsResponse, <-chan error) { + responseChan := make(chan *DescribeVpcsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeVpcs(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeVpcsWithCallback invokes the ecs.DescribeVpcs API asynchronously +// api document: https://help.aliyun.com/api/ecs/describevpcs.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeVpcsWithCallback(request *DescribeVpcsRequest, callback func(response *DescribeVpcsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeVpcsResponse + var err error + defer close(result) + response, err = client.DescribeVpcs(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeVpcsRequest is the request struct for api DescribeVpcs +type DescribeVpcsRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + VpcId string `position:"Query" name:"VpcId"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + IsDefault requests.Boolean `position:"Query" name:"IsDefault"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` +} + +// DescribeVpcsResponse is the response struct for api DescribeVpcs +type DescribeVpcsResponse 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"` + Vpcs Vpcs `json:"Vpcs" xml:"Vpcs"` +} + +// CreateDescribeVpcsRequest creates a request to invoke DescribeVpcs API +func CreateDescribeVpcsRequest() (request *DescribeVpcsRequest) { + request = &DescribeVpcsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeVpcs", "ecs", "openAPI") + return +} + +// CreateDescribeVpcsResponse creates a response to parse from DescribeVpcs response +func CreateDescribeVpcsResponse() (response *DescribeVpcsResponse) { + response = &DescribeVpcsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_zones.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_zones.go new file mode 100644 index 000000000..007fe4ccb --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_zones.go @@ -0,0 +1,111 @@ +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" +) + +// DescribeZones invokes the ecs.DescribeZones API synchronously +// api document: https://help.aliyun.com/api/ecs/describezones.html +func (client *Client) DescribeZones(request *DescribeZonesRequest) (response *DescribeZonesResponse, err error) { + response = CreateDescribeZonesResponse() + err = client.DoAction(request, response) + return +} + +// DescribeZonesWithChan invokes the ecs.DescribeZones API asynchronously +// api document: https://help.aliyun.com/api/ecs/describezones.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeZonesWithChan(request *DescribeZonesRequest) (<-chan *DescribeZonesResponse, <-chan error) { + responseChan := make(chan *DescribeZonesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeZones(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeZonesWithCallback invokes the ecs.DescribeZones API asynchronously +// api document: https://help.aliyun.com/api/ecs/describezones.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeZonesWithCallback(request *DescribeZonesRequest, callback func(response *DescribeZonesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeZonesResponse + var err error + defer close(result) + response, err = client.DescribeZones(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeZonesRequest is the request struct for api DescribeZones +type DescribeZonesRequest struct { + *requests.RpcRequest + SpotStrategy string `position:"Query" name:"SpotStrategy"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + AcceptLanguage string `position:"Query" name:"AcceptLanguage"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + InstanceChargeType string `position:"Query" name:"InstanceChargeType"` + Verbose requests.Boolean `position:"Query" name:"Verbose"` +} + +// DescribeZonesResponse is the response struct for api DescribeZones +type DescribeZonesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Zones ZonesInDescribeZones `json:"Zones" xml:"Zones"` +} + +// CreateDescribeZonesRequest creates a request to invoke DescribeZones API +func CreateDescribeZonesRequest() (request *DescribeZonesRequest) { + request = &DescribeZonesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeZones", "ecs", "openAPI") + return +} + +// CreateDescribeZonesResponse creates a response to parse from DescribeZones response +func CreateDescribeZonesResponse() (response *DescribeZonesResponse) { + response = &DescribeZonesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/detach_classic_link_vpc.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/detach_classic_link_vpc.go new file mode 100644 index 000000000..7b061371e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/detach_classic_link_vpc.go @@ -0,0 +1,107 @@ +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" +) + +// DetachClassicLinkVpc invokes the ecs.DetachClassicLinkVpc API synchronously +// api document: https://help.aliyun.com/api/ecs/detachclassiclinkvpc.html +func (client *Client) DetachClassicLinkVpc(request *DetachClassicLinkVpcRequest) (response *DetachClassicLinkVpcResponse, err error) { + response = CreateDetachClassicLinkVpcResponse() + err = client.DoAction(request, response) + return +} + +// DetachClassicLinkVpcWithChan invokes the ecs.DetachClassicLinkVpc API asynchronously +// api document: https://help.aliyun.com/api/ecs/detachclassiclinkvpc.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DetachClassicLinkVpcWithChan(request *DetachClassicLinkVpcRequest) (<-chan *DetachClassicLinkVpcResponse, <-chan error) { + responseChan := make(chan *DetachClassicLinkVpcResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DetachClassicLinkVpc(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DetachClassicLinkVpcWithCallback invokes the ecs.DetachClassicLinkVpc API asynchronously +// api document: https://help.aliyun.com/api/ecs/detachclassiclinkvpc.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DetachClassicLinkVpcWithCallback(request *DetachClassicLinkVpcRequest, callback func(response *DetachClassicLinkVpcResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DetachClassicLinkVpcResponse + var err error + defer close(result) + response, err = client.DetachClassicLinkVpc(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DetachClassicLinkVpcRequest is the request struct for api DetachClassicLinkVpc +type DetachClassicLinkVpcRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + InstanceId string `position:"Query" name:"InstanceId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + VpcId string `position:"Query" name:"VpcId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DetachClassicLinkVpcResponse is the response struct for api DetachClassicLinkVpc +type DetachClassicLinkVpcResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDetachClassicLinkVpcRequest creates a request to invoke DetachClassicLinkVpc API +func CreateDetachClassicLinkVpcRequest() (request *DetachClassicLinkVpcRequest) { + request = &DetachClassicLinkVpcRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DetachClassicLinkVpc", "ecs", "openAPI") + return +} + +// CreateDetachClassicLinkVpcResponse creates a response to parse from DetachClassicLinkVpc response +func CreateDetachClassicLinkVpcResponse() (response *DetachClassicLinkVpcResponse) { + response = &DetachClassicLinkVpcResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/detach_disk.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/detach_disk.go new file mode 100644 index 000000000..ae3f8a766 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/detach_disk.go @@ -0,0 +1,108 @@ +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" +) + +// DetachDisk invokes the ecs.DetachDisk API synchronously +// api document: https://help.aliyun.com/api/ecs/detachdisk.html +func (client *Client) DetachDisk(request *DetachDiskRequest) (response *DetachDiskResponse, err error) { + response = CreateDetachDiskResponse() + err = client.DoAction(request, response) + return +} + +// DetachDiskWithChan invokes the ecs.DetachDisk API asynchronously +// api document: https://help.aliyun.com/api/ecs/detachdisk.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DetachDiskWithChan(request *DetachDiskRequest) (<-chan *DetachDiskResponse, <-chan error) { + responseChan := make(chan *DetachDiskResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DetachDisk(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DetachDiskWithCallback invokes the ecs.DetachDisk API asynchronously +// api document: https://help.aliyun.com/api/ecs/detachdisk.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DetachDiskWithCallback(request *DetachDiskRequest, callback func(response *DetachDiskResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DetachDiskResponse + var err error + defer close(result) + response, err = client.DetachDisk(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DetachDiskRequest is the request struct for api DetachDisk +type DetachDiskRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + InstanceId string `position:"Query" name:"InstanceId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + DiskId string `position:"Query" name:"DiskId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DetachDiskResponse is the response struct for api DetachDisk +type DetachDiskResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDetachDiskRequest creates a request to invoke DetachDisk API +func CreateDetachDiskRequest() (request *DetachDiskRequest) { + request = &DetachDiskRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DetachDisk", "ecs", "openAPI") + return +} + +// CreateDetachDiskResponse creates a response to parse from DetachDisk response +func CreateDetachDiskResponse() (response *DetachDiskResponse) { + response = &DetachDiskResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/detach_instance_ram_role.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/detach_instance_ram_role.go new file mode 100644 index 000000000..db5da1094 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/detach_instance_ram_role.go @@ -0,0 +1,111 @@ +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" +) + +// DetachInstanceRamRole invokes the ecs.DetachInstanceRamRole API synchronously +// api document: https://help.aliyun.com/api/ecs/detachinstanceramrole.html +func (client *Client) DetachInstanceRamRole(request *DetachInstanceRamRoleRequest) (response *DetachInstanceRamRoleResponse, err error) { + response = CreateDetachInstanceRamRoleResponse() + err = client.DoAction(request, response) + return +} + +// DetachInstanceRamRoleWithChan invokes the ecs.DetachInstanceRamRole API asynchronously +// api document: https://help.aliyun.com/api/ecs/detachinstanceramrole.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DetachInstanceRamRoleWithChan(request *DetachInstanceRamRoleRequest) (<-chan *DetachInstanceRamRoleResponse, <-chan error) { + responseChan := make(chan *DetachInstanceRamRoleResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DetachInstanceRamRole(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DetachInstanceRamRoleWithCallback invokes the ecs.DetachInstanceRamRole API asynchronously +// api document: https://help.aliyun.com/api/ecs/detachinstanceramrole.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DetachInstanceRamRoleWithCallback(request *DetachInstanceRamRoleRequest, callback func(response *DetachInstanceRamRoleResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DetachInstanceRamRoleResponse + var err error + defer close(result) + response, err = client.DetachInstanceRamRole(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DetachInstanceRamRoleRequest is the request struct for api DetachInstanceRamRole +type DetachInstanceRamRoleRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + InstanceIds string `position:"Query" name:"InstanceIds"` + RamRoleName string `position:"Query" name:"RamRoleName"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DetachInstanceRamRoleResponse is the response struct for api DetachInstanceRamRole +type DetachInstanceRamRoleResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + FailCount int `json:"FailCount" xml:"FailCount"` + RamRoleName string `json:"RamRoleName" xml:"RamRoleName"` + DetachInstanceRamRoleResults DetachInstanceRamRoleResults `json:"DetachInstanceRamRoleResults" xml:"DetachInstanceRamRoleResults"` +} + +// CreateDetachInstanceRamRoleRequest creates a request to invoke DetachInstanceRamRole API +func CreateDetachInstanceRamRoleRequest() (request *DetachInstanceRamRoleRequest) { + request = &DetachInstanceRamRoleRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DetachInstanceRamRole", "ecs", "openAPI") + return +} + +// CreateDetachInstanceRamRoleResponse creates a response to parse from DetachInstanceRamRole response +func CreateDetachInstanceRamRoleResponse() (response *DetachInstanceRamRoleResponse) { + response = &DetachInstanceRamRoleResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/detach_key_pair.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/detach_key_pair.go new file mode 100644 index 000000000..295a30b71 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/detach_key_pair.go @@ -0,0 +1,111 @@ +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" +) + +// DetachKeyPair invokes the ecs.DetachKeyPair API synchronously +// api document: https://help.aliyun.com/api/ecs/detachkeypair.html +func (client *Client) DetachKeyPair(request *DetachKeyPairRequest) (response *DetachKeyPairResponse, err error) { + response = CreateDetachKeyPairResponse() + err = client.DoAction(request, response) + return +} + +// DetachKeyPairWithChan invokes the ecs.DetachKeyPair API asynchronously +// api document: https://help.aliyun.com/api/ecs/detachkeypair.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DetachKeyPairWithChan(request *DetachKeyPairRequest) (<-chan *DetachKeyPairResponse, <-chan error) { + responseChan := make(chan *DetachKeyPairResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DetachKeyPair(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DetachKeyPairWithCallback invokes the ecs.DetachKeyPair API asynchronously +// api document: https://help.aliyun.com/api/ecs/detachkeypair.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DetachKeyPairWithCallback(request *DetachKeyPairRequest, callback func(response *DetachKeyPairResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DetachKeyPairResponse + var err error + defer close(result) + response, err = client.DetachKeyPair(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DetachKeyPairRequest is the request struct for api DetachKeyPair +type DetachKeyPairRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + InstanceIds string `position:"Query" name:"InstanceIds"` + KeyPairName string `position:"Query" name:"KeyPairName"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DetachKeyPairResponse is the response struct for api DetachKeyPair +type DetachKeyPairResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + TotalCount string `json:"TotalCount" xml:"TotalCount"` + FailCount string `json:"FailCount" xml:"FailCount"` + KeyPairName string `json:"KeyPairName" xml:"KeyPairName"` + Results ResultsInDetachKeyPair `json:"Results" xml:"Results"` +} + +// CreateDetachKeyPairRequest creates a request to invoke DetachKeyPair API +func CreateDetachKeyPairRequest() (request *DetachKeyPairRequest) { + request = &DetachKeyPairRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DetachKeyPair", "ecs", "openAPI") + return +} + +// CreateDetachKeyPairResponse creates a response to parse from DetachKeyPair response +func CreateDetachKeyPairResponse() (response *DetachKeyPairResponse) { + response = &DetachKeyPairResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/detach_network_interface.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/detach_network_interface.go new file mode 100644 index 000000000..2da30db80 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/detach_network_interface.go @@ -0,0 +1,108 @@ +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" +) + +// DetachNetworkInterface invokes the ecs.DetachNetworkInterface API synchronously +// api document: https://help.aliyun.com/api/ecs/detachnetworkinterface.html +func (client *Client) DetachNetworkInterface(request *DetachNetworkInterfaceRequest) (response *DetachNetworkInterfaceResponse, err error) { + response = CreateDetachNetworkInterfaceResponse() + err = client.DoAction(request, response) + return +} + +// DetachNetworkInterfaceWithChan invokes the ecs.DetachNetworkInterface API asynchronously +// api document: https://help.aliyun.com/api/ecs/detachnetworkinterface.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DetachNetworkInterfaceWithChan(request *DetachNetworkInterfaceRequest) (<-chan *DetachNetworkInterfaceResponse, <-chan error) { + responseChan := make(chan *DetachNetworkInterfaceResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DetachNetworkInterface(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DetachNetworkInterfaceWithCallback invokes the ecs.DetachNetworkInterface API asynchronously +// api document: https://help.aliyun.com/api/ecs/detachnetworkinterface.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DetachNetworkInterfaceWithCallback(request *DetachNetworkInterfaceRequest, callback func(response *DetachNetworkInterfaceResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DetachNetworkInterfaceResponse + var err error + defer close(result) + response, err = client.DetachNetworkInterface(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DetachNetworkInterfaceRequest is the request struct for api DetachNetworkInterface +type DetachNetworkInterfaceRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + InstanceId string `position:"Query" name:"InstanceId"` + NetworkInterfaceId string `position:"Query" name:"NetworkInterfaceId"` +} + +// DetachNetworkInterfaceResponse is the response struct for api DetachNetworkInterface +type DetachNetworkInterfaceResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDetachNetworkInterfaceRequest creates a request to invoke DetachNetworkInterface API +func CreateDetachNetworkInterfaceRequest() (request *DetachNetworkInterfaceRequest) { + request = &DetachNetworkInterfaceRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "DetachNetworkInterface", "ecs", "openAPI") + return +} + +// CreateDetachNetworkInterfaceResponse creates a response to parse from DetachNetworkInterface response +func CreateDetachNetworkInterfaceResponse() (response *DetachNetworkInterfaceResponse) { + response = &DetachNetworkInterfaceResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/eip_fill_params.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/eip_fill_params.go new file mode 100644 index 000000000..fe512cbec --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/eip_fill_params.go @@ -0,0 +1,113 @@ +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" +) + +// EipFillParams invokes the ecs.EipFillParams API synchronously +// api document: https://help.aliyun.com/api/ecs/eipfillparams.html +func (client *Client) EipFillParams(request *EipFillParamsRequest) (response *EipFillParamsResponse, err error) { + response = CreateEipFillParamsResponse() + err = client.DoAction(request, response) + return +} + +// EipFillParamsWithChan invokes the ecs.EipFillParams API asynchronously +// api document: https://help.aliyun.com/api/ecs/eipfillparams.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) EipFillParamsWithChan(request *EipFillParamsRequest) (<-chan *EipFillParamsResponse, <-chan error) { + responseChan := make(chan *EipFillParamsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.EipFillParams(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// EipFillParamsWithCallback invokes the ecs.EipFillParams API asynchronously +// api document: https://help.aliyun.com/api/ecs/eipfillparams.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) EipFillParamsWithCallback(request *EipFillParamsRequest, callback func(response *EipFillParamsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *EipFillParamsResponse + var err error + defer close(result) + response, err = client.EipFillParams(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// EipFillParamsRequest is the request struct for api EipFillParams +type EipFillParamsRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + Data string `position:"Query" name:"data"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + UserCidr string `position:"Query" name:"UserCidr"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// EipFillParamsResponse is the response struct for api EipFillParams +type EipFillParamsResponse struct { + *responses.BaseResponse + RequestId string `json:"requestId" xml:"requestId"` + Data string `json:"data" xml:"data"` + Code string `json:"code" xml:"code"` + Success bool `json:"success" xml:"success"` + Message string `json:"message" xml:"message"` +} + +// CreateEipFillParamsRequest creates a request to invoke EipFillParams API +func CreateEipFillParamsRequest() (request *EipFillParamsRequest) { + request = &EipFillParamsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "EipFillParams", "ecs", "openAPI") + return +} + +// CreateEipFillParamsResponse creates a response to parse from EipFillParams response +func CreateEipFillParamsResponse() (response *EipFillParamsResponse) { + response = &EipFillParamsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/eip_fill_product.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/eip_fill_product.go new file mode 100644 index 000000000..7a7fc41c0 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/eip_fill_product.go @@ -0,0 +1,113 @@ +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" +) + +// EipFillProduct invokes the ecs.EipFillProduct API synchronously +// api document: https://help.aliyun.com/api/ecs/eipfillproduct.html +func (client *Client) EipFillProduct(request *EipFillProductRequest) (response *EipFillProductResponse, err error) { + response = CreateEipFillProductResponse() + err = client.DoAction(request, response) + return +} + +// EipFillProductWithChan invokes the ecs.EipFillProduct API asynchronously +// api document: https://help.aliyun.com/api/ecs/eipfillproduct.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) EipFillProductWithChan(request *EipFillProductRequest) (<-chan *EipFillProductResponse, <-chan error) { + responseChan := make(chan *EipFillProductResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.EipFillProduct(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// EipFillProductWithCallback invokes the ecs.EipFillProduct API asynchronously +// api document: https://help.aliyun.com/api/ecs/eipfillproduct.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) EipFillProductWithCallback(request *EipFillProductRequest, callback func(response *EipFillProductResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *EipFillProductResponse + var err error + defer close(result) + response, err = client.EipFillProduct(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// EipFillProductRequest is the request struct for api EipFillProduct +type EipFillProductRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + Data string `position:"Query" name:"data"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + UserCidr string `position:"Query" name:"UserCidr"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// EipFillProductResponse is the response struct for api EipFillProduct +type EipFillProductResponse struct { + *responses.BaseResponse + RequestId string `json:"requestId" xml:"requestId"` + Data string `json:"data" xml:"data"` + Code string `json:"code" xml:"code"` + Success bool `json:"success" xml:"success"` + Message string `json:"message" xml:"message"` +} + +// CreateEipFillProductRequest creates a request to invoke EipFillProduct API +func CreateEipFillProductRequest() (request *EipFillProductRequest) { + request = &EipFillProductRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "EipFillProduct", "ecs", "openAPI") + return +} + +// CreateEipFillProductResponse creates a response to parse from EipFillProduct response +func CreateEipFillProductResponse() (response *EipFillProductResponse) { + response = &EipFillProductResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/eip_notify_paid.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/eip_notify_paid.go new file mode 100644 index 000000000..5b75dc880 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/eip_notify_paid.go @@ -0,0 +1,113 @@ +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" +) + +// EipNotifyPaid invokes the ecs.EipNotifyPaid API synchronously +// api document: https://help.aliyun.com/api/ecs/eipnotifypaid.html +func (client *Client) EipNotifyPaid(request *EipNotifyPaidRequest) (response *EipNotifyPaidResponse, err error) { + response = CreateEipNotifyPaidResponse() + err = client.DoAction(request, response) + return +} + +// EipNotifyPaidWithChan invokes the ecs.EipNotifyPaid API asynchronously +// api document: https://help.aliyun.com/api/ecs/eipnotifypaid.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) EipNotifyPaidWithChan(request *EipNotifyPaidRequest) (<-chan *EipNotifyPaidResponse, <-chan error) { + responseChan := make(chan *EipNotifyPaidResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.EipNotifyPaid(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// EipNotifyPaidWithCallback invokes the ecs.EipNotifyPaid API asynchronously +// api document: https://help.aliyun.com/api/ecs/eipnotifypaid.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) EipNotifyPaidWithCallback(request *EipNotifyPaidRequest, callback func(response *EipNotifyPaidResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *EipNotifyPaidResponse + var err error + defer close(result) + response, err = client.EipNotifyPaid(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// EipNotifyPaidRequest is the request struct for api EipNotifyPaid +type EipNotifyPaidRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + Data string `position:"Query" name:"data"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + UserCidr string `position:"Query" name:"UserCidr"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// EipNotifyPaidResponse is the response struct for api EipNotifyPaid +type EipNotifyPaidResponse struct { + *responses.BaseResponse + RequestId string `json:"requestId" xml:"requestId"` + Data string `json:"data" xml:"data"` + Code string `json:"code" xml:"code"` + Message string `json:"message" xml:"message"` + Success bool `json:"success" xml:"success"` +} + +// CreateEipNotifyPaidRequest creates a request to invoke EipNotifyPaid API +func CreateEipNotifyPaidRequest() (request *EipNotifyPaidRequest) { + request = &EipNotifyPaidRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "EipNotifyPaid", "ecs", "openAPI") + return +} + +// CreateEipNotifyPaidResponse creates a response to parse from EipNotifyPaid response +func CreateEipNotifyPaidResponse() (response *EipNotifyPaidResponse) { + response = &EipNotifyPaidResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/enable_physical_connection.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/enable_physical_connection.go new file mode 100644 index 000000000..0862f1cfe --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/enable_physical_connection.go @@ -0,0 +1,109 @@ +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" +) + +// EnablePhysicalConnection invokes the ecs.EnablePhysicalConnection API synchronously +// api document: https://help.aliyun.com/api/ecs/enablephysicalconnection.html +func (client *Client) EnablePhysicalConnection(request *EnablePhysicalConnectionRequest) (response *EnablePhysicalConnectionResponse, err error) { + response = CreateEnablePhysicalConnectionResponse() + err = client.DoAction(request, response) + return +} + +// EnablePhysicalConnectionWithChan invokes the ecs.EnablePhysicalConnection API asynchronously +// api document: https://help.aliyun.com/api/ecs/enablephysicalconnection.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) EnablePhysicalConnectionWithChan(request *EnablePhysicalConnectionRequest) (<-chan *EnablePhysicalConnectionResponse, <-chan error) { + responseChan := make(chan *EnablePhysicalConnectionResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.EnablePhysicalConnection(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// EnablePhysicalConnectionWithCallback invokes the ecs.EnablePhysicalConnection API asynchronously +// api document: https://help.aliyun.com/api/ecs/enablephysicalconnection.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) EnablePhysicalConnectionWithCallback(request *EnablePhysicalConnectionRequest, callback func(response *EnablePhysicalConnectionResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *EnablePhysicalConnectionResponse + var err error + defer close(result) + response, err = client.EnablePhysicalConnection(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// EnablePhysicalConnectionRequest is the request struct for api EnablePhysicalConnection +type EnablePhysicalConnectionRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + PhysicalConnectionId string `position:"Query" name:"PhysicalConnectionId"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + UserCidr string `position:"Query" name:"UserCidr"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// EnablePhysicalConnectionResponse is the response struct for api EnablePhysicalConnection +type EnablePhysicalConnectionResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateEnablePhysicalConnectionRequest creates a request to invoke EnablePhysicalConnection API +func CreateEnablePhysicalConnectionRequest() (request *EnablePhysicalConnectionRequest) { + request = &EnablePhysicalConnectionRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "EnablePhysicalConnection", "ecs", "openAPI") + return +} + +// CreateEnablePhysicalConnectionResponse creates a response to parse from EnablePhysicalConnection response +func CreateEnablePhysicalConnectionResponse() (response *EnablePhysicalConnectionResponse) { + response = &EnablePhysicalConnectionResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/export_image.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/export_image.go new file mode 100644 index 000000000..eaf54319a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/export_image.go @@ -0,0 +1,112 @@ +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" +) + +// ExportImage invokes the ecs.ExportImage API synchronously +// api document: https://help.aliyun.com/api/ecs/exportimage.html +func (client *Client) ExportImage(request *ExportImageRequest) (response *ExportImageResponse, err error) { + response = CreateExportImageResponse() + err = client.DoAction(request, response) + return +} + +// ExportImageWithChan invokes the ecs.ExportImage API asynchronously +// api document: https://help.aliyun.com/api/ecs/exportimage.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ExportImageWithChan(request *ExportImageRequest) (<-chan *ExportImageResponse, <-chan error) { + responseChan := make(chan *ExportImageResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ExportImage(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ExportImageWithCallback invokes the ecs.ExportImage API asynchronously +// api document: https://help.aliyun.com/api/ecs/exportimage.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ExportImageWithCallback(request *ExportImageRequest, callback func(response *ExportImageResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ExportImageResponse + var err error + defer close(result) + response, err = client.ExportImage(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ExportImageRequest is the request struct for api ExportImage +type ExportImageRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ImageId string `position:"Query" name:"ImageId"` + OSSBucket string `position:"Query" name:"OSSBucket"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OSSPrefix string `position:"Query" name:"OSSPrefix"` + RoleName string `position:"Query" name:"RoleName"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + ImageFormat string `position:"Query" name:"ImageFormat"` +} + +// ExportImageResponse is the response struct for api ExportImage +type ExportImageResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + TaskId string `json:"TaskId" xml:"TaskId"` + RegionId string `json:"RegionId" xml:"RegionId"` +} + +// CreateExportImageRequest creates a request to invoke ExportImage API +func CreateExportImageRequest() (request *ExportImageRequest) { + request = &ExportImageRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ExportImage", "ecs", "openAPI") + return +} + +// CreateExportImageResponse creates a response to parse from ExportImage response +func CreateExportImageResponse() (response *ExportImageResponse) { + response = &ExportImageResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/export_snapshot.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/export_snapshot.go new file mode 100644 index 000000000..750974795 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/export_snapshot.go @@ -0,0 +1,109 @@ +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" +) + +// ExportSnapshot invokes the ecs.ExportSnapshot API synchronously +// api document: https://help.aliyun.com/api/ecs/exportsnapshot.html +func (client *Client) ExportSnapshot(request *ExportSnapshotRequest) (response *ExportSnapshotResponse, err error) { + response = CreateExportSnapshotResponse() + err = client.DoAction(request, response) + return +} + +// ExportSnapshotWithChan invokes the ecs.ExportSnapshot API asynchronously +// api document: https://help.aliyun.com/api/ecs/exportsnapshot.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ExportSnapshotWithChan(request *ExportSnapshotRequest) (<-chan *ExportSnapshotResponse, <-chan error) { + responseChan := make(chan *ExportSnapshotResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ExportSnapshot(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ExportSnapshotWithCallback invokes the ecs.ExportSnapshot API asynchronously +// api document: https://help.aliyun.com/api/ecs/exportsnapshot.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ExportSnapshotWithCallback(request *ExportSnapshotRequest, callback func(response *ExportSnapshotResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ExportSnapshotResponse + var err error + defer close(result) + response, err = client.ExportSnapshot(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ExportSnapshotRequest is the request struct for api ExportSnapshot +type ExportSnapshotRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + SnapshotId string `position:"Query" name:"SnapshotId"` + OssBucket string `position:"Query" name:"OssBucket"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + RoleName string `position:"Query" name:"RoleName"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// ExportSnapshotResponse is the response struct for api ExportSnapshot +type ExportSnapshotResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + TaskId string `json:"TaskId" xml:"TaskId"` +} + +// CreateExportSnapshotRequest creates a request to invoke ExportSnapshot API +func CreateExportSnapshotRequest() (request *ExportSnapshotRequest) { + request = &ExportSnapshotRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ExportSnapshot", "ecs", "openAPI") + return +} + +// CreateExportSnapshotResponse creates a response to parse from ExportSnapshot response +func CreateExportSnapshotResponse() (response *ExportSnapshotResponse) { + response = &ExportSnapshotResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/get_instance_console_output.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/get_instance_console_output.go new file mode 100644 index 000000000..2e2891f04 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/get_instance_console_output.go @@ -0,0 +1,110 @@ +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" +) + +// GetInstanceConsoleOutput invokes the ecs.GetInstanceConsoleOutput API synchronously +// api document: https://help.aliyun.com/api/ecs/getinstanceconsoleoutput.html +func (client *Client) GetInstanceConsoleOutput(request *GetInstanceConsoleOutputRequest) (response *GetInstanceConsoleOutputResponse, err error) { + response = CreateGetInstanceConsoleOutputResponse() + err = client.DoAction(request, response) + return +} + +// GetInstanceConsoleOutputWithChan invokes the ecs.GetInstanceConsoleOutput API asynchronously +// api document: https://help.aliyun.com/api/ecs/getinstanceconsoleoutput.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) GetInstanceConsoleOutputWithChan(request *GetInstanceConsoleOutputRequest) (<-chan *GetInstanceConsoleOutputResponse, <-chan error) { + responseChan := make(chan *GetInstanceConsoleOutputResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.GetInstanceConsoleOutput(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// GetInstanceConsoleOutputWithCallback invokes the ecs.GetInstanceConsoleOutput API asynchronously +// api document: https://help.aliyun.com/api/ecs/getinstanceconsoleoutput.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) GetInstanceConsoleOutputWithCallback(request *GetInstanceConsoleOutputRequest, callback func(response *GetInstanceConsoleOutputResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *GetInstanceConsoleOutputResponse + var err error + defer close(result) + response, err = client.GetInstanceConsoleOutput(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// GetInstanceConsoleOutputRequest is the request struct for api GetInstanceConsoleOutput +type GetInstanceConsoleOutputRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + InstanceId string `position:"Query" name:"InstanceId"` +} + +// GetInstanceConsoleOutputResponse is the response struct for api GetInstanceConsoleOutput +type GetInstanceConsoleOutputResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + InstanceId string `json:"InstanceId" xml:"InstanceId"` + ConsoleOutput string `json:"ConsoleOutput" xml:"ConsoleOutput"` + LastUpdateTime string `json:"LastUpdateTime" xml:"LastUpdateTime"` +} + +// CreateGetInstanceConsoleOutputRequest creates a request to invoke GetInstanceConsoleOutput API +func CreateGetInstanceConsoleOutputRequest() (request *GetInstanceConsoleOutputRequest) { + request = &GetInstanceConsoleOutputRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "GetInstanceConsoleOutput", "ecs", "openAPI") + return +} + +// CreateGetInstanceConsoleOutputResponse creates a response to parse from GetInstanceConsoleOutput response +func CreateGetInstanceConsoleOutputResponse() (response *GetInstanceConsoleOutputResponse) { + response = &GetInstanceConsoleOutputResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/get_instance_screenshot.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/get_instance_screenshot.go new file mode 100644 index 000000000..13d86459a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/get_instance_screenshot.go @@ -0,0 +1,110 @@ +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" +) + +// GetInstanceScreenshot invokes the ecs.GetInstanceScreenshot API synchronously +// api document: https://help.aliyun.com/api/ecs/getinstancescreenshot.html +func (client *Client) GetInstanceScreenshot(request *GetInstanceScreenshotRequest) (response *GetInstanceScreenshotResponse, err error) { + response = CreateGetInstanceScreenshotResponse() + err = client.DoAction(request, response) + return +} + +// GetInstanceScreenshotWithChan invokes the ecs.GetInstanceScreenshot API asynchronously +// api document: https://help.aliyun.com/api/ecs/getinstancescreenshot.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) GetInstanceScreenshotWithChan(request *GetInstanceScreenshotRequest) (<-chan *GetInstanceScreenshotResponse, <-chan error) { + responseChan := make(chan *GetInstanceScreenshotResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.GetInstanceScreenshot(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// GetInstanceScreenshotWithCallback invokes the ecs.GetInstanceScreenshot API asynchronously +// api document: https://help.aliyun.com/api/ecs/getinstancescreenshot.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) GetInstanceScreenshotWithCallback(request *GetInstanceScreenshotRequest, callback func(response *GetInstanceScreenshotResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *GetInstanceScreenshotResponse + var err error + defer close(result) + response, err = client.GetInstanceScreenshot(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// GetInstanceScreenshotRequest is the request struct for api GetInstanceScreenshot +type GetInstanceScreenshotRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + WakeUp requests.Boolean `position:"Query" name:"WakeUp"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + InstanceId string `position:"Query" name:"InstanceId"` +} + +// GetInstanceScreenshotResponse is the response struct for api GetInstanceScreenshot +type GetInstanceScreenshotResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + InstanceId string `json:"InstanceId" xml:"InstanceId"` + Screenshot string `json:"Screenshot" xml:"Screenshot"` +} + +// CreateGetInstanceScreenshotRequest creates a request to invoke GetInstanceScreenshot API +func CreateGetInstanceScreenshotRequest() (request *GetInstanceScreenshotRequest) { + request = &GetInstanceScreenshotRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "GetInstanceScreenshot", "ecs", "openAPI") + return +} + +// CreateGetInstanceScreenshotResponse creates a response to parse from GetInstanceScreenshot response +func CreateGetInstanceScreenshotResponse() (response *GetInstanceScreenshotResponse) { + response = &GetInstanceScreenshotResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/import_image.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/import_image.go new file mode 100644 index 000000000..d0c5b0be3 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/import_image.go @@ -0,0 +1,125 @@ +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" +) + +// ImportImage invokes the ecs.ImportImage API synchronously +// api document: https://help.aliyun.com/api/ecs/importimage.html +func (client *Client) ImportImage(request *ImportImageRequest) (response *ImportImageResponse, err error) { + response = CreateImportImageResponse() + err = client.DoAction(request, response) + return +} + +// ImportImageWithChan invokes the ecs.ImportImage API asynchronously +// api document: https://help.aliyun.com/api/ecs/importimage.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ImportImageWithChan(request *ImportImageRequest) (<-chan *ImportImageResponse, <-chan error) { + responseChan := make(chan *ImportImageResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ImportImage(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ImportImageWithCallback invokes the ecs.ImportImage API asynchronously +// api document: https://help.aliyun.com/api/ecs/importimage.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ImportImageWithCallback(request *ImportImageRequest, callback func(response *ImportImageResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ImportImageResponse + var err error + defer close(result) + response, err = client.ImportImage(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ImportImageRequest is the request struct for api ImportImage +type ImportImageRequest struct { + *requests.RpcRequest + DiskDeviceMapping *[]ImportImageDiskDeviceMapping `position:"Query" name:"DiskDeviceMapping" type:"Repeated"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + RoleName string `position:"Query" name:"RoleName"` + Description string `position:"Query" name:"Description"` + OSType string `position:"Query" name:"OSType"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Platform string `position:"Query" name:"Platform"` + ImageName string `position:"Query" name:"ImageName"` + Architecture string `position:"Query" name:"Architecture"` +} + +// ImportImageDiskDeviceMapping is a repeated param struct in ImportImageRequest +type ImportImageDiskDeviceMapping struct { + OSSBucket string `name:"OSSBucket"` + DiskImSize string `name:"DiskImSize"` + Format string `name:"Format"` + Device string `name:"Device"` + OSSObject string `name:"OSSObject"` + DiskImageSize string `name:"DiskImageSize"` +} + +// ImportImageResponse is the response struct for api ImportImage +type ImportImageResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + TaskId string `json:"TaskId" xml:"TaskId"` + RegionId string `json:"RegionId" xml:"RegionId"` + ImageId string `json:"ImageId" xml:"ImageId"` +} + +// CreateImportImageRequest creates a request to invoke ImportImage API +func CreateImportImageRequest() (request *ImportImageRequest) { + request = &ImportImageRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ImportImage", "ecs", "openAPI") + return +} + +// CreateImportImageResponse creates a response to parse from ImportImage response +func CreateImportImageResponse() (response *ImportImageResponse) { + response = &ImportImageResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/import_key_pair.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/import_key_pair.go new file mode 100644 index 000000000..30ba16ec9 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/import_key_pair.go @@ -0,0 +1,109 @@ +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" +) + +// ImportKeyPair invokes the ecs.ImportKeyPair API synchronously +// api document: https://help.aliyun.com/api/ecs/importkeypair.html +func (client *Client) ImportKeyPair(request *ImportKeyPairRequest) (response *ImportKeyPairResponse, err error) { + response = CreateImportKeyPairResponse() + err = client.DoAction(request, response) + return +} + +// ImportKeyPairWithChan invokes the ecs.ImportKeyPair API asynchronously +// api document: https://help.aliyun.com/api/ecs/importkeypair.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ImportKeyPairWithChan(request *ImportKeyPairRequest) (<-chan *ImportKeyPairResponse, <-chan error) { + responseChan := make(chan *ImportKeyPairResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ImportKeyPair(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ImportKeyPairWithCallback invokes the ecs.ImportKeyPair API asynchronously +// api document: https://help.aliyun.com/api/ecs/importkeypair.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ImportKeyPairWithCallback(request *ImportKeyPairRequest, callback func(response *ImportKeyPairResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ImportKeyPairResponse + var err error + defer close(result) + response, err = client.ImportKeyPair(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ImportKeyPairRequest is the request struct for api ImportKeyPair +type ImportKeyPairRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + PublicKeyBody string `position:"Query" name:"PublicKeyBody"` + KeyPairName string `position:"Query" name:"KeyPairName"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// ImportKeyPairResponse is the response struct for api ImportKeyPair +type ImportKeyPairResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + KeyPairName string `json:"KeyPairName" xml:"KeyPairName"` + KeyPairFingerPrint string `json:"KeyPairFingerPrint" xml:"KeyPairFingerPrint"` +} + +// CreateImportKeyPairRequest creates a request to invoke ImportKeyPair API +func CreateImportKeyPairRequest() (request *ImportKeyPairRequest) { + request = &ImportKeyPairRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ImportKeyPair", "ecs", "openAPI") + return +} + +// CreateImportKeyPairResponse creates a response to parse from ImportKeyPair response +func CreateImportKeyPairResponse() (response *ImportKeyPairResponse) { + response = &ImportKeyPairResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/import_snapshot.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/import_snapshot.go new file mode 100644 index 000000000..d61a119a1 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/import_snapshot.go @@ -0,0 +1,111 @@ +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" +) + +// ImportSnapshot invokes the ecs.ImportSnapshot API synchronously +// api document: https://help.aliyun.com/api/ecs/importsnapshot.html +func (client *Client) ImportSnapshot(request *ImportSnapshotRequest) (response *ImportSnapshotResponse, err error) { + response = CreateImportSnapshotResponse() + err = client.DoAction(request, response) + return +} + +// ImportSnapshotWithChan invokes the ecs.ImportSnapshot API asynchronously +// api document: https://help.aliyun.com/api/ecs/importsnapshot.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ImportSnapshotWithChan(request *ImportSnapshotRequest) (<-chan *ImportSnapshotResponse, <-chan error) { + responseChan := make(chan *ImportSnapshotResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ImportSnapshot(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ImportSnapshotWithCallback invokes the ecs.ImportSnapshot API asynchronously +// api document: https://help.aliyun.com/api/ecs/importsnapshot.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ImportSnapshotWithCallback(request *ImportSnapshotRequest, callback func(response *ImportSnapshotResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ImportSnapshotResponse + var err error + defer close(result) + response, err = client.ImportSnapshot(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ImportSnapshotRequest is the request struct for api ImportSnapshot +type ImportSnapshotRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + SnapshotName string `position:"Query" name:"SnapshotName"` + OssObject string `position:"Query" name:"OssObject"` + OssBucket string `position:"Query" name:"OssBucket"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + RoleName string `position:"Query" name:"RoleName"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// ImportSnapshotResponse is the response struct for api ImportSnapshot +type ImportSnapshotResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + TaskId string `json:"TaskId" xml:"TaskId"` + SnapshotId string `json:"SnapshotId" xml:"SnapshotId"` +} + +// CreateImportSnapshotRequest creates a request to invoke ImportSnapshot API +func CreateImportSnapshotRequest() (request *ImportSnapshotRequest) { + request = &ImportSnapshotRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ImportSnapshot", "ecs", "openAPI") + return +} + +// CreateImportSnapshotResponse creates a response to parse from ImportSnapshot response +func CreateImportSnapshotResponse() (response *ImportSnapshotResponse) { + response = &ImportSnapshotResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/install_cloud_assistant.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/install_cloud_assistant.go new file mode 100644 index 000000000..89c4b9b93 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/install_cloud_assistant.go @@ -0,0 +1,107 @@ +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" +) + +// InstallCloudAssistant invokes the ecs.InstallCloudAssistant API synchronously +// api document: https://help.aliyun.com/api/ecs/installcloudassistant.html +func (client *Client) InstallCloudAssistant(request *InstallCloudAssistantRequest) (response *InstallCloudAssistantResponse, err error) { + response = CreateInstallCloudAssistantResponse() + err = client.DoAction(request, response) + return +} + +// InstallCloudAssistantWithChan invokes the ecs.InstallCloudAssistant API asynchronously +// api document: https://help.aliyun.com/api/ecs/installcloudassistant.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) InstallCloudAssistantWithChan(request *InstallCloudAssistantRequest) (<-chan *InstallCloudAssistantResponse, <-chan error) { + responseChan := make(chan *InstallCloudAssistantResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.InstallCloudAssistant(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// InstallCloudAssistantWithCallback invokes the ecs.InstallCloudAssistant API asynchronously +// api document: https://help.aliyun.com/api/ecs/installcloudassistant.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) InstallCloudAssistantWithCallback(request *InstallCloudAssistantRequest, callback func(response *InstallCloudAssistantResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *InstallCloudAssistantResponse + var err error + defer close(result) + response, err = client.InstallCloudAssistant(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// InstallCloudAssistantRequest is the request struct for api InstallCloudAssistant +type InstallCloudAssistantRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + InstanceId *[]string `position:"Query" name:"InstanceId" type:"Repeated"` +} + +// InstallCloudAssistantResponse is the response struct for api InstallCloudAssistant +type InstallCloudAssistantResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateInstallCloudAssistantRequest creates a request to invoke InstallCloudAssistant API +func CreateInstallCloudAssistantRequest() (request *InstallCloudAssistantRequest) { + request = &InstallCloudAssistantRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "InstallCloudAssistant", "ecs", "openAPI") + return +} + +// CreateInstallCloudAssistantResponse creates a response to parse from InstallCloudAssistant response +func CreateInstallCloudAssistantResponse() (response *InstallCloudAssistantResponse) { + response = &InstallCloudAssistantResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/invoke_command.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/invoke_command.go new file mode 100644 index 000000000..0bb43c8ad --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/invoke_command.go @@ -0,0 +1,111 @@ +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" +) + +// InvokeCommand invokes the ecs.InvokeCommand API synchronously +// api document: https://help.aliyun.com/api/ecs/invokecommand.html +func (client *Client) InvokeCommand(request *InvokeCommandRequest) (response *InvokeCommandResponse, err error) { + response = CreateInvokeCommandResponse() + err = client.DoAction(request, response) + return +} + +// InvokeCommandWithChan invokes the ecs.InvokeCommand API asynchronously +// api document: https://help.aliyun.com/api/ecs/invokecommand.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) InvokeCommandWithChan(request *InvokeCommandRequest) (<-chan *InvokeCommandResponse, <-chan error) { + responseChan := make(chan *InvokeCommandResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.InvokeCommand(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// InvokeCommandWithCallback invokes the ecs.InvokeCommand API asynchronously +// api document: https://help.aliyun.com/api/ecs/invokecommand.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) InvokeCommandWithCallback(request *InvokeCommandRequest, callback func(response *InvokeCommandResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *InvokeCommandResponse + var err error + defer close(result) + response, err = client.InvokeCommand(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// InvokeCommandRequest is the request struct for api InvokeCommand +type InvokeCommandRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + CommandId string `position:"Query" name:"CommandId"` + Frequency string `position:"Query" name:"Frequency"` + Timed requests.Boolean `position:"Query" name:"Timed"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + InstanceId *[]string `position:"Query" name:"InstanceId" type:"Repeated"` +} + +// InvokeCommandResponse is the response struct for api InvokeCommand +type InvokeCommandResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + InvokeId string `json:"InvokeId" xml:"InvokeId"` +} + +// CreateInvokeCommandRequest creates a request to invoke InvokeCommand API +func CreateInvokeCommandRequest() (request *InvokeCommandRequest) { + request = &InvokeCommandRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "InvokeCommand", "ecs", "openAPI") + return +} + +// CreateInvokeCommandResponse creates a response to parse from InvokeCommand response +func CreateInvokeCommandResponse() (response *InvokeCommandResponse) { + response = &InvokeCommandResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/join_resource_group.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/join_resource_group.go new file mode 100644 index 000000000..9f3f7d25d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/join_resource_group.go @@ -0,0 +1,109 @@ +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" +) + +// JoinResourceGroup invokes the ecs.JoinResourceGroup API synchronously +// api document: https://help.aliyun.com/api/ecs/joinresourcegroup.html +func (client *Client) JoinResourceGroup(request *JoinResourceGroupRequest) (response *JoinResourceGroupResponse, err error) { + response = CreateJoinResourceGroupResponse() + err = client.DoAction(request, response) + return +} + +// JoinResourceGroupWithChan invokes the ecs.JoinResourceGroup API asynchronously +// api document: https://help.aliyun.com/api/ecs/joinresourcegroup.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) JoinResourceGroupWithChan(request *JoinResourceGroupRequest) (<-chan *JoinResourceGroupResponse, <-chan error) { + responseChan := make(chan *JoinResourceGroupResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.JoinResourceGroup(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// JoinResourceGroupWithCallback invokes the ecs.JoinResourceGroup API asynchronously +// api document: https://help.aliyun.com/api/ecs/joinresourcegroup.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) JoinResourceGroupWithCallback(request *JoinResourceGroupRequest, callback func(response *JoinResourceGroupResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *JoinResourceGroupResponse + var err error + defer close(result) + response, err = client.JoinResourceGroup(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// JoinResourceGroupRequest is the request struct for api JoinResourceGroup +type JoinResourceGroupRequest struct { + *requests.RpcRequest + ResourceGroupId string `position:"Query" name:"ResourceGroupId"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceId string `position:"Query" name:"ResourceId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + ResourceType string `position:"Query" name:"ResourceType"` +} + +// JoinResourceGroupResponse is the response struct for api JoinResourceGroup +type JoinResourceGroupResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateJoinResourceGroupRequest creates a request to invoke JoinResourceGroup API +func CreateJoinResourceGroupRequest() (request *JoinResourceGroupRequest) { + request = &JoinResourceGroupRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "JoinResourceGroup", "ecs", "openAPI") + return +} + +// CreateJoinResourceGroupResponse creates a response to parse from JoinResourceGroup response +func CreateJoinResourceGroupResponse() (response *JoinResourceGroupResponse) { + response = &JoinResourceGroupResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/join_security_group.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/join_security_group.go new file mode 100644 index 000000000..fa6a2f8d3 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/join_security_group.go @@ -0,0 +1,108 @@ +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" +) + +// JoinSecurityGroup invokes the ecs.JoinSecurityGroup API synchronously +// api document: https://help.aliyun.com/api/ecs/joinsecuritygroup.html +func (client *Client) JoinSecurityGroup(request *JoinSecurityGroupRequest) (response *JoinSecurityGroupResponse, err error) { + response = CreateJoinSecurityGroupResponse() + err = client.DoAction(request, response) + return +} + +// JoinSecurityGroupWithChan invokes the ecs.JoinSecurityGroup API asynchronously +// api document: https://help.aliyun.com/api/ecs/joinsecuritygroup.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) JoinSecurityGroupWithChan(request *JoinSecurityGroupRequest) (<-chan *JoinSecurityGroupResponse, <-chan error) { + responseChan := make(chan *JoinSecurityGroupResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.JoinSecurityGroup(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// JoinSecurityGroupWithCallback invokes the ecs.JoinSecurityGroup API asynchronously +// api document: https://help.aliyun.com/api/ecs/joinsecuritygroup.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) JoinSecurityGroupWithCallback(request *JoinSecurityGroupRequest, callback func(response *JoinSecurityGroupResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *JoinSecurityGroupResponse + var err error + defer close(result) + response, err = client.JoinSecurityGroup(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// JoinSecurityGroupRequest is the request struct for api JoinSecurityGroup +type JoinSecurityGroupRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + InstanceId string `position:"Query" name:"InstanceId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + SecurityGroupId string `position:"Query" name:"SecurityGroupId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// JoinSecurityGroupResponse is the response struct for api JoinSecurityGroup +type JoinSecurityGroupResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateJoinSecurityGroupRequest creates a request to invoke JoinSecurityGroup API +func CreateJoinSecurityGroupRequest() (request *JoinSecurityGroupRequest) { + request = &JoinSecurityGroupRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "JoinSecurityGroup", "ecs", "openAPI") + return +} + +// CreateJoinSecurityGroupResponse creates a response to parse from JoinSecurityGroup response +func CreateJoinSecurityGroupResponse() (response *JoinSecurityGroupResponse) { + response = &JoinSecurityGroupResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/leave_security_group.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/leave_security_group.go new file mode 100644 index 000000000..279d0fdda --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/leave_security_group.go @@ -0,0 +1,108 @@ +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" +) + +// LeaveSecurityGroup invokes the ecs.LeaveSecurityGroup API synchronously +// api document: https://help.aliyun.com/api/ecs/leavesecuritygroup.html +func (client *Client) LeaveSecurityGroup(request *LeaveSecurityGroupRequest) (response *LeaveSecurityGroupResponse, err error) { + response = CreateLeaveSecurityGroupResponse() + err = client.DoAction(request, response) + return +} + +// LeaveSecurityGroupWithChan invokes the ecs.LeaveSecurityGroup API asynchronously +// api document: https://help.aliyun.com/api/ecs/leavesecuritygroup.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) LeaveSecurityGroupWithChan(request *LeaveSecurityGroupRequest) (<-chan *LeaveSecurityGroupResponse, <-chan error) { + responseChan := make(chan *LeaveSecurityGroupResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.LeaveSecurityGroup(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// LeaveSecurityGroupWithCallback invokes the ecs.LeaveSecurityGroup API asynchronously +// api document: https://help.aliyun.com/api/ecs/leavesecuritygroup.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) LeaveSecurityGroupWithCallback(request *LeaveSecurityGroupRequest, callback func(response *LeaveSecurityGroupResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *LeaveSecurityGroupResponse + var err error + defer close(result) + response, err = client.LeaveSecurityGroup(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// LeaveSecurityGroupRequest is the request struct for api LeaveSecurityGroup +type LeaveSecurityGroupRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + InstanceId string `position:"Query" name:"InstanceId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + SecurityGroupId string `position:"Query" name:"SecurityGroupId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// LeaveSecurityGroupResponse is the response struct for api LeaveSecurityGroup +type LeaveSecurityGroupResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateLeaveSecurityGroupRequest creates a request to invoke LeaveSecurityGroup API +func CreateLeaveSecurityGroupRequest() (request *LeaveSecurityGroupRequest) { + request = &LeaveSecurityGroupRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "LeaveSecurityGroup", "ecs", "openAPI") + return +} + +// CreateLeaveSecurityGroupResponse creates a response to parse from LeaveSecurityGroup response +func CreateLeaveSecurityGroupResponse() (response *LeaveSecurityGroupResponse) { + response = &LeaveSecurityGroupResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/list_tag_resources.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/list_tag_resources.go new file mode 100644 index 000000000..8b0dd342c --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/list_tag_resources.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" +) + +// ListTagResources invokes the ecs.ListTagResources API synchronously +// api document: https://help.aliyun.com/api/ecs/listtagresources.html +func (client *Client) ListTagResources(request *ListTagResourcesRequest) (response *ListTagResourcesResponse, err error) { + response = CreateListTagResourcesResponse() + err = client.DoAction(request, response) + return +} + +// ListTagResourcesWithChan invokes the ecs.ListTagResources API asynchronously +// api document: https://help.aliyun.com/api/ecs/listtagresources.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ListTagResourcesWithChan(request *ListTagResourcesRequest) (<-chan *ListTagResourcesResponse, <-chan error) { + responseChan := make(chan *ListTagResourcesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ListTagResources(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ListTagResourcesWithCallback invokes the ecs.ListTagResources API asynchronously +// api document: https://help.aliyun.com/api/ecs/listtagresources.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ListTagResourcesWithCallback(request *ListTagResourcesRequest, callback func(response *ListTagResourcesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ListTagResourcesResponse + var err error + defer close(result) + response, err = client.ListTagResources(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ListTagResourcesRequest is the request struct for api ListTagResources +type ListTagResourcesRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + NextToken string `position:"Query" name:"NextToken"` + Tag *[]ListTagResourcesTag `position:"Query" name:"Tag" type:"Repeated"` + ResourceId *[]string `position:"Query" name:"ResourceId" type:"Repeated"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + ResourceType string `position:"Query" name:"ResourceType"` +} + +// ListTagResourcesTag is a repeated param struct in ListTagResourcesRequest +type ListTagResourcesTag struct { + Key string `name:"Key"` + Value string `name:"Value"` +} + +// ListTagResourcesResponse is the response struct for api ListTagResources +type ListTagResourcesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + NextToken string `json:"NextToken" xml:"NextToken"` + TagResources TagResources `json:"TagResources" xml:"TagResources"` +} + +// CreateListTagResourcesRequest creates a request to invoke ListTagResources API +func CreateListTagResourcesRequest() (request *ListTagResourcesRequest) { + request = &ListTagResourcesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ListTagResources", "ecs", "openAPI") + return +} + +// CreateListTagResourcesResponse creates a response to parse from ListTagResources response +func CreateListTagResourcesResponse() (response *ListTagResourcesResponse) { + response = &ListTagResourcesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_auto_snapshot_policy.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_auto_snapshot_policy.go new file mode 100644 index 000000000..91eeb1bde --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_auto_snapshot_policy.go @@ -0,0 +1,114 @@ +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" +) + +// ModifyAutoSnapshotPolicy invokes the ecs.ModifyAutoSnapshotPolicy API synchronously +// api document: https://help.aliyun.com/api/ecs/modifyautosnapshotpolicy.html +func (client *Client) ModifyAutoSnapshotPolicy(request *ModifyAutoSnapshotPolicyRequest) (response *ModifyAutoSnapshotPolicyResponse, err error) { + response = CreateModifyAutoSnapshotPolicyResponse() + err = client.DoAction(request, response) + return +} + +// ModifyAutoSnapshotPolicyWithChan invokes the ecs.ModifyAutoSnapshotPolicy API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyautosnapshotpolicy.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyAutoSnapshotPolicyWithChan(request *ModifyAutoSnapshotPolicyRequest) (<-chan *ModifyAutoSnapshotPolicyResponse, <-chan error) { + responseChan := make(chan *ModifyAutoSnapshotPolicyResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyAutoSnapshotPolicy(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyAutoSnapshotPolicyWithCallback invokes the ecs.ModifyAutoSnapshotPolicy API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyautosnapshotpolicy.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyAutoSnapshotPolicyWithCallback(request *ModifyAutoSnapshotPolicyRequest, callback func(response *ModifyAutoSnapshotPolicyResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyAutoSnapshotPolicyResponse + var err error + defer close(result) + response, err = client.ModifyAutoSnapshotPolicy(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyAutoSnapshotPolicyRequest is the request struct for api ModifyAutoSnapshotPolicy +type ModifyAutoSnapshotPolicyRequest struct { + *requests.RpcRequest + DataDiskPolicyEnabled requests.Boolean `position:"Query" name:"DataDiskPolicyEnabled"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + DataDiskPolicyRetentionDays requests.Integer `position:"Query" name:"DataDiskPolicyRetentionDays"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + SystemDiskPolicyRetentionLastWeek requests.Boolean `position:"Query" name:"SystemDiskPolicyRetentionLastWeek"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + SystemDiskPolicyTimePeriod requests.Integer `position:"Query" name:"SystemDiskPolicyTimePeriod"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + DataDiskPolicyRetentionLastWeek requests.Boolean `position:"Query" name:"DataDiskPolicyRetentionLastWeek"` + SystemDiskPolicyRetentionDays requests.Integer `position:"Query" name:"SystemDiskPolicyRetentionDays"` + DataDiskPolicyTimePeriod requests.Integer `position:"Query" name:"DataDiskPolicyTimePeriod"` + SystemDiskPolicyEnabled requests.Boolean `position:"Query" name:"SystemDiskPolicyEnabled"` +} + +// ModifyAutoSnapshotPolicyResponse is the response struct for api ModifyAutoSnapshotPolicy +type ModifyAutoSnapshotPolicyResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyAutoSnapshotPolicyRequest creates a request to invoke ModifyAutoSnapshotPolicy API +func CreateModifyAutoSnapshotPolicyRequest() (request *ModifyAutoSnapshotPolicyRequest) { + request = &ModifyAutoSnapshotPolicyRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyAutoSnapshotPolicy", "ecs", "openAPI") + return +} + +// CreateModifyAutoSnapshotPolicyResponse creates a response to parse from ModifyAutoSnapshotPolicy response +func CreateModifyAutoSnapshotPolicyResponse() (response *ModifyAutoSnapshotPolicyResponse) { + response = &ModifyAutoSnapshotPolicyResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_auto_snapshot_policy_ex.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_auto_snapshot_policy_ex.go new file mode 100644 index 000000000..13bbfb662 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_auto_snapshot_policy_ex.go @@ -0,0 +1,110 @@ +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" +) + +// ModifyAutoSnapshotPolicyEx invokes the ecs.ModifyAutoSnapshotPolicyEx API synchronously +// api document: https://help.aliyun.com/api/ecs/modifyautosnapshotpolicyex.html +func (client *Client) ModifyAutoSnapshotPolicyEx(request *ModifyAutoSnapshotPolicyExRequest) (response *ModifyAutoSnapshotPolicyExResponse, err error) { + response = CreateModifyAutoSnapshotPolicyExResponse() + err = client.DoAction(request, response) + return +} + +// ModifyAutoSnapshotPolicyExWithChan invokes the ecs.ModifyAutoSnapshotPolicyEx API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyautosnapshotpolicyex.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyAutoSnapshotPolicyExWithChan(request *ModifyAutoSnapshotPolicyExRequest) (<-chan *ModifyAutoSnapshotPolicyExResponse, <-chan error) { + responseChan := make(chan *ModifyAutoSnapshotPolicyExResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyAutoSnapshotPolicyEx(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyAutoSnapshotPolicyExWithCallback invokes the ecs.ModifyAutoSnapshotPolicyEx API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyautosnapshotpolicyex.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyAutoSnapshotPolicyExWithCallback(request *ModifyAutoSnapshotPolicyExRequest, callback func(response *ModifyAutoSnapshotPolicyExResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyAutoSnapshotPolicyExResponse + var err error + defer close(result) + response, err = client.ModifyAutoSnapshotPolicyEx(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyAutoSnapshotPolicyExRequest is the request struct for api ModifyAutoSnapshotPolicyEx +type ModifyAutoSnapshotPolicyExRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + AutoSnapshotPolicyId string `position:"Query" name:"autoSnapshotPolicyId"` + TimePoints string `position:"Query" name:"timePoints"` + RetentionDays requests.Integer `position:"Query" name:"retentionDays"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + RepeatWeekdays string `position:"Query" name:"repeatWeekdays"` + AutoSnapshotPolicyName string `position:"Query" name:"autoSnapshotPolicyName"` +} + +// ModifyAutoSnapshotPolicyExResponse is the response struct for api ModifyAutoSnapshotPolicyEx +type ModifyAutoSnapshotPolicyExResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyAutoSnapshotPolicyExRequest creates a request to invoke ModifyAutoSnapshotPolicyEx API +func CreateModifyAutoSnapshotPolicyExRequest() (request *ModifyAutoSnapshotPolicyExRequest) { + request = &ModifyAutoSnapshotPolicyExRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyAutoSnapshotPolicyEx", "ecs", "openAPI") + return +} + +// CreateModifyAutoSnapshotPolicyExResponse creates a response to parse from ModifyAutoSnapshotPolicyEx response +func CreateModifyAutoSnapshotPolicyExResponse() (response *ModifyAutoSnapshotPolicyExResponse) { + response = &ModifyAutoSnapshotPolicyExResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_bandwidth_package_spec.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_bandwidth_package_spec.go new file mode 100644 index 000000000..c9426163d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_bandwidth_package_spec.go @@ -0,0 +1,108 @@ +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" +) + +// ModifyBandwidthPackageSpec invokes the ecs.ModifyBandwidthPackageSpec API synchronously +// api document: https://help.aliyun.com/api/ecs/modifybandwidthpackagespec.html +func (client *Client) ModifyBandwidthPackageSpec(request *ModifyBandwidthPackageSpecRequest) (response *ModifyBandwidthPackageSpecResponse, err error) { + response = CreateModifyBandwidthPackageSpecResponse() + err = client.DoAction(request, response) + return +} + +// ModifyBandwidthPackageSpecWithChan invokes the ecs.ModifyBandwidthPackageSpec API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifybandwidthpackagespec.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyBandwidthPackageSpecWithChan(request *ModifyBandwidthPackageSpecRequest) (<-chan *ModifyBandwidthPackageSpecResponse, <-chan error) { + responseChan := make(chan *ModifyBandwidthPackageSpecResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyBandwidthPackageSpec(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyBandwidthPackageSpecWithCallback invokes the ecs.ModifyBandwidthPackageSpec API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifybandwidthpackagespec.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyBandwidthPackageSpecWithCallback(request *ModifyBandwidthPackageSpecRequest, callback func(response *ModifyBandwidthPackageSpecResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyBandwidthPackageSpecResponse + var err error + defer close(result) + response, err = client.ModifyBandwidthPackageSpec(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyBandwidthPackageSpecRequest is the request struct for api ModifyBandwidthPackageSpec +type ModifyBandwidthPackageSpecRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + BandwidthPackageId string `position:"Query" name:"BandwidthPackageId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + Bandwidth string `position:"Query" name:"Bandwidth"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// ModifyBandwidthPackageSpecResponse is the response struct for api ModifyBandwidthPackageSpec +type ModifyBandwidthPackageSpecResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyBandwidthPackageSpecRequest creates a request to invoke ModifyBandwidthPackageSpec API +func CreateModifyBandwidthPackageSpecRequest() (request *ModifyBandwidthPackageSpecRequest) { + request = &ModifyBandwidthPackageSpecRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyBandwidthPackageSpec", "ecs", "openAPI") + return +} + +// CreateModifyBandwidthPackageSpecResponse creates a response to parse from ModifyBandwidthPackageSpec response +func CreateModifyBandwidthPackageSpecResponse() (response *ModifyBandwidthPackageSpecResponse) { + response = &ModifyBandwidthPackageSpecResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_command.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_command.go new file mode 100644 index 000000000..13347f50a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_command.go @@ -0,0 +1,112 @@ +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" +) + +// ModifyCommand invokes the ecs.ModifyCommand API synchronously +// api document: https://help.aliyun.com/api/ecs/modifycommand.html +func (client *Client) ModifyCommand(request *ModifyCommandRequest) (response *ModifyCommandResponse, err error) { + response = CreateModifyCommandResponse() + err = client.DoAction(request, response) + return +} + +// ModifyCommandWithChan invokes the ecs.ModifyCommand API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifycommand.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyCommandWithChan(request *ModifyCommandRequest) (<-chan *ModifyCommandResponse, <-chan error) { + responseChan := make(chan *ModifyCommandResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyCommand(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyCommandWithCallback invokes the ecs.ModifyCommand API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifycommand.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyCommandWithCallback(request *ModifyCommandRequest, callback func(response *ModifyCommandResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyCommandResponse + var err error + defer close(result) + response, err = client.ModifyCommand(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyCommandRequest is the request struct for api ModifyCommand +type ModifyCommandRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + WorkingDir string `position:"Query" name:"WorkingDir"` + Description string `position:"Query" name:"Description"` + CommandId string `position:"Query" name:"CommandId"` + CommandContent string `position:"Query" name:"CommandContent"` + Timeout requests.Integer `position:"Query" name:"Timeout"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Name string `position:"Query" name:"Name"` +} + +// ModifyCommandResponse is the response struct for api ModifyCommand +type ModifyCommandResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyCommandRequest creates a request to invoke ModifyCommand API +func CreateModifyCommandRequest() (request *ModifyCommandRequest) { + request = &ModifyCommandRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyCommand", "ecs", "openAPI") + return +} + +// CreateModifyCommandResponse creates a response to parse from ModifyCommand response +func CreateModifyCommandResponse() (response *ModifyCommandResponse) { + response = &ModifyCommandResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_dedicated_host_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_dedicated_host_attribute.go new file mode 100644 index 000000000..dd5c603b2 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_dedicated_host_attribute.go @@ -0,0 +1,112 @@ +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" +) + +// ModifyDedicatedHostAttribute invokes the ecs.ModifyDedicatedHostAttribute API synchronously +// api document: https://help.aliyun.com/api/ecs/modifydedicatedhostattribute.html +func (client *Client) ModifyDedicatedHostAttribute(request *ModifyDedicatedHostAttributeRequest) (response *ModifyDedicatedHostAttributeResponse, err error) { + response = CreateModifyDedicatedHostAttributeResponse() + err = client.DoAction(request, response) + return +} + +// ModifyDedicatedHostAttributeWithChan invokes the ecs.ModifyDedicatedHostAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifydedicatedhostattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyDedicatedHostAttributeWithChan(request *ModifyDedicatedHostAttributeRequest) (<-chan *ModifyDedicatedHostAttributeResponse, <-chan error) { + responseChan := make(chan *ModifyDedicatedHostAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyDedicatedHostAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyDedicatedHostAttributeWithCallback invokes the ecs.ModifyDedicatedHostAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifydedicatedhostattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyDedicatedHostAttributeWithCallback(request *ModifyDedicatedHostAttributeRequest, callback func(response *ModifyDedicatedHostAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyDedicatedHostAttributeResponse + var err error + defer close(result) + response, err = client.ModifyDedicatedHostAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyDedicatedHostAttributeRequest is the request struct for api ModifyDedicatedHostAttribute +type ModifyDedicatedHostAttributeRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + Description string `position:"Query" name:"Description"` + ActionOnMaintenance string `position:"Query" name:"ActionOnMaintenance"` + DedicatedHostName string `position:"Query" name:"DedicatedHostName"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + DedicatedHostId string `position:"Query" name:"DedicatedHostId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + NetworkAttributesSlbUdpTimeout requests.Integer `position:"Query" name:"NetworkAttributes.SlbUdpTimeout"` + NetworkAttributesUdpTimeout requests.Integer `position:"Query" name:"NetworkAttributes.UdpTimeout"` +} + +// ModifyDedicatedHostAttributeResponse is the response struct for api ModifyDedicatedHostAttribute +type ModifyDedicatedHostAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyDedicatedHostAttributeRequest creates a request to invoke ModifyDedicatedHostAttribute API +func CreateModifyDedicatedHostAttributeRequest() (request *ModifyDedicatedHostAttributeRequest) { + request = &ModifyDedicatedHostAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyDedicatedHostAttribute", "ecs", "openAPI") + return +} + +// CreateModifyDedicatedHostAttributeResponse creates a response to parse from ModifyDedicatedHostAttribute response +func CreateModifyDedicatedHostAttributeResponse() (response *ModifyDedicatedHostAttributeResponse) { + response = &ModifyDedicatedHostAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_dedicated_host_auto_release_time.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_dedicated_host_auto_release_time.go new file mode 100644 index 000000000..0f8b495b1 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_dedicated_host_auto_release_time.go @@ -0,0 +1,108 @@ +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" +) + +// ModifyDedicatedHostAutoReleaseTime invokes the ecs.ModifyDedicatedHostAutoReleaseTime API synchronously +// api document: https://help.aliyun.com/api/ecs/modifydedicatedhostautoreleasetime.html +func (client *Client) ModifyDedicatedHostAutoReleaseTime(request *ModifyDedicatedHostAutoReleaseTimeRequest) (response *ModifyDedicatedHostAutoReleaseTimeResponse, err error) { + response = CreateModifyDedicatedHostAutoReleaseTimeResponse() + err = client.DoAction(request, response) + return +} + +// ModifyDedicatedHostAutoReleaseTimeWithChan invokes the ecs.ModifyDedicatedHostAutoReleaseTime API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifydedicatedhostautoreleasetime.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyDedicatedHostAutoReleaseTimeWithChan(request *ModifyDedicatedHostAutoReleaseTimeRequest) (<-chan *ModifyDedicatedHostAutoReleaseTimeResponse, <-chan error) { + responseChan := make(chan *ModifyDedicatedHostAutoReleaseTimeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyDedicatedHostAutoReleaseTime(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyDedicatedHostAutoReleaseTimeWithCallback invokes the ecs.ModifyDedicatedHostAutoReleaseTime API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifydedicatedhostautoreleasetime.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyDedicatedHostAutoReleaseTimeWithCallback(request *ModifyDedicatedHostAutoReleaseTimeRequest, callback func(response *ModifyDedicatedHostAutoReleaseTimeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyDedicatedHostAutoReleaseTimeResponse + var err error + defer close(result) + response, err = client.ModifyDedicatedHostAutoReleaseTime(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyDedicatedHostAutoReleaseTimeRequest is the request struct for api ModifyDedicatedHostAutoReleaseTime +type ModifyDedicatedHostAutoReleaseTimeRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + AutoReleaseTime string `position:"Query" name:"AutoReleaseTime"` + DedicatedHostId string `position:"Query" name:"DedicatedHostId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// ModifyDedicatedHostAutoReleaseTimeResponse is the response struct for api ModifyDedicatedHostAutoReleaseTime +type ModifyDedicatedHostAutoReleaseTimeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyDedicatedHostAutoReleaseTimeRequest creates a request to invoke ModifyDedicatedHostAutoReleaseTime API +func CreateModifyDedicatedHostAutoReleaseTimeRequest() (request *ModifyDedicatedHostAutoReleaseTimeRequest) { + request = &ModifyDedicatedHostAutoReleaseTimeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyDedicatedHostAutoReleaseTime", "ecs", "openAPI") + return +} + +// CreateModifyDedicatedHostAutoReleaseTimeResponse creates a response to parse from ModifyDedicatedHostAutoReleaseTime response +func CreateModifyDedicatedHostAutoReleaseTimeResponse() (response *ModifyDedicatedHostAutoReleaseTimeResponse) { + response = &ModifyDedicatedHostAutoReleaseTimeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_dedicated_host_auto_renew_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_dedicated_host_auto_renew_attribute.go new file mode 100644 index 000000000..5f270a4fc --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_dedicated_host_auto_renew_attribute.go @@ -0,0 +1,111 @@ +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" +) + +// ModifyDedicatedHostAutoRenewAttribute invokes the ecs.ModifyDedicatedHostAutoRenewAttribute API synchronously +// api document: https://help.aliyun.com/api/ecs/modifydedicatedhostautorenewattribute.html +func (client *Client) ModifyDedicatedHostAutoRenewAttribute(request *ModifyDedicatedHostAutoRenewAttributeRequest) (response *ModifyDedicatedHostAutoRenewAttributeResponse, err error) { + response = CreateModifyDedicatedHostAutoRenewAttributeResponse() + err = client.DoAction(request, response) + return +} + +// ModifyDedicatedHostAutoRenewAttributeWithChan invokes the ecs.ModifyDedicatedHostAutoRenewAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifydedicatedhostautorenewattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyDedicatedHostAutoRenewAttributeWithChan(request *ModifyDedicatedHostAutoRenewAttributeRequest) (<-chan *ModifyDedicatedHostAutoRenewAttributeResponse, <-chan error) { + responseChan := make(chan *ModifyDedicatedHostAutoRenewAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyDedicatedHostAutoRenewAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyDedicatedHostAutoRenewAttributeWithCallback invokes the ecs.ModifyDedicatedHostAutoRenewAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifydedicatedhostautorenewattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyDedicatedHostAutoRenewAttributeWithCallback(request *ModifyDedicatedHostAutoRenewAttributeRequest, callback func(response *ModifyDedicatedHostAutoRenewAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyDedicatedHostAutoRenewAttributeResponse + var err error + defer close(result) + response, err = client.ModifyDedicatedHostAutoRenewAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyDedicatedHostAutoRenewAttributeRequest is the request struct for api ModifyDedicatedHostAutoRenewAttribute +type ModifyDedicatedHostAutoRenewAttributeRequest struct { + *requests.RpcRequest + Duration requests.Integer `position:"Query" name:"Duration"` + DedicatedHostIds string `position:"Query" name:"DedicatedHostIds"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + PeriodUnit string `position:"Query" name:"PeriodUnit"` + AutoRenew requests.Boolean `position:"Query" name:"AutoRenew"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + RenewalStatus string `position:"Query" name:"RenewalStatus"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// ModifyDedicatedHostAutoRenewAttributeResponse is the response struct for api ModifyDedicatedHostAutoRenewAttribute +type ModifyDedicatedHostAutoRenewAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyDedicatedHostAutoRenewAttributeRequest creates a request to invoke ModifyDedicatedHostAutoRenewAttribute API +func CreateModifyDedicatedHostAutoRenewAttributeRequest() (request *ModifyDedicatedHostAutoRenewAttributeRequest) { + request = &ModifyDedicatedHostAutoRenewAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyDedicatedHostAutoRenewAttribute", "ecs", "openAPI") + return +} + +// CreateModifyDedicatedHostAutoRenewAttributeResponse creates a response to parse from ModifyDedicatedHostAutoRenewAttribute response +func CreateModifyDedicatedHostAutoRenewAttributeResponse() (response *ModifyDedicatedHostAutoRenewAttributeResponse) { + response = &ModifyDedicatedHostAutoRenewAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_deployment_set_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_deployment_set_attribute.go new file mode 100644 index 000000000..66b322b22 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_deployment_set_attribute.go @@ -0,0 +1,109 @@ +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" +) + +// ModifyDeploymentSetAttribute invokes the ecs.ModifyDeploymentSetAttribute API synchronously +// api document: https://help.aliyun.com/api/ecs/modifydeploymentsetattribute.html +func (client *Client) ModifyDeploymentSetAttribute(request *ModifyDeploymentSetAttributeRequest) (response *ModifyDeploymentSetAttributeResponse, err error) { + response = CreateModifyDeploymentSetAttributeResponse() + err = client.DoAction(request, response) + return +} + +// ModifyDeploymentSetAttributeWithChan invokes the ecs.ModifyDeploymentSetAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifydeploymentsetattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyDeploymentSetAttributeWithChan(request *ModifyDeploymentSetAttributeRequest) (<-chan *ModifyDeploymentSetAttributeResponse, <-chan error) { + responseChan := make(chan *ModifyDeploymentSetAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyDeploymentSetAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyDeploymentSetAttributeWithCallback invokes the ecs.ModifyDeploymentSetAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifydeploymentsetattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyDeploymentSetAttributeWithCallback(request *ModifyDeploymentSetAttributeRequest, callback func(response *ModifyDeploymentSetAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyDeploymentSetAttributeResponse + var err error + defer close(result) + response, err = client.ModifyDeploymentSetAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyDeploymentSetAttributeRequest is the request struct for api ModifyDeploymentSetAttribute +type ModifyDeploymentSetAttributeRequest struct { + *requests.RpcRequest + DeploymentSetId string `position:"Query" name:"DeploymentSetId"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Description string `position:"Query" name:"Description"` + DeploymentSetName string `position:"Query" name:"DeploymentSetName"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// ModifyDeploymentSetAttributeResponse is the response struct for api ModifyDeploymentSetAttribute +type ModifyDeploymentSetAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyDeploymentSetAttributeRequest creates a request to invoke ModifyDeploymentSetAttribute API +func CreateModifyDeploymentSetAttributeRequest() (request *ModifyDeploymentSetAttributeRequest) { + request = &ModifyDeploymentSetAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyDeploymentSetAttribute", "ecs", "openAPI") + return +} + +// CreateModifyDeploymentSetAttributeResponse creates a response to parse from ModifyDeploymentSetAttribute response +func CreateModifyDeploymentSetAttributeResponse() (response *ModifyDeploymentSetAttributeResponse) { + response = &ModifyDeploymentSetAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_disk_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_disk_attribute.go new file mode 100644 index 000000000..a01013d9f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_disk_attribute.go @@ -0,0 +1,112 @@ +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" +) + +// ModifyDiskAttribute invokes the ecs.ModifyDiskAttribute API synchronously +// api document: https://help.aliyun.com/api/ecs/modifydiskattribute.html +func (client *Client) ModifyDiskAttribute(request *ModifyDiskAttributeRequest) (response *ModifyDiskAttributeResponse, err error) { + response = CreateModifyDiskAttributeResponse() + err = client.DoAction(request, response) + return +} + +// ModifyDiskAttributeWithChan invokes the ecs.ModifyDiskAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifydiskattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyDiskAttributeWithChan(request *ModifyDiskAttributeRequest) (<-chan *ModifyDiskAttributeResponse, <-chan error) { + responseChan := make(chan *ModifyDiskAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyDiskAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyDiskAttributeWithCallback invokes the ecs.ModifyDiskAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifydiskattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyDiskAttributeWithCallback(request *ModifyDiskAttributeRequest, callback func(response *ModifyDiskAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyDiskAttributeResponse + var err error + defer close(result) + response, err = client.ModifyDiskAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyDiskAttributeRequest is the request struct for api ModifyDiskAttribute +type ModifyDiskAttributeRequest struct { + *requests.RpcRequest + DiskName string `position:"Query" name:"DiskName"` + DeleteAutoSnapshot requests.Boolean `position:"Query" name:"DeleteAutoSnapshot"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + EnableAutoSnapshot requests.Boolean `position:"Query" name:"EnableAutoSnapshot"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Description string `position:"Query" name:"Description"` + DiskId string `position:"Query" name:"DiskId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + DeleteWithInstance requests.Boolean `position:"Query" name:"DeleteWithInstance"` +} + +// ModifyDiskAttributeResponse is the response struct for api ModifyDiskAttribute +type ModifyDiskAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyDiskAttributeRequest creates a request to invoke ModifyDiskAttribute API +func CreateModifyDiskAttributeRequest() (request *ModifyDiskAttributeRequest) { + request = &ModifyDiskAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyDiskAttribute", "ecs", "openAPI") + return +} + +// CreateModifyDiskAttributeResponse creates a response to parse from ModifyDiskAttribute response +func CreateModifyDiskAttributeResponse() (response *ModifyDiskAttributeResponse) { + response = &ModifyDiskAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_disk_charge_type.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_disk_charge_type.go new file mode 100644 index 000000000..5b9bba896 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_disk_charge_type.go @@ -0,0 +1,112 @@ +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" +) + +// ModifyDiskChargeType invokes the ecs.ModifyDiskChargeType API synchronously +// api document: https://help.aliyun.com/api/ecs/modifydiskchargetype.html +func (client *Client) ModifyDiskChargeType(request *ModifyDiskChargeTypeRequest) (response *ModifyDiskChargeTypeResponse, err error) { + response = CreateModifyDiskChargeTypeResponse() + err = client.DoAction(request, response) + return +} + +// ModifyDiskChargeTypeWithChan invokes the ecs.ModifyDiskChargeType API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifydiskchargetype.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyDiskChargeTypeWithChan(request *ModifyDiskChargeTypeRequest) (<-chan *ModifyDiskChargeTypeResponse, <-chan error) { + responseChan := make(chan *ModifyDiskChargeTypeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyDiskChargeType(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyDiskChargeTypeWithCallback invokes the ecs.ModifyDiskChargeType API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifydiskchargetype.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyDiskChargeTypeWithCallback(request *ModifyDiskChargeTypeRequest, callback func(response *ModifyDiskChargeTypeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyDiskChargeTypeResponse + var err error + defer close(result) + response, err = client.ModifyDiskChargeType(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyDiskChargeTypeRequest is the request struct for api ModifyDiskChargeType +type ModifyDiskChargeTypeRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + DiskChargeType string `position:"Query" name:"DiskChargeType"` + InstanceId string `position:"Query" name:"InstanceId"` + AutoPay requests.Boolean `position:"Query" name:"AutoPay"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + DiskIds string `position:"Query" name:"DiskIds"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// ModifyDiskChargeTypeResponse is the response struct for api ModifyDiskChargeType +type ModifyDiskChargeTypeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + OrderId string `json:"OrderId" xml:"OrderId"` +} + +// CreateModifyDiskChargeTypeRequest creates a request to invoke ModifyDiskChargeType API +func CreateModifyDiskChargeTypeRequest() (request *ModifyDiskChargeTypeRequest) { + request = &ModifyDiskChargeTypeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyDiskChargeType", "ecs", "openAPI") + return +} + +// CreateModifyDiskChargeTypeResponse creates a response to parse from ModifyDiskChargeType response +func CreateModifyDiskChargeTypeResponse() (response *ModifyDiskChargeTypeResponse) { + response = &ModifyDiskChargeTypeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_eip_address_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_eip_address_attribute.go new file mode 100644 index 000000000..cf46a852e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_eip_address_attribute.go @@ -0,0 +1,108 @@ +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" +) + +// ModifyEipAddressAttribute invokes the ecs.ModifyEipAddressAttribute API synchronously +// api document: https://help.aliyun.com/api/ecs/modifyeipaddressattribute.html +func (client *Client) ModifyEipAddressAttribute(request *ModifyEipAddressAttributeRequest) (response *ModifyEipAddressAttributeResponse, err error) { + response = CreateModifyEipAddressAttributeResponse() + err = client.DoAction(request, response) + return +} + +// ModifyEipAddressAttributeWithChan invokes the ecs.ModifyEipAddressAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyeipaddressattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyEipAddressAttributeWithChan(request *ModifyEipAddressAttributeRequest) (<-chan *ModifyEipAddressAttributeResponse, <-chan error) { + responseChan := make(chan *ModifyEipAddressAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyEipAddressAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyEipAddressAttributeWithCallback invokes the ecs.ModifyEipAddressAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyeipaddressattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyEipAddressAttributeWithCallback(request *ModifyEipAddressAttributeRequest, callback func(response *ModifyEipAddressAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyEipAddressAttributeResponse + var err error + defer close(result) + response, err = client.ModifyEipAddressAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyEipAddressAttributeRequest is the request struct for api ModifyEipAddressAttribute +type ModifyEipAddressAttributeRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + Bandwidth string `position:"Query" name:"Bandwidth"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + AllocationId string `position:"Query" name:"AllocationId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// ModifyEipAddressAttributeResponse is the response struct for api ModifyEipAddressAttribute +type ModifyEipAddressAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyEipAddressAttributeRequest creates a request to invoke ModifyEipAddressAttribute API +func CreateModifyEipAddressAttributeRequest() (request *ModifyEipAddressAttributeRequest) { + request = &ModifyEipAddressAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyEipAddressAttribute", "ecs", "openAPI") + return +} + +// CreateModifyEipAddressAttributeResponse creates a response to parse from ModifyEipAddressAttribute response +func CreateModifyEipAddressAttributeResponse() (response *ModifyEipAddressAttributeResponse) { + response = &ModifyEipAddressAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_forward_entry.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_forward_entry.go new file mode 100644 index 000000000..d831c393d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_forward_entry.go @@ -0,0 +1,113 @@ +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" +) + +// ModifyForwardEntry invokes the ecs.ModifyForwardEntry API synchronously +// api document: https://help.aliyun.com/api/ecs/modifyforwardentry.html +func (client *Client) ModifyForwardEntry(request *ModifyForwardEntryRequest) (response *ModifyForwardEntryResponse, err error) { + response = CreateModifyForwardEntryResponse() + err = client.DoAction(request, response) + return +} + +// ModifyForwardEntryWithChan invokes the ecs.ModifyForwardEntry API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyforwardentry.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyForwardEntryWithChan(request *ModifyForwardEntryRequest) (<-chan *ModifyForwardEntryResponse, <-chan error) { + responseChan := make(chan *ModifyForwardEntryResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyForwardEntry(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyForwardEntryWithCallback invokes the ecs.ModifyForwardEntry API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyforwardentry.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyForwardEntryWithCallback(request *ModifyForwardEntryRequest, callback func(response *ModifyForwardEntryResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyForwardEntryResponse + var err error + defer close(result) + response, err = client.ModifyForwardEntry(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyForwardEntryRequest is the request struct for api ModifyForwardEntry +type ModifyForwardEntryRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + IpProtocol string `position:"Query" name:"IpProtocol"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + ForwardTableId string `position:"Query" name:"ForwardTableId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + InternalIp string `position:"Query" name:"InternalIp"` + ForwardEntryId string `position:"Query" name:"ForwardEntryId"` + InternalPort string `position:"Query" name:"InternalPort"` + ExternalIp string `position:"Query" name:"ExternalIp"` + ExternalPort string `position:"Query" name:"ExternalPort"` +} + +// ModifyForwardEntryResponse is the response struct for api ModifyForwardEntry +type ModifyForwardEntryResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyForwardEntryRequest creates a request to invoke ModifyForwardEntry API +func CreateModifyForwardEntryRequest() (request *ModifyForwardEntryRequest) { + request = &ModifyForwardEntryRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyForwardEntry", "ecs", "openAPI") + return +} + +// CreateModifyForwardEntryResponse creates a response to parse from ModifyForwardEntry response +func CreateModifyForwardEntryResponse() (response *ModifyForwardEntryResponse) { + response = &ModifyForwardEntryResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_ha_vip_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_ha_vip_attribute.go new file mode 100644 index 000000000..034501af0 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_ha_vip_attribute.go @@ -0,0 +1,109 @@ +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" +) + +// ModifyHaVipAttribute invokes the ecs.ModifyHaVipAttribute API synchronously +// api document: https://help.aliyun.com/api/ecs/modifyhavipattribute.html +func (client *Client) ModifyHaVipAttribute(request *ModifyHaVipAttributeRequest) (response *ModifyHaVipAttributeResponse, err error) { + response = CreateModifyHaVipAttributeResponse() + err = client.DoAction(request, response) + return +} + +// ModifyHaVipAttributeWithChan invokes the ecs.ModifyHaVipAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyhavipattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyHaVipAttributeWithChan(request *ModifyHaVipAttributeRequest) (<-chan *ModifyHaVipAttributeResponse, <-chan error) { + responseChan := make(chan *ModifyHaVipAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyHaVipAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyHaVipAttributeWithCallback invokes the ecs.ModifyHaVipAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyhavipattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyHaVipAttributeWithCallback(request *ModifyHaVipAttributeRequest, callback func(response *ModifyHaVipAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyHaVipAttributeResponse + var err error + defer close(result) + response, err = client.ModifyHaVipAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyHaVipAttributeRequest is the request struct for api ModifyHaVipAttribute +type ModifyHaVipAttributeRequest struct { + *requests.RpcRequest + HaVipId string `position:"Query" name:"HaVipId"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Description string `position:"Query" name:"Description"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// ModifyHaVipAttributeResponse is the response struct for api ModifyHaVipAttribute +type ModifyHaVipAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyHaVipAttributeRequest creates a request to invoke ModifyHaVipAttribute API +func CreateModifyHaVipAttributeRequest() (request *ModifyHaVipAttributeRequest) { + request = &ModifyHaVipAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyHaVipAttribute", "ecs", "openAPI") + return +} + +// CreateModifyHaVipAttributeResponse creates a response to parse from ModifyHaVipAttribute response +func CreateModifyHaVipAttributeResponse() (response *ModifyHaVipAttributeResponse) { + response = &ModifyHaVipAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_hpc_cluster_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_hpc_cluster_attribute.go new file mode 100644 index 000000000..9df6f6053 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_hpc_cluster_attribute.go @@ -0,0 +1,110 @@ +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" +) + +// ModifyHpcClusterAttribute invokes the ecs.ModifyHpcClusterAttribute API synchronously +// api document: https://help.aliyun.com/api/ecs/modifyhpcclusterattribute.html +func (client *Client) ModifyHpcClusterAttribute(request *ModifyHpcClusterAttributeRequest) (response *ModifyHpcClusterAttributeResponse, err error) { + response = CreateModifyHpcClusterAttributeResponse() + err = client.DoAction(request, response) + return +} + +// ModifyHpcClusterAttributeWithChan invokes the ecs.ModifyHpcClusterAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyhpcclusterattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyHpcClusterAttributeWithChan(request *ModifyHpcClusterAttributeRequest) (<-chan *ModifyHpcClusterAttributeResponse, <-chan error) { + responseChan := make(chan *ModifyHpcClusterAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyHpcClusterAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyHpcClusterAttributeWithCallback invokes the ecs.ModifyHpcClusterAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyhpcclusterattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyHpcClusterAttributeWithCallback(request *ModifyHpcClusterAttributeRequest, callback func(response *ModifyHpcClusterAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyHpcClusterAttributeResponse + var err error + defer close(result) + response, err = client.ModifyHpcClusterAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyHpcClusterAttributeRequest is the request struct for api ModifyHpcClusterAttribute +type ModifyHpcClusterAttributeRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + HpcClusterId string `position:"Query" name:"HpcClusterId"` + ClientToken string `position:"Query" name:"ClientToken"` + Description string `position:"Query" name:"Description"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Name string `position:"Query" name:"Name"` +} + +// ModifyHpcClusterAttributeResponse is the response struct for api ModifyHpcClusterAttribute +type ModifyHpcClusterAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyHpcClusterAttributeRequest creates a request to invoke ModifyHpcClusterAttribute API +func CreateModifyHpcClusterAttributeRequest() (request *ModifyHpcClusterAttributeRequest) { + request = &ModifyHpcClusterAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyHpcClusterAttribute", "ecs", "openAPI") + return +} + +// CreateModifyHpcClusterAttributeResponse creates a response to parse from ModifyHpcClusterAttribute response +func CreateModifyHpcClusterAttributeResponse() (response *ModifyHpcClusterAttributeResponse) { + response = &ModifyHpcClusterAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_image_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_image_attribute.go new file mode 100644 index 000000000..bed589ab9 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_image_attribute.go @@ -0,0 +1,109 @@ +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" +) + +// ModifyImageAttribute invokes the ecs.ModifyImageAttribute API synchronously +// api document: https://help.aliyun.com/api/ecs/modifyimageattribute.html +func (client *Client) ModifyImageAttribute(request *ModifyImageAttributeRequest) (response *ModifyImageAttributeResponse, err error) { + response = CreateModifyImageAttributeResponse() + err = client.DoAction(request, response) + return +} + +// ModifyImageAttributeWithChan invokes the ecs.ModifyImageAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyimageattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyImageAttributeWithChan(request *ModifyImageAttributeRequest) (<-chan *ModifyImageAttributeResponse, <-chan error) { + responseChan := make(chan *ModifyImageAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyImageAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyImageAttributeWithCallback invokes the ecs.ModifyImageAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyimageattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyImageAttributeWithCallback(request *ModifyImageAttributeRequest, callback func(response *ModifyImageAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyImageAttributeResponse + var err error + defer close(result) + response, err = client.ModifyImageAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyImageAttributeRequest is the request struct for api ModifyImageAttribute +type ModifyImageAttributeRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ImageId string `position:"Query" name:"ImageId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ImageName string `position:"Query" name:"ImageName"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Description string `position:"Query" name:"Description"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// ModifyImageAttributeResponse is the response struct for api ModifyImageAttribute +type ModifyImageAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyImageAttributeRequest creates a request to invoke ModifyImageAttribute API +func CreateModifyImageAttributeRequest() (request *ModifyImageAttributeRequest) { + request = &ModifyImageAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyImageAttribute", "ecs", "openAPI") + return +} + +// CreateModifyImageAttributeResponse creates a response to parse from ModifyImageAttribute response +func CreateModifyImageAttributeResponse() (response *ModifyImageAttributeResponse) { + response = &ModifyImageAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_image_share_group_permission.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_image_share_group_permission.go new file mode 100644 index 000000000..fb3142aa9 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_image_share_group_permission.go @@ -0,0 +1,109 @@ +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" +) + +// ModifyImageShareGroupPermission invokes the ecs.ModifyImageShareGroupPermission API synchronously +// api document: https://help.aliyun.com/api/ecs/modifyimagesharegrouppermission.html +func (client *Client) ModifyImageShareGroupPermission(request *ModifyImageShareGroupPermissionRequest) (response *ModifyImageShareGroupPermissionResponse, err error) { + response = CreateModifyImageShareGroupPermissionResponse() + err = client.DoAction(request, response) + return +} + +// ModifyImageShareGroupPermissionWithChan invokes the ecs.ModifyImageShareGroupPermission API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyimagesharegrouppermission.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyImageShareGroupPermissionWithChan(request *ModifyImageShareGroupPermissionRequest) (<-chan *ModifyImageShareGroupPermissionResponse, <-chan error) { + responseChan := make(chan *ModifyImageShareGroupPermissionResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyImageShareGroupPermission(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyImageShareGroupPermissionWithCallback invokes the ecs.ModifyImageShareGroupPermission API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyimagesharegrouppermission.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyImageShareGroupPermissionWithCallback(request *ModifyImageShareGroupPermissionRequest, callback func(response *ModifyImageShareGroupPermissionResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyImageShareGroupPermissionResponse + var err error + defer close(result) + response, err = client.ModifyImageShareGroupPermission(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyImageShareGroupPermissionRequest is the request struct for api ModifyImageShareGroupPermission +type ModifyImageShareGroupPermissionRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ImageId string `position:"Query" name:"ImageId"` + AddGroup1 string `position:"Query" name:"AddGroup.1"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + RemoveGroup1 string `position:"Query" name:"RemoveGroup.1"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// ModifyImageShareGroupPermissionResponse is the response struct for api ModifyImageShareGroupPermission +type ModifyImageShareGroupPermissionResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyImageShareGroupPermissionRequest creates a request to invoke ModifyImageShareGroupPermission API +func CreateModifyImageShareGroupPermissionRequest() (request *ModifyImageShareGroupPermissionRequest) { + request = &ModifyImageShareGroupPermissionRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyImageShareGroupPermission", "ecs", "openAPI") + return +} + +// CreateModifyImageShareGroupPermissionResponse creates a response to parse from ModifyImageShareGroupPermission response +func CreateModifyImageShareGroupPermissionResponse() (response *ModifyImageShareGroupPermissionResponse) { + response = &ModifyImageShareGroupPermissionResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_image_share_permission.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_image_share_permission.go new file mode 100644 index 000000000..d73f19f78 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_image_share_permission.go @@ -0,0 +1,109 @@ +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" +) + +// ModifyImageSharePermission invokes the ecs.ModifyImageSharePermission API synchronously +// api document: https://help.aliyun.com/api/ecs/modifyimagesharepermission.html +func (client *Client) ModifyImageSharePermission(request *ModifyImageSharePermissionRequest) (response *ModifyImageSharePermissionResponse, err error) { + response = CreateModifyImageSharePermissionResponse() + err = client.DoAction(request, response) + return +} + +// ModifyImageSharePermissionWithChan invokes the ecs.ModifyImageSharePermission API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyimagesharepermission.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyImageSharePermissionWithChan(request *ModifyImageSharePermissionRequest) (<-chan *ModifyImageSharePermissionResponse, <-chan error) { + responseChan := make(chan *ModifyImageSharePermissionResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyImageSharePermission(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyImageSharePermissionWithCallback invokes the ecs.ModifyImageSharePermission API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyimagesharepermission.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyImageSharePermissionWithCallback(request *ModifyImageSharePermissionRequest, callback func(response *ModifyImageSharePermissionResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyImageSharePermissionResponse + var err error + defer close(result) + response, err = client.ModifyImageSharePermission(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyImageSharePermissionRequest is the request struct for api ModifyImageSharePermission +type ModifyImageSharePermissionRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ImageId string `position:"Query" name:"ImageId"` + AddAccount *[]string `position:"Query" name:"AddAccount" type:"Repeated"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + RemoveAccount *[]string `position:"Query" name:"RemoveAccount" type:"Repeated"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// ModifyImageSharePermissionResponse is the response struct for api ModifyImageSharePermission +type ModifyImageSharePermissionResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyImageSharePermissionRequest creates a request to invoke ModifyImageSharePermission API +func CreateModifyImageSharePermissionRequest() (request *ModifyImageSharePermissionRequest) { + request = &ModifyImageSharePermissionRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyImageSharePermission", "ecs", "openAPI") + return +} + +// CreateModifyImageSharePermissionResponse creates a response to parse from ModifyImageSharePermission response +func CreateModifyImageSharePermissionResponse() (response *ModifyImageSharePermissionResponse) { + response = &ModifyImageSharePermissionResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_instance_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_instance_attribute.go new file mode 100644 index 000000000..57bfed403 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_instance_attribute.go @@ -0,0 +1,115 @@ +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" +) + +// ModifyInstanceAttribute invokes the ecs.ModifyInstanceAttribute API synchronously +// api document: https://help.aliyun.com/api/ecs/modifyinstanceattribute.html +func (client *Client) ModifyInstanceAttribute(request *ModifyInstanceAttributeRequest) (response *ModifyInstanceAttributeResponse, err error) { + response = CreateModifyInstanceAttributeResponse() + err = client.DoAction(request, response) + return +} + +// ModifyInstanceAttributeWithChan invokes the ecs.ModifyInstanceAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyinstanceattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyInstanceAttributeWithChan(request *ModifyInstanceAttributeRequest) (<-chan *ModifyInstanceAttributeResponse, <-chan error) { + responseChan := make(chan *ModifyInstanceAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyInstanceAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyInstanceAttributeWithCallback invokes the ecs.ModifyInstanceAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyinstanceattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyInstanceAttributeWithCallback(request *ModifyInstanceAttributeRequest, callback func(response *ModifyInstanceAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyInstanceAttributeResponse + var err error + defer close(result) + response, err = client.ModifyInstanceAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyInstanceAttributeRequest is the request struct for api ModifyInstanceAttribute +type ModifyInstanceAttributeRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + Recyclable requests.Boolean `position:"Query" name:"Recyclable"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Description string `position:"Query" name:"Description"` + CreditSpecification string `position:"Query" name:"CreditSpecification"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + DeletionProtection requests.Boolean `position:"Query" name:"DeletionProtection"` + UserData string `position:"Query" name:"UserData"` + Password string `position:"Query" name:"Password"` + HostName string `position:"Query" name:"HostName"` + InstanceId string `position:"Query" name:"InstanceId"` + InstanceName string `position:"Query" name:"InstanceName"` +} + +// ModifyInstanceAttributeResponse is the response struct for api ModifyInstanceAttribute +type ModifyInstanceAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyInstanceAttributeRequest creates a request to invoke ModifyInstanceAttribute API +func CreateModifyInstanceAttributeRequest() (request *ModifyInstanceAttributeRequest) { + request = &ModifyInstanceAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyInstanceAttribute", "ecs", "openAPI") + return +} + +// CreateModifyInstanceAttributeResponse creates a response to parse from ModifyInstanceAttribute response +func CreateModifyInstanceAttributeResponse() (response *ModifyInstanceAttributeResponse) { + response = &ModifyInstanceAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_instance_auto_release_time.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_instance_auto_release_time.go new file mode 100644 index 000000000..6e596d3de --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_instance_auto_release_time.go @@ -0,0 +1,108 @@ +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" +) + +// ModifyInstanceAutoReleaseTime invokes the ecs.ModifyInstanceAutoReleaseTime API synchronously +// api document: https://help.aliyun.com/api/ecs/modifyinstanceautoreleasetime.html +func (client *Client) ModifyInstanceAutoReleaseTime(request *ModifyInstanceAutoReleaseTimeRequest) (response *ModifyInstanceAutoReleaseTimeResponse, err error) { + response = CreateModifyInstanceAutoReleaseTimeResponse() + err = client.DoAction(request, response) + return +} + +// ModifyInstanceAutoReleaseTimeWithChan invokes the ecs.ModifyInstanceAutoReleaseTime API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyinstanceautoreleasetime.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyInstanceAutoReleaseTimeWithChan(request *ModifyInstanceAutoReleaseTimeRequest) (<-chan *ModifyInstanceAutoReleaseTimeResponse, <-chan error) { + responseChan := make(chan *ModifyInstanceAutoReleaseTimeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyInstanceAutoReleaseTime(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyInstanceAutoReleaseTimeWithCallback invokes the ecs.ModifyInstanceAutoReleaseTime API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyinstanceautoreleasetime.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyInstanceAutoReleaseTimeWithCallback(request *ModifyInstanceAutoReleaseTimeRequest, callback func(response *ModifyInstanceAutoReleaseTimeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyInstanceAutoReleaseTimeResponse + var err error + defer close(result) + response, err = client.ModifyInstanceAutoReleaseTime(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyInstanceAutoReleaseTimeRequest is the request struct for api ModifyInstanceAutoReleaseTime +type ModifyInstanceAutoReleaseTimeRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + InstanceId string `position:"Query" name:"InstanceId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + AutoReleaseTime string `position:"Query" name:"AutoReleaseTime"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// ModifyInstanceAutoReleaseTimeResponse is the response struct for api ModifyInstanceAutoReleaseTime +type ModifyInstanceAutoReleaseTimeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyInstanceAutoReleaseTimeRequest creates a request to invoke ModifyInstanceAutoReleaseTime API +func CreateModifyInstanceAutoReleaseTimeRequest() (request *ModifyInstanceAutoReleaseTimeRequest) { + request = &ModifyInstanceAutoReleaseTimeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyInstanceAutoReleaseTime", "ecs", "openAPI") + return +} + +// CreateModifyInstanceAutoReleaseTimeResponse creates a response to parse from ModifyInstanceAutoReleaseTime response +func CreateModifyInstanceAutoReleaseTimeResponse() (response *ModifyInstanceAutoReleaseTimeResponse) { + response = &ModifyInstanceAutoReleaseTimeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_instance_auto_renew_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_instance_auto_renew_attribute.go new file mode 100644 index 000000000..3df2c793f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_instance_auto_renew_attribute.go @@ -0,0 +1,111 @@ +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" +) + +// ModifyInstanceAutoRenewAttribute invokes the ecs.ModifyInstanceAutoRenewAttribute API synchronously +// api document: https://help.aliyun.com/api/ecs/modifyinstanceautorenewattribute.html +func (client *Client) ModifyInstanceAutoRenewAttribute(request *ModifyInstanceAutoRenewAttributeRequest) (response *ModifyInstanceAutoRenewAttributeResponse, err error) { + response = CreateModifyInstanceAutoRenewAttributeResponse() + err = client.DoAction(request, response) + return +} + +// ModifyInstanceAutoRenewAttributeWithChan invokes the ecs.ModifyInstanceAutoRenewAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyinstanceautorenewattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyInstanceAutoRenewAttributeWithChan(request *ModifyInstanceAutoRenewAttributeRequest) (<-chan *ModifyInstanceAutoRenewAttributeResponse, <-chan error) { + responseChan := make(chan *ModifyInstanceAutoRenewAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyInstanceAutoRenewAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyInstanceAutoRenewAttributeWithCallback invokes the ecs.ModifyInstanceAutoRenewAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyinstanceautorenewattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyInstanceAutoRenewAttributeWithCallback(request *ModifyInstanceAutoRenewAttributeRequest, callback func(response *ModifyInstanceAutoRenewAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyInstanceAutoRenewAttributeResponse + var err error + defer close(result) + response, err = client.ModifyInstanceAutoRenewAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyInstanceAutoRenewAttributeRequest is the request struct for api ModifyInstanceAutoRenewAttribute +type ModifyInstanceAutoRenewAttributeRequest struct { + *requests.RpcRequest + Duration requests.Integer `position:"Query" name:"Duration"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + PeriodUnit string `position:"Query" name:"PeriodUnit"` + InstanceId string `position:"Query" name:"InstanceId"` + AutoRenew requests.Boolean `position:"Query" name:"AutoRenew"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + RenewalStatus string `position:"Query" name:"RenewalStatus"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// ModifyInstanceAutoRenewAttributeResponse is the response struct for api ModifyInstanceAutoRenewAttribute +type ModifyInstanceAutoRenewAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyInstanceAutoRenewAttributeRequest creates a request to invoke ModifyInstanceAutoRenewAttribute API +func CreateModifyInstanceAutoRenewAttributeRequest() (request *ModifyInstanceAutoRenewAttributeRequest) { + request = &ModifyInstanceAutoRenewAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyInstanceAutoRenewAttribute", "ecs", "openAPI") + return +} + +// CreateModifyInstanceAutoRenewAttributeResponse creates a response to parse from ModifyInstanceAutoRenewAttribute response +func CreateModifyInstanceAutoRenewAttributeResponse() (response *ModifyInstanceAutoRenewAttributeResponse) { + response = &ModifyInstanceAutoRenewAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_instance_charge_type.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_instance_charge_type.go new file mode 100644 index 000000000..658fcdf61 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_instance_charge_type.go @@ -0,0 +1,115 @@ +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" +) + +// ModifyInstanceChargeType invokes the ecs.ModifyInstanceChargeType API synchronously +// api document: https://help.aliyun.com/api/ecs/modifyinstancechargetype.html +func (client *Client) ModifyInstanceChargeType(request *ModifyInstanceChargeTypeRequest) (response *ModifyInstanceChargeTypeResponse, err error) { + response = CreateModifyInstanceChargeTypeResponse() + err = client.DoAction(request, response) + return +} + +// ModifyInstanceChargeTypeWithChan invokes the ecs.ModifyInstanceChargeType API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyinstancechargetype.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyInstanceChargeTypeWithChan(request *ModifyInstanceChargeTypeRequest) (<-chan *ModifyInstanceChargeTypeResponse, <-chan error) { + responseChan := make(chan *ModifyInstanceChargeTypeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyInstanceChargeType(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyInstanceChargeTypeWithCallback invokes the ecs.ModifyInstanceChargeType API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyinstancechargetype.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyInstanceChargeTypeWithCallback(request *ModifyInstanceChargeTypeRequest, callback func(response *ModifyInstanceChargeTypeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyInstanceChargeTypeResponse + var err error + defer close(result) + response, err = client.ModifyInstanceChargeType(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyInstanceChargeTypeRequest is the request struct for api ModifyInstanceChargeType +type ModifyInstanceChargeTypeRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + Period requests.Integer `position:"Query" name:"Period"` + DryRun requests.Boolean `position:"Query" name:"DryRun"` + AutoPay requests.Boolean `position:"Query" name:"AutoPay"` + IncludeDataDisks requests.Boolean `position:"Query" name:"IncludeDataDisks"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PeriodUnit string `position:"Query" name:"PeriodUnit"` + InstanceIds string `position:"Query" name:"InstanceIds"` + InstanceChargeType string `position:"Query" name:"InstanceChargeType"` +} + +// ModifyInstanceChargeTypeResponse is the response struct for api ModifyInstanceChargeType +type ModifyInstanceChargeTypeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + OrderId string `json:"OrderId" xml:"OrderId"` +} + +// CreateModifyInstanceChargeTypeRequest creates a request to invoke ModifyInstanceChargeType API +func CreateModifyInstanceChargeTypeRequest() (request *ModifyInstanceChargeTypeRequest) { + request = &ModifyInstanceChargeTypeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyInstanceChargeType", "ecs", "openAPI") + return +} + +// CreateModifyInstanceChargeTypeResponse creates a response to parse from ModifyInstanceChargeType response +func CreateModifyInstanceChargeTypeResponse() (response *ModifyInstanceChargeTypeResponse) { + response = &ModifyInstanceChargeTypeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_instance_deployment.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_instance_deployment.go new file mode 100644 index 000000000..c2bf25eca --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_instance_deployment.go @@ -0,0 +1,110 @@ +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" +) + +// ModifyInstanceDeployment invokes the ecs.ModifyInstanceDeployment API synchronously +// api document: https://help.aliyun.com/api/ecs/modifyinstancedeployment.html +func (client *Client) ModifyInstanceDeployment(request *ModifyInstanceDeploymentRequest) (response *ModifyInstanceDeploymentResponse, err error) { + response = CreateModifyInstanceDeploymentResponse() + err = client.DoAction(request, response) + return +} + +// ModifyInstanceDeploymentWithChan invokes the ecs.ModifyInstanceDeployment API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyinstancedeployment.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyInstanceDeploymentWithChan(request *ModifyInstanceDeploymentRequest) (<-chan *ModifyInstanceDeploymentResponse, <-chan error) { + responseChan := make(chan *ModifyInstanceDeploymentResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyInstanceDeployment(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyInstanceDeploymentWithCallback invokes the ecs.ModifyInstanceDeployment API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyinstancedeployment.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyInstanceDeploymentWithCallback(request *ModifyInstanceDeploymentRequest, callback func(response *ModifyInstanceDeploymentResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyInstanceDeploymentResponse + var err error + defer close(result) + response, err = client.ModifyInstanceDeployment(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyInstanceDeploymentRequest is the request struct for api ModifyInstanceDeployment +type ModifyInstanceDeploymentRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + DeploymentSetId string `position:"Query" name:"DeploymentSetId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + DedicatedHostId string `position:"Query" name:"DedicatedHostId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + InstanceId string `position:"Query" name:"InstanceId"` + Force requests.Boolean `position:"Query" name:"Force"` +} + +// ModifyInstanceDeploymentResponse is the response struct for api ModifyInstanceDeployment +type ModifyInstanceDeploymentResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyInstanceDeploymentRequest creates a request to invoke ModifyInstanceDeployment API +func CreateModifyInstanceDeploymentRequest() (request *ModifyInstanceDeploymentRequest) { + request = &ModifyInstanceDeploymentRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyInstanceDeployment", "ecs", "openAPI") + return +} + +// CreateModifyInstanceDeploymentResponse creates a response to parse from ModifyInstanceDeployment response +func CreateModifyInstanceDeploymentResponse() (response *ModifyInstanceDeploymentResponse) { + response = &ModifyInstanceDeploymentResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_instance_network_spec.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_instance_network_spec.go new file mode 100644 index 000000000..cf4c68318 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_instance_network_spec.go @@ -0,0 +1,116 @@ +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" +) + +// ModifyInstanceNetworkSpec invokes the ecs.ModifyInstanceNetworkSpec API synchronously +// api document: https://help.aliyun.com/api/ecs/modifyinstancenetworkspec.html +func (client *Client) ModifyInstanceNetworkSpec(request *ModifyInstanceNetworkSpecRequest) (response *ModifyInstanceNetworkSpecResponse, err error) { + response = CreateModifyInstanceNetworkSpecResponse() + err = client.DoAction(request, response) + return +} + +// ModifyInstanceNetworkSpecWithChan invokes the ecs.ModifyInstanceNetworkSpec API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyinstancenetworkspec.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyInstanceNetworkSpecWithChan(request *ModifyInstanceNetworkSpecRequest) (<-chan *ModifyInstanceNetworkSpecResponse, <-chan error) { + responseChan := make(chan *ModifyInstanceNetworkSpecResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyInstanceNetworkSpec(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyInstanceNetworkSpecWithCallback invokes the ecs.ModifyInstanceNetworkSpec API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyinstancenetworkspec.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyInstanceNetworkSpecWithCallback(request *ModifyInstanceNetworkSpecRequest, callback func(response *ModifyInstanceNetworkSpecResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyInstanceNetworkSpecResponse + var err error + defer close(result) + response, err = client.ModifyInstanceNetworkSpec(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyInstanceNetworkSpecRequest is the request struct for api ModifyInstanceNetworkSpec +type ModifyInstanceNetworkSpecRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + AutoPay requests.Boolean `position:"Query" name:"AutoPay"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + InternetMaxBandwidthOut requests.Integer `position:"Query" name:"InternetMaxBandwidthOut"` + EndTime string `position:"Query" name:"EndTime"` + StartTime string `position:"Query" name:"StartTime"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + InstanceId string `position:"Query" name:"InstanceId"` + NetworkChargeType string `position:"Query" name:"NetworkChargeType"` + InternetMaxBandwidthIn requests.Integer `position:"Query" name:"InternetMaxBandwidthIn"` + AllocatePublicIp requests.Boolean `position:"Query" name:"AllocatePublicIp"` +} + +// ModifyInstanceNetworkSpecResponse is the response struct for api ModifyInstanceNetworkSpec +type ModifyInstanceNetworkSpecResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + OrderId string `json:"OrderId" xml:"OrderId"` +} + +// CreateModifyInstanceNetworkSpecRequest creates a request to invoke ModifyInstanceNetworkSpec API +func CreateModifyInstanceNetworkSpecRequest() (request *ModifyInstanceNetworkSpecRequest) { + request = &ModifyInstanceNetworkSpecRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyInstanceNetworkSpec", "ecs", "openAPI") + return +} + +// CreateModifyInstanceNetworkSpecResponse creates a response to parse from ModifyInstanceNetworkSpec response +func CreateModifyInstanceNetworkSpecResponse() (response *ModifyInstanceNetworkSpecResponse) { + response = &ModifyInstanceNetworkSpecResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_instance_spec.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_instance_spec.go new file mode 100644 index 000000000..b6d1e7b31 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_instance_spec.go @@ -0,0 +1,117 @@ +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" +) + +// ModifyInstanceSpec invokes the ecs.ModifyInstanceSpec API synchronously +// api document: https://help.aliyun.com/api/ecs/modifyinstancespec.html +func (client *Client) ModifyInstanceSpec(request *ModifyInstanceSpecRequest) (response *ModifyInstanceSpecResponse, err error) { + response = CreateModifyInstanceSpecResponse() + err = client.DoAction(request, response) + return +} + +// ModifyInstanceSpecWithChan invokes the ecs.ModifyInstanceSpec API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyinstancespec.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyInstanceSpecWithChan(request *ModifyInstanceSpecRequest) (<-chan *ModifyInstanceSpecResponse, <-chan error) { + responseChan := make(chan *ModifyInstanceSpecResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyInstanceSpec(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyInstanceSpecWithCallback invokes the ecs.ModifyInstanceSpec API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyinstancespec.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyInstanceSpecWithCallback(request *ModifyInstanceSpecRequest, callback func(response *ModifyInstanceSpecResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyInstanceSpecResponse + var err error + defer close(result) + response, err = client.ModifyInstanceSpec(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyInstanceSpecRequest is the request struct for api ModifyInstanceSpec +type ModifyInstanceSpecRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + AllowMigrateAcrossZone requests.Boolean `position:"Query" name:"AllowMigrateAcrossZone"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + InternetMaxBandwidthOut requests.Integer `position:"Query" name:"InternetMaxBandwidthOut"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + TemporaryInternetMaxBandwidthOut requests.Integer `position:"Query" name:"Temporary.InternetMaxBandwidthOut"` + SystemDiskCategory string `position:"Query" name:"SystemDisk.Category"` + TemporaryStartTime string `position:"Query" name:"Temporary.StartTime"` + Async requests.Boolean `position:"Query" name:"Async"` + InstanceId string `position:"Query" name:"InstanceId"` + InstanceType string `position:"Query" name:"InstanceType"` + TemporaryEndTime string `position:"Query" name:"Temporary.EndTime"` + InternetMaxBandwidthIn requests.Integer `position:"Query" name:"InternetMaxBandwidthIn"` +} + +// ModifyInstanceSpecResponse is the response struct for api ModifyInstanceSpec +type ModifyInstanceSpecResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyInstanceSpecRequest creates a request to invoke ModifyInstanceSpec API +func CreateModifyInstanceSpecRequest() (request *ModifyInstanceSpecRequest) { + request = &ModifyInstanceSpecRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyInstanceSpec", "ecs", "openAPI") + return +} + +// CreateModifyInstanceSpecResponse creates a response to parse from ModifyInstanceSpec response +func CreateModifyInstanceSpecResponse() (response *ModifyInstanceSpecResponse) { + response = &ModifyInstanceSpecResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_instance_vnc_passwd.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_instance_vnc_passwd.go new file mode 100644 index 000000000..dcc971aa4 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_instance_vnc_passwd.go @@ -0,0 +1,108 @@ +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" +) + +// ModifyInstanceVncPasswd invokes the ecs.ModifyInstanceVncPasswd API synchronously +// api document: https://help.aliyun.com/api/ecs/modifyinstancevncpasswd.html +func (client *Client) ModifyInstanceVncPasswd(request *ModifyInstanceVncPasswdRequest) (response *ModifyInstanceVncPasswdResponse, err error) { + response = CreateModifyInstanceVncPasswdResponse() + err = client.DoAction(request, response) + return +} + +// ModifyInstanceVncPasswdWithChan invokes the ecs.ModifyInstanceVncPasswd API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyinstancevncpasswd.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyInstanceVncPasswdWithChan(request *ModifyInstanceVncPasswdRequest) (<-chan *ModifyInstanceVncPasswdResponse, <-chan error) { + responseChan := make(chan *ModifyInstanceVncPasswdResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyInstanceVncPasswd(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyInstanceVncPasswdWithCallback invokes the ecs.ModifyInstanceVncPasswd API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyinstancevncpasswd.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyInstanceVncPasswdWithCallback(request *ModifyInstanceVncPasswdRequest, callback func(response *ModifyInstanceVncPasswdResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyInstanceVncPasswdResponse + var err error + defer close(result) + response, err = client.ModifyInstanceVncPasswd(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyInstanceVncPasswdRequest is the request struct for api ModifyInstanceVncPasswd +type ModifyInstanceVncPasswdRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + InstanceId string `position:"Query" name:"InstanceId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + VncPassword string `position:"Query" name:"VncPassword"` +} + +// ModifyInstanceVncPasswdResponse is the response struct for api ModifyInstanceVncPasswd +type ModifyInstanceVncPasswdResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyInstanceVncPasswdRequest creates a request to invoke ModifyInstanceVncPasswd API +func CreateModifyInstanceVncPasswdRequest() (request *ModifyInstanceVncPasswdRequest) { + request = &ModifyInstanceVncPasswdRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyInstanceVncPasswd", "ecs", "openAPI") + return +} + +// CreateModifyInstanceVncPasswdResponse creates a response to parse from ModifyInstanceVncPasswd response +func CreateModifyInstanceVncPasswdResponse() (response *ModifyInstanceVncPasswdResponse) { + response = &ModifyInstanceVncPasswdResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_instance_vpc_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_instance_vpc_attribute.go new file mode 100644 index 000000000..6c4e510f8 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_instance_vpc_attribute.go @@ -0,0 +1,109 @@ +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" +) + +// ModifyInstanceVpcAttribute invokes the ecs.ModifyInstanceVpcAttribute API synchronously +// api document: https://help.aliyun.com/api/ecs/modifyinstancevpcattribute.html +func (client *Client) ModifyInstanceVpcAttribute(request *ModifyInstanceVpcAttributeRequest) (response *ModifyInstanceVpcAttributeResponse, err error) { + response = CreateModifyInstanceVpcAttributeResponse() + err = client.DoAction(request, response) + return +} + +// ModifyInstanceVpcAttributeWithChan invokes the ecs.ModifyInstanceVpcAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyinstancevpcattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyInstanceVpcAttributeWithChan(request *ModifyInstanceVpcAttributeRequest) (<-chan *ModifyInstanceVpcAttributeResponse, <-chan error) { + responseChan := make(chan *ModifyInstanceVpcAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyInstanceVpcAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyInstanceVpcAttributeWithCallback invokes the ecs.ModifyInstanceVpcAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyinstancevpcattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyInstanceVpcAttributeWithCallback(request *ModifyInstanceVpcAttributeRequest, callback func(response *ModifyInstanceVpcAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyInstanceVpcAttributeResponse + var err error + defer close(result) + response, err = client.ModifyInstanceVpcAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyInstanceVpcAttributeRequest is the request struct for api ModifyInstanceVpcAttribute +type ModifyInstanceVpcAttributeRequest struct { + *requests.RpcRequest + VSwitchId string `position:"Query" name:"VSwitchId"` + PrivateIpAddress string `position:"Query" name:"PrivateIpAddress"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + InstanceId string `position:"Query" name:"InstanceId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// ModifyInstanceVpcAttributeResponse is the response struct for api ModifyInstanceVpcAttribute +type ModifyInstanceVpcAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyInstanceVpcAttributeRequest creates a request to invoke ModifyInstanceVpcAttribute API +func CreateModifyInstanceVpcAttributeRequest() (request *ModifyInstanceVpcAttributeRequest) { + request = &ModifyInstanceVpcAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyInstanceVpcAttribute", "ecs", "openAPI") + return +} + +// CreateModifyInstanceVpcAttributeResponse creates a response to parse from ModifyInstanceVpcAttribute response +func CreateModifyInstanceVpcAttributeResponse() (response *ModifyInstanceVpcAttributeResponse) { + response = &ModifyInstanceVpcAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_launch_template_default_version.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_launch_template_default_version.go new file mode 100644 index 000000000..ddb4db403 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_launch_template_default_version.go @@ -0,0 +1,109 @@ +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" +) + +// ModifyLaunchTemplateDefaultVersion invokes the ecs.ModifyLaunchTemplateDefaultVersion API synchronously +// api document: https://help.aliyun.com/api/ecs/modifylaunchtemplatedefaultversion.html +func (client *Client) ModifyLaunchTemplateDefaultVersion(request *ModifyLaunchTemplateDefaultVersionRequest) (response *ModifyLaunchTemplateDefaultVersionResponse, err error) { + response = CreateModifyLaunchTemplateDefaultVersionResponse() + err = client.DoAction(request, response) + return +} + +// ModifyLaunchTemplateDefaultVersionWithChan invokes the ecs.ModifyLaunchTemplateDefaultVersion API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifylaunchtemplatedefaultversion.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyLaunchTemplateDefaultVersionWithChan(request *ModifyLaunchTemplateDefaultVersionRequest) (<-chan *ModifyLaunchTemplateDefaultVersionResponse, <-chan error) { + responseChan := make(chan *ModifyLaunchTemplateDefaultVersionResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyLaunchTemplateDefaultVersion(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyLaunchTemplateDefaultVersionWithCallback invokes the ecs.ModifyLaunchTemplateDefaultVersion API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifylaunchtemplatedefaultversion.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyLaunchTemplateDefaultVersionWithCallback(request *ModifyLaunchTemplateDefaultVersionRequest, callback func(response *ModifyLaunchTemplateDefaultVersionResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyLaunchTemplateDefaultVersionResponse + var err error + defer close(result) + response, err = client.ModifyLaunchTemplateDefaultVersion(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyLaunchTemplateDefaultVersionRequest is the request struct for api ModifyLaunchTemplateDefaultVersion +type ModifyLaunchTemplateDefaultVersionRequest struct { + *requests.RpcRequest + LaunchTemplateName string `position:"Query" name:"LaunchTemplateName"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + LaunchTemplateId string `position:"Query" name:"LaunchTemplateId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + DefaultVersionNumber requests.Integer `position:"Query" name:"DefaultVersionNumber"` +} + +// ModifyLaunchTemplateDefaultVersionResponse is the response struct for api ModifyLaunchTemplateDefaultVersion +type ModifyLaunchTemplateDefaultVersionResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyLaunchTemplateDefaultVersionRequest creates a request to invoke ModifyLaunchTemplateDefaultVersion API +func CreateModifyLaunchTemplateDefaultVersionRequest() (request *ModifyLaunchTemplateDefaultVersionRequest) { + request = &ModifyLaunchTemplateDefaultVersionRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyLaunchTemplateDefaultVersion", "ecs", "openAPI") + return +} + +// CreateModifyLaunchTemplateDefaultVersionResponse creates a response to parse from ModifyLaunchTemplateDefaultVersion response +func CreateModifyLaunchTemplateDefaultVersionResponse() (response *ModifyLaunchTemplateDefaultVersionResponse) { + response = &ModifyLaunchTemplateDefaultVersionResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_network_interface_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_network_interface_attribute.go new file mode 100644 index 000000000..81620cc00 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_network_interface_attribute.go @@ -0,0 +1,110 @@ +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" +) + +// ModifyNetworkInterfaceAttribute invokes the ecs.ModifyNetworkInterfaceAttribute API synchronously +// api document: https://help.aliyun.com/api/ecs/modifynetworkinterfaceattribute.html +func (client *Client) ModifyNetworkInterfaceAttribute(request *ModifyNetworkInterfaceAttributeRequest) (response *ModifyNetworkInterfaceAttributeResponse, err error) { + response = CreateModifyNetworkInterfaceAttributeResponse() + err = client.DoAction(request, response) + return +} + +// ModifyNetworkInterfaceAttributeWithChan invokes the ecs.ModifyNetworkInterfaceAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifynetworkinterfaceattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyNetworkInterfaceAttributeWithChan(request *ModifyNetworkInterfaceAttributeRequest) (<-chan *ModifyNetworkInterfaceAttributeResponse, <-chan error) { + responseChan := make(chan *ModifyNetworkInterfaceAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyNetworkInterfaceAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyNetworkInterfaceAttributeWithCallback invokes the ecs.ModifyNetworkInterfaceAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifynetworkinterfaceattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyNetworkInterfaceAttributeWithCallback(request *ModifyNetworkInterfaceAttributeRequest, callback func(response *ModifyNetworkInterfaceAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyNetworkInterfaceAttributeResponse + var err error + defer close(result) + response, err = client.ModifyNetworkInterfaceAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyNetworkInterfaceAttributeRequest is the request struct for api ModifyNetworkInterfaceAttribute +type ModifyNetworkInterfaceAttributeRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + SecurityGroupId *[]string `position:"Query" name:"SecurityGroupId" type:"Repeated"` + Description string `position:"Query" name:"Description"` + NetworkInterfaceName string `position:"Query" name:"NetworkInterfaceName"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + NetworkInterfaceId string `position:"Query" name:"NetworkInterfaceId"` +} + +// ModifyNetworkInterfaceAttributeResponse is the response struct for api ModifyNetworkInterfaceAttribute +type ModifyNetworkInterfaceAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyNetworkInterfaceAttributeRequest creates a request to invoke ModifyNetworkInterfaceAttribute API +func CreateModifyNetworkInterfaceAttributeRequest() (request *ModifyNetworkInterfaceAttributeRequest) { + request = &ModifyNetworkInterfaceAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyNetworkInterfaceAttribute", "ecs", "openAPI") + return +} + +// CreateModifyNetworkInterfaceAttributeResponse creates a response to parse from ModifyNetworkInterfaceAttribute response +func CreateModifyNetworkInterfaceAttributeResponse() (response *ModifyNetworkInterfaceAttributeResponse) { + response = &ModifyNetworkInterfaceAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_physical_connection_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_physical_connection_attribute.go new file mode 100644 index 000000000..728bde2ca --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_physical_connection_attribute.go @@ -0,0 +1,117 @@ +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" +) + +// ModifyPhysicalConnectionAttribute invokes the ecs.ModifyPhysicalConnectionAttribute API synchronously +// api document: https://help.aliyun.com/api/ecs/modifyphysicalconnectionattribute.html +func (client *Client) ModifyPhysicalConnectionAttribute(request *ModifyPhysicalConnectionAttributeRequest) (response *ModifyPhysicalConnectionAttributeResponse, err error) { + response = CreateModifyPhysicalConnectionAttributeResponse() + err = client.DoAction(request, response) + return +} + +// ModifyPhysicalConnectionAttributeWithChan invokes the ecs.ModifyPhysicalConnectionAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyphysicalconnectionattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyPhysicalConnectionAttributeWithChan(request *ModifyPhysicalConnectionAttributeRequest) (<-chan *ModifyPhysicalConnectionAttributeResponse, <-chan error) { + responseChan := make(chan *ModifyPhysicalConnectionAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyPhysicalConnectionAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyPhysicalConnectionAttributeWithCallback invokes the ecs.ModifyPhysicalConnectionAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyphysicalconnectionattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyPhysicalConnectionAttributeWithCallback(request *ModifyPhysicalConnectionAttributeRequest, callback func(response *ModifyPhysicalConnectionAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyPhysicalConnectionAttributeResponse + var err error + defer close(result) + response, err = client.ModifyPhysicalConnectionAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyPhysicalConnectionAttributeRequest is the request struct for api ModifyPhysicalConnectionAttribute +type ModifyPhysicalConnectionAttributeRequest struct { + *requests.RpcRequest + RedundantPhysicalConnectionId string `position:"Query" name:"RedundantPhysicalConnectionId"` + PeerLocation string `position:"Query" name:"PeerLocation"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + PortType string `position:"Query" name:"PortType"` + CircuitCode string `position:"Query" name:"CircuitCode"` + Bandwidth requests.Integer `position:"Query" name:"bandwidth"` + ClientToken string `position:"Query" name:"ClientToken"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Description string `position:"Query" name:"Description"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + LineOperator string `position:"Query" name:"LineOperator"` + PhysicalConnectionId string `position:"Query" name:"PhysicalConnectionId"` + Name string `position:"Query" name:"Name"` + UserCidr string `position:"Query" name:"UserCidr"` +} + +// ModifyPhysicalConnectionAttributeResponse is the response struct for api ModifyPhysicalConnectionAttribute +type ModifyPhysicalConnectionAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyPhysicalConnectionAttributeRequest creates a request to invoke ModifyPhysicalConnectionAttribute API +func CreateModifyPhysicalConnectionAttributeRequest() (request *ModifyPhysicalConnectionAttributeRequest) { + request = &ModifyPhysicalConnectionAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyPhysicalConnectionAttribute", "ecs", "openAPI") + return +} + +// CreateModifyPhysicalConnectionAttributeResponse creates a response to parse from ModifyPhysicalConnectionAttribute response +func CreateModifyPhysicalConnectionAttributeResponse() (response *ModifyPhysicalConnectionAttributeResponse) { + response = &ModifyPhysicalConnectionAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_prepay_instance_spec.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_prepay_instance_spec.go new file mode 100644 index 000000000..4bdf8234e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_prepay_instance_spec.go @@ -0,0 +1,114 @@ +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" +) + +// ModifyPrepayInstanceSpec invokes the ecs.ModifyPrepayInstanceSpec API synchronously +// api document: https://help.aliyun.com/api/ecs/modifyprepayinstancespec.html +func (client *Client) ModifyPrepayInstanceSpec(request *ModifyPrepayInstanceSpecRequest) (response *ModifyPrepayInstanceSpecResponse, err error) { + response = CreateModifyPrepayInstanceSpecResponse() + err = client.DoAction(request, response) + return +} + +// ModifyPrepayInstanceSpecWithChan invokes the ecs.ModifyPrepayInstanceSpec API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyprepayinstancespec.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyPrepayInstanceSpecWithChan(request *ModifyPrepayInstanceSpecRequest) (<-chan *ModifyPrepayInstanceSpecResponse, <-chan error) { + responseChan := make(chan *ModifyPrepayInstanceSpecResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyPrepayInstanceSpec(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyPrepayInstanceSpecWithCallback invokes the ecs.ModifyPrepayInstanceSpec API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyprepayinstancespec.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyPrepayInstanceSpecWithCallback(request *ModifyPrepayInstanceSpecRequest, callback func(response *ModifyPrepayInstanceSpecResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyPrepayInstanceSpecResponse + var err error + defer close(result) + response, err = client.ModifyPrepayInstanceSpec(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyPrepayInstanceSpecRequest is the request struct for api ModifyPrepayInstanceSpec +type ModifyPrepayInstanceSpecRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + AutoPay requests.Boolean `position:"Query" name:"AutoPay"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + OperatorType string `position:"Query" name:"OperatorType"` + SystemDiskCategory string `position:"Query" name:"SystemDisk.Category"` + InstanceId string `position:"Query" name:"InstanceId"` + MigrateAcrossZone requests.Boolean `position:"Query" name:"MigrateAcrossZone"` + InstanceType string `position:"Query" name:"InstanceType"` +} + +// ModifyPrepayInstanceSpecResponse is the response struct for api ModifyPrepayInstanceSpec +type ModifyPrepayInstanceSpecResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + OrderId string `json:"OrderId" xml:"OrderId"` +} + +// CreateModifyPrepayInstanceSpecRequest creates a request to invoke ModifyPrepayInstanceSpec API +func CreateModifyPrepayInstanceSpecRequest() (request *ModifyPrepayInstanceSpecRequest) { + request = &ModifyPrepayInstanceSpecRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyPrepayInstanceSpec", "ecs", "openAPI") + return +} + +// CreateModifyPrepayInstanceSpecResponse creates a response to parse from ModifyPrepayInstanceSpec response +func CreateModifyPrepayInstanceSpecResponse() (response *ModifyPrepayInstanceSpecResponse) { + response = &ModifyPrepayInstanceSpecResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_reserved_instances.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_reserved_instances.go new file mode 100644 index 000000000..29c4ca392 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/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 +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_router_interface_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_router_interface_attribute.go new file mode 100644 index 000000000..db09fb58a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_router_interface_attribute.go @@ -0,0 +1,114 @@ +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" +) + +// ModifyRouterInterfaceAttribute invokes the ecs.ModifyRouterInterfaceAttribute API synchronously +// api document: https://help.aliyun.com/api/ecs/modifyrouterinterfaceattribute.html +func (client *Client) ModifyRouterInterfaceAttribute(request *ModifyRouterInterfaceAttributeRequest) (response *ModifyRouterInterfaceAttributeResponse, err error) { + response = CreateModifyRouterInterfaceAttributeResponse() + err = client.DoAction(request, response) + return +} + +// ModifyRouterInterfaceAttributeWithChan invokes the ecs.ModifyRouterInterfaceAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyrouterinterfaceattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyRouterInterfaceAttributeWithChan(request *ModifyRouterInterfaceAttributeRequest) (<-chan *ModifyRouterInterfaceAttributeResponse, <-chan error) { + responseChan := make(chan *ModifyRouterInterfaceAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyRouterInterfaceAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyRouterInterfaceAttributeWithCallback invokes the ecs.ModifyRouterInterfaceAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyrouterinterfaceattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyRouterInterfaceAttributeWithCallback(request *ModifyRouterInterfaceAttributeRequest, callback func(response *ModifyRouterInterfaceAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyRouterInterfaceAttributeResponse + var err error + defer close(result) + response, err = client.ModifyRouterInterfaceAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyRouterInterfaceAttributeRequest is the request struct for api ModifyRouterInterfaceAttribute +type ModifyRouterInterfaceAttributeRequest struct { + *requests.RpcRequest + OppositeRouterId string `position:"Query" name:"OppositeRouterId"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + Description string `position:"Query" name:"Description"` + HealthCheckTargetIp string `position:"Query" name:"HealthCheckTargetIp"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + RouterInterfaceId string `position:"Query" name:"RouterInterfaceId"` + OppositeInterfaceOwnerId requests.Integer `position:"Query" name:"OppositeInterfaceOwnerId"` + HealthCheckSourceIp string `position:"Query" name:"HealthCheckSourceIp"` + Name string `position:"Query" name:"Name"` + OppositeRouterType string `position:"Query" name:"OppositeRouterType"` + OppositeInterfaceId string `position:"Query" name:"OppositeInterfaceId"` +} + +// ModifyRouterInterfaceAttributeResponse is the response struct for api ModifyRouterInterfaceAttribute +type ModifyRouterInterfaceAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyRouterInterfaceAttributeRequest creates a request to invoke ModifyRouterInterfaceAttribute API +func CreateModifyRouterInterfaceAttributeRequest() (request *ModifyRouterInterfaceAttributeRequest) { + request = &ModifyRouterInterfaceAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyRouterInterfaceAttribute", "ecs", "openAPI") + return +} + +// CreateModifyRouterInterfaceAttributeResponse creates a response to parse from ModifyRouterInterfaceAttribute response +func CreateModifyRouterInterfaceAttributeResponse() (response *ModifyRouterInterfaceAttributeResponse) { + response = &ModifyRouterInterfaceAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_router_interface_spec.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_router_interface_spec.go new file mode 100644 index 000000000..044e5e91a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_router_interface_spec.go @@ -0,0 +1,111 @@ +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" +) + +// ModifyRouterInterfaceSpec invokes the ecs.ModifyRouterInterfaceSpec API synchronously +// api document: https://help.aliyun.com/api/ecs/modifyrouterinterfacespec.html +func (client *Client) ModifyRouterInterfaceSpec(request *ModifyRouterInterfaceSpecRequest) (response *ModifyRouterInterfaceSpecResponse, err error) { + response = CreateModifyRouterInterfaceSpecResponse() + err = client.DoAction(request, response) + return +} + +// ModifyRouterInterfaceSpecWithChan invokes the ecs.ModifyRouterInterfaceSpec API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyrouterinterfacespec.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyRouterInterfaceSpecWithChan(request *ModifyRouterInterfaceSpecRequest) (<-chan *ModifyRouterInterfaceSpecResponse, <-chan error) { + responseChan := make(chan *ModifyRouterInterfaceSpecResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyRouterInterfaceSpec(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyRouterInterfaceSpecWithCallback invokes the ecs.ModifyRouterInterfaceSpec API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyrouterinterfacespec.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyRouterInterfaceSpecWithCallback(request *ModifyRouterInterfaceSpecRequest, callback func(response *ModifyRouterInterfaceSpecResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyRouterInterfaceSpecResponse + var err error + defer close(result) + response, err = client.ModifyRouterInterfaceSpec(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyRouterInterfaceSpecRequest is the request struct for api ModifyRouterInterfaceSpec +type ModifyRouterInterfaceSpecRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + UserCidr string `position:"Query" name:"UserCidr"` + RouterInterfaceId string `position:"Query" name:"RouterInterfaceId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Spec string `position:"Query" name:"Spec"` +} + +// ModifyRouterInterfaceSpecResponse is the response struct for api ModifyRouterInterfaceSpec +type ModifyRouterInterfaceSpecResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Spec string `json:"Spec" xml:"Spec"` +} + +// CreateModifyRouterInterfaceSpecRequest creates a request to invoke ModifyRouterInterfaceSpec API +func CreateModifyRouterInterfaceSpecRequest() (request *ModifyRouterInterfaceSpecRequest) { + request = &ModifyRouterInterfaceSpecRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyRouterInterfaceSpec", "ecs", "openAPI") + return +} + +// CreateModifyRouterInterfaceSpecResponse creates a response to parse from ModifyRouterInterfaceSpec response +func CreateModifyRouterInterfaceSpecResponse() (response *ModifyRouterInterfaceSpecResponse) { + response = &ModifyRouterInterfaceSpecResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_security_group_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_security_group_attribute.go new file mode 100644 index 000000000..4f01612db --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_security_group_attribute.go @@ -0,0 +1,109 @@ +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" +) + +// ModifySecurityGroupAttribute invokes the ecs.ModifySecurityGroupAttribute API synchronously +// api document: https://help.aliyun.com/api/ecs/modifysecuritygroupattribute.html +func (client *Client) ModifySecurityGroupAttribute(request *ModifySecurityGroupAttributeRequest) (response *ModifySecurityGroupAttributeResponse, err error) { + response = CreateModifySecurityGroupAttributeResponse() + err = client.DoAction(request, response) + return +} + +// ModifySecurityGroupAttributeWithChan invokes the ecs.ModifySecurityGroupAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifysecuritygroupattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifySecurityGroupAttributeWithChan(request *ModifySecurityGroupAttributeRequest) (<-chan *ModifySecurityGroupAttributeResponse, <-chan error) { + responseChan := make(chan *ModifySecurityGroupAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifySecurityGroupAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifySecurityGroupAttributeWithCallback invokes the ecs.ModifySecurityGroupAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifysecuritygroupattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifySecurityGroupAttributeWithCallback(request *ModifySecurityGroupAttributeRequest, callback func(response *ModifySecurityGroupAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifySecurityGroupAttributeResponse + var err error + defer close(result) + response, err = client.ModifySecurityGroupAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifySecurityGroupAttributeRequest is the request struct for api ModifySecurityGroupAttribute +type ModifySecurityGroupAttributeRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + SecurityGroupId string `position:"Query" name:"SecurityGroupId"` + Description string `position:"Query" name:"Description"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + SecurityGroupName string `position:"Query" name:"SecurityGroupName"` +} + +// ModifySecurityGroupAttributeResponse is the response struct for api ModifySecurityGroupAttribute +type ModifySecurityGroupAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifySecurityGroupAttributeRequest creates a request to invoke ModifySecurityGroupAttribute API +func CreateModifySecurityGroupAttributeRequest() (request *ModifySecurityGroupAttributeRequest) { + request = &ModifySecurityGroupAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ModifySecurityGroupAttribute", "ecs", "openAPI") + return +} + +// CreateModifySecurityGroupAttributeResponse creates a response to parse from ModifySecurityGroupAttribute response +func CreateModifySecurityGroupAttributeResponse() (response *ModifySecurityGroupAttributeResponse) { + response = &ModifySecurityGroupAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_security_group_egress_rule.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_security_group_egress_rule.go new file mode 100644 index 000000000..5b1bb177e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_security_group_egress_rule.go @@ -0,0 +1,122 @@ +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" +) + +// ModifySecurityGroupEgressRule invokes the ecs.ModifySecurityGroupEgressRule API synchronously +// api document: https://help.aliyun.com/api/ecs/modifysecuritygroupegressrule.html +func (client *Client) ModifySecurityGroupEgressRule(request *ModifySecurityGroupEgressRuleRequest) (response *ModifySecurityGroupEgressRuleResponse, err error) { + response = CreateModifySecurityGroupEgressRuleResponse() + err = client.DoAction(request, response) + return +} + +// ModifySecurityGroupEgressRuleWithChan invokes the ecs.ModifySecurityGroupEgressRule API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifysecuritygroupegressrule.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifySecurityGroupEgressRuleWithChan(request *ModifySecurityGroupEgressRuleRequest) (<-chan *ModifySecurityGroupEgressRuleResponse, <-chan error) { + responseChan := make(chan *ModifySecurityGroupEgressRuleResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifySecurityGroupEgressRule(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifySecurityGroupEgressRuleWithCallback invokes the ecs.ModifySecurityGroupEgressRule API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifysecuritygroupegressrule.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifySecurityGroupEgressRuleWithCallback(request *ModifySecurityGroupEgressRuleRequest, callback func(response *ModifySecurityGroupEgressRuleResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifySecurityGroupEgressRuleResponse + var err error + defer close(result) + response, err = client.ModifySecurityGroupEgressRule(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifySecurityGroupEgressRuleRequest is the request struct for api ModifySecurityGroupEgressRule +type ModifySecurityGroupEgressRuleRequest struct { + *requests.RpcRequest + NicType string `position:"Query" name:"NicType"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + SourcePortRange string `position:"Query" name:"SourcePortRange"` + ClientToken string `position:"Query" name:"ClientToken"` + SecurityGroupId string `position:"Query" name:"SecurityGroupId"` + Description string `position:"Query" name:"Description"` + Ipv6DestCidrIp string `position:"Query" name:"Ipv6DestCidrIp"` + Ipv6SourceCidrIp string `position:"Query" name:"Ipv6SourceCidrIp"` + Policy string `position:"Query" name:"Policy"` + PortRange string `position:"Query" name:"PortRange"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + IpProtocol string `position:"Query" name:"IpProtocol"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + SourceCidrIp string `position:"Query" name:"SourceCidrIp"` + DestGroupId string `position:"Query" name:"DestGroupId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + DestGroupOwnerAccount string `position:"Query" name:"DestGroupOwnerAccount"` + Priority string `position:"Query" name:"Priority"` + DestCidrIp string `position:"Query" name:"DestCidrIp"` + DestGroupOwnerId requests.Integer `position:"Query" name:"DestGroupOwnerId"` +} + +// ModifySecurityGroupEgressRuleResponse is the response struct for api ModifySecurityGroupEgressRule +type ModifySecurityGroupEgressRuleResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifySecurityGroupEgressRuleRequest creates a request to invoke ModifySecurityGroupEgressRule API +func CreateModifySecurityGroupEgressRuleRequest() (request *ModifySecurityGroupEgressRuleRequest) { + request = &ModifySecurityGroupEgressRuleRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ModifySecurityGroupEgressRule", "ecs", "openAPI") + return +} + +// CreateModifySecurityGroupEgressRuleResponse creates a response to parse from ModifySecurityGroupEgressRule response +func CreateModifySecurityGroupEgressRuleResponse() (response *ModifySecurityGroupEgressRuleResponse) { + response = &ModifySecurityGroupEgressRuleResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_security_group_policy.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_security_group_policy.go new file mode 100644 index 000000000..e9eeaed84 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_security_group_policy.go @@ -0,0 +1,109 @@ +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" +) + +// ModifySecurityGroupPolicy invokes the ecs.ModifySecurityGroupPolicy API synchronously +// api document: https://help.aliyun.com/api/ecs/modifysecuritygrouppolicy.html +func (client *Client) ModifySecurityGroupPolicy(request *ModifySecurityGroupPolicyRequest) (response *ModifySecurityGroupPolicyResponse, err error) { + response = CreateModifySecurityGroupPolicyResponse() + err = client.DoAction(request, response) + return +} + +// ModifySecurityGroupPolicyWithChan invokes the ecs.ModifySecurityGroupPolicy API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifysecuritygrouppolicy.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifySecurityGroupPolicyWithChan(request *ModifySecurityGroupPolicyRequest) (<-chan *ModifySecurityGroupPolicyResponse, <-chan error) { + responseChan := make(chan *ModifySecurityGroupPolicyResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifySecurityGroupPolicy(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifySecurityGroupPolicyWithCallback invokes the ecs.ModifySecurityGroupPolicy API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifysecuritygrouppolicy.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifySecurityGroupPolicyWithCallback(request *ModifySecurityGroupPolicyRequest, callback func(response *ModifySecurityGroupPolicyResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifySecurityGroupPolicyResponse + var err error + defer close(result) + response, err = client.ModifySecurityGroupPolicy(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifySecurityGroupPolicyRequest is the request struct for api ModifySecurityGroupPolicy +type ModifySecurityGroupPolicyRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ClientToken string `position:"Query" name:"ClientToken"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + SecurityGroupId string `position:"Query" name:"SecurityGroupId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + InnerAccessPolicy string `position:"Query" name:"InnerAccessPolicy"` +} + +// ModifySecurityGroupPolicyResponse is the response struct for api ModifySecurityGroupPolicy +type ModifySecurityGroupPolicyResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifySecurityGroupPolicyRequest creates a request to invoke ModifySecurityGroupPolicy API +func CreateModifySecurityGroupPolicyRequest() (request *ModifySecurityGroupPolicyRequest) { + request = &ModifySecurityGroupPolicyRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ModifySecurityGroupPolicy", "ecs", "openAPI") + return +} + +// CreateModifySecurityGroupPolicyResponse creates a response to parse from ModifySecurityGroupPolicy response +func CreateModifySecurityGroupPolicyResponse() (response *ModifySecurityGroupPolicyResponse) { + response = &ModifySecurityGroupPolicyResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_security_group_rule.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_security_group_rule.go new file mode 100644 index 000000000..d298fb817 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_security_group_rule.go @@ -0,0 +1,122 @@ +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" +) + +// ModifySecurityGroupRule invokes the ecs.ModifySecurityGroupRule API synchronously +// api document: https://help.aliyun.com/api/ecs/modifysecuritygrouprule.html +func (client *Client) ModifySecurityGroupRule(request *ModifySecurityGroupRuleRequest) (response *ModifySecurityGroupRuleResponse, err error) { + response = CreateModifySecurityGroupRuleResponse() + err = client.DoAction(request, response) + return +} + +// ModifySecurityGroupRuleWithChan invokes the ecs.ModifySecurityGroupRule API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifysecuritygrouprule.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifySecurityGroupRuleWithChan(request *ModifySecurityGroupRuleRequest) (<-chan *ModifySecurityGroupRuleResponse, <-chan error) { + responseChan := make(chan *ModifySecurityGroupRuleResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifySecurityGroupRule(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifySecurityGroupRuleWithCallback invokes the ecs.ModifySecurityGroupRule API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifysecuritygrouprule.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifySecurityGroupRuleWithCallback(request *ModifySecurityGroupRuleRequest, callback func(response *ModifySecurityGroupRuleResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifySecurityGroupRuleResponse + var err error + defer close(result) + response, err = client.ModifySecurityGroupRule(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifySecurityGroupRuleRequest is the request struct for api ModifySecurityGroupRule +type ModifySecurityGroupRuleRequest struct { + *requests.RpcRequest + NicType string `position:"Query" name:"NicType"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + SourcePortRange string `position:"Query" name:"SourcePortRange"` + ClientToken string `position:"Query" name:"ClientToken"` + SecurityGroupId string `position:"Query" name:"SecurityGroupId"` + Description string `position:"Query" name:"Description"` + SourceGroupOwnerId requests.Integer `position:"Query" name:"SourceGroupOwnerId"` + SourceGroupOwnerAccount string `position:"Query" name:"SourceGroupOwnerAccount"` + Ipv6SourceCidrIp string `position:"Query" name:"Ipv6SourceCidrIp"` + Ipv6DestCidrIp string `position:"Query" name:"Ipv6DestCidrIp"` + Policy string `position:"Query" name:"Policy"` + PortRange string `position:"Query" name:"PortRange"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + IpProtocol string `position:"Query" name:"IpProtocol"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + SourceCidrIp string `position:"Query" name:"SourceCidrIp"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Priority string `position:"Query" name:"Priority"` + DestCidrIp string `position:"Query" name:"DestCidrIp"` + SourceGroupId string `position:"Query" name:"SourceGroupId"` +} + +// ModifySecurityGroupRuleResponse is the response struct for api ModifySecurityGroupRule +type ModifySecurityGroupRuleResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifySecurityGroupRuleRequest creates a request to invoke ModifySecurityGroupRule API +func CreateModifySecurityGroupRuleRequest() (request *ModifySecurityGroupRuleRequest) { + request = &ModifySecurityGroupRuleRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ModifySecurityGroupRule", "ecs", "openAPI") + return +} + +// CreateModifySecurityGroupRuleResponse creates a response to parse from ModifySecurityGroupRule response +func CreateModifySecurityGroupRuleResponse() (response *ModifySecurityGroupRuleResponse) { + response = &ModifySecurityGroupRuleResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_snapshot_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_snapshot_attribute.go new file mode 100644 index 000000000..3b1796388 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_snapshot_attribute.go @@ -0,0 +1,109 @@ +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" +) + +// ModifySnapshotAttribute invokes the ecs.ModifySnapshotAttribute API synchronously +// api document: https://help.aliyun.com/api/ecs/modifysnapshotattribute.html +func (client *Client) ModifySnapshotAttribute(request *ModifySnapshotAttributeRequest) (response *ModifySnapshotAttributeResponse, err error) { + response = CreateModifySnapshotAttributeResponse() + err = client.DoAction(request, response) + return +} + +// ModifySnapshotAttributeWithChan invokes the ecs.ModifySnapshotAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifysnapshotattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifySnapshotAttributeWithChan(request *ModifySnapshotAttributeRequest) (<-chan *ModifySnapshotAttributeResponse, <-chan error) { + responseChan := make(chan *ModifySnapshotAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifySnapshotAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifySnapshotAttributeWithCallback invokes the ecs.ModifySnapshotAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifysnapshotattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifySnapshotAttributeWithCallback(request *ModifySnapshotAttributeRequest, callback func(response *ModifySnapshotAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifySnapshotAttributeResponse + var err error + defer close(result) + response, err = client.ModifySnapshotAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifySnapshotAttributeRequest is the request struct for api ModifySnapshotAttribute +type ModifySnapshotAttributeRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + SnapshotId string `position:"Query" name:"SnapshotId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Description string `position:"Query" name:"Description"` + SnapshotName string `position:"Query" name:"SnapshotName"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// ModifySnapshotAttributeResponse is the response struct for api ModifySnapshotAttribute +type ModifySnapshotAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifySnapshotAttributeRequest creates a request to invoke ModifySnapshotAttribute API +func CreateModifySnapshotAttributeRequest() (request *ModifySnapshotAttributeRequest) { + request = &ModifySnapshotAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ModifySnapshotAttribute", "ecs", "openAPI") + return +} + +// CreateModifySnapshotAttributeResponse creates a response to parse from ModifySnapshotAttribute response +func CreateModifySnapshotAttributeResponse() (response *ModifySnapshotAttributeResponse) { + response = &ModifySnapshotAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_user_business_behavior.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_user_business_behavior.go new file mode 100644 index 000000000..c30d0ac7a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_user_business_behavior.go @@ -0,0 +1,108 @@ +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" +) + +// ModifyUserBusinessBehavior invokes the ecs.ModifyUserBusinessBehavior API synchronously +// api document: https://help.aliyun.com/api/ecs/modifyuserbusinessbehavior.html +func (client *Client) ModifyUserBusinessBehavior(request *ModifyUserBusinessBehaviorRequest) (response *ModifyUserBusinessBehaviorResponse, err error) { + response = CreateModifyUserBusinessBehaviorResponse() + err = client.DoAction(request, response) + return +} + +// ModifyUserBusinessBehaviorWithChan invokes the ecs.ModifyUserBusinessBehavior API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyuserbusinessbehavior.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyUserBusinessBehaviorWithChan(request *ModifyUserBusinessBehaviorRequest) (<-chan *ModifyUserBusinessBehaviorResponse, <-chan error) { + responseChan := make(chan *ModifyUserBusinessBehaviorResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyUserBusinessBehavior(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyUserBusinessBehaviorWithCallback invokes the ecs.ModifyUserBusinessBehavior API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyuserbusinessbehavior.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyUserBusinessBehaviorWithCallback(request *ModifyUserBusinessBehaviorRequest, callback func(response *ModifyUserBusinessBehaviorResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyUserBusinessBehaviorResponse + var err error + defer close(result) + response, err = client.ModifyUserBusinessBehavior(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyUserBusinessBehaviorRequest is the request struct for api ModifyUserBusinessBehavior +type ModifyUserBusinessBehaviorRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + StatusValue string `position:"Query" name:"statusValue"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + StatusKey string `position:"Query" name:"statusKey"` +} + +// ModifyUserBusinessBehaviorResponse is the response struct for api ModifyUserBusinessBehavior +type ModifyUserBusinessBehaviorResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyUserBusinessBehaviorRequest creates a request to invoke ModifyUserBusinessBehavior API +func CreateModifyUserBusinessBehaviorRequest() (request *ModifyUserBusinessBehaviorRequest) { + request = &ModifyUserBusinessBehaviorRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyUserBusinessBehavior", "ecs", "openAPI") + return +} + +// CreateModifyUserBusinessBehaviorResponse creates a response to parse from ModifyUserBusinessBehavior response +func CreateModifyUserBusinessBehaviorResponse() (response *ModifyUserBusinessBehaviorResponse) { + response = &ModifyUserBusinessBehaviorResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_v_router_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_v_router_attribute.go new file mode 100644 index 000000000..5bcd9a872 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_v_router_attribute.go @@ -0,0 +1,109 @@ +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" +) + +// ModifyVRouterAttribute invokes the ecs.ModifyVRouterAttribute API synchronously +// api document: https://help.aliyun.com/api/ecs/modifyvrouterattribute.html +func (client *Client) ModifyVRouterAttribute(request *ModifyVRouterAttributeRequest) (response *ModifyVRouterAttributeResponse, err error) { + response = CreateModifyVRouterAttributeResponse() + err = client.DoAction(request, response) + return +} + +// ModifyVRouterAttributeWithChan invokes the ecs.ModifyVRouterAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyvrouterattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyVRouterAttributeWithChan(request *ModifyVRouterAttributeRequest) (<-chan *ModifyVRouterAttributeResponse, <-chan error) { + responseChan := make(chan *ModifyVRouterAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyVRouterAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyVRouterAttributeWithCallback invokes the ecs.ModifyVRouterAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyvrouterattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyVRouterAttributeWithCallback(request *ModifyVRouterAttributeRequest, callback func(response *ModifyVRouterAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyVRouterAttributeResponse + var err error + defer close(result) + response, err = client.ModifyVRouterAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyVRouterAttributeRequest is the request struct for api ModifyVRouterAttribute +type ModifyVRouterAttributeRequest struct { + *requests.RpcRequest + VRouterName string `position:"Query" name:"VRouterName"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + VRouterId string `position:"Query" name:"VRouterId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Description string `position:"Query" name:"Description"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// ModifyVRouterAttributeResponse is the response struct for api ModifyVRouterAttribute +type ModifyVRouterAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyVRouterAttributeRequest creates a request to invoke ModifyVRouterAttribute API +func CreateModifyVRouterAttributeRequest() (request *ModifyVRouterAttributeRequest) { + request = &ModifyVRouterAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyVRouterAttribute", "ecs", "openAPI") + return +} + +// CreateModifyVRouterAttributeResponse creates a response to parse from ModifyVRouterAttribute response +func CreateModifyVRouterAttributeResponse() (response *ModifyVRouterAttributeResponse) { + response = &ModifyVRouterAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_v_switch_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_v_switch_attribute.go new file mode 100644 index 000000000..c7cd18a0f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_v_switch_attribute.go @@ -0,0 +1,109 @@ +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" +) + +// ModifyVSwitchAttribute invokes the ecs.ModifyVSwitchAttribute API synchronously +// api document: https://help.aliyun.com/api/ecs/modifyvswitchattribute.html +func (client *Client) ModifyVSwitchAttribute(request *ModifyVSwitchAttributeRequest) (response *ModifyVSwitchAttributeResponse, err error) { + response = CreateModifyVSwitchAttributeResponse() + err = client.DoAction(request, response) + return +} + +// ModifyVSwitchAttributeWithChan invokes the ecs.ModifyVSwitchAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyvswitchattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyVSwitchAttributeWithChan(request *ModifyVSwitchAttributeRequest) (<-chan *ModifyVSwitchAttributeResponse, <-chan error) { + responseChan := make(chan *ModifyVSwitchAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyVSwitchAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyVSwitchAttributeWithCallback invokes the ecs.ModifyVSwitchAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyvswitchattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyVSwitchAttributeWithCallback(request *ModifyVSwitchAttributeRequest, callback func(response *ModifyVSwitchAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyVSwitchAttributeResponse + var err error + defer close(result) + response, err = client.ModifyVSwitchAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyVSwitchAttributeRequest is the request struct for api ModifyVSwitchAttribute +type ModifyVSwitchAttributeRequest struct { + *requests.RpcRequest + VSwitchId string `position:"Query" name:"VSwitchId"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + VSwitchName string `position:"Query" name:"VSwitchName"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Description string `position:"Query" name:"Description"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// ModifyVSwitchAttributeResponse is the response struct for api ModifyVSwitchAttribute +type ModifyVSwitchAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyVSwitchAttributeRequest creates a request to invoke ModifyVSwitchAttribute API +func CreateModifyVSwitchAttributeRequest() (request *ModifyVSwitchAttributeRequest) { + request = &ModifyVSwitchAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyVSwitchAttribute", "ecs", "openAPI") + return +} + +// CreateModifyVSwitchAttributeResponse creates a response to parse from ModifyVSwitchAttribute response +func CreateModifyVSwitchAttributeResponse() (response *ModifyVSwitchAttributeResponse) { + response = &ModifyVSwitchAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_virtual_border_router_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_virtual_border_router_attribute.go new file mode 100644 index 000000000..96fb0499b --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_virtual_border_router_attribute.go @@ -0,0 +1,116 @@ +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" +) + +// ModifyVirtualBorderRouterAttribute invokes the ecs.ModifyVirtualBorderRouterAttribute API synchronously +// api document: https://help.aliyun.com/api/ecs/modifyvirtualborderrouterattribute.html +func (client *Client) ModifyVirtualBorderRouterAttribute(request *ModifyVirtualBorderRouterAttributeRequest) (response *ModifyVirtualBorderRouterAttributeResponse, err error) { + response = CreateModifyVirtualBorderRouterAttributeResponse() + err = client.DoAction(request, response) + return +} + +// ModifyVirtualBorderRouterAttributeWithChan invokes the ecs.ModifyVirtualBorderRouterAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyvirtualborderrouterattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyVirtualBorderRouterAttributeWithChan(request *ModifyVirtualBorderRouterAttributeRequest) (<-chan *ModifyVirtualBorderRouterAttributeResponse, <-chan error) { + responseChan := make(chan *ModifyVirtualBorderRouterAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyVirtualBorderRouterAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyVirtualBorderRouterAttributeWithCallback invokes the ecs.ModifyVirtualBorderRouterAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyvirtualborderrouterattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyVirtualBorderRouterAttributeWithCallback(request *ModifyVirtualBorderRouterAttributeRequest, callback func(response *ModifyVirtualBorderRouterAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyVirtualBorderRouterAttributeResponse + var err error + defer close(result) + response, err = client.ModifyVirtualBorderRouterAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyVirtualBorderRouterAttributeRequest is the request struct for api ModifyVirtualBorderRouterAttribute +type ModifyVirtualBorderRouterAttributeRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + CircuitCode string `position:"Query" name:"CircuitCode"` + VlanId requests.Integer `position:"Query" name:"VlanId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Description string `position:"Query" name:"Description"` + VbrId string `position:"Query" name:"VbrId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PeerGatewayIp string `position:"Query" name:"PeerGatewayIp"` + PeeringSubnetMask string `position:"Query" name:"PeeringSubnetMask"` + Name string `position:"Query" name:"Name"` + LocalGatewayIp string `position:"Query" name:"LocalGatewayIp"` + UserCidr string `position:"Query" name:"UserCidr"` +} + +// ModifyVirtualBorderRouterAttributeResponse is the response struct for api ModifyVirtualBorderRouterAttribute +type ModifyVirtualBorderRouterAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyVirtualBorderRouterAttributeRequest creates a request to invoke ModifyVirtualBorderRouterAttribute API +func CreateModifyVirtualBorderRouterAttributeRequest() (request *ModifyVirtualBorderRouterAttributeRequest) { + request = &ModifyVirtualBorderRouterAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyVirtualBorderRouterAttribute", "ecs", "openAPI") + return +} + +// CreateModifyVirtualBorderRouterAttributeResponse creates a response to parse from ModifyVirtualBorderRouterAttribute response +func CreateModifyVirtualBorderRouterAttributeResponse() (response *ModifyVirtualBorderRouterAttributeResponse) { + response = &ModifyVirtualBorderRouterAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_vpc_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_vpc_attribute.go new file mode 100644 index 000000000..79525aaf6 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_vpc_attribute.go @@ -0,0 +1,111 @@ +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" +) + +// ModifyVpcAttribute invokes the ecs.ModifyVpcAttribute API synchronously +// api document: https://help.aliyun.com/api/ecs/modifyvpcattribute.html +func (client *Client) ModifyVpcAttribute(request *ModifyVpcAttributeRequest) (response *ModifyVpcAttributeResponse, err error) { + response = CreateModifyVpcAttributeResponse() + err = client.DoAction(request, response) + return +} + +// ModifyVpcAttributeWithChan invokes the ecs.ModifyVpcAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyvpcattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyVpcAttributeWithChan(request *ModifyVpcAttributeRequest) (<-chan *ModifyVpcAttributeResponse, <-chan error) { + responseChan := make(chan *ModifyVpcAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyVpcAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyVpcAttributeWithCallback invokes the ecs.ModifyVpcAttribute API asynchronously +// api document: https://help.aliyun.com/api/ecs/modifyvpcattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyVpcAttributeWithCallback(request *ModifyVpcAttributeRequest, callback func(response *ModifyVpcAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyVpcAttributeResponse + var err error + defer close(result) + response, err = client.ModifyVpcAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyVpcAttributeRequest is the request struct for api ModifyVpcAttribute +type ModifyVpcAttributeRequest struct { + *requests.RpcRequest + VpcName string `position:"Query" name:"VpcName"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + VpcId string `position:"Query" name:"VpcId"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + CidrBlock string `position:"Query" name:"CidrBlock"` + Description string `position:"Query" name:"Description"` + UserCidr string `position:"Query" name:"UserCidr"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// ModifyVpcAttributeResponse is the response struct for api ModifyVpcAttribute +type ModifyVpcAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyVpcAttributeRequest creates a request to invoke ModifyVpcAttribute API +func CreateModifyVpcAttributeRequest() (request *ModifyVpcAttributeRequest) { + request = &ModifyVpcAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyVpcAttribute", "ecs", "openAPI") + return +} + +// CreateModifyVpcAttributeResponse creates a response to parse from ModifyVpcAttribute response +func CreateModifyVpcAttributeResponse() (response *ModifyVpcAttributeResponse) { + response = &ModifyVpcAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/purchase_reserved_instances_offering.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/purchase_reserved_instances_offering.go new file mode 100644 index 000000000..a4e6c694d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/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 +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/re_activate_instances.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/re_activate_instances.go new file mode 100644 index 000000000..155dcde2c --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/re_activate_instances.go @@ -0,0 +1,107 @@ +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" +) + +// ReActivateInstances invokes the ecs.ReActivateInstances API synchronously +// api document: https://help.aliyun.com/api/ecs/reactivateinstances.html +func (client *Client) ReActivateInstances(request *ReActivateInstancesRequest) (response *ReActivateInstancesResponse, err error) { + response = CreateReActivateInstancesResponse() + err = client.DoAction(request, response) + return +} + +// ReActivateInstancesWithChan invokes the ecs.ReActivateInstances API asynchronously +// api document: https://help.aliyun.com/api/ecs/reactivateinstances.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ReActivateInstancesWithChan(request *ReActivateInstancesRequest) (<-chan *ReActivateInstancesResponse, <-chan error) { + responseChan := make(chan *ReActivateInstancesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ReActivateInstances(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ReActivateInstancesWithCallback invokes the ecs.ReActivateInstances API asynchronously +// api document: https://help.aliyun.com/api/ecs/reactivateinstances.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ReActivateInstancesWithCallback(request *ReActivateInstancesRequest, callback func(response *ReActivateInstancesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ReActivateInstancesResponse + var err error + defer close(result) + response, err = client.ReActivateInstances(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ReActivateInstancesRequest is the request struct for api ReActivateInstances +type ReActivateInstancesRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + InstanceId string `position:"Query" name:"InstanceId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// ReActivateInstancesResponse is the response struct for api ReActivateInstances +type ReActivateInstancesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateReActivateInstancesRequest creates a request to invoke ReActivateInstances API +func CreateReActivateInstancesRequest() (request *ReActivateInstancesRequest) { + request = &ReActivateInstancesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ReActivateInstances", "ecs", "openAPI") + return +} + +// CreateReActivateInstancesResponse creates a response to parse from ReActivateInstances response +func CreateReActivateInstancesResponse() (response *ReActivateInstancesResponse) { + response = &ReActivateInstancesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/re_init_disk.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/re_init_disk.go new file mode 100644 index 000000000..69f325638 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/re_init_disk.go @@ -0,0 +1,111 @@ +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" +) + +// ReInitDisk invokes the ecs.ReInitDisk API synchronously +// api document: https://help.aliyun.com/api/ecs/reinitdisk.html +func (client *Client) ReInitDisk(request *ReInitDiskRequest) (response *ReInitDiskResponse, err error) { + response = CreateReInitDiskResponse() + err = client.DoAction(request, response) + return +} + +// ReInitDiskWithChan invokes the ecs.ReInitDisk API asynchronously +// api document: https://help.aliyun.com/api/ecs/reinitdisk.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ReInitDiskWithChan(request *ReInitDiskRequest) (<-chan *ReInitDiskResponse, <-chan error) { + responseChan := make(chan *ReInitDiskResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ReInitDisk(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ReInitDiskWithCallback invokes the ecs.ReInitDisk API asynchronously +// api document: https://help.aliyun.com/api/ecs/reinitdisk.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ReInitDiskWithCallback(request *ReInitDiskRequest, callback func(response *ReInitDiskResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ReInitDiskResponse + var err error + defer close(result) + response, err = client.ReInitDisk(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ReInitDiskRequest is the request struct for api ReInitDisk +type ReInitDiskRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + Password string `position:"Query" name:"Password"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + AutoStartInstance requests.Boolean `position:"Query" name:"AutoStartInstance"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + DiskId string `position:"Query" name:"DiskId"` + SecurityEnhancementStrategy string `position:"Query" name:"SecurityEnhancementStrategy"` + KeyPairName string `position:"Query" name:"KeyPairName"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// ReInitDiskResponse is the response struct for api ReInitDisk +type ReInitDiskResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateReInitDiskRequest creates a request to invoke ReInitDisk API +func CreateReInitDiskRequest() (request *ReInitDiskRequest) { + request = &ReInitDiskRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ReInitDisk", "ecs", "openAPI") + return +} + +// CreateReInitDiskResponse creates a response to parse from ReInitDisk response +func CreateReInitDiskResponse() (response *ReInitDiskResponse) { + response = &ReInitDiskResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/reboot_instance.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/reboot_instance.go new file mode 100644 index 000000000..60a99b148 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/reboot_instance.go @@ -0,0 +1,109 @@ +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" +) + +// RebootInstance invokes the ecs.RebootInstance API synchronously +// api document: https://help.aliyun.com/api/ecs/rebootinstance.html +func (client *Client) RebootInstance(request *RebootInstanceRequest) (response *RebootInstanceResponse, err error) { + response = CreateRebootInstanceResponse() + err = client.DoAction(request, response) + return +} + +// RebootInstanceWithChan invokes the ecs.RebootInstance API asynchronously +// api document: https://help.aliyun.com/api/ecs/rebootinstance.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) RebootInstanceWithChan(request *RebootInstanceRequest) (<-chan *RebootInstanceResponse, <-chan error) { + responseChan := make(chan *RebootInstanceResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.RebootInstance(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// RebootInstanceWithCallback invokes the ecs.RebootInstance API asynchronously +// api document: https://help.aliyun.com/api/ecs/rebootinstance.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) RebootInstanceWithCallback(request *RebootInstanceRequest, callback func(response *RebootInstanceResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *RebootInstanceResponse + var err error + defer close(result) + response, err = client.RebootInstance(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// RebootInstanceRequest is the request struct for api RebootInstance +type RebootInstanceRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + InstanceId string `position:"Query" name:"InstanceId"` + DryRun requests.Boolean `position:"Query" name:"DryRun"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + ForceStop requests.Boolean `position:"Query" name:"ForceStop"` +} + +// RebootInstanceResponse is the response struct for api RebootInstance +type RebootInstanceResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateRebootInstanceRequest creates a request to invoke RebootInstance API +func CreateRebootInstanceRequest() (request *RebootInstanceRequest) { + request = &RebootInstanceRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "RebootInstance", "ecs", "openAPI") + return +} + +// CreateRebootInstanceResponse creates a response to parse from RebootInstance response +func CreateRebootInstanceResponse() (response *RebootInstanceResponse) { + response = &RebootInstanceResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/recover_virtual_border_router.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/recover_virtual_border_router.go new file mode 100644 index 000000000..dae7e69e5 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/recover_virtual_border_router.go @@ -0,0 +1,109 @@ +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" +) + +// RecoverVirtualBorderRouter invokes the ecs.RecoverVirtualBorderRouter API synchronously +// api document: https://help.aliyun.com/api/ecs/recovervirtualborderrouter.html +func (client *Client) RecoverVirtualBorderRouter(request *RecoverVirtualBorderRouterRequest) (response *RecoverVirtualBorderRouterResponse, err error) { + response = CreateRecoverVirtualBorderRouterResponse() + err = client.DoAction(request, response) + return +} + +// RecoverVirtualBorderRouterWithChan invokes the ecs.RecoverVirtualBorderRouter API asynchronously +// api document: https://help.aliyun.com/api/ecs/recovervirtualborderrouter.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) RecoverVirtualBorderRouterWithChan(request *RecoverVirtualBorderRouterRequest) (<-chan *RecoverVirtualBorderRouterResponse, <-chan error) { + responseChan := make(chan *RecoverVirtualBorderRouterResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.RecoverVirtualBorderRouter(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// RecoverVirtualBorderRouterWithCallback invokes the ecs.RecoverVirtualBorderRouter API asynchronously +// api document: https://help.aliyun.com/api/ecs/recovervirtualborderrouter.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) RecoverVirtualBorderRouterWithCallback(request *RecoverVirtualBorderRouterRequest, callback func(response *RecoverVirtualBorderRouterResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *RecoverVirtualBorderRouterResponse + var err error + defer close(result) + response, err = client.RecoverVirtualBorderRouter(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// RecoverVirtualBorderRouterRequest is the request struct for api RecoverVirtualBorderRouter +type RecoverVirtualBorderRouterRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + UserCidr string `position:"Query" name:"UserCidr"` + VbrId string `position:"Query" name:"VbrId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// RecoverVirtualBorderRouterResponse is the response struct for api RecoverVirtualBorderRouter +type RecoverVirtualBorderRouterResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateRecoverVirtualBorderRouterRequest creates a request to invoke RecoverVirtualBorderRouter API +func CreateRecoverVirtualBorderRouterRequest() (request *RecoverVirtualBorderRouterRequest) { + request = &RecoverVirtualBorderRouterRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "RecoverVirtualBorderRouter", "ecs", "openAPI") + return +} + +// CreateRecoverVirtualBorderRouterResponse creates a response to parse from RecoverVirtualBorderRouter response +func CreateRecoverVirtualBorderRouterResponse() (response *RecoverVirtualBorderRouterResponse) { + response = &RecoverVirtualBorderRouterResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/redeploy_instance.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/redeploy_instance.go new file mode 100644 index 000000000..35d55df9f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/redeploy_instance.go @@ -0,0 +1,109 @@ +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" +) + +// RedeployInstance invokes the ecs.RedeployInstance API synchronously +// api document: https://help.aliyun.com/api/ecs/redeployinstance.html +func (client *Client) RedeployInstance(request *RedeployInstanceRequest) (response *RedeployInstanceResponse, err error) { + response = CreateRedeployInstanceResponse() + err = client.DoAction(request, response) + return +} + +// RedeployInstanceWithChan invokes the ecs.RedeployInstance API asynchronously +// api document: https://help.aliyun.com/api/ecs/redeployinstance.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) RedeployInstanceWithChan(request *RedeployInstanceRequest) (<-chan *RedeployInstanceResponse, <-chan error) { + responseChan := make(chan *RedeployInstanceResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.RedeployInstance(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// RedeployInstanceWithCallback invokes the ecs.RedeployInstance API asynchronously +// api document: https://help.aliyun.com/api/ecs/redeployinstance.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) RedeployInstanceWithCallback(request *RedeployInstanceRequest, callback func(response *RedeployInstanceResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *RedeployInstanceResponse + var err error + defer close(result) + response, err = client.RedeployInstance(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// RedeployInstanceRequest is the request struct for api RedeployInstance +type RedeployInstanceRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ForceStop requests.Boolean `position:"Query" name:"ForceStop"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + InstanceId string `position:"Query" name:"InstanceId"` +} + +// RedeployInstanceResponse is the response struct for api RedeployInstance +type RedeployInstanceResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + TaskId string `json:"TaskId" xml:"TaskId"` +} + +// CreateRedeployInstanceRequest creates a request to invoke RedeployInstance API +func CreateRedeployInstanceRequest() (request *RedeployInstanceRequest) { + request = &RedeployInstanceRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "RedeployInstance", "ecs", "openAPI") + return +} + +// CreateRedeployInstanceResponse creates a response to parse from RedeployInstance response +func CreateRedeployInstanceResponse() (response *RedeployInstanceResponse) { + response = &RedeployInstanceResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/release_dedicated_host.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/release_dedicated_host.go new file mode 100644 index 000000000..a8269b6e5 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/release_dedicated_host.go @@ -0,0 +1,107 @@ +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" +) + +// ReleaseDedicatedHost invokes the ecs.ReleaseDedicatedHost API synchronously +// api document: https://help.aliyun.com/api/ecs/releasededicatedhost.html +func (client *Client) ReleaseDedicatedHost(request *ReleaseDedicatedHostRequest) (response *ReleaseDedicatedHostResponse, err error) { + response = CreateReleaseDedicatedHostResponse() + err = client.DoAction(request, response) + return +} + +// ReleaseDedicatedHostWithChan invokes the ecs.ReleaseDedicatedHost API asynchronously +// api document: https://help.aliyun.com/api/ecs/releasededicatedhost.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ReleaseDedicatedHostWithChan(request *ReleaseDedicatedHostRequest) (<-chan *ReleaseDedicatedHostResponse, <-chan error) { + responseChan := make(chan *ReleaseDedicatedHostResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ReleaseDedicatedHost(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ReleaseDedicatedHostWithCallback invokes the ecs.ReleaseDedicatedHost API asynchronously +// api document: https://help.aliyun.com/api/ecs/releasededicatedhost.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ReleaseDedicatedHostWithCallback(request *ReleaseDedicatedHostRequest, callback func(response *ReleaseDedicatedHostResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ReleaseDedicatedHostResponse + var err error + defer close(result) + response, err = client.ReleaseDedicatedHost(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ReleaseDedicatedHostRequest is the request struct for api ReleaseDedicatedHost +type ReleaseDedicatedHostRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + DedicatedHostId string `position:"Query" name:"DedicatedHostId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// ReleaseDedicatedHostResponse is the response struct for api ReleaseDedicatedHost +type ReleaseDedicatedHostResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateReleaseDedicatedHostRequest creates a request to invoke ReleaseDedicatedHost API +func CreateReleaseDedicatedHostRequest() (request *ReleaseDedicatedHostRequest) { + request = &ReleaseDedicatedHostRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ReleaseDedicatedHost", "ecs", "openAPI") + return +} + +// CreateReleaseDedicatedHostResponse creates a response to parse from ReleaseDedicatedHost response +func CreateReleaseDedicatedHostResponse() (response *ReleaseDedicatedHostResponse) { + response = &ReleaseDedicatedHostResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/release_eip_address.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/release_eip_address.go new file mode 100644 index 000000000..8d1217f21 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/release_eip_address.go @@ -0,0 +1,107 @@ +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" +) + +// ReleaseEipAddress invokes the ecs.ReleaseEipAddress API synchronously +// api document: https://help.aliyun.com/api/ecs/releaseeipaddress.html +func (client *Client) ReleaseEipAddress(request *ReleaseEipAddressRequest) (response *ReleaseEipAddressResponse, err error) { + response = CreateReleaseEipAddressResponse() + err = client.DoAction(request, response) + return +} + +// ReleaseEipAddressWithChan invokes the ecs.ReleaseEipAddress API asynchronously +// api document: https://help.aliyun.com/api/ecs/releaseeipaddress.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ReleaseEipAddressWithChan(request *ReleaseEipAddressRequest) (<-chan *ReleaseEipAddressResponse, <-chan error) { + responseChan := make(chan *ReleaseEipAddressResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ReleaseEipAddress(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ReleaseEipAddressWithCallback invokes the ecs.ReleaseEipAddress API asynchronously +// api document: https://help.aliyun.com/api/ecs/releaseeipaddress.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ReleaseEipAddressWithCallback(request *ReleaseEipAddressRequest, callback func(response *ReleaseEipAddressResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ReleaseEipAddressResponse + var err error + defer close(result) + response, err = client.ReleaseEipAddress(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ReleaseEipAddressRequest is the request struct for api ReleaseEipAddress +type ReleaseEipAddressRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + AllocationId string `position:"Query" name:"AllocationId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// ReleaseEipAddressResponse is the response struct for api ReleaseEipAddress +type ReleaseEipAddressResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateReleaseEipAddressRequest creates a request to invoke ReleaseEipAddress API +func CreateReleaseEipAddressRequest() (request *ReleaseEipAddressRequest) { + request = &ReleaseEipAddressRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ReleaseEipAddress", "ecs", "openAPI") + return +} + +// CreateReleaseEipAddressResponse creates a response to parse from ReleaseEipAddress response +func CreateReleaseEipAddressResponse() (response *ReleaseEipAddressResponse) { + response = &ReleaseEipAddressResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/release_public_ip_address.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/release_public_ip_address.go new file mode 100644 index 000000000..819340ef6 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/release_public_ip_address.go @@ -0,0 +1,108 @@ +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" +) + +// ReleasePublicIpAddress invokes the ecs.ReleasePublicIpAddress API synchronously +// api document: https://help.aliyun.com/api/ecs/releasepublicipaddress.html +func (client *Client) ReleasePublicIpAddress(request *ReleasePublicIpAddressRequest) (response *ReleasePublicIpAddressResponse, err error) { + response = CreateReleasePublicIpAddressResponse() + err = client.DoAction(request, response) + return +} + +// ReleasePublicIpAddressWithChan invokes the ecs.ReleasePublicIpAddress API asynchronously +// api document: https://help.aliyun.com/api/ecs/releasepublicipaddress.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ReleasePublicIpAddressWithChan(request *ReleasePublicIpAddressRequest) (<-chan *ReleasePublicIpAddressResponse, <-chan error) { + responseChan := make(chan *ReleasePublicIpAddressResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ReleasePublicIpAddress(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ReleasePublicIpAddressWithCallback invokes the ecs.ReleasePublicIpAddress API asynchronously +// api document: https://help.aliyun.com/api/ecs/releasepublicipaddress.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ReleasePublicIpAddressWithCallback(request *ReleasePublicIpAddressRequest, callback func(response *ReleasePublicIpAddressResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ReleasePublicIpAddressResponse + var err error + defer close(result) + response, err = client.ReleasePublicIpAddress(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ReleasePublicIpAddressRequest is the request struct for api ReleasePublicIpAddress +type ReleasePublicIpAddressRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + PublicIpAddress string `position:"Query" name:"PublicIpAddress"` + InstanceId string `position:"Query" name:"InstanceId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// ReleasePublicIpAddressResponse is the response struct for api ReleasePublicIpAddress +type ReleasePublicIpAddressResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateReleasePublicIpAddressRequest creates a request to invoke ReleasePublicIpAddress API +func CreateReleasePublicIpAddressRequest() (request *ReleasePublicIpAddressRequest) { + request = &ReleasePublicIpAddressRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ReleasePublicIpAddress", "ecs", "openAPI") + return +} + +// CreateReleasePublicIpAddressResponse creates a response to parse from ReleasePublicIpAddress response +func CreateReleasePublicIpAddressResponse() (response *ReleasePublicIpAddressResponse) { + response = &ReleasePublicIpAddressResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/remove_bandwidth_package_ips.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/remove_bandwidth_package_ips.go new file mode 100644 index 000000000..4abb537f6 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/remove_bandwidth_package_ips.go @@ -0,0 +1,109 @@ +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" +) + +// RemoveBandwidthPackageIps invokes the ecs.RemoveBandwidthPackageIps API synchronously +// api document: https://help.aliyun.com/api/ecs/removebandwidthpackageips.html +func (client *Client) RemoveBandwidthPackageIps(request *RemoveBandwidthPackageIpsRequest) (response *RemoveBandwidthPackageIpsResponse, err error) { + response = CreateRemoveBandwidthPackageIpsResponse() + err = client.DoAction(request, response) + return +} + +// RemoveBandwidthPackageIpsWithChan invokes the ecs.RemoveBandwidthPackageIps API asynchronously +// api document: https://help.aliyun.com/api/ecs/removebandwidthpackageips.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) RemoveBandwidthPackageIpsWithChan(request *RemoveBandwidthPackageIpsRequest) (<-chan *RemoveBandwidthPackageIpsResponse, <-chan error) { + responseChan := make(chan *RemoveBandwidthPackageIpsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.RemoveBandwidthPackageIps(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// RemoveBandwidthPackageIpsWithCallback invokes the ecs.RemoveBandwidthPackageIps API asynchronously +// api document: https://help.aliyun.com/api/ecs/removebandwidthpackageips.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) RemoveBandwidthPackageIpsWithCallback(request *RemoveBandwidthPackageIpsRequest, callback func(response *RemoveBandwidthPackageIpsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *RemoveBandwidthPackageIpsResponse + var err error + defer close(result) + response, err = client.RemoveBandwidthPackageIps(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// RemoveBandwidthPackageIpsRequest is the request struct for api RemoveBandwidthPackageIps +type RemoveBandwidthPackageIpsRequest struct { + *requests.RpcRequest + RemovedIpAddresses *[]string `position:"Query" name:"RemovedIpAddresses" type:"Repeated"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + BandwidthPackageId string `position:"Query" name:"BandwidthPackageId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// RemoveBandwidthPackageIpsResponse is the response struct for api RemoveBandwidthPackageIps +type RemoveBandwidthPackageIpsResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateRemoveBandwidthPackageIpsRequest creates a request to invoke RemoveBandwidthPackageIps API +func CreateRemoveBandwidthPackageIpsRequest() (request *RemoveBandwidthPackageIpsRequest) { + request = &RemoveBandwidthPackageIpsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "RemoveBandwidthPackageIps", "ecs", "openAPI") + return +} + +// CreateRemoveBandwidthPackageIpsResponse creates a response to parse from RemoveBandwidthPackageIps response +func CreateRemoveBandwidthPackageIpsResponse() (response *RemoveBandwidthPackageIpsResponse) { + response = &RemoveBandwidthPackageIpsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/remove_tags.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/remove_tags.go new file mode 100644 index 000000000..f5bcdd1f8 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/remove_tags.go @@ -0,0 +1,114 @@ +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" +) + +// RemoveTags invokes the ecs.RemoveTags API synchronously +// api document: https://help.aliyun.com/api/ecs/removetags.html +func (client *Client) RemoveTags(request *RemoveTagsRequest) (response *RemoveTagsResponse, err error) { + response = CreateRemoveTagsResponse() + err = client.DoAction(request, response) + return +} + +// RemoveTagsWithChan invokes the ecs.RemoveTags API asynchronously +// api document: https://help.aliyun.com/api/ecs/removetags.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) RemoveTagsWithChan(request *RemoveTagsRequest) (<-chan *RemoveTagsResponse, <-chan error) { + responseChan := make(chan *RemoveTagsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.RemoveTags(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// RemoveTagsWithCallback invokes the ecs.RemoveTags API asynchronously +// api document: https://help.aliyun.com/api/ecs/removetags.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) RemoveTagsWithCallback(request *RemoveTagsRequest, callback func(response *RemoveTagsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *RemoveTagsResponse + var err error + defer close(result) + response, err = client.RemoveTags(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// RemoveTagsRequest is the request struct for api RemoveTags +type RemoveTagsRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceId string `position:"Query" name:"ResourceId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + Tag *[]RemoveTagsTag `position:"Query" name:"Tag" type:"Repeated"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + ResourceType string `position:"Query" name:"ResourceType"` +} + +// RemoveTagsTag is a repeated param struct in RemoveTagsRequest +type RemoveTagsTag struct { + Value string `name:"Value"` + Key string `name:"Key"` +} + +// RemoveTagsResponse is the response struct for api RemoveTags +type RemoveTagsResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateRemoveTagsRequest creates a request to invoke RemoveTags API +func CreateRemoveTagsRequest() (request *RemoveTagsRequest) { + request = &RemoveTagsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "RemoveTags", "ecs", "openAPI") + return +} + +// CreateRemoveTagsResponse creates a response to parse from RemoveTags response +func CreateRemoveTagsResponse() (response *RemoveTagsResponse) { + response = &RemoveTagsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/renew_dedicated_hosts.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/renew_dedicated_hosts.go new file mode 100644 index 000000000..c5032957a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/renew_dedicated_hosts.go @@ -0,0 +1,110 @@ +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" +) + +// RenewDedicatedHosts invokes the ecs.RenewDedicatedHosts API synchronously +// api document: https://help.aliyun.com/api/ecs/renewdedicatedhosts.html +func (client *Client) RenewDedicatedHosts(request *RenewDedicatedHostsRequest) (response *RenewDedicatedHostsResponse, err error) { + response = CreateRenewDedicatedHostsResponse() + err = client.DoAction(request, response) + return +} + +// RenewDedicatedHostsWithChan invokes the ecs.RenewDedicatedHosts API asynchronously +// api document: https://help.aliyun.com/api/ecs/renewdedicatedhosts.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) RenewDedicatedHostsWithChan(request *RenewDedicatedHostsRequest) (<-chan *RenewDedicatedHostsResponse, <-chan error) { + responseChan := make(chan *RenewDedicatedHostsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.RenewDedicatedHosts(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// RenewDedicatedHostsWithCallback invokes the ecs.RenewDedicatedHosts API asynchronously +// api document: https://help.aliyun.com/api/ecs/renewdedicatedhosts.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) RenewDedicatedHostsWithCallback(request *RenewDedicatedHostsRequest, callback func(response *RenewDedicatedHostsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *RenewDedicatedHostsResponse + var err error + defer close(result) + response, err = client.RenewDedicatedHosts(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// RenewDedicatedHostsRequest is the request struct for api RenewDedicatedHosts +type RenewDedicatedHostsRequest struct { + *requests.RpcRequest + DedicatedHostIds string `position:"Query" name:"DedicatedHostIds"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ClientToken string `position:"Query" name:"ClientToken"` + 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"` +} + +// RenewDedicatedHostsResponse is the response struct for api RenewDedicatedHosts +type RenewDedicatedHostsResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateRenewDedicatedHostsRequest creates a request to invoke RenewDedicatedHosts API +func CreateRenewDedicatedHostsRequest() (request *RenewDedicatedHostsRequest) { + request = &RenewDedicatedHostsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "RenewDedicatedHosts", "ecs", "openAPI") + return +} + +// CreateRenewDedicatedHostsResponse creates a response to parse from RenewDedicatedHosts response +func CreateRenewDedicatedHostsResponse() (response *RenewDedicatedHostsResponse) { + response = &RenewDedicatedHostsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/renew_instance.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/renew_instance.go new file mode 100644 index 000000000..928fc2298 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/renew_instance.go @@ -0,0 +1,110 @@ +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" +) + +// RenewInstance invokes the ecs.RenewInstance API synchronously +// api document: https://help.aliyun.com/api/ecs/renewinstance.html +func (client *Client) RenewInstance(request *RenewInstanceRequest) (response *RenewInstanceResponse, err error) { + response = CreateRenewInstanceResponse() + err = client.DoAction(request, response) + return +} + +// RenewInstanceWithChan invokes the ecs.RenewInstance API asynchronously +// api document: https://help.aliyun.com/api/ecs/renewinstance.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) RenewInstanceWithChan(request *RenewInstanceRequest) (<-chan *RenewInstanceResponse, <-chan error) { + responseChan := make(chan *RenewInstanceResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.RenewInstance(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// RenewInstanceWithCallback invokes the ecs.RenewInstance API asynchronously +// api document: https://help.aliyun.com/api/ecs/renewinstance.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) RenewInstanceWithCallback(request *RenewInstanceRequest, callback func(response *RenewInstanceResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *RenewInstanceResponse + var err error + defer close(result) + response, err = client.RenewInstance(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// RenewInstanceRequest is the request struct for api RenewInstance +type RenewInstanceRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + Period requests.Integer `position:"Query" name:"Period"` + PeriodUnit string `position:"Query" name:"PeriodUnit"` + InstanceId string `position:"Query" name:"InstanceId"` + ClientToken string `position:"Query" name:"ClientToken"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// RenewInstanceResponse is the response struct for api RenewInstance +type RenewInstanceResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateRenewInstanceRequest creates a request to invoke RenewInstance API +func CreateRenewInstanceRequest() (request *RenewInstanceRequest) { + request = &RenewInstanceRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "RenewInstance", "ecs", "openAPI") + return +} + +// CreateRenewInstanceResponse creates a response to parse from RenewInstance response +func CreateRenewInstanceResponse() (response *RenewInstanceResponse) { + response = &RenewInstanceResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/replace_system_disk.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/replace_system_disk.go new file mode 100644 index 000000000..cfcb5135b --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/replace_system_disk.go @@ -0,0 +1,119 @@ +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" +) + +// ReplaceSystemDisk invokes the ecs.ReplaceSystemDisk API synchronously +// api document: https://help.aliyun.com/api/ecs/replacesystemdisk.html +func (client *Client) ReplaceSystemDisk(request *ReplaceSystemDiskRequest) (response *ReplaceSystemDiskResponse, err error) { + response = CreateReplaceSystemDiskResponse() + err = client.DoAction(request, response) + return +} + +// ReplaceSystemDiskWithChan invokes the ecs.ReplaceSystemDisk API asynchronously +// api document: https://help.aliyun.com/api/ecs/replacesystemdisk.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ReplaceSystemDiskWithChan(request *ReplaceSystemDiskRequest) (<-chan *ReplaceSystemDiskResponse, <-chan error) { + responseChan := make(chan *ReplaceSystemDiskResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ReplaceSystemDisk(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ReplaceSystemDiskWithCallback invokes the ecs.ReplaceSystemDisk API asynchronously +// api document: https://help.aliyun.com/api/ecs/replacesystemdisk.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ReplaceSystemDiskWithCallback(request *ReplaceSystemDiskRequest, callback func(response *ReplaceSystemDiskResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ReplaceSystemDiskResponse + var err error + defer close(result) + response, err = client.ReplaceSystemDisk(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ReplaceSystemDiskRequest is the request struct for api ReplaceSystemDisk +type ReplaceSystemDiskRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ImageId string `position:"Query" name:"ImageId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + SecurityEnhancementStrategy string `position:"Query" name:"SecurityEnhancementStrategy"` + KeyPairName string `position:"Query" name:"KeyPairName"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Platform string `position:"Query" name:"Platform"` + Password string `position:"Query" name:"Password"` + InstanceId string `position:"Query" name:"InstanceId"` + PasswordInherit requests.Boolean `position:"Query" name:"PasswordInherit"` + SystemDiskSize requests.Integer `position:"Query" name:"SystemDisk.Size"` + DiskId string `position:"Query" name:"DiskId"` + UseAdditionalService requests.Boolean `position:"Query" name:"UseAdditionalService"` + Architecture string `position:"Query" name:"Architecture"` +} + +// ReplaceSystemDiskResponse is the response struct for api ReplaceSystemDisk +type ReplaceSystemDiskResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + DiskId string `json:"DiskId" xml:"DiskId"` +} + +// CreateReplaceSystemDiskRequest creates a request to invoke ReplaceSystemDisk API +func CreateReplaceSystemDiskRequest() (request *ReplaceSystemDiskRequest) { + request = &ReplaceSystemDiskRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ReplaceSystemDisk", "ecs", "openAPI") + return +} + +// CreateReplaceSystemDiskResponse creates a response to parse from ReplaceSystemDisk response +func CreateReplaceSystemDiskResponse() (response *ReplaceSystemDiskResponse) { + response = &ReplaceSystemDiskResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/reset_disk.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/reset_disk.go new file mode 100644 index 000000000..6a062f7e2 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/reset_disk.go @@ -0,0 +1,108 @@ +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" +) + +// ResetDisk invokes the ecs.ResetDisk API synchronously +// api document: https://help.aliyun.com/api/ecs/resetdisk.html +func (client *Client) ResetDisk(request *ResetDiskRequest) (response *ResetDiskResponse, err error) { + response = CreateResetDiskResponse() + err = client.DoAction(request, response) + return +} + +// ResetDiskWithChan invokes the ecs.ResetDisk API asynchronously +// api document: https://help.aliyun.com/api/ecs/resetdisk.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ResetDiskWithChan(request *ResetDiskRequest) (<-chan *ResetDiskResponse, <-chan error) { + responseChan := make(chan *ResetDiskResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ResetDisk(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ResetDiskWithCallback invokes the ecs.ResetDisk API asynchronously +// api document: https://help.aliyun.com/api/ecs/resetdisk.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ResetDiskWithCallback(request *ResetDiskRequest, callback func(response *ResetDiskResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ResetDiskResponse + var err error + defer close(result) + response, err = client.ResetDisk(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ResetDiskRequest is the request struct for api ResetDisk +type ResetDiskRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + SnapshotId string `position:"Query" name:"SnapshotId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + DiskId string `position:"Query" name:"DiskId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// ResetDiskResponse is the response struct for api ResetDisk +type ResetDiskResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateResetDiskRequest creates a request to invoke ResetDisk API +func CreateResetDiskRequest() (request *ResetDiskRequest) { + request = &ResetDiskRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ResetDisk", "ecs", "openAPI") + return +} + +// CreateResetDiskResponse creates a response to parse from ResetDisk response +func CreateResetDiskResponse() (response *ResetDiskResponse) { + response = &ResetDiskResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/resize_disk.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/resize_disk.go new file mode 100644 index 000000000..a8a44c94b --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/resize_disk.go @@ -0,0 +1,110 @@ +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" +) + +// ResizeDisk invokes the ecs.ResizeDisk API synchronously +// api document: https://help.aliyun.com/api/ecs/resizedisk.html +func (client *Client) ResizeDisk(request *ResizeDiskRequest) (response *ResizeDiskResponse, err error) { + response = CreateResizeDiskResponse() + err = client.DoAction(request, response) + return +} + +// ResizeDiskWithChan invokes the ecs.ResizeDisk API asynchronously +// api document: https://help.aliyun.com/api/ecs/resizedisk.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ResizeDiskWithChan(request *ResizeDiskRequest) (<-chan *ResizeDiskResponse, <-chan error) { + responseChan := make(chan *ResizeDiskResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ResizeDisk(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ResizeDiskWithCallback invokes the ecs.ResizeDisk API asynchronously +// api document: https://help.aliyun.com/api/ecs/resizedisk.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ResizeDiskWithCallback(request *ResizeDiskRequest, callback func(response *ResizeDiskResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ResizeDiskResponse + var err error + defer close(result) + response, err = client.ResizeDisk(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ResizeDiskRequest is the request struct for api ResizeDisk +type ResizeDiskRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + NewSize requests.Integer `position:"Query" name:"NewSize"` + DiskId string `position:"Query" name:"DiskId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Type string `position:"Query" name:"Type"` +} + +// ResizeDiskResponse is the response struct for api ResizeDisk +type ResizeDiskResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateResizeDiskRequest creates a request to invoke ResizeDisk API +func CreateResizeDiskRequest() (request *ResizeDiskRequest) { + request = &ResizeDiskRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "ResizeDisk", "ecs", "openAPI") + return +} + +// CreateResizeDiskResponse creates a response to parse from ResizeDisk response +func CreateResizeDiskResponse() (response *ResizeDiskResponse) { + response = &ResizeDiskResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/revoke_security_group.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/revoke_security_group.go new file mode 100644 index 000000000..c3bc4bfee --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/revoke_security_group.go @@ -0,0 +1,122 @@ +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" +) + +// RevokeSecurityGroup invokes the ecs.RevokeSecurityGroup API synchronously +// api document: https://help.aliyun.com/api/ecs/revokesecuritygroup.html +func (client *Client) RevokeSecurityGroup(request *RevokeSecurityGroupRequest) (response *RevokeSecurityGroupResponse, err error) { + response = CreateRevokeSecurityGroupResponse() + err = client.DoAction(request, response) + return +} + +// RevokeSecurityGroupWithChan invokes the ecs.RevokeSecurityGroup API asynchronously +// api document: https://help.aliyun.com/api/ecs/revokesecuritygroup.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) RevokeSecurityGroupWithChan(request *RevokeSecurityGroupRequest) (<-chan *RevokeSecurityGroupResponse, <-chan error) { + responseChan := make(chan *RevokeSecurityGroupResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.RevokeSecurityGroup(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// RevokeSecurityGroupWithCallback invokes the ecs.RevokeSecurityGroup API asynchronously +// api document: https://help.aliyun.com/api/ecs/revokesecuritygroup.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) RevokeSecurityGroupWithCallback(request *RevokeSecurityGroupRequest, callback func(response *RevokeSecurityGroupResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *RevokeSecurityGroupResponse + var err error + defer close(result) + response, err = client.RevokeSecurityGroup(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// RevokeSecurityGroupRequest is the request struct for api RevokeSecurityGroup +type RevokeSecurityGroupRequest struct { + *requests.RpcRequest + NicType string `position:"Query" name:"NicType"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + SourcePortRange string `position:"Query" name:"SourcePortRange"` + ClientToken string `position:"Query" name:"ClientToken"` + SecurityGroupId string `position:"Query" name:"SecurityGroupId"` + Description string `position:"Query" name:"Description"` + SourceGroupOwnerId requests.Integer `position:"Query" name:"SourceGroupOwnerId"` + SourceGroupOwnerAccount string `position:"Query" name:"SourceGroupOwnerAccount"` + Ipv6DestCidrIp string `position:"Query" name:"Ipv6DestCidrIp"` + Ipv6SourceCidrIp string `position:"Query" name:"Ipv6SourceCidrIp"` + Policy string `position:"Query" name:"Policy"` + PortRange string `position:"Query" name:"PortRange"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + IpProtocol string `position:"Query" name:"IpProtocol"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + SourceCidrIp string `position:"Query" name:"SourceCidrIp"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Priority string `position:"Query" name:"Priority"` + DestCidrIp string `position:"Query" name:"DestCidrIp"` + SourceGroupId string `position:"Query" name:"SourceGroupId"` +} + +// RevokeSecurityGroupResponse is the response struct for api RevokeSecurityGroup +type RevokeSecurityGroupResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateRevokeSecurityGroupRequest creates a request to invoke RevokeSecurityGroup API +func CreateRevokeSecurityGroupRequest() (request *RevokeSecurityGroupRequest) { + request = &RevokeSecurityGroupRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "RevokeSecurityGroup", "ecs", "openAPI") + return +} + +// CreateRevokeSecurityGroupResponse creates a response to parse from RevokeSecurityGroup response +func CreateRevokeSecurityGroupResponse() (response *RevokeSecurityGroupResponse) { + response = &RevokeSecurityGroupResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/revoke_security_group_egress.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/revoke_security_group_egress.go new file mode 100644 index 000000000..be1433352 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/revoke_security_group_egress.go @@ -0,0 +1,122 @@ +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" +) + +// RevokeSecurityGroupEgress invokes the ecs.RevokeSecurityGroupEgress API synchronously +// api document: https://help.aliyun.com/api/ecs/revokesecuritygroupegress.html +func (client *Client) RevokeSecurityGroupEgress(request *RevokeSecurityGroupEgressRequest) (response *RevokeSecurityGroupEgressResponse, err error) { + response = CreateRevokeSecurityGroupEgressResponse() + err = client.DoAction(request, response) + return +} + +// RevokeSecurityGroupEgressWithChan invokes the ecs.RevokeSecurityGroupEgress API asynchronously +// api document: https://help.aliyun.com/api/ecs/revokesecuritygroupegress.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) RevokeSecurityGroupEgressWithChan(request *RevokeSecurityGroupEgressRequest) (<-chan *RevokeSecurityGroupEgressResponse, <-chan error) { + responseChan := make(chan *RevokeSecurityGroupEgressResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.RevokeSecurityGroupEgress(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// RevokeSecurityGroupEgressWithCallback invokes the ecs.RevokeSecurityGroupEgress API asynchronously +// api document: https://help.aliyun.com/api/ecs/revokesecuritygroupegress.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) RevokeSecurityGroupEgressWithCallback(request *RevokeSecurityGroupEgressRequest, callback func(response *RevokeSecurityGroupEgressResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *RevokeSecurityGroupEgressResponse + var err error + defer close(result) + response, err = client.RevokeSecurityGroupEgress(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// RevokeSecurityGroupEgressRequest is the request struct for api RevokeSecurityGroupEgress +type RevokeSecurityGroupEgressRequest struct { + *requests.RpcRequest + NicType string `position:"Query" name:"NicType"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + SourcePortRange string `position:"Query" name:"SourcePortRange"` + ClientToken string `position:"Query" name:"ClientToken"` + SecurityGroupId string `position:"Query" name:"SecurityGroupId"` + Description string `position:"Query" name:"Description"` + Ipv6DestCidrIp string `position:"Query" name:"Ipv6DestCidrIp"` + Ipv6SourceCidrIp string `position:"Query" name:"Ipv6SourceCidrIp"` + Policy string `position:"Query" name:"Policy"` + PortRange string `position:"Query" name:"PortRange"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + IpProtocol string `position:"Query" name:"IpProtocol"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + SourceCidrIp string `position:"Query" name:"SourceCidrIp"` + DestGroupId string `position:"Query" name:"DestGroupId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + DestGroupOwnerAccount string `position:"Query" name:"DestGroupOwnerAccount"` + Priority string `position:"Query" name:"Priority"` + DestCidrIp string `position:"Query" name:"DestCidrIp"` + DestGroupOwnerId requests.Integer `position:"Query" name:"DestGroupOwnerId"` +} + +// RevokeSecurityGroupEgressResponse is the response struct for api RevokeSecurityGroupEgress +type RevokeSecurityGroupEgressResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateRevokeSecurityGroupEgressRequest creates a request to invoke RevokeSecurityGroupEgress API +func CreateRevokeSecurityGroupEgressRequest() (request *RevokeSecurityGroupEgressRequest) { + request = &RevokeSecurityGroupEgressRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "RevokeSecurityGroupEgress", "ecs", "openAPI") + return +} + +// CreateRevokeSecurityGroupEgressResponse creates a response to parse from RevokeSecurityGroupEgress response +func CreateRevokeSecurityGroupEgressResponse() (response *RevokeSecurityGroupEgressResponse) { + response = &RevokeSecurityGroupEgressResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/run_instances.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/run_instances.go new file mode 100644 index 000000000..7588da075 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/run_instances.go @@ -0,0 +1,189 @@ +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" +) + +// RunInstances invokes the ecs.RunInstances API synchronously +// api document: https://help.aliyun.com/api/ecs/runinstances.html +func (client *Client) RunInstances(request *RunInstancesRequest) (response *RunInstancesResponse, err error) { + response = CreateRunInstancesResponse() + err = client.DoAction(request, response) + return +} + +// RunInstancesWithChan invokes the ecs.RunInstances API asynchronously +// api document: https://help.aliyun.com/api/ecs/runinstances.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) RunInstancesWithChan(request *RunInstancesRequest) (<-chan *RunInstancesResponse, <-chan error) { + responseChan := make(chan *RunInstancesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.RunInstances(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// RunInstancesWithCallback invokes the ecs.RunInstances API asynchronously +// api document: https://help.aliyun.com/api/ecs/runinstances.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) RunInstancesWithCallback(request *RunInstancesRequest, callback func(response *RunInstancesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *RunInstancesResponse + var err error + defer close(result) + response, err = client.RunInstances(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// RunInstancesRequest is the request struct for api RunInstances +type RunInstancesRequest struct { + *requests.RpcRequest + LaunchTemplateName string `position:"Query" name:"LaunchTemplateName"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + UniqueSuffix requests.Boolean `position:"Query" name:"UniqueSuffix"` + HpcClusterId string `position:"Query" name:"HpcClusterId"` + SecurityEnhancementStrategy string `position:"Query" name:"SecurityEnhancementStrategy"` + KeyPairName string `position:"Query" name:"KeyPairName"` + MinAmount requests.Integer `position:"Query" name:"MinAmount"` + SpotPriceLimit requests.Float `position:"Query" name:"SpotPriceLimit"` + DeletionProtection requests.Boolean `position:"Query" name:"DeletionProtection"` + ResourceGroupId string `position:"Query" name:"ResourceGroupId"` + HostName string `position:"Query" name:"HostName"` + Password string `position:"Query" name:"Password"` + Tag *[]RunInstancesTag `position:"Query" name:"Tag" type:"Repeated"` + AutoRenewPeriod requests.Integer `position:"Query" name:"AutoRenewPeriod"` + Period requests.Integer `position:"Query" name:"Period"` + DryRun requests.Boolean `position:"Query" name:"DryRun"` + LaunchTemplateId string `position:"Query" name:"LaunchTemplateId"` + Ipv6AddressCount requests.Integer `position:"Query" name:"Ipv6AddressCount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + CapacityReservationPreference string `position:"Query" name:"CapacityReservationPreference"` + VSwitchId string `position:"Query" name:"VSwitchId"` + SpotStrategy string `position:"Query" name:"SpotStrategy"` + PrivateIpAddress string `position:"Query" name:"PrivateIpAddress"` + 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"` + Ipv6Address *[]string `position:"Query" name:"Ipv6Address" type:"Repeated"` + InternetMaxBandwidthIn requests.Integer `position:"Query" name:"InternetMaxBandwidthIn"` + ImageId string `position:"Query" name:"ImageId"` + SpotInterruptionBehavior string `position:"Query" name:"SpotInterruptionBehavior"` + ClientToken string `position:"Query" name:"ClientToken"` + 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"` + CapacityReservationId string `position:"Query" name:"CapacityReservationId"` + UserData string `position:"Query" name:"UserData"` + PasswordInherit requests.Boolean `position:"Query" name:"PasswordInherit"` + InstanceType string `position:"Query" name:"InstanceType"` + HibernationConfigured requests.Boolean `position:"Query" name:"HibernationConfigured"` + InstanceChargeType string `position:"Query" name:"InstanceChargeType"` + NetworkInterface *[]RunInstancesNetworkInterface `position:"Query" name:"NetworkInterface" type:"Repeated"` + DeploymentSetId string `position:"Query" name:"DeploymentSetId"` + Amount requests.Integer `position:"Query" name:"Amount"` + 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"` + AutoReleaseTime string `position:"Query" name:"AutoReleaseTime"` + DedicatedHostId string `position:"Query" name:"DedicatedHostId"` + CreditSpecification string `position:"Query" name:"CreditSpecification"` + DataDisk *[]RunInstancesDataDisk `position:"Query" name:"DataDisk" type:"Repeated"` + LaunchTemplateVersion requests.Integer `position:"Query" name:"LaunchTemplateVersion"` + SystemDiskSize string `position:"Query" name:"SystemDisk.Size"` + SystemDiskDescription string `position:"Query" name:"SystemDisk.Description"` +} + +// RunInstancesTag is a repeated param struct in RunInstancesRequest +type RunInstancesTag struct { + Key string `name:"Key"` + Value string `name:"Value"` +} + +// RunInstancesNetworkInterface is a repeated param struct in RunInstancesRequest +type RunInstancesNetworkInterface struct { + PrimaryIpAddress string `name:"PrimaryIpAddress"` + VSwitchId string `name:"VSwitchId"` + SecurityGroupId string `name:"SecurityGroupId"` + NetworkInterfaceName string `name:"NetworkInterfaceName"` + Description string `name:"Description"` +} + +// RunInstancesDataDisk is a repeated param struct in RunInstancesRequest +type RunInstancesDataDisk struct { + Size string `name:"Size"` + SnapshotId string `name:"SnapshotId"` + Category string `name:"Category"` + Encrypted string `name:"Encrypted"` + KMSKeyId string `name:"KMSKeyId"` + DiskName string `name:"DiskName"` + Description string `name:"Description"` + Device string `name:"Device"` + DeleteWithInstance string `name:"DeleteWithInstance"` +} + +// RunInstancesResponse is the response struct for api RunInstances +type RunInstancesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + InstanceIdSets InstanceIdSets `json:"InstanceIdSets" xml:"InstanceIdSets"` +} + +// CreateRunInstancesRequest creates a request to invoke RunInstances API +func CreateRunInstancesRequest() (request *RunInstancesRequest) { + request = &RunInstancesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "RunInstances", "ecs", "openAPI") + return +} + +// CreateRunInstancesResponse creates a response to parse from RunInstances response +func CreateRunInstancesResponse() (response *RunInstancesResponse) { + response = &RunInstancesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/start_instance.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/start_instance.go new file mode 100644 index 000000000..1fece7fa8 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/start_instance.go @@ -0,0 +1,110 @@ +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" +) + +// StartInstance invokes the ecs.StartInstance API synchronously +// api document: https://help.aliyun.com/api/ecs/startinstance.html +func (client *Client) StartInstance(request *StartInstanceRequest) (response *StartInstanceResponse, err error) { + response = CreateStartInstanceResponse() + err = client.DoAction(request, response) + return +} + +// StartInstanceWithChan invokes the ecs.StartInstance API asynchronously +// api document: https://help.aliyun.com/api/ecs/startinstance.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) StartInstanceWithChan(request *StartInstanceRequest) (<-chan *StartInstanceResponse, <-chan error) { + responseChan := make(chan *StartInstanceResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.StartInstance(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// StartInstanceWithCallback invokes the ecs.StartInstance API asynchronously +// api document: https://help.aliyun.com/api/ecs/startinstance.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) StartInstanceWithCallback(request *StartInstanceRequest, callback func(response *StartInstanceResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *StartInstanceResponse + var err error + defer close(result) + response, err = client.StartInstance(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// StartInstanceRequest is the request struct for api StartInstance +type StartInstanceRequest struct { + *requests.RpcRequest + SourceRegionId string `position:"Query" name:"SourceRegionId"` + InitLocalDisk requests.Boolean `position:"Query" name:"InitLocalDisk"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + InstanceId string `position:"Query" name:"InstanceId"` + DryRun requests.Boolean `position:"Query" name:"DryRun"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// StartInstanceResponse is the response struct for api StartInstance +type StartInstanceResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateStartInstanceRequest creates a request to invoke StartInstance API +func CreateStartInstanceRequest() (request *StartInstanceRequest) { + request = &StartInstanceRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "StartInstance", "ecs", "openAPI") + return +} + +// CreateStartInstanceResponse creates a response to parse from StartInstance response +func CreateStartInstanceResponse() (response *StartInstanceResponse) { + response = &StartInstanceResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/stop_instance.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/stop_instance.go new file mode 100644 index 000000000..c9d5417db --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/stop_instance.go @@ -0,0 +1,112 @@ +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" +) + +// StopInstance invokes the ecs.StopInstance API synchronously +// api document: https://help.aliyun.com/api/ecs/stopinstance.html +func (client *Client) StopInstance(request *StopInstanceRequest) (response *StopInstanceResponse, err error) { + response = CreateStopInstanceResponse() + err = client.DoAction(request, response) + return +} + +// StopInstanceWithChan invokes the ecs.StopInstance API asynchronously +// api document: https://help.aliyun.com/api/ecs/stopinstance.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) StopInstanceWithChan(request *StopInstanceRequest) (<-chan *StopInstanceResponse, <-chan error) { + responseChan := make(chan *StopInstanceResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.StopInstance(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// StopInstanceWithCallback invokes the ecs.StopInstance API asynchronously +// api document: https://help.aliyun.com/api/ecs/stopinstance.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) StopInstanceWithCallback(request *StopInstanceRequest, callback func(response *StopInstanceResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *StopInstanceResponse + var err error + defer close(result) + response, err = client.StopInstance(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// StopInstanceRequest is the request struct for api StopInstance +type StopInstanceRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + InstanceId string `position:"Query" name:"InstanceId"` + DryRun requests.Boolean `position:"Query" name:"DryRun"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ConfirmStop requests.Boolean `position:"Query" name:"ConfirmStop"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + StoppedMode string `position:"Query" name:"StoppedMode"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Hibernate requests.Boolean `position:"Query" name:"Hibernate"` + ForceStop requests.Boolean `position:"Query" name:"ForceStop"` +} + +// StopInstanceResponse is the response struct for api StopInstance +type StopInstanceResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateStopInstanceRequest creates a request to invoke StopInstance API +func CreateStopInstanceRequest() (request *StopInstanceRequest) { + request = &StopInstanceRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "StopInstance", "ecs", "openAPI") + return +} + +// CreateStopInstanceResponse creates a response to parse from StopInstance response +func CreateStopInstanceResponse() (response *StopInstanceResponse) { + response = &StopInstanceResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/stop_invocation.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/stop_invocation.go new file mode 100644 index 000000000..c49dca582 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/stop_invocation.go @@ -0,0 +1,108 @@ +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" +) + +// StopInvocation invokes the ecs.StopInvocation API synchronously +// api document: https://help.aliyun.com/api/ecs/stopinvocation.html +func (client *Client) StopInvocation(request *StopInvocationRequest) (response *StopInvocationResponse, err error) { + response = CreateStopInvocationResponse() + err = client.DoAction(request, response) + return +} + +// StopInvocationWithChan invokes the ecs.StopInvocation API asynchronously +// api document: https://help.aliyun.com/api/ecs/stopinvocation.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) StopInvocationWithChan(request *StopInvocationRequest) (<-chan *StopInvocationResponse, <-chan error) { + responseChan := make(chan *StopInvocationResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.StopInvocation(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// StopInvocationWithCallback invokes the ecs.StopInvocation API asynchronously +// api document: https://help.aliyun.com/api/ecs/stopinvocation.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) StopInvocationWithCallback(request *StopInvocationRequest, callback func(response *StopInvocationResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *StopInvocationResponse + var err error + defer close(result) + response, err = client.StopInvocation(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// StopInvocationRequest is the request struct for api StopInvocation +type StopInvocationRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + InvokeId string `position:"Query" name:"InvokeId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + InstanceId *[]string `position:"Query" name:"InstanceId" type:"Repeated"` +} + +// StopInvocationResponse is the response struct for api StopInvocation +type StopInvocationResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateStopInvocationRequest creates a request to invoke StopInvocation API +func CreateStopInvocationRequest() (request *StopInvocationRequest) { + request = &StopInvocationRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "StopInvocation", "ecs", "openAPI") + return +} + +// CreateStopInvocationResponse creates a response to parse from StopInvocation response +func CreateStopInvocationResponse() (response *StopInvocationResponse) { + response = &StopInvocationResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_access_point_set.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_access_point_set.go new file mode 100644 index 000000000..40c538f8b --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_access_point_set.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. + +// AccessPointSet is a nested struct in ecs response +type AccessPointSet struct { + AccessPointType []AccessPointType `json:"AccessPointType" xml:"AccessPointType"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_access_point_type.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_access_point_type.go new file mode 100644 index 000000000..4fb9e989f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_access_point_type.go @@ -0,0 +1,28 @@ +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. + +// AccessPointType is a nested struct in ecs response +type AccessPointType struct { + AccessPointId string `json:"AccessPointId" xml:"AccessPointId"` + Status string `json:"Status" xml:"Status"` + Type string `json:"Type" xml:"Type"` + AttachedRegionNo string `json:"AttachedRegionNo" xml:"AttachedRegionNo"` + Location string `json:"Location" xml:"Location"` + HostOperator string `json:"HostOperator" xml:"HostOperator"` + Name string `json:"Name" xml:"Name"` + Description string `json:"Description" xml:"Description"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_account.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_account.go new file mode 100644 index 000000000..f54239055 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_account.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. + +// Account is a nested struct in ecs response +type Account struct { + AliyunId string `json:"AliyunId" xml:"AliyunId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_account_attribute_item.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_account_attribute_item.go new file mode 100644 index 000000000..43ded2036 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_account_attribute_item.go @@ -0,0 +1,22 @@ +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. + +// AccountAttributeItem is a nested struct in ecs response +type AccountAttributeItem struct { + AttributeName string `json:"AttributeName" xml:"AttributeName"` + AttributeValues AttributeValues `json:"AttributeValues" xml:"AttributeValues"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_account_attribute_items.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_account_attribute_items.go new file mode 100644 index 000000000..93a3b6afd --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_account_attribute_items.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. + +// AccountAttributeItems is a nested struct in ecs response +type AccountAttributeItems struct { + AccountAttributeItem []AccountAttributeItem `json:"AccountAttributeItem" xml:"AccountAttributeItem"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_accounts.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_accounts.go new file mode 100644 index 000000000..f287e0e1f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_accounts.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. + +// Accounts is a nested struct in ecs response +type Accounts struct { + Account []Account `json:"Account" xml:"Account"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_associated_eip_addresses.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_associated_eip_addresses.go new file mode 100644 index 000000000..1adc3d063 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_associated_eip_addresses.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. + +// AssociatedEipAddresses is a nested struct in ecs response +type AssociatedEipAddresses struct { + AssociatedEipAddresse []string `json:"associatedEipAddresse" xml:"associatedEipAddresse"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_associated_instances.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_associated_instances.go new file mode 100644 index 000000000..37331c346 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_associated_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. + +// AssociatedInstances is a nested struct in ecs response +type AssociatedInstances struct { + AssociatedInstance []string `json:"associatedInstance" xml:"associatedInstance"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_associated_public_ip.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_associated_public_ip.go new file mode 100644 index 000000000..4287bc31b --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_associated_public_ip.go @@ -0,0 +1,22 @@ +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. + +// AssociatedPublicIp is a nested struct in ecs response +type AssociatedPublicIp struct { + PublicIpAddress string `json:"PublicIpAddress" xml:"PublicIpAddress"` + AllocationId string `json:"AllocationId" xml:"AllocationId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_attach_instance_ram_role_result.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_attach_instance_ram_role_result.go new file mode 100644 index 000000000..c2a206cfe --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_attach_instance_ram_role_result.go @@ -0,0 +1,24 @@ +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. + +// AttachInstanceRamRoleResult is a nested struct in ecs response +type AttachInstanceRamRoleResult struct { + InstanceId string `json:"InstanceId" xml:"InstanceId"` + Success bool `json:"Success" xml:"Success"` + Code string `json:"Code" xml:"Code"` + Message string `json:"Message" xml:"Message"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_attach_instance_ram_role_results.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_attach_instance_ram_role_results.go new file mode 100644 index 000000000..b5d998ca8 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_attach_instance_ram_role_results.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. + +// AttachInstanceRamRoleResults is a nested struct in ecs response +type AttachInstanceRamRoleResults struct { + AttachInstanceRamRoleResult []AttachInstanceRamRoleResult `json:"AttachInstanceRamRoleResult" xml:"AttachInstanceRamRoleResult"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_attribute_values.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_attribute_values.go new file mode 100644 index 000000000..76eb7dea1 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_attribute_values.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. + +// AttributeValues is a nested struct in ecs response +type AttributeValues struct { + ValueItem []ValueItem `json:"ValueItem" xml:"ValueItem"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_auto_snapshot_policies.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_auto_snapshot_policies.go new file mode 100644 index 000000000..8c3e62ce6 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_auto_snapshot_policies.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. + +// AutoSnapshotPolicies is a nested struct in ecs response +type AutoSnapshotPolicies struct { + AutoSnapshotPolicy []AutoSnapshotPolicy `json:"AutoSnapshotPolicy" xml:"AutoSnapshotPolicy"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_auto_snapshot_policy.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_auto_snapshot_policy.go new file mode 100644 index 000000000..1b3e85e6e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_auto_snapshot_policy.go @@ -0,0 +1,30 @@ +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. + +// AutoSnapshotPolicy is a nested struct in ecs response +type AutoSnapshotPolicy struct { + AutoSnapshotPolicyId string `json:"AutoSnapshotPolicyId" xml:"AutoSnapshotPolicyId"` + RegionId string `json:"RegionId" xml:"RegionId"` + AutoSnapshotPolicyName string `json:"AutoSnapshotPolicyName" xml:"AutoSnapshotPolicyName"` + TimePoints string `json:"TimePoints" xml:"TimePoints"` + RepeatWeekdays string `json:"RepeatWeekdays" xml:"RepeatWeekdays"` + RetentionDays int `json:"RetentionDays" xml:"RetentionDays"` + DiskNums int `json:"DiskNums" xml:"DiskNums"` + VolumeNums int `json:"VolumeNums" xml:"VolumeNums"` + CreationTime string `json:"CreationTime" xml:"CreationTime"` + Status string `json:"Status" xml:"Status"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_available_dedicated_host_types.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_available_dedicated_host_types.go new file mode 100644 index 000000000..86eaf0ee5 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_available_dedicated_host_types.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. + +// AvailableDedicatedHostTypes is a nested struct in ecs response +type AvailableDedicatedHostTypes struct { + DedicatedHostType []string `json:"DedicatedHostType" xml:"DedicatedHostType"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_available_disk_categories.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_available_disk_categories.go new file mode 100644 index 000000000..4de10595d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_available_disk_categories.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. + +// AvailableDiskCategories is a nested struct in ecs response +type AvailableDiskCategories struct { + DiskCategories []string `json:"DiskCategories" xml:"DiskCategories"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_available_instance_types.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_available_instance_types.go new file mode 100644 index 000000000..295337169 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_available_instance_types.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. + +// AvailableInstanceTypes is a nested struct in ecs response +type AvailableInstanceTypes struct { + InstanceTypes []string `json:"InstanceTypes" xml:"InstanceTypes"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_available_resource.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_available_resource.go new file mode 100644 index 000000000..04d8e63ae --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_available_resource.go @@ -0,0 +1,22 @@ +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. + +// AvailableResource is a nested struct in ecs response +type AvailableResource struct { + Type string `json:"Type" xml:"Type"` + SupportedResources SupportedResourcesInDescribeResourcesModification `json:"SupportedResources" xml:"SupportedResources"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_available_resource_creation.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_available_resource_creation.go new file mode 100644 index 000000000..4a20f01be --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_available_resource_creation.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. + +// AvailableResourceCreation is a nested struct in ecs response +type AvailableResourceCreation struct { + ResourceTypes []string `json:"ResourceTypes" xml:"ResourceTypes"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_available_resources_in_describe_available_resource.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_available_resources_in_describe_available_resource.go new file mode 100644 index 000000000..8638d99a6 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_available_resources_in_describe_available_resource.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. + +// AvailableResourcesInDescribeAvailableResource is a nested struct in ecs response +type AvailableResourcesInDescribeAvailableResource struct { + AvailableResource []AvailableResource `json:"AvailableResource" xml:"AvailableResource"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_available_resources_in_describe_resources_modification.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_available_resources_in_describe_resources_modification.go new file mode 100644 index 000000000..73eb771b8 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_available_resources_in_describe_resources_modification.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. + +// AvailableResourcesInDescribeResourcesModification is a nested struct in ecs response +type AvailableResourcesInDescribeResourcesModification struct { + AvailableResource []AvailableResource `json:"AvailableResource" xml:"AvailableResource"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_available_resources_in_describe_zones.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_available_resources_in_describe_zones.go new file mode 100644 index 000000000..4c2db7ba5 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_available_resources_in_describe_zones.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. + +// AvailableResourcesInDescribeZones is a nested struct in ecs response +type AvailableResourcesInDescribeZones struct { + ResourcesInfo []ResourcesInfo `json:"ResourcesInfo" xml:"ResourcesInfo"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_available_volume_categories.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_available_volume_categories.go new file mode 100644 index 000000000..97fdf0daa --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_available_volume_categories.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. + +// AvailableVolumeCategories is a nested struct in ecs response +type AvailableVolumeCategories struct { + VolumeCategories []string `json:"VolumeCategories" xml:"VolumeCategories"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_available_zone.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_available_zone.go new file mode 100644 index 000000000..8c9df9078 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_available_zone.go @@ -0,0 +1,25 @@ +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. + +// AvailableZone is a nested struct in ecs response +type AvailableZone struct { + RegionId string `json:"RegionId" xml:"RegionId"` + ZoneId string `json:"ZoneId" xml:"ZoneId"` + StatusCategory string `json:"StatusCategory" xml:"StatusCategory"` + Status string `json:"Status" xml:"Status"` + AvailableResources AvailableResourcesInDescribeResourcesModification `json:"AvailableResources" xml:"AvailableResources"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_available_zones_in_describe_available_resource.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_available_zones_in_describe_available_resource.go new file mode 100644 index 000000000..c0947c37d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_available_zones_in_describe_available_resource.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. + +// AvailableZonesInDescribeAvailableResource is a nested struct in ecs response +type AvailableZonesInDescribeAvailableResource struct { + AvailableZone []AvailableZone `json:"AvailableZone" xml:"AvailableZone"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_available_zones_in_describe_resources_modification.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_available_zones_in_describe_resources_modification.go new file mode 100644 index 000000000..9368019c2 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_available_zones_in_describe_resources_modification.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. + +// AvailableZonesInDescribeResourcesModification is a nested struct in ecs response +type AvailableZonesInDescribeResourcesModification struct { + AvailableZone []AvailableZone `json:"AvailableZone" xml:"AvailableZone"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_bandwidth.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_bandwidth.go new file mode 100644 index 000000000..2cabba166 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_bandwidth.go @@ -0,0 +1,24 @@ +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. + +// Bandwidth is a nested struct in ecs response +type Bandwidth struct { + InternetChargeType string `json:"InternetChargeType" xml:"InternetChargeType"` + Min int `json:"Min" xml:"Min"` + Max int `json:"Max" xml:"Max"` + Unit string `json:"Unit" xml:"Unit"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_bandwidth_package.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_bandwidth_package.go new file mode 100644 index 000000000..acfdace7b --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_bandwidth_package.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. + +// BandwidthPackage is a nested struct in ecs response +type BandwidthPackage struct { + BandwidthPackageId string `json:"BandwidthPackageId" xml:"BandwidthPackageId"` + RegionId string `json:"RegionId" xml:"RegionId"` + Name string `json:"Name" xml:"Name"` + Description string `json:"Description" xml:"Description"` + ZoneId string `json:"ZoneId" xml:"ZoneId"` + NatGatewayId string `json:"NatGatewayId" xml:"NatGatewayId"` + Bandwidth string `json:"Bandwidth" xml:"Bandwidth"` + InstanceChargeType string `json:"InstanceChargeType" xml:"InstanceChargeType"` + InternetChargeType string `json:"InternetChargeType" xml:"InternetChargeType"` + BusinessStatus string `json:"BusinessStatus" xml:"BusinessStatus"` + IpCount string `json:"IpCount" xml:"IpCount"` + ISP string `json:"ISP" xml:"ISP"` + CreationTime string `json:"CreationTime" xml:"CreationTime"` + Status string `json:"Status" xml:"Status"` + PublicIpAddresses PublicIpAddresses `json:"PublicIpAddresses" xml:"PublicIpAddresses"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_bandwidth_package_ids_in_create_nat_gateway.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_bandwidth_package_ids_in_create_nat_gateway.go new file mode 100644 index 000000000..816324bef --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_bandwidth_package_ids_in_create_nat_gateway.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. + +// BandwidthPackageIdsInCreateNatGateway is a nested struct in ecs response +type BandwidthPackageIdsInCreateNatGateway struct { + BandwidthPackageId []string `json:"BandwidthPackageId" xml:"BandwidthPackageId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_bandwidth_package_ids_in_describe_nat_gateways.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_bandwidth_package_ids_in_describe_nat_gateways.go new file mode 100644 index 000000000..f25820e45 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_bandwidth_package_ids_in_describe_nat_gateways.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. + +// BandwidthPackageIdsInDescribeNatGateways is a nested struct in ecs response +type BandwidthPackageIdsInDescribeNatGateways struct { + BandwidthPackageId []string `json:"BandwidthPackageId" xml:"BandwidthPackageId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_bandwidth_packages.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_bandwidth_packages.go new file mode 100644 index 000000000..565403079 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_bandwidth_packages.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. + +// BandwidthPackages is a nested struct in ecs response +type BandwidthPackages struct { + BandwidthPackage []BandwidthPackage `json:"BandwidthPackage" xml:"BandwidthPackage"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_bandwidths.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_bandwidths.go new file mode 100644 index 000000000..84ecd4b03 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_bandwidths.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. + +// Bandwidths is a nested struct in ecs response +type Bandwidths struct { + Bandwidth []Bandwidth `json:"Bandwidth" xml:"Bandwidth"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_capacity.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_capacity.go new file mode 100644 index 000000000..00da0ec23 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_capacity.go @@ -0,0 +1,29 @@ +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. + +// Capacity is a nested struct in ecs response +type Capacity struct { + TotalVcpus int `json:"TotalVcpus" xml:"TotalVcpus"` + AvailableVcpus int `json:"AvailableVcpus" xml:"AvailableVcpus"` + TotalVgpus int `json:"TotalVgpus" xml:"TotalVgpus"` + AvailableVgpus int `json:"AvailableVgpus" xml:"AvailableVgpus"` + TotalMemory float64 `json:"TotalMemory" xml:"TotalMemory"` + AvailableMemory float64 `json:"AvailableMemory" xml:"AvailableMemory"` + TotalLocalStorage int `json:"TotalLocalStorage" xml:"TotalLocalStorage"` + AvailableLocalStorage int `json:"AvailableLocalStorage" xml:"AvailableLocalStorage"` + LocalStorageCategory string `json:"LocalStorageCategory" xml:"LocalStorageCategory"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_cluster.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_cluster.go new file mode 100644 index 000000000..7fe7b720f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_cluster.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. + +// Cluster is a nested struct in ecs response +type Cluster struct { + ClusterId string `json:"ClusterId" xml:"ClusterId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_clusters.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_clusters.go new file mode 100644 index 000000000..a8a0b654f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_clusters.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. + +// Clusters is a nested struct in ecs response +type Clusters struct { + Cluster []Cluster `json:"Cluster" xml:"Cluster"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_command.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_command.go new file mode 100644 index 000000000..2217de564 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_command.go @@ -0,0 +1,28 @@ +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. + +// Command is a nested struct in ecs response +type Command struct { + CommandId string `json:"CommandId" xml:"CommandId"` + Name string `json:"Name" xml:"Name"` + Type string `json:"Type" xml:"Type"` + Description string `json:"Description" xml:"Description"` + CommandContent string `json:"CommandContent" xml:"CommandContent"` + WorkingDir string `json:"WorkingDir" xml:"WorkingDir"` + Timeout int `json:"Timeout" xml:"Timeout"` + CreationTime string `json:"CreationTime" xml:"CreationTime"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_commands.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_commands.go new file mode 100644 index 000000000..1843b1ba6 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_commands.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. + +// Commands is a nested struct in ecs response +type Commands struct { + Command []Command `json:"Command" xml:"Command"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_data.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_data.go new file mode 100644 index 000000000..4d6f9c891 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_data.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. + +// Data is a nested struct in ecs response +type Data struct { + RecommendInstanceType []RecommendInstanceType `json:"RecommendInstanceType" xml:"RecommendInstanceType"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_data_disk.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_data_disk.go new file mode 100644 index 000000000..515b0f467 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_data_disk.go @@ -0,0 +1,28 @@ +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. + +// DataDisk is a nested struct in ecs response +type DataDisk struct { + Size int `json:"Size" xml:"Size"` + SnapshotId string `json:"SnapshotId" xml:"SnapshotId"` + Category string `json:"Category" xml:"Category"` + Encrypted string `json:"Encrypted" xml:"Encrypted"` + DiskName string `json:"DiskName" xml:"DiskName"` + Description string `json:"Description" xml:"Description"` + DeleteWithInstance bool `json:"DeleteWithInstance" xml:"DeleteWithInstance"` + Device string `json:"Device" xml:"Device"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_data_disk_categories.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_data_disk_categories.go new file mode 100644 index 000000000..16b26e106 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_data_disk_categories.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. + +// DataDiskCategories is a nested struct in ecs response +type DataDiskCategories struct { + SupportedDataDiskCategory []string `json:"supportedDataDiskCategory" xml:"supportedDataDiskCategory"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_data_disks.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_data_disks.go new file mode 100644 index 000000000..c91ee49c4 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_data_disks.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. + +// DataDisks is a nested struct in ecs response +type DataDisks struct { + DataDisk []DataDisk `json:"DataDisk" xml:"DataDisk"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_data_point.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_data_point.go new file mode 100644 index 000000000..550541b20 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_data_point.go @@ -0,0 +1,22 @@ +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. + +// DataPoint is a nested struct in ecs response +type DataPoint struct { + TimeStamp string `json:"TimeStamp" xml:"TimeStamp"` + Size int `json:"Size" xml:"Size"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_dedicated_host.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_dedicated_host.go new file mode 100644 index 000000000..75856705c --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_dedicated_host.go @@ -0,0 +1,46 @@ +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. + +// DedicatedHost is a nested struct in ecs response +type DedicatedHost struct { + DedicatedHostId string `json:"DedicatedHostId" xml:"DedicatedHostId"` + RegionId string `json:"RegionId" xml:"RegionId"` + ZoneId string `json:"ZoneId" xml:"ZoneId"` + DedicatedHostName string `json:"DedicatedHostName" xml:"DedicatedHostName"` + MachineId string `json:"MachineId" xml:"MachineId"` + Description string `json:"Description" xml:"Description"` + DedicatedHostType string `json:"DedicatedHostType" xml:"DedicatedHostType"` + Sockets int `json:"Sockets" xml:"Sockets"` + Cores int `json:"Cores" xml:"Cores"` + PhysicalGpus int `json:"PhysicalGpus" xml:"PhysicalGpus"` + GPUSpec string `json:"GPUSpec" xml:"GPUSpec"` + ActionOnMaintenance string `json:"ActionOnMaintenance" xml:"ActionOnMaintenance"` + Status string `json:"Status" xml:"Status"` + CreationTime string `json:"CreationTime" xml:"CreationTime"` + ChargeType string `json:"ChargeType" xml:"ChargeType"` + SaleCycle string `json:"SaleCycle" xml:"SaleCycle"` + ExpiredTime string `json:"ExpiredTime" xml:"ExpiredTime"` + AutoReleaseTime string `json:"AutoReleaseTime" xml:"AutoReleaseTime"` + ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` + SupportedInstanceTypeFamilies SupportedInstanceTypeFamiliesInDescribeDedicatedHosts `json:"SupportedInstanceTypeFamilies" xml:"SupportedInstanceTypeFamilies"` + SupportedInstanceTypesList SupportedInstanceTypesListInDescribeDedicatedHosts `json:"SupportedInstanceTypesList" xml:"SupportedInstanceTypesList"` + Capacity Capacity `json:"Capacity" xml:"Capacity"` + NetworkAttributes NetworkAttributes `json:"NetworkAttributes" xml:"NetworkAttributes"` + Instances InstancesInDescribeDedicatedHosts `json:"Instances" xml:"Instances"` + OperationLocks OperationLocksInDescribeDedicatedHosts `json:"OperationLocks" xml:"OperationLocks"` + Tags TagsInDescribeDedicatedHosts `json:"Tags" xml:"Tags"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_dedicated_host_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_dedicated_host_attribute.go new file mode 100644 index 000000000..98153a1b3 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_dedicated_host_attribute.go @@ -0,0 +1,22 @@ +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. + +// DedicatedHostAttribute is a nested struct in ecs response +type DedicatedHostAttribute struct { + DedicatedHostName string `json:"DedicatedHostName" xml:"DedicatedHostName"` + DedicatedHostId string `json:"DedicatedHostId" xml:"DedicatedHostId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_dedicated_host_generations.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_dedicated_host_generations.go new file mode 100644 index 000000000..4637e136a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_dedicated_host_generations.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. + +// DedicatedHostGenerations is a nested struct in ecs response +type DedicatedHostGenerations struct { + DedicatedHostGeneration []string `json:"DedicatedHostGeneration" xml:"DedicatedHostGeneration"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_dedicated_host_id_sets.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_dedicated_host_id_sets.go new file mode 100644 index 000000000..c8604d6ee --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_dedicated_host_id_sets.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. + +// DedicatedHostIdSets is a nested struct in ecs response +type DedicatedHostIdSets struct { + DedicatedHostId []string `json:"DedicatedHostId" xml:"DedicatedHostId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_dedicated_host_renew_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_dedicated_host_renew_attribute.go new file mode 100644 index 000000000..4c390a287 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_dedicated_host_renew_attribute.go @@ -0,0 +1,25 @@ +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. + +// DedicatedHostRenewAttribute is a nested struct in ecs response +type DedicatedHostRenewAttribute struct { + DedicatedHostId string `json:"DedicatedHostId" xml:"DedicatedHostId"` + AutoRenewEnabled bool `json:"AutoRenewEnabled" xml:"AutoRenewEnabled"` + Duration int `json:"Duration" xml:"Duration"` + PeriodUnit string `json:"PeriodUnit" xml:"PeriodUnit"` + RenewalStatus string `json:"RenewalStatus" xml:"RenewalStatus"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_dedicated_host_renew_attributes.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_dedicated_host_renew_attributes.go new file mode 100644 index 000000000..755f8c586 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_dedicated_host_renew_attributes.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. + +// DedicatedHostRenewAttributes is a nested struct in ecs response +type DedicatedHostRenewAttributes struct { + DedicatedHostRenewAttribute []DedicatedHostRenewAttribute `json:"DedicatedHostRenewAttribute" xml:"DedicatedHostRenewAttribute"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_dedicated_host_type.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_dedicated_host_type.go new file mode 100644 index 000000000..eb4f891eb --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_dedicated_host_type.go @@ -0,0 +1,33 @@ +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. + +// DedicatedHostType is a nested struct in ecs response +type DedicatedHostType struct { + DedicatedHostType string `json:"DedicatedHostType" xml:"DedicatedHostType"` + Sockets int `json:"Sockets" xml:"Sockets"` + TotalVcpus int `json:"TotalVcpus" xml:"TotalVcpus"` + TotalVgpus int `json:"TotalVgpus" xml:"TotalVgpus"` + Cores int `json:"Cores" xml:"Cores"` + PhysicalGpus int `json:"PhysicalGpus" xml:"PhysicalGpus"` + MemorySize float64 `json:"MemorySize" xml:"MemorySize"` + LocalStorageCapacity int `json:"LocalStorageCapacity" xml:"LocalStorageCapacity"` + LocalStorageAmount int `json:"LocalStorageAmount" xml:"LocalStorageAmount"` + LocalStorageCategory string `json:"LocalStorageCategory" xml:"LocalStorageCategory"` + GPUSpec string `json:"GPUSpec" xml:"GPUSpec"` + SupportedInstanceTypeFamilies SupportedInstanceTypeFamiliesInDescribeDedicatedHostTypes `json:"SupportedInstanceTypeFamilies" xml:"SupportedInstanceTypeFamilies"` + SupportedInstanceTypesList SupportedInstanceTypesListInDescribeDedicatedHostTypes `json:"SupportedInstanceTypesList" xml:"SupportedInstanceTypesList"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_dedicated_host_types.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_dedicated_host_types.go new file mode 100644 index 000000000..255f61b55 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_dedicated_host_types.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. + +// DedicatedHostTypes is a nested struct in ecs response +type DedicatedHostTypes struct { + DedicatedHostType []DedicatedHostType `json:"DedicatedHostType" xml:"DedicatedHostType"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_dedicated_hosts.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_dedicated_hosts.go new file mode 100644 index 000000000..aef425fda --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_dedicated_hosts.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. + +// DedicatedHosts is a nested struct in ecs response +type DedicatedHosts struct { + DedicatedHost []DedicatedHost `json:"DedicatedHost" xml:"DedicatedHost"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_demand.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_demand.go new file mode 100644 index 000000000..a64888f45 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_demand.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. + +// Demand is a nested struct in ecs response +type Demand struct { + ZoneId string `json:"ZoneId" xml:"ZoneId"` + DemandTime string `json:"DemandTime" xml:"DemandTime"` + InstanceTypeFamily string `json:"InstanceTypeFamily" xml:"InstanceTypeFamily"` + InstanceType string `json:"InstanceType" xml:"InstanceType"` + InstanceChargeType string `json:"InstanceChargeType" xml:"InstanceChargeType"` + Period int `json:"Period" xml:"Period"` + PeriodUnit string `json:"PeriodUnit" xml:"PeriodUnit"` + StartTime string `json:"StartTime" xml:"StartTime"` + EndTime string `json:"EndTime" xml:"EndTime"` + DemandStatus string `json:"DemandStatus" xml:"DemandStatus"` + TotalAmount int `json:"TotalAmount" xml:"TotalAmount"` + AvailableAmount int `json:"AvailableAmount" xml:"AvailableAmount"` + UsedAmount int `json:"UsedAmount" xml:"UsedAmount"` + DeliveringAmount int `json:"DeliveringAmount" xml:"DeliveringAmount"` + SupplyInfos SupplyInfos `json:"SupplyInfos" xml:"SupplyInfos"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_demands.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_demands.go new file mode 100644 index 000000000..2acd06186 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_demands.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. + +// Demands is a nested struct in ecs response +type Demands struct { + Demand []Demand `json:"Demand" xml:"Demand"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_deployment_set.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_deployment_set.go new file mode 100644 index 000000000..c1f0b4631 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_deployment_set.go @@ -0,0 +1,30 @@ +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. + +// DeploymentSet is a nested struct in ecs response +type DeploymentSet struct { + DeploymentSetId string `json:"DeploymentSetId" xml:"DeploymentSetId"` + DeploymentSetDescription string `json:"DeploymentSetDescription" xml:"DeploymentSetDescription"` + DeploymentSetName string `json:"DeploymentSetName" xml:"DeploymentSetName"` + Strategy string `json:"Strategy" xml:"Strategy"` + DeploymentStrategy string `json:"DeploymentStrategy" xml:"DeploymentStrategy"` + Domain string `json:"Domain" xml:"Domain"` + Granularity string `json:"Granularity" xml:"Granularity"` + InstanceAmount int `json:"InstanceAmount" xml:"InstanceAmount"` + CreationTime string `json:"CreationTime" xml:"CreationTime"` + InstanceIds InstanceIds `json:"InstanceIds" xml:"InstanceIds"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_deployment_sets.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_deployment_sets.go new file mode 100644 index 000000000..151d7b056 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_deployment_sets.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. + +// DeploymentSets is a nested struct in ecs response +type DeploymentSets struct { + DeploymentSet []DeploymentSet `json:"DeploymentSet" xml:"DeploymentSet"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_detach_instance_ram_role_result.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_detach_instance_ram_role_result.go new file mode 100644 index 000000000..00c13a21b --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_detach_instance_ram_role_result.go @@ -0,0 +1,25 @@ +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. + +// DetachInstanceRamRoleResult is a nested struct in ecs response +type DetachInstanceRamRoleResult struct { + InstanceId string `json:"InstanceId" xml:"InstanceId"` + Success bool `json:"Success" xml:"Success"` + Code string `json:"Code" xml:"Code"` + Message string `json:"Message" xml:"Message"` + InstanceRamRoleSets InstanceRamRoleSetsInDetachInstanceRamRole `json:"InstanceRamRoleSets" xml:"InstanceRamRoleSets"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_detach_instance_ram_role_results.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_detach_instance_ram_role_results.go new file mode 100644 index 000000000..06c3b82c8 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_detach_instance_ram_role_results.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. + +// DetachInstanceRamRoleResults is a nested struct in ecs response +type DetachInstanceRamRoleResults struct { + DetachInstanceRamRoleResult []DetachInstanceRamRoleResult `json:"DetachInstanceRamRoleResult" xml:"DetachInstanceRamRoleResult"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_detail_infos_in_describe_price.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_detail_infos_in_describe_price.go new file mode 100644 index 000000000..c28cc7062 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_detail_infos_in_describe_price.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. + +// DetailInfosInDescribePrice is a nested struct in ecs response +type DetailInfosInDescribePrice struct { + ResourcePriceModel []ResourcePriceModel `json:"ResourcePriceModel" xml:"ResourcePriceModel"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_detail_infos_in_describe_renewal_price.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_detail_infos_in_describe_renewal_price.go new file mode 100644 index 000000000..2a9c41388 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_detail_infos_in_describe_renewal_price.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. + +// DetailInfosInDescribeRenewalPrice is a nested struct in ecs response +type DetailInfosInDescribeRenewalPrice struct { + ResourcePriceModel []ResourcePriceModel `json:"ResourcePriceModel" xml:"ResourcePriceModel"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_disk.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_disk.go new file mode 100644 index 000000000..e1ca7d5e5 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_disk.go @@ -0,0 +1,55 @@ +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. + +// Disk is a nested struct in ecs response +type Disk struct { + DiskId string `json:"DiskId" xml:"DiskId"` + RegionId string `json:"RegionId" xml:"RegionId"` + ZoneId string `json:"ZoneId" xml:"ZoneId"` + DiskName string `json:"DiskName" xml:"DiskName"` + Description string `json:"Description" xml:"Description"` + Type string `json:"Type" xml:"Type"` + Category string `json:"Category" xml:"Category"` + Size int `json:"Size" xml:"Size"` + ImageId string `json:"ImageId" xml:"ImageId"` + SourceSnapshotId string `json:"SourceSnapshotId" xml:"SourceSnapshotId"` + AutoSnapshotPolicyId string `json:"AutoSnapshotPolicyId" xml:"AutoSnapshotPolicyId"` + ProductCode string `json:"ProductCode" xml:"ProductCode"` + Portable bool `json:"Portable" xml:"Portable"` + Status string `json:"Status" xml:"Status"` + InstanceId string `json:"InstanceId" xml:"InstanceId"` + Device string `json:"Device" xml:"Device"` + DeleteWithInstance bool `json:"DeleteWithInstance" xml:"DeleteWithInstance"` + DeleteAutoSnapshot bool `json:"DeleteAutoSnapshot" xml:"DeleteAutoSnapshot"` + EnableAutoSnapshot bool `json:"EnableAutoSnapshot" xml:"EnableAutoSnapshot"` + EnableAutomatedSnapshotPolicy bool `json:"EnableAutomatedSnapshotPolicy" xml:"EnableAutomatedSnapshotPolicy"` + CreationTime string `json:"CreationTime" xml:"CreationTime"` + AttachedTime string `json:"AttachedTime" xml:"AttachedTime"` + DetachedTime string `json:"DetachedTime" xml:"DetachedTime"` + DiskChargeType string `json:"DiskChargeType" xml:"DiskChargeType"` + ExpiredTime string `json:"ExpiredTime" xml:"ExpiredTime"` + ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` + Encrypted bool `json:"Encrypted" xml:"Encrypted"` + MountInstanceNum int `json:"MountInstanceNum" xml:"MountInstanceNum"` + IOPS int `json:"IOPS" xml:"IOPS"` + IOPSRead int `json:"IOPSRead" xml:"IOPSRead"` + IOPSWrite int `json:"IOPSWrite" xml:"IOPSWrite"` + KMSKeyId string `json:"KMSKeyId" xml:"KMSKeyId"` + OperationLocks OperationLocksInDescribeDisks `json:"OperationLocks" xml:"OperationLocks"` + MountInstances MountInstances `json:"MountInstances" xml:"MountInstances"` + Tags TagsInDescribeDisks `json:"Tags" xml:"Tags"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_disk_device_mapping.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_disk_device_mapping.go new file mode 100644 index 000000000..68a97fd58 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_disk_device_mapping.go @@ -0,0 +1,29 @@ +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. + +// DiskDeviceMapping is a nested struct in ecs response +type DiskDeviceMapping struct { + SnapshotId string `json:"SnapshotId" xml:"SnapshotId"` + Size string `json:"Size" xml:"Size"` + Device string `json:"Device" xml:"Device"` + Type string `json:"Type" xml:"Type"` + Format string `json:"Format" xml:"Format"` + ImportOSSBucket string `json:"ImportOSSBucket" xml:"ImportOSSBucket"` + ImportOSSObject string `json:"ImportOSSObject" xml:"ImportOSSObject"` + Progress string `json:"Progress" xml:"Progress"` + RemainTime int `json:"RemainTime" xml:"RemainTime"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_disk_device_mappings.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_disk_device_mappings.go new file mode 100644 index 000000000..9585dcfb5 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_disk_device_mappings.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. + +// DiskDeviceMappings is a nested struct in ecs response +type DiskDeviceMappings struct { + DiskDeviceMapping []DiskDeviceMapping `json:"DiskDeviceMapping" xml:"DiskDeviceMapping"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_disk_event_set.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_disk_event_set.go new file mode 100644 index 000000000..6b334e5b7 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_disk_event_set.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. + +// DiskEventSet is a nested struct in ecs response +type DiskEventSet struct { + DiskEventType []DiskEventType `json:"DiskEventType" xml:"DiskEventType"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_disk_event_type.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_disk_event_type.go new file mode 100644 index 000000000..56f1324d8 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_disk_event_type.go @@ -0,0 +1,24 @@ +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. + +// DiskEventType is a nested struct in ecs response +type DiskEventType struct { + EventId string `json:"EventId" xml:"EventId"` + EventTime string `json:"EventTime" xml:"EventTime"` + EventEndTime string `json:"EventEndTime" xml:"EventEndTime"` + EventType EventType `json:"EventType" xml:"EventType"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_disk_full_status_set.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_disk_full_status_set.go new file mode 100644 index 000000000..fe46bf15e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_disk_full_status_set.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. + +// DiskFullStatusSet is a nested struct in ecs response +type DiskFullStatusSet struct { + DiskFullStatusType []DiskFullStatusType `json:"DiskFullStatusType" xml:"DiskFullStatusType"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_disk_full_status_type.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_disk_full_status_type.go new file mode 100644 index 000000000..67fa8dacf --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_disk_full_status_type.go @@ -0,0 +1,26 @@ +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. + +// DiskFullStatusType is a nested struct in ecs response +type DiskFullStatusType struct { + DiskId string `json:"DiskId" xml:"DiskId"` + InstanceId string `json:"InstanceId" xml:"InstanceId"` + Device string `json:"Device" xml:"Device"` + Status Status `json:"Status" xml:"Status"` + HealthStatus HealthStatus `json:"HealthStatus" xml:"HealthStatus"` + DiskEventSet DiskEventSet `json:"DiskEventSet" xml:"DiskEventSet"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_disk_monitor_data.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_disk_monitor_data.go new file mode 100644 index 000000000..3fb25e231 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_disk_monitor_data.go @@ -0,0 +1,30 @@ +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. + +// DiskMonitorData is a nested struct in ecs response +type DiskMonitorData struct { + DiskId string `json:"DiskId" xml:"DiskId"` + IOPSRead int `json:"IOPSRead" xml:"IOPSRead"` + IOPSWrite int `json:"IOPSWrite" xml:"IOPSWrite"` + IOPSTotal int `json:"IOPSTotal" xml:"IOPSTotal"` + BPSRead int `json:"BPSRead" xml:"BPSRead"` + BPSWrite int `json:"BPSWrite" xml:"BPSWrite"` + BPSTotal int `json:"BPSTotal" xml:"BPSTotal"` + LatencyRead int `json:"LatencyRead" xml:"LatencyRead"` + LatencyWrite int `json:"LatencyWrite" xml:"LatencyWrite"` + TimeStamp string `json:"TimeStamp" xml:"TimeStamp"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_disks.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_disks.go new file mode 100644 index 000000000..789dd5772 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_disks.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. + +// Disks is a nested struct in ecs response +type Disks struct { + Disk []Disk `json:"Disk" xml:"Disk"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_ecs_capacity_reservation_attr.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_ecs_capacity_reservation_attr.go new file mode 100644 index 000000000..d38002682 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_ecs_capacity_reservation_attr.go @@ -0,0 +1,22 @@ +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. + +// EcsCapacityReservationAttr is a nested struct in ecs response +type EcsCapacityReservationAttr struct { + CapacityReservationId string `json:"CapacityReservationId" xml:"CapacityReservationId"` + CapacityReservationPreference string `json:"CapacityReservationPreference" xml:"CapacityReservationPreference"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_eip_address.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_eip_address.go new file mode 100644 index 000000000..52906ff01 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_eip_address.go @@ -0,0 +1,25 @@ +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. + +// EipAddress is a nested struct in ecs response +type EipAddress struct { + Bandwidth int `json:"Bandwidth" xml:"Bandwidth"` + IsSupportUnassociate bool `json:"IsSupportUnassociate" xml:"IsSupportUnassociate"` + IpAddress string `json:"IpAddress" xml:"IpAddress"` + InternetChargeType string `json:"InternetChargeType" xml:"InternetChargeType"` + AllocationId string `json:"AllocationId" xml:"AllocationId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_eip_address_in_describe_eip_addresses.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_eip_address_in_describe_eip_addresses.go new file mode 100644 index 000000000..6315d2b11 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_eip_address_in_describe_eip_addresses.go @@ -0,0 +1,33 @@ +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. + +// EipAddressInDescribeEipAddresses is a nested struct in ecs response +type EipAddressInDescribeEipAddresses struct { + RegionId string `json:"RegionId" xml:"RegionId"` + IpAddress string `json:"IpAddress" xml:"IpAddress"` + AllocationId string `json:"AllocationId" xml:"AllocationId"` + Status string `json:"Status" xml:"Status"` + InstanceId string `json:"InstanceId" xml:"InstanceId"` + Bandwidth string `json:"Bandwidth" xml:"Bandwidth"` + EipBandwidth string `json:"EipBandwidth" xml:"EipBandwidth"` + InternetChargeType string `json:"InternetChargeType" xml:"InternetChargeType"` + AllocationTime string `json:"AllocationTime" xml:"AllocationTime"` + InstanceType string `json:"InstanceType" xml:"InstanceType"` + ChargeType string `json:"ChargeType" xml:"ChargeType"` + ExpiredTime string `json:"ExpiredTime" xml:"ExpiredTime"` + OperationLocks OperationLocksInDescribeEipAddresses `json:"OperationLocks" xml:"OperationLocks"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_eip_addresses.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_eip_addresses.go new file mode 100644 index 000000000..bef9830ed --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_eip_addresses.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. + +// EipAddresses is a nested struct in ecs response +type EipAddresses struct { + EipAddress []EipAddressInDescribeEipAddresses `json:"EipAddress" xml:"EipAddress"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_eip_monitor_data.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_eip_monitor_data.go new file mode 100644 index 000000000..4d559e6ce --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_eip_monitor_data.go @@ -0,0 +1,26 @@ +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. + +// EipMonitorData is a nested struct in ecs response +type EipMonitorData struct { + EipPackets int `json:"EipPackets" xml:"EipPackets"` + TimeStamp string `json:"TimeStamp" xml:"TimeStamp"` + EipFlow int `json:"EipFlow" xml:"EipFlow"` + EipRX int `json:"EipRX" xml:"EipRX"` + EipBandwidth int `json:"EipBandwidth" xml:"EipBandwidth"` + EipTX int `json:"EipTX" xml:"EipTX"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_eip_monitor_datas_in_describe_eip_monitor_data.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_eip_monitor_datas_in_describe_eip_monitor_data.go new file mode 100644 index 000000000..04b66a955 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_eip_monitor_datas_in_describe_eip_monitor_data.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. + +// EipMonitorDatasInDescribeEipMonitorData is a nested struct in ecs response +type EipMonitorDatasInDescribeEipMonitorData struct { + EipMonitorData []EipMonitorData `json:"EipMonitorData" xml:"EipMonitorData"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_eip_monitor_datas_in_describe_new_project_eip_monitor_data.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_eip_monitor_datas_in_describe_new_project_eip_monitor_data.go new file mode 100644 index 000000000..8beed79d6 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_eip_monitor_datas_in_describe_new_project_eip_monitor_data.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. + +// EipMonitorDatasInDescribeNewProjectEipMonitorData is a nested struct in ecs response +type EipMonitorDatasInDescribeNewProjectEipMonitorData struct { + EipMonitorData []EipMonitorData `json:"EipMonitorData" xml:"EipMonitorData"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_eni_monitor_data.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_eni_monitor_data.go new file mode 100644 index 000000000..52af66f45 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_eni_monitor_data.go @@ -0,0 +1,28 @@ +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. + +// EniMonitorData is a nested struct in ecs response +type EniMonitorData struct { + EniId string `json:"EniId" xml:"EniId"` + TimeStamp string `json:"TimeStamp" xml:"TimeStamp"` + PacketTx string `json:"PacketTx" xml:"PacketTx"` + PacketRx string `json:"PacketRx" xml:"PacketRx"` + IntranetTx string `json:"IntranetTx" xml:"IntranetTx"` + IntranetRx string `json:"IntranetRx" xml:"IntranetRx"` + DropPacketTx string `json:"DropPacketTx" xml:"DropPacketTx"` + DropPacketRx string `json:"DropPacketRx" xml:"DropPacketRx"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_event_cycle_status.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_event_cycle_status.go new file mode 100644 index 000000000..e36507914 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_event_cycle_status.go @@ -0,0 +1,22 @@ +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. + +// EventCycleStatus is a nested struct in ecs response +type EventCycleStatus struct { + Name string `json:"Name" xml:"Name"` + Code int `json:"Code" xml:"Code"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_event_id_set.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_event_id_set.go new file mode 100644 index 000000000..c70120c80 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_event_id_set.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. + +// EventIdSet is a nested struct in ecs response +type EventIdSet struct { + EventId []string `json:"EventId" xml:"EventId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_event_type.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_event_type.go new file mode 100644 index 000000000..9121810c0 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_event_type.go @@ -0,0 +1,22 @@ +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. + +// EventType is a nested struct in ecs response +type EventType struct { + Name string `json:"Name" xml:"Name"` + Code int `json:"Code" xml:"Code"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_extended_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_extended_attribute.go new file mode 100644 index 000000000..cfa146cd4 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_extended_attribute.go @@ -0,0 +1,22 @@ +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. + +// ExtendedAttribute is a nested struct in ecs response +type ExtendedAttribute struct { + Device string `json:"Device" xml:"Device"` + DiskId string `json:"DiskId" xml:"DiskId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_forward_table_entries.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_forward_table_entries.go new file mode 100644 index 000000000..07ef77a46 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_forward_table_entries.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. + +// ForwardTableEntries is a nested struct in ecs response +type ForwardTableEntries struct { + ForwardTableEntry []ForwardTableEntry `json:"ForwardTableEntry" xml:"ForwardTableEntry"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_forward_table_entry.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_forward_table_entry.go new file mode 100644 index 000000000..e7a1ed6bb --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_forward_table_entry.go @@ -0,0 +1,28 @@ +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. + +// ForwardTableEntry is a nested struct in ecs response +type ForwardTableEntry struct { + ForwardTableId string `json:"ForwardTableId" xml:"ForwardTableId"` + ForwardEntryId string `json:"ForwardEntryId" xml:"ForwardEntryId"` + ExternalIp string `json:"ExternalIp" xml:"ExternalIp"` + ExternalPort string `json:"ExternalPort" xml:"ExternalPort"` + IpProtocol string `json:"IpProtocol" xml:"IpProtocol"` + InternalIp string `json:"InternalIp" xml:"InternalIp"` + InternalPort string `json:"InternalPort" xml:"InternalPort"` + Status string `json:"Status" xml:"Status"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_forward_table_ids_in_create_nat_gateway.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_forward_table_ids_in_create_nat_gateway.go new file mode 100644 index 000000000..fb9d9199c --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_forward_table_ids_in_create_nat_gateway.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. + +// ForwardTableIdsInCreateNatGateway is a nested struct in ecs response +type ForwardTableIdsInCreateNatGateway struct { + ForwardTableId []string `json:"ForwardTableId" xml:"ForwardTableId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_forward_table_ids_in_describe_nat_gateways.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_forward_table_ids_in_describe_nat_gateways.go new file mode 100644 index 000000000..a28d7d5c5 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_forward_table_ids_in_describe_nat_gateways.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. + +// ForwardTableIdsInDescribeNatGateways is a nested struct in ecs response +type ForwardTableIdsInDescribeNatGateways struct { + ForwardTableId []string `json:"ForwardTableId" xml:"ForwardTableId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_ha_vip.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_ha_vip.go new file mode 100644 index 000000000..6c754001b --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_ha_vip.go @@ -0,0 +1,31 @@ +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. + +// HaVip is a nested struct in ecs response +type HaVip struct { + HaVipId string `json:"HaVipId" xml:"HaVipId"` + RegionId string `json:"RegionId" xml:"RegionId"` + VpcId string `json:"VpcId" xml:"VpcId"` + VSwitchId string `json:"VSwitchId" xml:"VSwitchId"` + IpAddress string `json:"IpAddress" xml:"IpAddress"` + Status string `json:"Status" xml:"Status"` + MasterInstanceId string `json:"MasterInstanceId" xml:"MasterInstanceId"` + Description string `json:"Description" xml:"Description"` + CreateTime string `json:"CreateTime" xml:"CreateTime"` + AssociatedInstances AssociatedInstances `json:"AssociatedInstances" xml:"AssociatedInstances"` + AssociatedEipAddresses AssociatedEipAddresses `json:"AssociatedEipAddresses" xml:"AssociatedEipAddresses"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_ha_vips.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_ha_vips.go new file mode 100644 index 000000000..2585d4f08 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_ha_vips.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. + +// HaVips is a nested struct in ecs response +type HaVips struct { + HaVip []HaVip `json:"HaVip" xml:"HaVip"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_health_status.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_health_status.go new file mode 100644 index 000000000..1528dc615 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_health_status.go @@ -0,0 +1,22 @@ +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. + +// HealthStatus is a nested struct in ecs response +type HealthStatus struct { + Name string `json:"Name" xml:"Name"` + Code int `json:"Code" xml:"Code"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_hpc_cluster.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_hpc_cluster.go new file mode 100644 index 000000000..16576fca7 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_hpc_cluster.go @@ -0,0 +1,23 @@ +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. + +// HpcCluster is a nested struct in ecs response +type HpcCluster struct { + HpcClusterId string `json:"HpcClusterId" xml:"HpcClusterId"` + Name string `json:"Name" xml:"Name"` + Description string `json:"Description" xml:"Description"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_hpc_clusters.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_hpc_clusters.go new file mode 100644 index 000000000..ca09c5ba2 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_hpc_clusters.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. + +// HpcClusters is a nested struct in ecs response +type HpcClusters struct { + HpcCluster []HpcCluster `json:"HpcCluster" xml:"HpcCluster"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_image.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_image.go new file mode 100644 index 000000000..17aab85de --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_image.go @@ -0,0 +1,44 @@ +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. + +// Image is a nested struct in ecs response +type Image struct { + Progress string `json:"Progress" xml:"Progress"` + ImageId string `json:"ImageId" xml:"ImageId"` + ImageName string `json:"ImageName" xml:"ImageName"` + ImageVersion string `json:"ImageVersion" xml:"ImageVersion"` + Description string `json:"Description" xml:"Description"` + Size int `json:"Size" xml:"Size"` + ImageOwnerAlias string `json:"ImageOwnerAlias" xml:"ImageOwnerAlias"` + IsSupportIoOptimized bool `json:"IsSupportIoOptimized" xml:"IsSupportIoOptimized"` + IsSupportCloudinit bool `json:"IsSupportCloudinit" xml:"IsSupportCloudinit"` + OSName string `json:"OSName" xml:"OSName"` + OSNameEn string `json:"OSNameEn" xml:"OSNameEn"` + Architecture string `json:"Architecture" xml:"Architecture"` + Status string `json:"Status" xml:"Status"` + ProductCode string `json:"ProductCode" xml:"ProductCode"` + IsSubscribed bool `json:"IsSubscribed" xml:"IsSubscribed"` + CreationTime string `json:"CreationTime" xml:"CreationTime"` + IsSelfShared string `json:"IsSelfShared" xml:"IsSelfShared"` + OSType string `json:"OSType" xml:"OSType"` + Platform string `json:"Platform" xml:"Platform"` + Usage string `json:"Usage" xml:"Usage"` + IsCopied bool `json:"IsCopied" xml:"IsCopied"` + ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` + DiskDeviceMappings DiskDeviceMappings `json:"DiskDeviceMappings" xml:"DiskDeviceMappings"` + Tags TagsInDescribeImages `json:"Tags" xml:"Tags"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_images.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_images.go new file mode 100644 index 000000000..f6bed398c --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_images.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. + +// Images is a nested struct in ecs response +type Images struct { + Image []Image `json:"Image" xml:"Image"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_inner_ip_address_in_describe_instance_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_inner_ip_address_in_describe_instance_attribute.go new file mode 100644 index 000000000..efc9e604e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_inner_ip_address_in_describe_instance_attribute.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. + +// InnerIpAddressInDescribeInstanceAttribute is a nested struct in ecs response +type InnerIpAddressInDescribeInstanceAttribute struct { + IpAddress []string `json:"IpAddress" xml:"IpAddress"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_inner_ip_address_in_describe_instances.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_inner_ip_address_in_describe_instances.go new file mode 100644 index 000000000..1f99dde35 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_inner_ip_address_in_describe_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. + +// InnerIpAddressInDescribeInstances is a nested struct in ecs response +type InnerIpAddressInDescribeInstances struct { + IpAddress []string `json:"IpAddress" xml:"IpAddress"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance.go new file mode 100644 index 000000000..d76584e07 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance.go @@ -0,0 +1,75 @@ +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. + +// Instance is a nested struct in ecs response +type Instance struct { + ImageId string `json:"ImageId" xml:"ImageId"` + InstanceType string `json:"InstanceType" xml:"InstanceType"` + AutoReleaseTime string `json:"AutoReleaseTime" xml:"AutoReleaseTime"` + DeviceAvailable bool `json:"DeviceAvailable" xml:"DeviceAvailable"` + InstanceNetworkType string `json:"InstanceNetworkType" xml:"InstanceNetworkType"` + LocalStorageAmount int `json:"LocalStorageAmount" xml:"LocalStorageAmount"` + InstanceChargeType string `json:"InstanceChargeType" xml:"InstanceChargeType"` + ClusterId string `json:"ClusterId" xml:"ClusterId"` + InstanceName string `json:"InstanceName" xml:"InstanceName"` + CreditSpecification string `json:"CreditSpecification" xml:"CreditSpecification"` + GPUAmount int `json:"GPUAmount" xml:"GPUAmount"` + StartTime string `json:"StartTime" xml:"StartTime"` + ZoneId string `json:"ZoneId" xml:"ZoneId"` + InternetChargeType string `json:"InternetChargeType" xml:"InternetChargeType"` + InternetMaxBandwidthIn int `json:"InternetMaxBandwidthIn" xml:"InternetMaxBandwidthIn"` + HostName string `json:"HostName" xml:"HostName"` + Cpu int `json:"Cpu" xml:"Cpu"` + Status string `json:"Status" xml:"Status"` + SpotPriceLimit float64 `json:"SpotPriceLimit" xml:"SpotPriceLimit"` + OSName string `json:"OSName" xml:"OSName"` + OSNameEn string `json:"OSNameEn" xml:"OSNameEn"` + SerialNumber string `json:"SerialNumber" xml:"SerialNumber"` + RegionId string `json:"RegionId" xml:"RegionId"` + InternetMaxBandwidthOut int `json:"InternetMaxBandwidthOut" xml:"InternetMaxBandwidthOut"` + IoOptimized bool `json:"IoOptimized" xml:"IoOptimized"` + ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` + InstanceTypeFamily string `json:"InstanceTypeFamily" xml:"InstanceTypeFamily"` + InstanceId string `json:"InstanceId" xml:"InstanceId"` + DeploymentSetId string `json:"DeploymentSetId" xml:"DeploymentSetId"` + GPUSpec string `json:"GPUSpec" xml:"GPUSpec"` + Description string `json:"Description" xml:"Description"` + Recyclable bool `json:"Recyclable" xml:"Recyclable"` + SaleCycle string `json:"SaleCycle" xml:"SaleCycle"` + ExpiredTime string `json:"ExpiredTime" xml:"ExpiredTime"` + OSType string `json:"OSType" xml:"OSType"` + Memory int `json:"Memory" xml:"Memory"` + CreationTime string `json:"CreationTime" xml:"CreationTime"` + KeyPairName string `json:"KeyPairName" xml:"KeyPairName"` + HpcClusterId string `json:"HpcClusterId" xml:"HpcClusterId"` + LocalStorageCapacity int `json:"LocalStorageCapacity" xml:"LocalStorageCapacity"` + VlanId string `json:"VlanId" xml:"VlanId"` + StoppedMode string `json:"StoppedMode" xml:"StoppedMode"` + SpotStrategy string `json:"SpotStrategy" xml:"SpotStrategy"` + DeletionProtection bool `json:"DeletionProtection" xml:"DeletionProtection"` + SecurityGroupIds SecurityGroupIdsInDescribeInstances `json:"SecurityGroupIds" xml:"SecurityGroupIds"` + InnerIpAddress InnerIpAddressInDescribeInstances `json:"InnerIpAddress" xml:"InnerIpAddress"` + PublicIpAddress PublicIpAddressInDescribeInstances `json:"PublicIpAddress" xml:"PublicIpAddress"` + RdmaIpAddress RdmaIpAddress `json:"RdmaIpAddress" xml:"RdmaIpAddress"` + EipAddress EipAddress `json:"EipAddress" xml:"EipAddress"` + EcsCapacityReservationAttr EcsCapacityReservationAttr `json:"EcsCapacityReservationAttr" xml:"EcsCapacityReservationAttr"` + DedicatedHostAttribute DedicatedHostAttribute `json:"DedicatedHostAttribute" xml:"DedicatedHostAttribute"` + VpcAttributes VpcAttributes `json:"VpcAttributes" xml:"VpcAttributes"` + NetworkInterfaces NetworkInterfacesInDescribeInstances `json:"NetworkInterfaces" xml:"NetworkInterfaces"` + OperationLocks OperationLocksInDescribeInstances `json:"OperationLocks" xml:"OperationLocks"` + Tags TagsInDescribeInstances `json:"Tags" xml:"Tags"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_cloud_assistant_status.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_cloud_assistant_status.go new file mode 100644 index 000000000..50d1aed24 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_cloud_assistant_status.go @@ -0,0 +1,22 @@ +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. + +// InstanceCloudAssistantStatus is a nested struct in ecs response +type InstanceCloudAssistantStatus struct { + InstanceId string `json:"InstanceId" xml:"InstanceId"` + CloudAssistantStatus string `json:"CloudAssistantStatus" xml:"CloudAssistantStatus"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_cloud_assistant_status_set.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_cloud_assistant_status_set.go new file mode 100644 index 000000000..ce652ff26 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_cloud_assistant_status_set.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. + +// InstanceCloudAssistantStatusSet is a nested struct in ecs response +type InstanceCloudAssistantStatusSet struct { + InstanceCloudAssistantStatus []InstanceCloudAssistantStatus `json:"InstanceCloudAssistantStatus" xml:"InstanceCloudAssistantStatus"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_full_status_set.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_full_status_set.go new file mode 100644 index 000000000..7e524090e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_full_status_set.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. + +// InstanceFullStatusSet is a nested struct in ecs response +type InstanceFullStatusSet struct { + InstanceFullStatusType []InstanceFullStatusType `json:"InstanceFullStatusType" xml:"InstanceFullStatusType"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_full_status_type.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_full_status_type.go new file mode 100644 index 000000000..895544690 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_full_status_type.go @@ -0,0 +1,24 @@ +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. + +// InstanceFullStatusType is a nested struct in ecs response +type InstanceFullStatusType struct { + InstanceId string `json:"InstanceId" xml:"InstanceId"` + Status Status `json:"Status" xml:"Status"` + HealthStatus HealthStatus `json:"HealthStatus" xml:"HealthStatus"` + ScheduledSystemEventSet ScheduledSystemEventSet `json:"ScheduledSystemEventSet" xml:"ScheduledSystemEventSet"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_generations.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_generations.go new file mode 100644 index 000000000..f09bc068a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_generations.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. + +// InstanceGenerations is a nested struct in ecs response +type InstanceGenerations struct { + SupportedInstanceGeneration []string `json:"supportedInstanceGeneration" xml:"supportedInstanceGeneration"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_id_sets.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_id_sets.go new file mode 100644 index 000000000..a825dc81a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_id_sets.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. + +// InstanceIdSets is a nested struct in ecs response +type InstanceIdSets struct { + InstanceIdSet []string `json:"InstanceIdSet" xml:"InstanceIdSet"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_ids.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_ids.go new file mode 100644 index 000000000..c5ec56c0e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_ids.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. + +// InstanceIds is a nested struct in ecs response +type InstanceIds struct { + InstanceId []string `json:"InstanceId" xml:"InstanceId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_monitor_data.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_monitor_data.go new file mode 100644 index 000000000..899132da8 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_monitor_data.go @@ -0,0 +1,37 @@ +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. + +// InstanceMonitorData is a nested struct in ecs response +type InstanceMonitorData struct { + InstanceId string `json:"InstanceId" xml:"InstanceId"` + CPU int `json:"CPU" xml:"CPU"` + IntranetRX int `json:"IntranetRX" xml:"IntranetRX"` + IntranetTX int `json:"IntranetTX" xml:"IntranetTX"` + IntranetBandwidth int `json:"IntranetBandwidth" xml:"IntranetBandwidth"` + InternetRX int `json:"InternetRX" xml:"InternetRX"` + InternetTX int `json:"InternetTX" xml:"InternetTX"` + InternetBandwidth int `json:"InternetBandwidth" xml:"InternetBandwidth"` + IOPSRead int `json:"IOPSRead" xml:"IOPSRead"` + IOPSWrite int `json:"IOPSWrite" xml:"IOPSWrite"` + BPSRead int `json:"BPSRead" xml:"BPSRead"` + BPSWrite int `json:"BPSWrite" xml:"BPSWrite"` + CPUCreditUsage float64 `json:"CPUCreditUsage" xml:"CPUCreditUsage"` + CPUCreditBalance float64 `json:"CPUCreditBalance" xml:"CPUCreditBalance"` + CPUAdvanceCreditBalance float64 `json:"CPUAdvanceCreditBalance" xml:"CPUAdvanceCreditBalance"` + CPUNotpaidSurplusCreditUsage float64 `json:"CPUNotpaidSurplusCreditUsage" xml:"CPUNotpaidSurplusCreditUsage"` + TimeStamp string `json:"TimeStamp" xml:"TimeStamp"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_ram_role_set.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_ram_role_set.go new file mode 100644 index 000000000..430c7d4d6 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_ram_role_set.go @@ -0,0 +1,22 @@ +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. + +// InstanceRamRoleSet is a nested struct in ecs response +type InstanceRamRoleSet struct { + InstanceId string `json:"InstanceId" xml:"InstanceId"` + RamRoleName string `json:"RamRoleName" xml:"RamRoleName"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_ram_role_sets_in_describe_instance_ram_role.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_ram_role_sets_in_describe_instance_ram_role.go new file mode 100644 index 000000000..6dba0a8dd --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_ram_role_sets_in_describe_instance_ram_role.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. + +// InstanceRamRoleSetsInDescribeInstanceRamRole is a nested struct in ecs response +type InstanceRamRoleSetsInDescribeInstanceRamRole struct { + InstanceRamRoleSet []InstanceRamRoleSet `json:"InstanceRamRoleSet" xml:"InstanceRamRoleSet"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_ram_role_sets_in_detach_instance_ram_role.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_ram_role_sets_in_detach_instance_ram_role.go new file mode 100644 index 000000000..c115b7cb6 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_ram_role_sets_in_detach_instance_ram_role.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. + +// InstanceRamRoleSetsInDetachInstanceRamRole is a nested struct in ecs response +type InstanceRamRoleSetsInDetachInstanceRamRole struct { + InstanceRamRoleSet []InstanceRamRoleSet `json:"InstanceRamRoleSet" xml:"InstanceRamRoleSet"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_renew_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_renew_attribute.go new file mode 100644 index 000000000..d275cb755 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_renew_attribute.go @@ -0,0 +1,25 @@ +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. + +// InstanceRenewAttribute is a nested struct in ecs response +type InstanceRenewAttribute struct { + InstanceId string `json:"InstanceId" xml:"InstanceId"` + AutoRenewEnabled bool `json:"AutoRenewEnabled" xml:"AutoRenewEnabled"` + Duration int `json:"Duration" xml:"Duration"` + PeriodUnit string `json:"PeriodUnit" xml:"PeriodUnit"` + RenewalStatus string `json:"RenewalStatus" xml:"RenewalStatus"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_renew_attributes.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_renew_attributes.go new file mode 100644 index 000000000..98accec96 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_renew_attributes.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. + +// InstanceRenewAttributes is a nested struct in ecs response +type InstanceRenewAttributes struct { + InstanceRenewAttribute []InstanceRenewAttribute `json:"InstanceRenewAttribute" xml:"InstanceRenewAttribute"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_status.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_status.go new file mode 100644 index 000000000..8f591c4ef --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_status.go @@ -0,0 +1,22 @@ +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. + +// InstanceStatus is a nested struct in ecs response +type InstanceStatus struct { + InstanceId string `json:"InstanceId" xml:"InstanceId"` + Status string `json:"Status" xml:"Status"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_statuses.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_statuses.go new file mode 100644 index 000000000..15fd69b5a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_statuses.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. + +// InstanceStatuses is a nested struct in ecs response +type InstanceStatuses struct { + InstanceStatus []InstanceStatus `json:"InstanceStatus" xml:"InstanceStatus"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_system_event_set.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_system_event_set.go new file mode 100644 index 000000000..33d8b9eee --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_system_event_set.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. + +// InstanceSystemEventSet is a nested struct in ecs response +type InstanceSystemEventSet struct { + InstanceSystemEventType []InstanceSystemEventType `json:"InstanceSystemEventType" xml:"InstanceSystemEventType"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_system_event_type.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_system_event_type.go new file mode 100644 index 000000000..8ee7015c3 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_system_event_type.go @@ -0,0 +1,28 @@ +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. + +// InstanceSystemEventType is a nested struct in ecs response +type InstanceSystemEventType struct { + InstanceId string `json:"InstanceId" xml:"InstanceId"` + EventId string `json:"EventId" xml:"EventId"` + EventPublishTime string `json:"EventPublishTime" xml:"EventPublishTime"` + NotBefore string `json:"NotBefore" xml:"NotBefore"` + EventFinishTime string `json:"EventFinishTime" xml:"EventFinishTime"` + EventType EventType `json:"EventType" xml:"EventType"` + EventCycleStatus EventCycleStatus `json:"EventCycleStatus" xml:"EventCycleStatus"` + ExtendedAttribute ExtendedAttribute `json:"ExtendedAttribute" xml:"ExtendedAttribute"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_tag.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_tag.go new file mode 100644 index 000000000..00804a645 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_tag.go @@ -0,0 +1,22 @@ +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. + +// InstanceTag is a nested struct in ecs response +type InstanceTag struct { + Key string `json:"Key" xml:"Key"` + Value string `json:"Value" xml:"Value"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_type.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_type.go new file mode 100644 index 000000000..713c4f589 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_type.go @@ -0,0 +1,43 @@ +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. + +// InstanceType is a nested struct in ecs response +type InstanceType struct { + MemorySize float64 `json:"MemorySize" xml:"MemorySize"` + EniPrivateIpAddressQuantity int `json:"EniPrivateIpAddressQuantity" xml:"EniPrivateIpAddressQuantity"` + InstancePpsRx int `json:"InstancePpsRx" xml:"InstancePpsRx"` + CpuCoreCount int `json:"CpuCoreCount" xml:"CpuCoreCount"` + Cores int `json:"Cores" xml:"Cores"` + Memory int `json:"Memory" xml:"Memory"` + InstanceTypeId string `json:"InstanceTypeId" xml:"InstanceTypeId"` + InstanceBandwidthRx int `json:"InstanceBandwidthRx" xml:"InstanceBandwidthRx"` + InstanceType string `json:"InstanceType" xml:"InstanceType"` + BaselineCredit int `json:"BaselineCredit" xml:"BaselineCredit"` + EniQuantity int `json:"EniQuantity" xml:"EniQuantity"` + Generation string `json:"Generation" xml:"Generation"` + GPUAmount int `json:"GPUAmount" xml:"GPUAmount"` + SupportIoOptimized string `json:"SupportIoOptimized" xml:"SupportIoOptimized"` + InstanceTypeFamily string `json:"InstanceTypeFamily" xml:"InstanceTypeFamily"` + InitialCredit int `json:"InitialCredit" xml:"InitialCredit"` + InstancePpsTx int `json:"InstancePpsTx" xml:"InstancePpsTx"` + LocalStorageAmount int `json:"LocalStorageAmount" xml:"LocalStorageAmount"` + InstanceFamilyLevel string `json:"InstanceFamilyLevel" xml:"InstanceFamilyLevel"` + LocalStorageCapacity int `json:"LocalStorageCapacity" xml:"LocalStorageCapacity"` + GPUSpec string `json:"GPUSpec" xml:"GPUSpec"` + LocalStorageCategory string `json:"LocalStorageCategory" xml:"LocalStorageCategory"` + InstanceBandwidthTx int `json:"InstanceBandwidthTx" xml:"InstanceBandwidthTx"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_type_families_in_describe_instance_type_families.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_type_families_in_describe_instance_type_families.go new file mode 100644 index 000000000..ed00ed498 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_type_families_in_describe_instance_type_families.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. + +// InstanceTypeFamiliesInDescribeInstanceTypeFamilies is a nested struct in ecs response +type InstanceTypeFamiliesInDescribeInstanceTypeFamilies struct { + InstanceTypeFamily []InstanceTypeFamily `json:"InstanceTypeFamily" xml:"InstanceTypeFamily"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_type_families_in_describe_zones.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_type_families_in_describe_zones.go new file mode 100644 index 000000000..ece839531 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_type_families_in_describe_zones.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. + +// InstanceTypeFamiliesInDescribeZones is a nested struct in ecs response +type InstanceTypeFamiliesInDescribeZones struct { + SupportedInstanceTypeFamily []string `json:"supportedInstanceTypeFamily" xml:"supportedInstanceTypeFamily"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_type_family.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_type_family.go new file mode 100644 index 000000000..06c2797d0 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_type_family.go @@ -0,0 +1,22 @@ +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. + +// InstanceTypeFamily is a nested struct in ecs response +type InstanceTypeFamily struct { + InstanceTypeFamilyId string `json:"InstanceTypeFamilyId" xml:"InstanceTypeFamilyId"` + Generation string `json:"Generation" xml:"Generation"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_types_in_describe_image_support_instance_types.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_types_in_describe_image_support_instance_types.go new file mode 100644 index 000000000..23dc52400 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_types_in_describe_image_support_instance_types.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. + +// InstanceTypesInDescribeImageSupportInstanceTypes is a nested struct in ecs response +type InstanceTypesInDescribeImageSupportInstanceTypes struct { + InstanceType []InstanceType `json:"InstanceType" xml:"InstanceType"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_types_in_describe_instance_types.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_types_in_describe_instance_types.go new file mode 100644 index 000000000..69012eae8 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_types_in_describe_instance_types.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. + +// InstanceTypesInDescribeInstanceTypes is a nested struct in ecs response +type InstanceTypesInDescribeInstanceTypes struct { + InstanceType []InstanceType `json:"InstanceType" xml:"InstanceType"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_types_in_describe_zones.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_types_in_describe_zones.go new file mode 100644 index 000000000..250f80d05 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_types_in_describe_zones.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. + +// InstanceTypesInDescribeZones is a nested struct in ecs response +type InstanceTypesInDescribeZones struct { + SupportedInstanceType []string `json:"supportedInstanceType" xml:"supportedInstanceType"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instances_in_describe_dedicated_hosts.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instances_in_describe_dedicated_hosts.go new file mode 100644 index 000000000..0b88522e4 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instances_in_describe_dedicated_hosts.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. + +// InstancesInDescribeDedicatedHosts is a nested struct in ecs response +type InstancesInDescribeDedicatedHosts struct { + Instance []Instance `json:"Instance" xml:"Instance"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instances_in_describe_instances.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instances_in_describe_instances.go new file mode 100644 index 000000000..82b254eed --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instances_in_describe_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. + +// InstancesInDescribeInstances is a nested struct in ecs response +type InstancesInDescribeInstances struct { + Instance []Instance `json:"Instance" xml:"Instance"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_invocation.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_invocation.go new file mode 100644 index 000000000..2eb884289 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_invocation.go @@ -0,0 +1,32 @@ +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. + +// Invocation is a nested struct in ecs response +type Invocation struct { + CommandId string `json:"CommandId" xml:"CommandId"` + PageNumber int `json:"PageNumber" xml:"PageNumber"` + CommandName string `json:"CommandName" xml:"CommandName"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + PageSize int `json:"PageSize" xml:"PageSize"` + InvokeId string `json:"InvokeId" xml:"InvokeId"` + InvokeStatus string `json:"InvokeStatus" xml:"InvokeStatus"` + Timed bool `json:"Timed" xml:"Timed"` + Frequency string `json:"Frequency" xml:"Frequency"` + CommandType string `json:"CommandType" xml:"CommandType"` + InvocationResults InvocationResults `json:"InvocationResults" xml:"InvocationResults"` + InvokeInstances InvokeInstances `json:"InvokeInstances" xml:"InvokeInstances"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_invocation_result.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_invocation_result.go new file mode 100644 index 000000000..86dc37cbe --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_invocation_result.go @@ -0,0 +1,27 @@ +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. + +// InvocationResult is a nested struct in ecs response +type InvocationResult struct { + CommandId string `json:"CommandId" xml:"CommandId"` + InvokeId string `json:"InvokeId" xml:"InvokeId"` + InstanceId string `json:"InstanceId" xml:"InstanceId"` + FinishedTime string `json:"FinishedTime" xml:"FinishedTime"` + Output string `json:"Output" xml:"Output"` + InvokeRecordStatus string `json:"InvokeRecordStatus" xml:"InvokeRecordStatus"` + ExitCode int `json:"ExitCode" xml:"ExitCode"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_invocation_results.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_invocation_results.go new file mode 100644 index 000000000..c2f0bb520 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_invocation_results.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. + +// InvocationResults is a nested struct in ecs response +type InvocationResults struct { + InvocationResult []InvocationResult `json:"InvocationResult" xml:"InvocationResult"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_invocations.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_invocations.go new file mode 100644 index 000000000..f7e100066 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_invocations.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. + +// Invocations is a nested struct in ecs response +type Invocations struct { + Invocation []Invocation `json:"Invocation" xml:"Invocation"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_invoke_instance.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_invoke_instance.go new file mode 100644 index 000000000..9c0b08ee5 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_invoke_instance.go @@ -0,0 +1,22 @@ +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. + +// InvokeInstance is a nested struct in ecs response +type InvokeInstance struct { + InstanceId string `json:"InstanceId" xml:"InstanceId"` + InstanceInvokeStatus string `json:"InstanceInvokeStatus" xml:"InstanceInvokeStatus"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_invoke_instances.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_invoke_instances.go new file mode 100644 index 000000000..2eb179075 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_invoke_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. + +// InvokeInstances is a nested struct in ecs response +type InvokeInstances struct { + InvokeInstance []InvokeInstance `json:"InvokeInstance" xml:"InvokeInstance"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_ipv6_set.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_ipv6_set.go new file mode 100644 index 000000000..6b6af81aa --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_ipv6_set.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. + +// Ipv6Set is a nested struct in ecs response +type Ipv6Set struct { + Ipv6Address string `json:"Ipv6Address" xml:"Ipv6Address"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_ipv6_sets.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_ipv6_sets.go new file mode 100644 index 000000000..53df57e76 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_ipv6_sets.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. + +// Ipv6Sets is a nested struct in ecs response +type Ipv6Sets struct { + Ipv6Set []Ipv6Set `json:"Ipv6Set" xml:"Ipv6Set"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_key_pair.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_key_pair.go new file mode 100644 index 000000000..cacee8fef --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_key_pair.go @@ -0,0 +1,24 @@ +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. + +// KeyPair is a nested struct in ecs response +type KeyPair struct { + KeyPairName string `json:"KeyPairName" xml:"KeyPairName"` + KeyPairFingerPrint string `json:"KeyPairFingerPrint" xml:"KeyPairFingerPrint"` + ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` + Tags TagsInDescribeKeyPairs `json:"Tags" xml:"Tags"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_key_pairs.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_key_pairs.go new file mode 100644 index 000000000..0c93a50d2 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_key_pairs.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. + +// KeyPairs is a nested struct in ecs response +type KeyPairs struct { + KeyPair []KeyPair `json:"KeyPair" xml:"KeyPair"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_launch_template_data.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_launch_template_data.go new file mode 100644 index 000000000..df5099abd --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_launch_template_data.go @@ -0,0 +1,56 @@ +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. + +// LaunchTemplateData is a nested struct in ecs response +type LaunchTemplateData struct { + ImageId string `json:"ImageId" xml:"ImageId"` + ImageOwnerAlias string `json:"ImageOwnerAlias" xml:"ImageOwnerAlias"` + PasswordInherit bool `json:"PasswordInherit" xml:"PasswordInherit"` + InstanceType string `json:"InstanceType" xml:"InstanceType"` + SecurityGroupId string `json:"SecurityGroupId" xml:"SecurityGroupId"` + VpcId string `json:"VpcId" xml:"VpcId"` + VSwitchId string `json:"VSwitchId" xml:"VSwitchId"` + InstanceName string `json:"InstanceName" xml:"InstanceName"` + Description string `json:"Description" xml:"Description"` + InternetMaxBandwidthIn int `json:"InternetMaxBandwidthIn" xml:"InternetMaxBandwidthIn"` + InternetMaxBandwidthOut int `json:"InternetMaxBandwidthOut" xml:"InternetMaxBandwidthOut"` + HostName string `json:"HostName" xml:"HostName"` + ZoneId string `json:"ZoneId" xml:"ZoneId"` + SystemDiskSize int `json:"SystemDisk.Size" xml:"SystemDisk.Size"` + SystemDiskCategory string `json:"SystemDisk.Category" xml:"SystemDisk.Category"` + SystemDiskDiskName string `json:"SystemDisk.DiskName" xml:"SystemDisk.DiskName"` + SystemDiskDescription string `json:"SystemDisk.Description" xml:"SystemDisk.Description"` + SystemDiskIops int `json:"SystemDisk.Iops" xml:"SystemDisk.Iops"` + IoOptimized string `json:"IoOptimized" xml:"IoOptimized"` + InstanceChargeType string `json:"InstanceChargeType" xml:"InstanceChargeType"` + Period int `json:"Period" xml:"Period"` + InternetChargeType string `json:"InternetChargeType" xml:"InternetChargeType"` + EnableVmOsConfig bool `json:"EnableVmOsConfig" xml:"EnableVmOsConfig"` + NetworkType string `json:"NetworkType" xml:"NetworkType"` + UserData string `json:"UserData" xml:"UserData"` + KeyPairName string `json:"KeyPairName" xml:"KeyPairName"` + RamRoleName string `json:"RamRoleName" xml:"RamRoleName"` + AutoReleaseTime string `json:"AutoReleaseTime" xml:"AutoReleaseTime"` + SpotStrategy string `json:"SpotStrategy" xml:"SpotStrategy"` + SpotPriceLimit float64 `json:"SpotPriceLimit" xml:"SpotPriceLimit"` + SpotDuration int `json:"SpotDuration" xml:"SpotDuration"` + ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` + SecurityEnhancementStrategy string `json:"SecurityEnhancementStrategy" xml:"SecurityEnhancementStrategy"` + DataDisks DataDisks `json:"DataDisks" xml:"DataDisks"` + NetworkInterfaces NetworkInterfacesInDescribeLaunchTemplateVersions `json:"NetworkInterfaces" xml:"NetworkInterfaces"` + Tags TagsInDescribeLaunchTemplateVersions `json:"Tags" xml:"Tags"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_launch_template_set.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_launch_template_set.go new file mode 100644 index 000000000..5419465f2 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_launch_template_set.go @@ -0,0 +1,29 @@ +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. + +// LaunchTemplateSet is a nested struct in ecs response +type LaunchTemplateSet struct { + CreateTime string `json:"CreateTime" xml:"CreateTime"` + ModifiedTime string `json:"ModifiedTime" xml:"ModifiedTime"` + LaunchTemplateId string `json:"LaunchTemplateId" xml:"LaunchTemplateId"` + LaunchTemplateName string `json:"LaunchTemplateName" xml:"LaunchTemplateName"` + DefaultVersionNumber int `json:"DefaultVersionNumber" xml:"DefaultVersionNumber"` + LatestVersionNumber int `json:"LatestVersionNumber" xml:"LatestVersionNumber"` + CreatedBy string `json:"CreatedBy" xml:"CreatedBy"` + ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` + Tags TagsInDescribeLaunchTemplates `json:"Tags" xml:"Tags"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_launch_template_sets.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_launch_template_sets.go new file mode 100644 index 000000000..1ac495310 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_launch_template_sets.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. + +// LaunchTemplateSets is a nested struct in ecs response +type LaunchTemplateSets struct { + LaunchTemplateSet []LaunchTemplateSet `json:"LaunchTemplateSet" xml:"LaunchTemplateSet"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_launch_template_version_set.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_launch_template_version_set.go new file mode 100644 index 000000000..46f53bebe --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_launch_template_version_set.go @@ -0,0 +1,29 @@ +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. + +// LaunchTemplateVersionSet is a nested struct in ecs response +type LaunchTemplateVersionSet struct { + CreateTime string `json:"CreateTime" xml:"CreateTime"` + ModifiedTime string `json:"ModifiedTime" xml:"ModifiedTime"` + LaunchTemplateId string `json:"LaunchTemplateId" xml:"LaunchTemplateId"` + LaunchTemplateName string `json:"LaunchTemplateName" xml:"LaunchTemplateName"` + DefaultVersion bool `json:"DefaultVersion" xml:"DefaultVersion"` + VersionNumber int `json:"VersionNumber" xml:"VersionNumber"` + VersionDescription string `json:"VersionDescription" xml:"VersionDescription"` + CreatedBy string `json:"CreatedBy" xml:"CreatedBy"` + LaunchTemplateData LaunchTemplateData `json:"LaunchTemplateData" xml:"LaunchTemplateData"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_launch_template_version_sets.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_launch_template_version_sets.go new file mode 100644 index 000000000..2f2d1b3bb --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_launch_template_version_sets.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. + +// LaunchTemplateVersionSets is a nested struct in ecs response +type LaunchTemplateVersionSets struct { + LaunchTemplateVersionSet []LaunchTemplateVersionSet `json:"LaunchTemplateVersionSet" xml:"LaunchTemplateVersionSet"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_link.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_link.go new file mode 100644 index 000000000..f0afa507b --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_link.go @@ -0,0 +1,22 @@ +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. + +// Link is a nested struct in ecs response +type Link struct { + InstanceId string `json:"InstanceId" xml:"InstanceId"` + VpcId string `json:"VpcId" xml:"VpcId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_links.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_links.go new file mode 100644 index 000000000..bd6406862 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_links.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. + +// Links is a nested struct in ecs response +type Links struct { + Link []Link `json:"Link" xml:"Link"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_lock_reason.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_lock_reason.go new file mode 100644 index 000000000..a4a3870f1 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_lock_reason.go @@ -0,0 +1,22 @@ +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. + +// LockReason is a nested struct in ecs response +type LockReason struct { + LockReason string `json:"LockReason" xml:"LockReason"` + LockMsg string `json:"LockMsg" xml:"LockMsg"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_monitor_data_in_describe_disk_monitor_data.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_monitor_data_in_describe_disk_monitor_data.go new file mode 100644 index 000000000..b4fb6b120 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_monitor_data_in_describe_disk_monitor_data.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. + +// MonitorDataInDescribeDiskMonitorData is a nested struct in ecs response +type MonitorDataInDescribeDiskMonitorData struct { + DiskMonitorData []DiskMonitorData `json:"DiskMonitorData" xml:"DiskMonitorData"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_monitor_data_in_describe_eni_monitor_data.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_monitor_data_in_describe_eni_monitor_data.go new file mode 100644 index 000000000..917b33fa2 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_monitor_data_in_describe_eni_monitor_data.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. + +// MonitorDataInDescribeEniMonitorData is a nested struct in ecs response +type MonitorDataInDescribeEniMonitorData struct { + EniMonitorData []EniMonitorData `json:"EniMonitorData" xml:"EniMonitorData"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_monitor_data_in_describe_instance_monitor_data.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_monitor_data_in_describe_instance_monitor_data.go new file mode 100644 index 000000000..3d57afeca --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_monitor_data_in_describe_instance_monitor_data.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. + +// MonitorDataInDescribeInstanceMonitorData is a nested struct in ecs response +type MonitorDataInDescribeInstanceMonitorData struct { + InstanceMonitorData []InstanceMonitorData `json:"InstanceMonitorData" xml:"InstanceMonitorData"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_monitor_data_in_describe_snapshot_monitor_data.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_monitor_data_in_describe_snapshot_monitor_data.go new file mode 100644 index 000000000..efec56338 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_monitor_data_in_describe_snapshot_monitor_data.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. + +// MonitorDataInDescribeSnapshotMonitorData is a nested struct in ecs response +type MonitorDataInDescribeSnapshotMonitorData struct { + DataPoint []DataPoint `json:"DataPoint" xml:"DataPoint"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_mount_instance.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_mount_instance.go new file mode 100644 index 000000000..c3db98054 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_mount_instance.go @@ -0,0 +1,23 @@ +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. + +// MountInstance is a nested struct in ecs response +type MountInstance struct { + InstanceId string `json:"InstanceId" xml:"InstanceId"` + Device string `json:"Device" xml:"Device"` + AttachedTime string `json:"AttachedTime" xml:"AttachedTime"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_mount_instances.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_mount_instances.go new file mode 100644 index 000000000..bdbfe6c2a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_mount_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. + +// MountInstances is a nested struct in ecs response +type MountInstances struct { + MountInstance []MountInstance `json:"MountInstance" xml:"MountInstance"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_nat_gateway.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_nat_gateway.go new file mode 100644 index 000000000..ac87f2453 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_nat_gateway.go @@ -0,0 +1,32 @@ +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. + +// NatGateway is a nested struct in ecs response +type NatGateway struct { + NatGatewayId string `json:"NatGatewayId" xml:"NatGatewayId"` + RegionId string `json:"RegionId" xml:"RegionId"` + Name string `json:"Name" xml:"Name"` + Description string `json:"Description" xml:"Description"` + VpcId string `json:"VpcId" xml:"VpcId"` + Spec string `json:"Spec" xml:"Spec"` + InstanceChargeType string `json:"InstanceChargeType" xml:"InstanceChargeType"` + BusinessStatus string `json:"BusinessStatus" xml:"BusinessStatus"` + CreationTime string `json:"CreationTime" xml:"CreationTime"` + Status string `json:"Status" xml:"Status"` + ForwardTableIds ForwardTableIdsInDescribeNatGateways `json:"ForwardTableIds" xml:"ForwardTableIds"` + BandwidthPackageIds BandwidthPackageIdsInDescribeNatGateways `json:"BandwidthPackageIds" xml:"BandwidthPackageIds"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_nat_gateways.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_nat_gateways.go new file mode 100644 index 000000000..abaccb98c --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_nat_gateways.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. + +// NatGateways is a nested struct in ecs response +type NatGateways struct { + NatGateway []NatGateway `json:"NatGateway" xml:"NatGateway"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_network_attributes.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_network_attributes.go new file mode 100644 index 000000000..98389dac1 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_network_attributes.go @@ -0,0 +1,22 @@ +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. + +// NetworkAttributes is a nested struct in ecs response +type NetworkAttributes struct { + SlbUdpTimeout int `json:"SlbUdpTimeout" xml:"SlbUdpTimeout"` + UdpTimeout int `json:"UdpTimeout" xml:"UdpTimeout"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_network_interface.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_network_interface.go new file mode 100644 index 000000000..908e72310 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_network_interface.go @@ -0,0 +1,27 @@ +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. + +// NetworkInterface is a nested struct in ecs response +type NetworkInterface struct { + SecurityGroupId string `json:"SecurityGroupId" xml:"SecurityGroupId"` + VSwitchId string `json:"VSwitchId" xml:"VSwitchId"` + NetworkInterfaceId string `json:"NetworkInterfaceId" xml:"NetworkInterfaceId"` + PrimaryIpAddress string `json:"PrimaryIpAddress" xml:"PrimaryIpAddress"` + MacAddress string `json:"MacAddress" xml:"MacAddress"` + Description string `json:"Description" xml:"Description"` + NetworkInterfaceName string `json:"NetworkInterfaceName" xml:"NetworkInterfaceName"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_network_interface_permission.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_network_interface_permission.go new file mode 100644 index 000000000..4c2ac06f8 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_network_interface_permission.go @@ -0,0 +1,26 @@ +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. + +// NetworkInterfacePermission is a nested struct in ecs response +type NetworkInterfacePermission struct { + Permission string `json:"Permission" xml:"Permission"` + AccountId int `json:"AccountId" xml:"AccountId"` + NetworkInterfaceId string `json:"NetworkInterfaceId" xml:"NetworkInterfaceId"` + ServiceName string `json:"ServiceName" xml:"ServiceName"` + NetworkInterfacePermissionId string `json:"NetworkInterfacePermissionId" xml:"NetworkInterfacePermissionId"` + PermissionState string `json:"PermissionState" xml:"PermissionState"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_network_interface_permissions.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_network_interface_permissions.go new file mode 100644 index 000000000..31c232634 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_network_interface_permissions.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. + +// NetworkInterfacePermissions is a nested struct in ecs response +type NetworkInterfacePermissions struct { + NetworkInterfacePermission []NetworkInterfacePermission `json:"NetworkInterfacePermission" xml:"NetworkInterfacePermission"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_network_interface_set.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_network_interface_set.go new file mode 100644 index 000000000..08b10badf --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_network_interface_set.go @@ -0,0 +1,40 @@ +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. + +// NetworkInterfaceSet is a nested struct in ecs response +type NetworkInterfaceSet struct { + NetworkInterfaceId string `json:"NetworkInterfaceId" xml:"NetworkInterfaceId"` + Status string `json:"Status" xml:"Status"` + Type string `json:"Type" xml:"Type"` + VpcId string `json:"VpcId" xml:"VpcId"` + VSwitchId string `json:"VSwitchId" xml:"VSwitchId"` + ZoneId string `json:"ZoneId" xml:"ZoneId"` + PrivateIpAddress string `json:"PrivateIpAddress" xml:"PrivateIpAddress"` + MacAddress string `json:"MacAddress" xml:"MacAddress"` + NetworkInterfaceName string `json:"NetworkInterfaceName" xml:"NetworkInterfaceName"` + Description string `json:"Description" xml:"Description"` + InstanceId string `json:"InstanceId" xml:"InstanceId"` + CreationTime string `json:"CreationTime" xml:"CreationTime"` + ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` + ServiceID int `json:"ServiceID" xml:"ServiceID"` + ServiceManaged bool `json:"ServiceManaged" xml:"ServiceManaged"` + SecurityGroupIds SecurityGroupIdsInDescribeNetworkInterfaces `json:"SecurityGroupIds" xml:"SecurityGroupIds"` + AssociatedPublicIp AssociatedPublicIp `json:"AssociatedPublicIp" xml:"AssociatedPublicIp"` + PrivateIpSets PrivateIpSets `json:"PrivateIpSets" xml:"PrivateIpSets"` + Ipv6Sets Ipv6Sets `json:"Ipv6Sets" xml:"Ipv6Sets"` + Tags TagsInDescribeNetworkInterfaces `json:"Tags" xml:"Tags"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_network_interface_sets.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_network_interface_sets.go new file mode 100644 index 000000000..e62c104a9 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_network_interface_sets.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. + +// NetworkInterfaceSets is a nested struct in ecs response +type NetworkInterfaceSets struct { + NetworkInterfaceSet []NetworkInterfaceSet `json:"NetworkInterfaceSet" xml:"NetworkInterfaceSet"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_network_interfaces_in_describe_instances.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_network_interfaces_in_describe_instances.go new file mode 100644 index 000000000..f506480d2 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_network_interfaces_in_describe_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. + +// NetworkInterfacesInDescribeInstances is a nested struct in ecs response +type NetworkInterfacesInDescribeInstances struct { + NetworkInterface []NetworkInterface `json:"NetworkInterface" xml:"NetworkInterface"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_network_interfaces_in_describe_launch_template_versions.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_network_interfaces_in_describe_launch_template_versions.go new file mode 100644 index 000000000..44e533aaf --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_network_interfaces_in_describe_launch_template_versions.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. + +// NetworkInterfacesInDescribeLaunchTemplateVersions is a nested struct in ecs response +type NetworkInterfacesInDescribeLaunchTemplateVersions struct { + NetworkInterface []NetworkInterface `json:"NetworkInterface" xml:"NetworkInterface"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_network_types_in_describe_recommend_instance_type.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_network_types_in_describe_recommend_instance_type.go new file mode 100644 index 000000000..519a9b639 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_network_types_in_describe_recommend_instance_type.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. + +// NetworkTypesInDescribeRecommendInstanceType is a nested struct in ecs response +type NetworkTypesInDescribeRecommendInstanceType struct { + NetworkType []string `json:"NetworkType" xml:"NetworkType"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_network_types_in_describe_zones.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_network_types_in_describe_zones.go new file mode 100644 index 000000000..383cbf466 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_network_types_in_describe_zones.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. + +// NetworkTypesInDescribeZones is a nested struct in ecs response +type NetworkTypesInDescribeZones struct { + SupportedNetworkCategory []string `json:"supportedNetworkCategory" xml:"supportedNetworkCategory"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_next_hop.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_next_hop.go new file mode 100644 index 000000000..3c20dc24f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_next_hop.go @@ -0,0 +1,24 @@ +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. + +// NextHop is a nested struct in ecs response +type NextHop struct { + NextHopType string `json:"NextHopType" xml:"NextHopType"` + NextHopId string `json:"NextHopId" xml:"NextHopId"` + Enabled int `json:"Enabled" xml:"Enabled"` + Weight int `json:"Weight" xml:"Weight"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_next_hops.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_next_hops.go new file mode 100644 index 000000000..8c89647ab --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_next_hops.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. + +// NextHops is a nested struct in ecs response +type NextHops struct { + NextHop []NextHop `json:"NextHop" xml:"NextHop"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_operation_lock.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_operation_lock.go new file mode 100644 index 000000000..444bcf3fb --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_operation_lock.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. + +// OperationLock is a nested struct in ecs response +type OperationLock struct { + LockReason string `json:"LockReason" xml:"LockReason"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_operation_locks_in_describe_dedicated_hosts.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_operation_locks_in_describe_dedicated_hosts.go new file mode 100644 index 000000000..ea35cd1a1 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_operation_locks_in_describe_dedicated_hosts.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. + +// OperationLocksInDescribeDedicatedHosts is a nested struct in ecs response +type OperationLocksInDescribeDedicatedHosts struct { + OperationLock []OperationLock `json:"OperationLock" xml:"OperationLock"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_operation_locks_in_describe_disks.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_operation_locks_in_describe_disks.go new file mode 100644 index 000000000..a16980368 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_operation_locks_in_describe_disks.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. + +// OperationLocksInDescribeDisks is a nested struct in ecs response +type OperationLocksInDescribeDisks struct { + OperationLock []OperationLock `json:"OperationLock" xml:"OperationLock"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_operation_locks_in_describe_eip_addresses.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_operation_locks_in_describe_eip_addresses.go new file mode 100644 index 000000000..79c313cb6 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_operation_locks_in_describe_eip_addresses.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. + +// OperationLocksInDescribeEipAddresses is a nested struct in ecs response +type OperationLocksInDescribeEipAddresses struct { + LockReason []LockReason `json:"LockReason" xml:"LockReason"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_operation_locks_in_describe_instance_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_operation_locks_in_describe_instance_attribute.go new file mode 100644 index 000000000..29fb7779d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_operation_locks_in_describe_instance_attribute.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. + +// OperationLocksInDescribeInstanceAttribute is a nested struct in ecs response +type OperationLocksInDescribeInstanceAttribute struct { + LockReason []LockReason `json:"LockReason" xml:"LockReason"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_operation_locks_in_describe_instances.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_operation_locks_in_describe_instances.go new file mode 100644 index 000000000..b28abc2fc --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_operation_locks_in_describe_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. + +// OperationLocksInDescribeInstances is a nested struct in ecs response +type OperationLocksInDescribeInstances struct { + LockReason []LockReason `json:"LockReason" xml:"LockReason"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_operation_locks_in_describe_reserved_instances.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_operation_locks_in_describe_reserved_instances.go new file mode 100644 index 000000000..050efdba9 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/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"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_operation_progress.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_operation_progress.go new file mode 100644 index 000000000..61bb990ed --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_operation_progress.go @@ -0,0 +1,24 @@ +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. + +// OperationProgress is a nested struct in ecs response +type OperationProgress struct { + OperationStatus string `json:"OperationStatus" xml:"OperationStatus"` + ErrorCode string `json:"ErrorCode" xml:"ErrorCode"` + ErrorMsg string `json:"ErrorMsg" xml:"ErrorMsg"` + RelatedItemSet RelatedItemSet `json:"RelatedItemSet" xml:"RelatedItemSet"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_operation_progress_set.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_operation_progress_set.go new file mode 100644 index 000000000..142ea4fff --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_operation_progress_set.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. + +// OperationProgressSet is a nested struct in ecs response +type OperationProgressSet struct { + OperationProgress []OperationProgress `json:"OperationProgress" xml:"OperationProgress"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_permission.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_permission.go new file mode 100644 index 000000000..4d69c7800 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_permission.go @@ -0,0 +1,39 @@ +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. + +// Permission is a nested struct in ecs response +type Permission struct { + IpProtocol string `json:"IpProtocol" xml:"IpProtocol"` + PortRange string `json:"PortRange" xml:"PortRange"` + SourcePortRange string `json:"SourcePortRange" xml:"SourcePortRange"` + SourceGroupId string `json:"SourceGroupId" xml:"SourceGroupId"` + SourceGroupName string `json:"SourceGroupName" xml:"SourceGroupName"` + SourceCidrIp string `json:"SourceCidrIp" xml:"SourceCidrIp"` + Ipv6SourceCidrIp string `json:"Ipv6SourceCidrIp" xml:"Ipv6SourceCidrIp"` + Policy string `json:"Policy" xml:"Policy"` + NicType string `json:"NicType" xml:"NicType"` + SourceGroupOwnerAccount string `json:"SourceGroupOwnerAccount" xml:"SourceGroupOwnerAccount"` + DestGroupId string `json:"DestGroupId" xml:"DestGroupId"` + DestGroupName string `json:"DestGroupName" xml:"DestGroupName"` + DestCidrIp string `json:"DestCidrIp" xml:"DestCidrIp"` + Ipv6DestCidrIp string `json:"Ipv6DestCidrIp" xml:"Ipv6DestCidrIp"` + DestGroupOwnerAccount string `json:"DestGroupOwnerAccount" xml:"DestGroupOwnerAccount"` + Priority string `json:"Priority" xml:"Priority"` + Direction string `json:"Direction" xml:"Direction"` + Description string `json:"Description" xml:"Description"` + CreateTime string `json:"CreateTime" xml:"CreateTime"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_permissions.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_permissions.go new file mode 100644 index 000000000..856f7b1ae --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_permissions.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. + +// Permissions is a nested struct in ecs response +type Permissions struct { + Permission []Permission `json:"Permission" xml:"Permission"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_physical_connection_set.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_physical_connection_set.go new file mode 100644 index 000000000..91ec256f0 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_physical_connection_set.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. + +// PhysicalConnectionSet is a nested struct in ecs response +type PhysicalConnectionSet struct { + PhysicalConnectionType []PhysicalConnectionType `json:"PhysicalConnectionType" xml:"PhysicalConnectionType"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_physical_connection_type.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_physical_connection_type.go new file mode 100644 index 000000000..5b79b0d8d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_physical_connection_type.go @@ -0,0 +1,38 @@ +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. + +// PhysicalConnectionType is a nested struct in ecs response +type PhysicalConnectionType struct { + PhysicalConnectionId string `json:"PhysicalConnectionId" xml:"PhysicalConnectionId"` + AccessPointId string `json:"AccessPointId" xml:"AccessPointId"` + Type string `json:"Type" xml:"Type"` + Status string `json:"Status" xml:"Status"` + BusinessStatus string `json:"BusinessStatus" xml:"BusinessStatus"` + CreationTime string `json:"CreationTime" xml:"CreationTime"` + EnabledTime string `json:"EnabledTime" xml:"EnabledTime"` + LineOperator string `json:"LineOperator" xml:"LineOperator"` + Spec string `json:"Spec" xml:"Spec"` + PeerLocation string `json:"PeerLocation" xml:"PeerLocation"` + PortType string `json:"PortType" xml:"PortType"` + RedundantPhysicalConnectionId string `json:"RedundantPhysicalConnectionId" xml:"RedundantPhysicalConnectionId"` + Name string `json:"Name" xml:"Name"` + Description string `json:"Description" xml:"Description"` + AdLocation string `json:"AdLocation" xml:"AdLocation"` + PortNumber string `json:"PortNumber" xml:"PortNumber"` + CircuitCode string `json:"CircuitCode" xml:"CircuitCode"` + Bandwidth int `json:"Bandwidth" xml:"Bandwidth"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_price.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_price.go new file mode 100644 index 000000000..bd142488a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_price.go @@ -0,0 +1,25 @@ +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. + +// Price is a nested struct in ecs response +type Price struct { + DiscountPrice float64 `json:"DiscountPrice" xml:"DiscountPrice"` + TradePrice float64 `json:"TradePrice" xml:"TradePrice"` + OriginalPrice float64 `json:"OriginalPrice" xml:"OriginalPrice"` + Currency string `json:"Currency" xml:"Currency"` + DetailInfos DetailInfosInDescribeRenewalPrice `json:"DetailInfos" xml:"DetailInfos"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_price_info.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_price_info.go new file mode 100644 index 000000000..3e02bfcbe --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_price_info.go @@ -0,0 +1,22 @@ +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. + +// PriceInfo is a nested struct in ecs response +type PriceInfo struct { + Price Price `json:"Price" xml:"Price"` + Rules RulesInDescribeRenewalPrice `json:"Rules" xml:"Rules"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_private_ip_address_in_describe_instance_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_private_ip_address_in_describe_instance_attribute.go new file mode 100644 index 000000000..35554714b --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_private_ip_address_in_describe_instance_attribute.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. + +// PrivateIpAddressInDescribeInstanceAttribute is a nested struct in ecs response +type PrivateIpAddressInDescribeInstanceAttribute struct { + IpAddress []string `json:"IpAddress" xml:"IpAddress"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_private_ip_address_in_describe_instances.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_private_ip_address_in_describe_instances.go new file mode 100644 index 000000000..611be66a1 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_private_ip_address_in_describe_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. + +// PrivateIpAddressInDescribeInstances is a nested struct in ecs response +type PrivateIpAddressInDescribeInstances struct { + IpAddress []string `json:"IpAddress" xml:"IpAddress"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_private_ip_set.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_private_ip_set.go new file mode 100644 index 000000000..9363951aa --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_private_ip_set.go @@ -0,0 +1,23 @@ +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. + +// PrivateIpSet is a nested struct in ecs response +type PrivateIpSet struct { + PrivateIpAddress string `json:"PrivateIpAddress" xml:"PrivateIpAddress"` + Primary bool `json:"Primary" xml:"Primary"` + AssociatedPublicIp AssociatedPublicIp `json:"AssociatedPublicIp" xml:"AssociatedPublicIp"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_private_ip_sets.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_private_ip_sets.go new file mode 100644 index 000000000..412ab9672 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_private_ip_sets.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. + +// PrivateIpSets is a nested struct in ecs response +type PrivateIpSets struct { + PrivateIpSet []PrivateIpSet `json:"PrivateIpSet" xml:"PrivateIpSet"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_public_ip_address_in_describe_instance_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_public_ip_address_in_describe_instance_attribute.go new file mode 100644 index 000000000..22d4a8f5d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_public_ip_address_in_describe_instance_attribute.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. + +// PublicIpAddressInDescribeInstanceAttribute is a nested struct in ecs response +type PublicIpAddressInDescribeInstanceAttribute struct { + IpAddress []string `json:"IpAddress" xml:"IpAddress"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_public_ip_address_in_describe_instances.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_public_ip_address_in_describe_instances.go new file mode 100644 index 000000000..cba813ae3 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_public_ip_address_in_describe_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. + +// PublicIpAddressInDescribeInstances is a nested struct in ecs response +type PublicIpAddressInDescribeInstances struct { + IpAddress []string `json:"IpAddress" xml:"IpAddress"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_public_ip_addresse.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_public_ip_addresse.go new file mode 100644 index 000000000..ea2cd850c --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_public_ip_addresse.go @@ -0,0 +1,22 @@ +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. + +// PublicIpAddresse is a nested struct in ecs response +type PublicIpAddresse struct { + AllocationId string `json:"AllocationId" xml:"AllocationId"` + IpAddress string `json:"IpAddress" xml:"IpAddress"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_public_ip_addresses.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_public_ip_addresses.go new file mode 100644 index 000000000..b7e4c728f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_public_ip_addresses.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. + +// PublicIpAddresses is a nested struct in ecs response +type PublicIpAddresses struct { + PublicIpAddresse []PublicIpAddresse `json:"PublicIpAddresse" xml:"PublicIpAddresse"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_rdma_ip_address.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_rdma_ip_address.go new file mode 100644 index 000000000..0a08e7fe8 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_rdma_ip_address.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. + +// RdmaIpAddress is a nested struct in ecs response +type RdmaIpAddress struct { + IpAddress []string `json:"IpAddress" xml:"IpAddress"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_recommend_instance_type.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_recommend_instance_type.go new file mode 100644 index 000000000..d7f7c3184 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_recommend_instance_type.go @@ -0,0 +1,25 @@ +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. + +// RecommendInstanceType is a nested struct in ecs response +type RecommendInstanceType struct { + RegionNo string `json:"RegionNo" xml:"RegionNo"` + CommodityCode string `json:"CommodityCode" xml:"CommodityCode"` + Scene string `json:"Scene" xml:"Scene"` + InstanceType InstanceType `json:"InstanceType" xml:"InstanceType"` + Zones ZonesInDescribeRecommendInstanceType `json:"Zones" xml:"Zones"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_referencing_security_group.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_referencing_security_group.go new file mode 100644 index 000000000..e57f98b03 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_referencing_security_group.go @@ -0,0 +1,22 @@ +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. + +// ReferencingSecurityGroup is a nested struct in ecs response +type ReferencingSecurityGroup struct { + AliUid string `json:"AliUid" xml:"AliUid"` + SecurityGroupId string `json:"SecurityGroupId" xml:"SecurityGroupId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_referencing_security_groups.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_referencing_security_groups.go new file mode 100644 index 000000000..e73740f1c --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_referencing_security_groups.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. + +// ReferencingSecurityGroups is a nested struct in ecs response +type ReferencingSecurityGroups struct { + ReferencingSecurityGroup []ReferencingSecurityGroup `json:"ReferencingSecurityGroup" xml:"ReferencingSecurityGroup"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_region.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_region.go new file mode 100644 index 000000000..bc8163b6c --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_region.go @@ -0,0 +1,24 @@ +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. + +// Region is a nested struct in ecs response +type Region struct { + RegionId string `json:"RegionId" xml:"RegionId"` + LocalName string `json:"LocalName" xml:"LocalName"` + RegionEndpoint string `json:"RegionEndpoint" xml:"RegionEndpoint"` + Status string `json:"Status" xml:"Status"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_regions.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_regions.go new file mode 100644 index 000000000..e3936d74d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_regions.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. + +// Regions is a nested struct in ecs response +type Regions struct { + Region []Region `json:"Region" xml:"Region"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_related_item.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_related_item.go new file mode 100644 index 000000000..4f3b07130 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_related_item.go @@ -0,0 +1,22 @@ +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. + +// RelatedItem is a nested struct in ecs response +type RelatedItem struct { + Name string `json:"Name" xml:"Name"` + Value string `json:"Value" xml:"Value"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_related_item_set.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_related_item_set.go new file mode 100644 index 000000000..10018fd99 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_related_item_set.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. + +// RelatedItemSet is a nested struct in ecs response +type RelatedItemSet struct { + RelatedItem []RelatedItem `json:"RelatedItem" xml:"RelatedItem"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_reserved_instance.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_reserved_instance.go new file mode 100644 index 000000000..042fd1983 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/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"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_reserved_instance_id_sets_in_modify_reserved_instances.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_reserved_instance_id_sets_in_modify_reserved_instances.go new file mode 100644 index 000000000..9981a279a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/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"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_reserved_instance_id_sets_in_purchase_reserved_instances_offering.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_reserved_instance_id_sets_in_purchase_reserved_instances_offering.go new file mode 100644 index 000000000..be10d5a98 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/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"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_reserved_instances.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_reserved_instances.go new file mode 100644 index 000000000..151e35c7b --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/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"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_resource.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_resource.go new file mode 100644 index 000000000..dc698a2cd --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_resource.go @@ -0,0 +1,23 @@ +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. + +// Resource is a nested struct in ecs response +type Resource struct { + ResourceId string `json:"ResourceId" xml:"ResourceId"` + ResourceType string `json:"ResourceType" xml:"ResourceType"` + RegionId string `json:"RegionId" xml:"RegionId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_resource_price_model.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_resource_price_model.go new file mode 100644 index 000000000..4a86dcb37 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_resource_price_model.go @@ -0,0 +1,25 @@ +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. + +// ResourcePriceModel is a nested struct in ecs response +type ResourcePriceModel struct { + DiscountPrice float64 `json:"DiscountPrice" xml:"DiscountPrice"` + TradePrice float64 `json:"TradePrice" xml:"TradePrice"` + OriginalPrice float64 `json:"OriginalPrice" xml:"OriginalPrice"` + Resource string `json:"Resource" xml:"Resource"` + SubRules SubRulesInDescribeRenewalPrice `json:"SubRules" xml:"SubRules"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_resource_type_count.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_resource_type_count.go new file mode 100644 index 000000000..46b4032af --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_resource_type_count.go @@ -0,0 +1,30 @@ +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. + +// ResourceTypeCount is a nested struct in ecs response +type ResourceTypeCount struct { + Instance int `json:"Instance" xml:"Instance"` + Disk int `json:"Disk" xml:"Disk"` + Volume int `json:"Volume" xml:"Volume"` + Image int `json:"Image" xml:"Image"` + Snapshot int `json:"Snapshot" xml:"Snapshot"` + Securitygroup int `json:"Securitygroup" xml:"Securitygroup"` + LaunchTemplate int `json:"LaunchTemplate" xml:"LaunchTemplate"` + Eni int `json:"Eni" xml:"Eni"` + Ddh int `json:"Ddh" xml:"Ddh"` + KeyPair int `json:"KeyPair" xml:"KeyPair"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_resources.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_resources.go new file mode 100644 index 000000000..1c9913caa --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_resources.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. + +// Resources is a nested struct in ecs response +type Resources struct { + Resource []Resource `json:"Resource" xml:"Resource"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_resources_info.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_resources_info.go new file mode 100644 index 000000000..e2b75116f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_resources_info.go @@ -0,0 +1,27 @@ +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. + +// ResourcesInfo is a nested struct in ecs response +type ResourcesInfo struct { + IoOptimized bool `json:"IoOptimized" xml:"IoOptimized"` + SystemDiskCategories SystemDiskCategories `json:"SystemDiskCategories" xml:"SystemDiskCategories"` + DataDiskCategories DataDiskCategories `json:"DataDiskCategories" xml:"DataDiskCategories"` + NetworkTypes NetworkTypesInDescribeZones `json:"NetworkTypes" xml:"NetworkTypes"` + InstanceTypes InstanceTypesInDescribeZones `json:"InstanceTypes" xml:"InstanceTypes"` + InstanceTypeFamilies InstanceTypeFamiliesInDescribeZones `json:"InstanceTypeFamilies" xml:"InstanceTypeFamilies"` + InstanceGenerations InstanceGenerations `json:"InstanceGenerations" xml:"InstanceGenerations"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_result.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_result.go new file mode 100644 index 000000000..24c16300a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_result.go @@ -0,0 +1,24 @@ +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. + +// Result is a nested struct in ecs response +type Result struct { + Message string `json:"Message" xml:"Message"` + Success string `json:"Success" xml:"Success"` + Code string `json:"Code" xml:"Code"` + InstanceId string `json:"InstanceId" xml:"InstanceId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_results_in_attach_key_pair.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_results_in_attach_key_pair.go new file mode 100644 index 000000000..81c572462 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_results_in_attach_key_pair.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. + +// ResultsInAttachKeyPair is a nested struct in ecs response +type ResultsInAttachKeyPair struct { + Result []Result `json:"Result" xml:"Result"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_results_in_detach_key_pair.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_results_in_detach_key_pair.go new file mode 100644 index 000000000..bf35b8d82 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_results_in_detach_key_pair.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. + +// ResultsInDetachKeyPair is a nested struct in ecs response +type ResultsInDetachKeyPair struct { + Result []Result `json:"Result" xml:"Result"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_route_entry.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_route_entry.go new file mode 100644 index 000000000..762a150e5 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_route_entry.go @@ -0,0 +1,27 @@ +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. + +// RouteEntry is a nested struct in ecs response +type RouteEntry struct { + RouteTableId string `json:"RouteTableId" xml:"RouteTableId"` + DestinationCidrBlock string `json:"DestinationCidrBlock" xml:"DestinationCidrBlock"` + Type string `json:"Type" xml:"Type"` + Status string `json:"Status" xml:"Status"` + InstanceId string `json:"InstanceId" xml:"InstanceId"` + NextHopType string `json:"NextHopType" xml:"NextHopType"` + NextHops NextHops `json:"NextHops" xml:"NextHops"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_route_entrys.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_route_entrys.go new file mode 100644 index 000000000..28b4da2b4 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_route_entrys.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. + +// RouteEntrys is a nested struct in ecs response +type RouteEntrys struct { + RouteEntry []RouteEntry `json:"RouteEntry" xml:"RouteEntry"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_route_table.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_route_table.go new file mode 100644 index 000000000..27e0571a6 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_route_table.go @@ -0,0 +1,26 @@ +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. + +// RouteTable is a nested struct in ecs response +type RouteTable struct { + VRouterId string `json:"VRouterId" xml:"VRouterId"` + RouteTableId string `json:"RouteTableId" xml:"RouteTableId"` + RouteTableType string `json:"RouteTableType" xml:"RouteTableType"` + CreationTime string `json:"CreationTime" xml:"CreationTime"` + ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` + RouteEntrys RouteEntrys `json:"RouteEntrys" xml:"RouteEntrys"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_route_table_ids.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_route_table_ids.go new file mode 100644 index 000000000..1114be1a1 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_route_table_ids.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. + +// RouteTableIds is a nested struct in ecs response +type RouteTableIds struct { + RouteTableId []string `json:"RouteTableId" xml:"RouteTableId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_route_tables.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_route_tables.go new file mode 100644 index 000000000..bf350f225 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_route_tables.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. + +// RouteTables is a nested struct in ecs response +type RouteTables struct { + RouteTable []RouteTable `json:"RouteTable" xml:"RouteTable"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_router_interface_set.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_router_interface_set.go new file mode 100644 index 000000000..ef8db99d7 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_router_interface_set.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. + +// RouterInterfaceSet is a nested struct in ecs response +type RouterInterfaceSet struct { + RouterInterfaceType []RouterInterfaceType `json:"RouterInterfaceType" xml:"RouterInterfaceType"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_router_interface_type.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_router_interface_type.go new file mode 100644 index 000000000..7527601ec --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_router_interface_type.go @@ -0,0 +1,45 @@ +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. + +// RouterInterfaceType is a nested struct in ecs response +type RouterInterfaceType struct { + RouterInterfaceId string `json:"RouterInterfaceId" xml:"RouterInterfaceId"` + OppositeRegionId string `json:"OppositeRegionId" xml:"OppositeRegionId"` + Role string `json:"Role" xml:"Role"` + Spec string `json:"Spec" xml:"Spec"` + Name string `json:"Name" xml:"Name"` + Description string `json:"Description" xml:"Description"` + RouterId string `json:"RouterId" xml:"RouterId"` + RouterType string `json:"RouterType" xml:"RouterType"` + CreationTime string `json:"CreationTime" xml:"CreationTime"` + EndTime string `json:"EndTime" xml:"EndTime"` + ChargeType string `json:"ChargeType" xml:"ChargeType"` + Status string `json:"Status" xml:"Status"` + BusinessStatus string `json:"BusinessStatus" xml:"BusinessStatus"` + ConnectedTime string `json:"ConnectedTime" xml:"ConnectedTime"` + OppositeInterfaceId string `json:"OppositeInterfaceId" xml:"OppositeInterfaceId"` + OppositeInterfaceSpec string `json:"OppositeInterfaceSpec" xml:"OppositeInterfaceSpec"` + OppositeInterfaceStatus string `json:"OppositeInterfaceStatus" xml:"OppositeInterfaceStatus"` + OppositeInterfaceBusinessStatus string `json:"OppositeInterfaceBusinessStatus" xml:"OppositeInterfaceBusinessStatus"` + OppositeRouterId string `json:"OppositeRouterId" xml:"OppositeRouterId"` + OppositeRouterType string `json:"OppositeRouterType" xml:"OppositeRouterType"` + OppositeInterfaceOwnerId string `json:"OppositeInterfaceOwnerId" xml:"OppositeInterfaceOwnerId"` + AccessPointId string `json:"AccessPointId" xml:"AccessPointId"` + OppositeAccessPointId string `json:"OppositeAccessPointId" xml:"OppositeAccessPointId"` + HealthCheckSourceIp string `json:"HealthCheckSourceIp" xml:"HealthCheckSourceIp"` + HealthCheckTargetIp string `json:"HealthCheckTargetIp" xml:"HealthCheckTargetIp"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_rule.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_rule.go new file mode 100644 index 000000000..7e373b4e6 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_rule.go @@ -0,0 +1,22 @@ +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. + +// Rule is a nested struct in ecs response +type Rule struct { + RuleId int `json:"RuleId" xml:"RuleId"` + Description string `json:"Description" xml:"Description"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_rules_in_describe_price.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_rules_in_describe_price.go new file mode 100644 index 000000000..7bba40644 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_rules_in_describe_price.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. + +// RulesInDescribePrice is a nested struct in ecs response +type RulesInDescribePrice struct { + Rule []Rule `json:"Rule" xml:"Rule"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_rules_in_describe_renewal_price.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_rules_in_describe_renewal_price.go new file mode 100644 index 000000000..d6dd4e4e3 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_rules_in_describe_renewal_price.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. + +// RulesInDescribeRenewalPrice is a nested struct in ecs response +type RulesInDescribeRenewalPrice struct { + Rule []Rule `json:"Rule" xml:"Rule"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_scheduled_system_event_set.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_scheduled_system_event_set.go new file mode 100644 index 000000000..6ca521d5a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_scheduled_system_event_set.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. + +// ScheduledSystemEventSet is a nested struct in ecs response +type ScheduledSystemEventSet struct { + ScheduledSystemEventType []ScheduledSystemEventType `json:"ScheduledSystemEventType" xml:"ScheduledSystemEventType"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_scheduled_system_event_type.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_scheduled_system_event_type.go new file mode 100644 index 000000000..da79d82e8 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_scheduled_system_event_type.go @@ -0,0 +1,26 @@ +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. + +// ScheduledSystemEventType is a nested struct in ecs response +type ScheduledSystemEventType struct { + EventId string `json:"EventId" xml:"EventId"` + EventPublishTime string `json:"EventPublishTime" xml:"EventPublishTime"` + NotBefore string `json:"NotBefore" xml:"NotBefore"` + EventCycleStatus EventCycleStatus `json:"EventCycleStatus" xml:"EventCycleStatus"` + EventType EventType `json:"EventType" xml:"EventType"` + ExtendedAttribute ExtendedAttribute `json:"ExtendedAttribute" xml:"ExtendedAttribute"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_security_group.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_security_group.go new file mode 100644 index 000000000..02f9e46ad --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_security_group.go @@ -0,0 +1,29 @@ +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. + +// SecurityGroup is a nested struct in ecs response +type SecurityGroup struct { + SecurityGroupId string `json:"SecurityGroupId" xml:"SecurityGroupId"` + Description string `json:"Description" xml:"Description"` + SecurityGroupName string `json:"SecurityGroupName" xml:"SecurityGroupName"` + VpcId string `json:"VpcId" xml:"VpcId"` + CreationTime string `json:"CreationTime" xml:"CreationTime"` + AvailableInstanceAmount int `json:"AvailableInstanceAmount" xml:"AvailableInstanceAmount"` + EcsCount int `json:"EcsCount" xml:"EcsCount"` + ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` + Tags TagsInDescribeSecurityGroups `json:"Tags" xml:"Tags"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_security_group_ids_in_describe_instance_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_security_group_ids_in_describe_instance_attribute.go new file mode 100644 index 000000000..8e7041910 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_security_group_ids_in_describe_instance_attribute.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. + +// SecurityGroupIdsInDescribeInstanceAttribute is a nested struct in ecs response +type SecurityGroupIdsInDescribeInstanceAttribute struct { + SecurityGroupId []string `json:"SecurityGroupId" xml:"SecurityGroupId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_security_group_ids_in_describe_instances.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_security_group_ids_in_describe_instances.go new file mode 100644 index 000000000..6dd94eec3 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_security_group_ids_in_describe_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. + +// SecurityGroupIdsInDescribeInstances is a nested struct in ecs response +type SecurityGroupIdsInDescribeInstances struct { + SecurityGroupId []string `json:"SecurityGroupId" xml:"SecurityGroupId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_security_group_ids_in_describe_network_interfaces.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_security_group_ids_in_describe_network_interfaces.go new file mode 100644 index 000000000..9d8b4e89d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_security_group_ids_in_describe_network_interfaces.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. + +// SecurityGroupIdsInDescribeNetworkInterfaces is a nested struct in ecs response +type SecurityGroupIdsInDescribeNetworkInterfaces struct { + SecurityGroupId []string `json:"SecurityGroupId" xml:"SecurityGroupId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_security_group_reference.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_security_group_reference.go new file mode 100644 index 000000000..0f850aed1 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_security_group_reference.go @@ -0,0 +1,22 @@ +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. + +// SecurityGroupReference is a nested struct in ecs response +type SecurityGroupReference struct { + SecurityGroupId string `json:"SecurityGroupId" xml:"SecurityGroupId"` + ReferencingSecurityGroups ReferencingSecurityGroups `json:"ReferencingSecurityGroups" xml:"ReferencingSecurityGroups"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_security_group_references.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_security_group_references.go new file mode 100644 index 000000000..18b76b778 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_security_group_references.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. + +// SecurityGroupReferences is a nested struct in ecs response +type SecurityGroupReferences struct { + SecurityGroupReference []SecurityGroupReference `json:"SecurityGroupReference" xml:"SecurityGroupReference"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_security_groups.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_security_groups.go new file mode 100644 index 000000000..45804349a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_security_groups.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. + +// SecurityGroups is a nested struct in ecs response +type SecurityGroups struct { + SecurityGroup []SecurityGroup `json:"SecurityGroup" xml:"SecurityGroup"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_share_group.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_share_group.go new file mode 100644 index 000000000..c7b088cfd --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_share_group.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. + +// ShareGroup is a nested struct in ecs response +type ShareGroup struct { + Group string `json:"Group" xml:"Group"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_share_groups.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_share_groups.go new file mode 100644 index 000000000..e78995415 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_share_groups.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. + +// ShareGroups is a nested struct in ecs response +type ShareGroups struct { + ShareGroup []ShareGroup `json:"ShareGroup" xml:"ShareGroup"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_snapshot.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_snapshot.go new file mode 100644 index 000000000..76eb0cad3 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_snapshot.go @@ -0,0 +1,38 @@ +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. + +// Snapshot is a nested struct in ecs response +type Snapshot struct { + SnapshotId string `json:"SnapshotId" xml:"SnapshotId"` + SnapshotName string `json:"SnapshotName" xml:"SnapshotName"` + Progress string `json:"Progress" xml:"Progress"` + ProductCode string `json:"ProductCode" xml:"ProductCode"` + SourceDiskId string `json:"SourceDiskId" xml:"SourceDiskId"` + SourceDiskType string `json:"SourceDiskType" xml:"SourceDiskType"` + RetentionDays int `json:"RetentionDays" xml:"RetentionDays"` + Encrypted bool `json:"Encrypted" xml:"Encrypted"` + SourceDiskSize string `json:"SourceDiskSize" xml:"SourceDiskSize"` + Description string `json:"Description" xml:"Description"` + CreationTime string `json:"CreationTime" xml:"CreationTime"` + Status string `json:"Status" xml:"Status"` + Usage string `json:"Usage" xml:"Usage"` + SourceStorageType string `json:"SourceStorageType" xml:"SourceStorageType"` + RemainTime int `json:"RemainTime" xml:"RemainTime"` + ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` + KMSKeyId string `json:"KMSKeyId" xml:"KMSKeyId"` + Tags TagsInDescribeSnapshots `json:"Tags" xml:"Tags"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_snapshot_link.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_snapshot_link.go new file mode 100644 index 000000000..5ab4ea0aa --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_snapshot_link.go @@ -0,0 +1,30 @@ +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. + +// SnapshotLink is a nested struct in ecs response +type SnapshotLink struct { + SnapshotLinkId string `json:"SnapshotLinkId" xml:"SnapshotLinkId"` + RegionId string `json:"RegionId" xml:"RegionId"` + InstanceId string `json:"InstanceId" xml:"InstanceId"` + InstanceName string `json:"InstanceName" xml:"InstanceName"` + SourceDiskId string `json:"SourceDiskId" xml:"SourceDiskId"` + SourceDiskName string `json:"SourceDiskName" xml:"SourceDiskName"` + SourceDiskSize int `json:"SourceDiskSize" xml:"SourceDiskSize"` + SourceDiskType string `json:"SourceDiskType" xml:"SourceDiskType"` + TotalSize int `json:"TotalSize" xml:"TotalSize"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_snapshot_links.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_snapshot_links.go new file mode 100644 index 000000000..0c2e558f3 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_snapshot_links.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. + +// SnapshotLinks is a nested struct in ecs response +type SnapshotLinks struct { + SnapshotLink []SnapshotLink `json:"SnapshotLink" xml:"SnapshotLink"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_snapshot_package.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_snapshot_package.go new file mode 100644 index 000000000..dfd78eb09 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_snapshot_package.go @@ -0,0 +1,24 @@ +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. + +// SnapshotPackage is a nested struct in ecs response +type SnapshotPackage struct { + StartTime string `json:"StartTime" xml:"StartTime"` + EndTime string `json:"EndTime" xml:"EndTime"` + InitCapacity int `json:"InitCapacity" xml:"InitCapacity"` + DisplayName string `json:"DisplayName" xml:"DisplayName"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_snapshot_packages.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_snapshot_packages.go new file mode 100644 index 000000000..35f485c60 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_snapshot_packages.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. + +// SnapshotPackages is a nested struct in ecs response +type SnapshotPackages struct { + SnapshotPackage []SnapshotPackage `json:"SnapshotPackage" xml:"SnapshotPackage"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_snapshots.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_snapshots.go new file mode 100644 index 000000000..9f6f40b3b --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_snapshots.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. + +// Snapshots is a nested struct in ecs response +type Snapshots struct { + Snapshot []Snapshot `json:"Snapshot" xml:"Snapshot"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_spot_price_type.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_spot_price_type.go new file mode 100644 index 000000000..093c72a3f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_spot_price_type.go @@ -0,0 +1,27 @@ +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. + +// SpotPriceType is a nested struct in ecs response +type SpotPriceType struct { + ZoneId string `json:"ZoneId" xml:"ZoneId"` + InstanceType string `json:"InstanceType" xml:"InstanceType"` + IoOptimized string `json:"IoOptimized" xml:"IoOptimized"` + Timestamp string `json:"Timestamp" xml:"Timestamp"` + NetworkType string `json:"NetworkType" xml:"NetworkType"` + SpotPrice float64 `json:"SpotPrice" xml:"SpotPrice"` + OriginPrice float64 `json:"OriginPrice" xml:"OriginPrice"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_spot_prices.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_spot_prices.go new file mode 100644 index 000000000..31353f593 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_spot_prices.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. + +// SpotPrices is a nested struct in ecs response +type SpotPrices struct { + SpotPriceType []SpotPriceType `json:"SpotPriceType" xml:"SpotPriceType"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_status.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_status.go new file mode 100644 index 000000000..a7de48500 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_status.go @@ -0,0 +1,22 @@ +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. + +// Status is a nested struct in ecs response +type Status struct { + Name string `json:"Name" xml:"Name"` + Code int `json:"Code" xml:"Code"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_sub_rules_in_describe_price.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_sub_rules_in_describe_price.go new file mode 100644 index 000000000..ba5579abc --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_sub_rules_in_describe_price.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. + +// SubRulesInDescribePrice is a nested struct in ecs response +type SubRulesInDescribePrice struct { + Rule []Rule `json:"Rule" xml:"Rule"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_sub_rules_in_describe_renewal_price.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_sub_rules_in_describe_renewal_price.go new file mode 100644 index 000000000..b17707abb --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_sub_rules_in_describe_renewal_price.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. + +// SubRulesInDescribeRenewalPrice is a nested struct in ecs response +type SubRulesInDescribeRenewalPrice struct { + Rule []Rule `json:"Rule" xml:"Rule"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_supply_info.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_supply_info.go new file mode 100644 index 000000000..b8003c5ef --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_supply_info.go @@ -0,0 +1,24 @@ +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. + +// SupplyInfo is a nested struct in ecs response +type SupplyInfo struct { + Amount int `json:"Amount" xml:"Amount"` + SupplyStatus string `json:"SupplyStatus" xml:"SupplyStatus"` + SupplyStartTime string `json:"SupplyStartTime" xml:"SupplyStartTime"` + SupplyEndTime string `json:"SupplyEndTime" xml:"SupplyEndTime"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_supply_infos.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_supply_infos.go new file mode 100644 index 000000000..f4525360d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_supply_infos.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. + +// SupplyInfos is a nested struct in ecs response +type SupplyInfos struct { + SupplyInfo []SupplyInfo `json:"SupplyInfo" xml:"SupplyInfo"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_supported_instance_type_families_in_describe_dedicated_host_types.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_supported_instance_type_families_in_describe_dedicated_host_types.go new file mode 100644 index 000000000..cf7c72326 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_supported_instance_type_families_in_describe_dedicated_host_types.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. + +// SupportedInstanceTypeFamiliesInDescribeDedicatedHostTypes is a nested struct in ecs response +type SupportedInstanceTypeFamiliesInDescribeDedicatedHostTypes struct { + SupportedInstanceTypeFamily []string `json:"SupportedInstanceTypeFamily" xml:"SupportedInstanceTypeFamily"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_supported_instance_type_families_in_describe_dedicated_hosts.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_supported_instance_type_families_in_describe_dedicated_hosts.go new file mode 100644 index 000000000..06e07b0bf --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_supported_instance_type_families_in_describe_dedicated_hosts.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. + +// SupportedInstanceTypeFamiliesInDescribeDedicatedHosts is a nested struct in ecs response +type SupportedInstanceTypeFamiliesInDescribeDedicatedHosts struct { + SupportedInstanceTypeFamily []string `json:"SupportedInstanceTypeFamily" xml:"SupportedInstanceTypeFamily"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_supported_instance_types_list_in_describe_dedicated_host_types.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_supported_instance_types_list_in_describe_dedicated_host_types.go new file mode 100644 index 000000000..0af514efd --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_supported_instance_types_list_in_describe_dedicated_host_types.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. + +// SupportedInstanceTypesListInDescribeDedicatedHostTypes is a nested struct in ecs response +type SupportedInstanceTypesListInDescribeDedicatedHostTypes struct { + SupportedInstanceTypesList []string `json:"SupportedInstanceTypesList" xml:"SupportedInstanceTypesList"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_supported_instance_types_list_in_describe_dedicated_hosts.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_supported_instance_types_list_in_describe_dedicated_hosts.go new file mode 100644 index 000000000..cd1489de8 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_supported_instance_types_list_in_describe_dedicated_hosts.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. + +// SupportedInstanceTypesListInDescribeDedicatedHosts is a nested struct in ecs response +type SupportedInstanceTypesListInDescribeDedicatedHosts struct { + SupportedInstanceTypesList []string `json:"SupportedInstanceTypesList" xml:"SupportedInstanceTypesList"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_supported_resource.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_supported_resource.go new file mode 100644 index 000000000..bb9fb5c37 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_supported_resource.go @@ -0,0 +1,26 @@ +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. + +// SupportedResource is a nested struct in ecs response +type SupportedResource struct { + Value string `json:"Value" xml:"Value"` + Max int `json:"Max" xml:"Max"` + Unit string `json:"Unit" xml:"Unit"` + StatusCategory string `json:"StatusCategory" xml:"StatusCategory"` + Status string `json:"Status" xml:"Status"` + Min int `json:"Min" xml:"Min"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_supported_resources_in_describe_available_resource.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_supported_resources_in_describe_available_resource.go new file mode 100644 index 000000000..e5f766832 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_supported_resources_in_describe_available_resource.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. + +// SupportedResourcesInDescribeAvailableResource is a nested struct in ecs response +type SupportedResourcesInDescribeAvailableResource struct { + SupportedResource []SupportedResource `json:"SupportedResource" xml:"SupportedResource"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_supported_resources_in_describe_resources_modification.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_supported_resources_in_describe_resources_modification.go new file mode 100644 index 000000000..a5d54318b --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_supported_resources_in_describe_resources_modification.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. + +// SupportedResourcesInDescribeResourcesModification is a nested struct in ecs response +type SupportedResourcesInDescribeResourcesModification struct { + SupportedResource []SupportedResource `json:"SupportedResource" xml:"SupportedResource"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_system_disk_categories.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_system_disk_categories.go new file mode 100644 index 000000000..be22e6923 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_system_disk_categories.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. + +// SystemDiskCategories is a nested struct in ecs response +type SystemDiskCategories struct { + SupportedSystemDiskCategory []string `json:"supportedSystemDiskCategory" xml:"supportedSystemDiskCategory"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_tag.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_tag.go new file mode 100644 index 000000000..00d617b3c --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_tag.go @@ -0,0 +1,23 @@ +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. + +// Tag is a nested struct in ecs response +type Tag struct { + TagValue string `json:"TagValue" xml:"TagValue"` + TagKey string `json:"TagKey" xml:"TagKey"` + ResourceTypeCount ResourceTypeCount `json:"ResourceTypeCount" xml:"ResourceTypeCount"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_tag_resource.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_tag_resource.go new file mode 100644 index 000000000..c2a94e915 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_tag_resource.go @@ -0,0 +1,24 @@ +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. + +// TagResource is a nested struct in ecs response +type TagResource struct { + ResourceType string `json:"ResourceType" xml:"ResourceType"` + ResourceId string `json:"ResourceId" xml:"ResourceId"` + TagKey string `json:"TagKey" xml:"TagKey"` + TagValue string `json:"TagValue" xml:"TagValue"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_tag_resources.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_tag_resources.go new file mode 100644 index 000000000..12ec529a6 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_tag_resources.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. + +// TagResources is a nested struct in ecs response +type TagResources struct { + TagResource []TagResource `json:"TagResource" xml:"TagResource"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_tags_in_describe_dedicated_hosts.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_tags_in_describe_dedicated_hosts.go new file mode 100644 index 000000000..473aa6e19 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_tags_in_describe_dedicated_hosts.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. + +// TagsInDescribeDedicatedHosts is a nested struct in ecs response +type TagsInDescribeDedicatedHosts struct { + Tag []Tag `json:"Tag" xml:"Tag"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_tags_in_describe_disks.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_tags_in_describe_disks.go new file mode 100644 index 000000000..c9acca81b --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_tags_in_describe_disks.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. + +// TagsInDescribeDisks is a nested struct in ecs response +type TagsInDescribeDisks struct { + Tag []Tag `json:"Tag" xml:"Tag"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_tags_in_describe_images.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_tags_in_describe_images.go new file mode 100644 index 000000000..a06db5b3e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_tags_in_describe_images.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. + +// TagsInDescribeImages is a nested struct in ecs response +type TagsInDescribeImages struct { + Tag []Tag `json:"Tag" xml:"Tag"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_tags_in_describe_instances.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_tags_in_describe_instances.go new file mode 100644 index 000000000..7eeb27b94 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_tags_in_describe_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. + +// TagsInDescribeInstances is a nested struct in ecs response +type TagsInDescribeInstances struct { + Tag []Tag `json:"Tag" xml:"Tag"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_tags_in_describe_key_pairs.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_tags_in_describe_key_pairs.go new file mode 100644 index 000000000..a153d220d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_tags_in_describe_key_pairs.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. + +// TagsInDescribeKeyPairs is a nested struct in ecs response +type TagsInDescribeKeyPairs struct { + Tag []Tag `json:"Tag" xml:"Tag"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_tags_in_describe_launch_template_versions.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_tags_in_describe_launch_template_versions.go new file mode 100644 index 000000000..87f733aab --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_tags_in_describe_launch_template_versions.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. + +// TagsInDescribeLaunchTemplateVersions is a nested struct in ecs response +type TagsInDescribeLaunchTemplateVersions struct { + InstanceTag []InstanceTag `json:"InstanceTag" xml:"InstanceTag"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_tags_in_describe_launch_templates.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_tags_in_describe_launch_templates.go new file mode 100644 index 000000000..33dc2bd1f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_tags_in_describe_launch_templates.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. + +// TagsInDescribeLaunchTemplates is a nested struct in ecs response +type TagsInDescribeLaunchTemplates struct { + Tag []Tag `json:"Tag" xml:"Tag"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_tags_in_describe_network_interfaces.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_tags_in_describe_network_interfaces.go new file mode 100644 index 000000000..a93e4bb61 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_tags_in_describe_network_interfaces.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. + +// TagsInDescribeNetworkInterfaces is a nested struct in ecs response +type TagsInDescribeNetworkInterfaces struct { + Tag []Tag `json:"Tag" xml:"Tag"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_tags_in_describe_security_groups.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_tags_in_describe_security_groups.go new file mode 100644 index 000000000..7182eed76 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_tags_in_describe_security_groups.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. + +// TagsInDescribeSecurityGroups is a nested struct in ecs response +type TagsInDescribeSecurityGroups struct { + Tag []Tag `json:"Tag" xml:"Tag"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_tags_in_describe_snapshots.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_tags_in_describe_snapshots.go new file mode 100644 index 000000000..7843d93a3 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_tags_in_describe_snapshots.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. + +// TagsInDescribeSnapshots is a nested struct in ecs response +type TagsInDescribeSnapshots struct { + Tag []Tag `json:"Tag" xml:"Tag"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_tags_in_describe_tags.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_tags_in_describe_tags.go new file mode 100644 index 000000000..d7d898c03 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_tags_in_describe_tags.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. + +// TagsInDescribeTags is a nested struct in ecs response +type TagsInDescribeTags struct { + Tag []Tag `json:"Tag" xml:"Tag"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_task.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_task.go new file mode 100644 index 000000000..ff4fdb63a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_task.go @@ -0,0 +1,26 @@ +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. + +// Task is a nested struct in ecs response +type Task struct { + TaskId string `json:"TaskId" xml:"TaskId"` + TaskAction string `json:"TaskAction" xml:"TaskAction"` + TaskStatus string `json:"TaskStatus" xml:"TaskStatus"` + SupportCancel string `json:"SupportCancel" xml:"SupportCancel"` + CreationTime string `json:"CreationTime" xml:"CreationTime"` + FinishedTime string `json:"FinishedTime" xml:"FinishedTime"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_task_set.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_task_set.go new file mode 100644 index 000000000..8449f6a58 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_task_set.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. + +// TaskSet is a nested struct in ecs response +type TaskSet struct { + Task []Task `json:"Task" xml:"Task"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_topology.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_topology.go new file mode 100644 index 000000000..dd5d26976 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_topology.go @@ -0,0 +1,22 @@ +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. + +// Topology is a nested struct in ecs response +type Topology struct { + InstanceId string `json:"InstanceId" xml:"InstanceId"` + HostId string `json:"HostId" xml:"HostId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_topologys.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_topologys.go new file mode 100644 index 000000000..575e0de73 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_topologys.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. + +// Topologys is a nested struct in ecs response +type Topologys struct { + Topology []Topology `json:"Topology" xml:"Topology"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_user_cidrs.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_user_cidrs.go new file mode 100644 index 000000000..2d79296de --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_user_cidrs.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. + +// UserCidrs is a nested struct in ecs response +type UserCidrs struct { + UserCidr []string `json:"UserCidr" xml:"UserCidr"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_v_router.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_v_router.go new file mode 100644 index 000000000..383343e87 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_v_router.go @@ -0,0 +1,27 @@ +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. + +// VRouter is a nested struct in ecs response +type VRouter struct { + RegionId string `json:"RegionId" xml:"RegionId"` + VpcId string `json:"VpcId" xml:"VpcId"` + VRouterName string `json:"VRouterName" xml:"VRouterName"` + Description string `json:"Description" xml:"Description"` + VRouterId string `json:"VRouterId" xml:"VRouterId"` + CreationTime string `json:"CreationTime" xml:"CreationTime"` + RouteTableIds RouteTableIds `json:"RouteTableIds" xml:"RouteTableIds"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_v_routers.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_v_routers.go new file mode 100644 index 000000000..fe485726b --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_v_routers.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. + +// VRouters is a nested struct in ecs response +type VRouters struct { + VRouter []VRouter `json:"VRouter" xml:"VRouter"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_v_switch.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_v_switch.go new file mode 100644 index 000000000..f360e42d1 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_v_switch.go @@ -0,0 +1,31 @@ +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. + +// VSwitch is a nested struct in ecs response +type VSwitch struct { + VSwitchId string `json:"VSwitchId" xml:"VSwitchId"` + VpcId string `json:"VpcId" xml:"VpcId"` + Status string `json:"Status" xml:"Status"` + CidrBlock string `json:"CidrBlock" xml:"CidrBlock"` + ZoneId string `json:"ZoneId" xml:"ZoneId"` + AvailableIpAddressCount int `json:"AvailableIpAddressCount" xml:"AvailableIpAddressCount"` + Description string `json:"Description" xml:"Description"` + VSwitchName string `json:"VSwitchName" xml:"VSwitchName"` + CreationTime string `json:"CreationTime" xml:"CreationTime"` + IsDefault bool `json:"IsDefault" xml:"IsDefault"` + ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_v_switch_ids.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_v_switch_ids.go new file mode 100644 index 000000000..5a2ab914c --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_v_switch_ids.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. + +// VSwitchIds is a nested struct in ecs response +type VSwitchIds struct { + VSwitchId []string `json:"VSwitchId" xml:"VSwitchId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_v_switches.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_v_switches.go new file mode 100644 index 000000000..b5e2d544d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_v_switches.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. + +// VSwitches is a nested struct in ecs response +type VSwitches struct { + VSwitch []VSwitch `json:"VSwitch" xml:"VSwitch"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_value_item.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_value_item.go new file mode 100644 index 000000000..4653ef03c --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_value_item.go @@ -0,0 +1,26 @@ +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. + +// ValueItem is a nested struct in ecs response +type ValueItem struct { + Value string `json:"Value" xml:"Value"` + ExpiredTime string `json:"ExpiredTime" xml:"ExpiredTime"` + ZoneId string `json:"ZoneId" xml:"ZoneId"` + InstanceChargeType string `json:"InstanceChargeType" xml:"InstanceChargeType"` + InstanceType string `json:"InstanceType" xml:"InstanceType"` + Count int `json:"Count" xml:"Count"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_virtual_border_router_for_physical_connection_set.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_virtual_border_router_for_physical_connection_set.go new file mode 100644 index 000000000..5b98c2b4d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_virtual_border_router_for_physical_connection_set.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. + +// VirtualBorderRouterForPhysicalConnectionSet is a nested struct in ecs response +type VirtualBorderRouterForPhysicalConnectionSet struct { + VirtualBorderRouterForPhysicalConnectionType []VirtualBorderRouterForPhysicalConnectionType `json:"VirtualBorderRouterForPhysicalConnectionType" xml:"VirtualBorderRouterForPhysicalConnectionType"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_virtual_border_router_for_physical_connection_type.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_virtual_border_router_for_physical_connection_type.go new file mode 100644 index 000000000..d516e65c7 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_virtual_border_router_for_physical_connection_type.go @@ -0,0 +1,28 @@ +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. + +// VirtualBorderRouterForPhysicalConnectionType is a nested struct in ecs response +type VirtualBorderRouterForPhysicalConnectionType struct { + VbrId string `json:"VbrId" xml:"VbrId"` + VbrOwnerUid int `json:"VbrOwnerUid" xml:"VbrOwnerUid"` + CreationTime string `json:"CreationTime" xml:"CreationTime"` + ActivationTime string `json:"ActivationTime" xml:"ActivationTime"` + TerminationTime string `json:"TerminationTime" xml:"TerminationTime"` + RecoveryTime string `json:"RecoveryTime" xml:"RecoveryTime"` + VlanId int `json:"VlanId" xml:"VlanId"` + CircuitCode string `json:"CircuitCode" xml:"CircuitCode"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_virtual_border_router_set.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_virtual_border_router_set.go new file mode 100644 index 000000000..22a29cde2 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_virtual_border_router_set.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. + +// VirtualBorderRouterSet is a nested struct in ecs response +type VirtualBorderRouterSet struct { + VirtualBorderRouterType []VirtualBorderRouterType `json:"VirtualBorderRouterType" xml:"VirtualBorderRouterType"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_virtual_border_router_type.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_virtual_border_router_type.go new file mode 100644 index 000000000..6ae23090e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_virtual_border_router_type.go @@ -0,0 +1,40 @@ +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. + +// VirtualBorderRouterType is a nested struct in ecs response +type VirtualBorderRouterType struct { + VbrId string `json:"VbrId" xml:"VbrId"` + CreationTime string `json:"CreationTime" xml:"CreationTime"` + ActivationTime string `json:"ActivationTime" xml:"ActivationTime"` + TerminationTime string `json:"TerminationTime" xml:"TerminationTime"` + RecoveryTime string `json:"RecoveryTime" xml:"RecoveryTime"` + Status string `json:"Status" xml:"Status"` + VlanId int `json:"VlanId" xml:"VlanId"` + CircuitCode string `json:"CircuitCode" xml:"CircuitCode"` + RouteTableId string `json:"RouteTableId" xml:"RouteTableId"` + VlanInterfaceId string `json:"VlanInterfaceId" xml:"VlanInterfaceId"` + LocalGatewayIp string `json:"LocalGatewayIp" xml:"LocalGatewayIp"` + PeerGatewayIp string `json:"PeerGatewayIp" xml:"PeerGatewayIp"` + PeeringSubnetMask string `json:"PeeringSubnetMask" xml:"PeeringSubnetMask"` + PhysicalConnectionId string `json:"PhysicalConnectionId" xml:"PhysicalConnectionId"` + PhysicalConnectionStatus string `json:"PhysicalConnectionStatus" xml:"PhysicalConnectionStatus"` + PhysicalConnectionBusinessStatus string `json:"PhysicalConnectionBusinessStatus" xml:"PhysicalConnectionBusinessStatus"` + PhysicalConnectionOwnerUid string `json:"PhysicalConnectionOwnerUid" xml:"PhysicalConnectionOwnerUid"` + AccessPointId string `json:"AccessPointId" xml:"AccessPointId"` + Name string `json:"Name" xml:"Name"` + Description string `json:"Description" xml:"Description"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_vpc.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_vpc.go new file mode 100644 index 000000000..d9cd890d2 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_vpc.go @@ -0,0 +1,31 @@ +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. + +// Vpc is a nested struct in ecs response +type Vpc struct { + VpcId string `json:"VpcId" xml:"VpcId"` + RegionId string `json:"RegionId" xml:"RegionId"` + Status string `json:"Status" xml:"Status"` + VpcName string `json:"VpcName" xml:"VpcName"` + CreationTime string `json:"CreationTime" xml:"CreationTime"` + CidrBlock string `json:"CidrBlock" xml:"CidrBlock"` + VRouterId string `json:"VRouterId" xml:"VRouterId"` + Description string `json:"Description" xml:"Description"` + IsDefault bool `json:"IsDefault" xml:"IsDefault"` + VSwitchIds VSwitchIds `json:"VSwitchIds" xml:"VSwitchIds"` + UserCidrs UserCidrs `json:"UserCidrs" xml:"UserCidrs"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_vpc_attributes.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_vpc_attributes.go new file mode 100644 index 000000000..73f611c99 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_vpc_attributes.go @@ -0,0 +1,24 @@ +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. + +// VpcAttributes is a nested struct in ecs response +type VpcAttributes struct { + VSwitchId string `json:"VSwitchId" xml:"VSwitchId"` + VpcId string `json:"VpcId" xml:"VpcId"` + NatIpAddress string `json:"NatIpAddress" xml:"NatIpAddress"` + PrivateIpAddress PrivateIpAddressInDescribeInstances `json:"PrivateIpAddress" xml:"PrivateIpAddress"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_vpcs.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_vpcs.go new file mode 100644 index 000000000..f1fbd6454 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_vpcs.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. + +// Vpcs is a nested struct in ecs response +type Vpcs struct { + Vpc []Vpc `json:"Vpc" xml:"Vpc"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_zone.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_zone.go new file mode 100644 index 000000000..932afe4db --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_zone.go @@ -0,0 +1,31 @@ +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. + +// Zone is a nested struct in ecs response +type Zone struct { + ZoneNo string `json:"ZoneNo" xml:"ZoneNo"` + ZoneId string `json:"ZoneId" xml:"ZoneId"` + LocalName string `json:"LocalName" xml:"LocalName"` + AvailableResourceCreation AvailableResourceCreation `json:"AvailableResourceCreation" xml:"AvailableResourceCreation"` + AvailableVolumeCategories AvailableVolumeCategories `json:"AvailableVolumeCategories" xml:"AvailableVolumeCategories"` + AvailableInstanceTypes AvailableInstanceTypes `json:"AvailableInstanceTypes" xml:"AvailableInstanceTypes"` + AvailableDedicatedHostTypes AvailableDedicatedHostTypes `json:"AvailableDedicatedHostTypes" xml:"AvailableDedicatedHostTypes"` + NetworkTypes NetworkTypesInDescribeRecommendInstanceType `json:"NetworkTypes" xml:"NetworkTypes"` + AvailableDiskCategories AvailableDiskCategories `json:"AvailableDiskCategories" xml:"AvailableDiskCategories"` + DedicatedHostGenerations DedicatedHostGenerations `json:"DedicatedHostGenerations" xml:"DedicatedHostGenerations"` + AvailableResources AvailableResourcesInDescribeZones `json:"AvailableResources" xml:"AvailableResources"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_zones_in_describe_recommend_instance_type.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_zones_in_describe_recommend_instance_type.go new file mode 100644 index 000000000..aab4743f0 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_zones_in_describe_recommend_instance_type.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. + +// ZonesInDescribeRecommendInstanceType is a nested struct in ecs response +type ZonesInDescribeRecommendInstanceType struct { + Zone []Zone `json:"zone" xml:"zone"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_zones_in_describe_zones.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_zones_in_describe_zones.go new file mode 100644 index 000000000..1e749d858 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_zones_in_describe_zones.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. + +// ZonesInDescribeZones is a nested struct in ecs response +type ZonesInDescribeZones struct { + Zone []Zone `json:"Zone" xml:"Zone"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/tag_resources.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/tag_resources.go new file mode 100644 index 000000000..a14087cb6 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/tag_resources.go @@ -0,0 +1,114 @@ +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" +) + +// TagResources invokes the ecs.TagResources API synchronously +// api document: https://help.aliyun.com/api/ecs/tagresources.html +func (client *Client) TagResources(request *TagResourcesRequest) (response *TagResourcesResponse, err error) { + response = CreateTagResourcesResponse() + err = client.DoAction(request, response) + return +} + +// TagResourcesWithChan invokes the ecs.TagResources API asynchronously +// api document: https://help.aliyun.com/api/ecs/tagresources.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) TagResourcesWithChan(request *TagResourcesRequest) (<-chan *TagResourcesResponse, <-chan error) { + responseChan := make(chan *TagResourcesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.TagResources(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// TagResourcesWithCallback invokes the ecs.TagResources API asynchronously +// api document: https://help.aliyun.com/api/ecs/tagresources.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) TagResourcesWithCallback(request *TagResourcesRequest, callback func(response *TagResourcesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *TagResourcesResponse + var err error + defer close(result) + response, err = client.TagResources(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// TagResourcesRequest is the request struct for api TagResources +type TagResourcesRequest struct { + *requests.RpcRequest + Tag *[]TagResourcesTag `position:"Query" name:"Tag" type:"Repeated"` + ResourceId *[]string `position:"Query" name:"ResourceId" type:"Repeated"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + ResourceType string `position:"Query" name:"ResourceType"` +} + +// TagResourcesTag is a repeated param struct in TagResourcesRequest +type TagResourcesTag struct { + Key string `name:"Key"` + Value string `name:"Value"` +} + +// TagResourcesResponse is the response struct for api TagResources +type TagResourcesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateTagResourcesRequest creates a request to invoke TagResources API +func CreateTagResourcesRequest() (request *TagResourcesRequest) { + request = &TagResourcesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "TagResources", "ecs", "openAPI") + return +} + +// CreateTagResourcesResponse creates a response to parse from TagResources response +func CreateTagResourcesResponse() (response *TagResourcesResponse) { + response = &TagResourcesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/terminate_physical_connection.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/terminate_physical_connection.go new file mode 100644 index 000000000..f9ea06fc1 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/terminate_physical_connection.go @@ -0,0 +1,109 @@ +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" +) + +// TerminatePhysicalConnection invokes the ecs.TerminatePhysicalConnection API synchronously +// api document: https://help.aliyun.com/api/ecs/terminatephysicalconnection.html +func (client *Client) TerminatePhysicalConnection(request *TerminatePhysicalConnectionRequest) (response *TerminatePhysicalConnectionResponse, err error) { + response = CreateTerminatePhysicalConnectionResponse() + err = client.DoAction(request, response) + return +} + +// TerminatePhysicalConnectionWithChan invokes the ecs.TerminatePhysicalConnection API asynchronously +// api document: https://help.aliyun.com/api/ecs/terminatephysicalconnection.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) TerminatePhysicalConnectionWithChan(request *TerminatePhysicalConnectionRequest) (<-chan *TerminatePhysicalConnectionResponse, <-chan error) { + responseChan := make(chan *TerminatePhysicalConnectionResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.TerminatePhysicalConnection(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// TerminatePhysicalConnectionWithCallback invokes the ecs.TerminatePhysicalConnection API asynchronously +// api document: https://help.aliyun.com/api/ecs/terminatephysicalconnection.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) TerminatePhysicalConnectionWithCallback(request *TerminatePhysicalConnectionRequest, callback func(response *TerminatePhysicalConnectionResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *TerminatePhysicalConnectionResponse + var err error + defer close(result) + response, err = client.TerminatePhysicalConnection(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// TerminatePhysicalConnectionRequest is the request struct for api TerminatePhysicalConnection +type TerminatePhysicalConnectionRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + PhysicalConnectionId string `position:"Query" name:"PhysicalConnectionId"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + UserCidr string `position:"Query" name:"UserCidr"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// TerminatePhysicalConnectionResponse is the response struct for api TerminatePhysicalConnection +type TerminatePhysicalConnectionResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateTerminatePhysicalConnectionRequest creates a request to invoke TerminatePhysicalConnection API +func CreateTerminatePhysicalConnectionRequest() (request *TerminatePhysicalConnectionRequest) { + request = &TerminatePhysicalConnectionRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "TerminatePhysicalConnection", "ecs", "openAPI") + return +} + +// CreateTerminatePhysicalConnectionResponse creates a response to parse from TerminatePhysicalConnection response +func CreateTerminatePhysicalConnectionResponse() (response *TerminatePhysicalConnectionResponse) { + response = &TerminatePhysicalConnectionResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/terminate_virtual_border_router.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/terminate_virtual_border_router.go new file mode 100644 index 000000000..51dd360b3 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/terminate_virtual_border_router.go @@ -0,0 +1,109 @@ +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" +) + +// TerminateVirtualBorderRouter invokes the ecs.TerminateVirtualBorderRouter API synchronously +// api document: https://help.aliyun.com/api/ecs/terminatevirtualborderrouter.html +func (client *Client) TerminateVirtualBorderRouter(request *TerminateVirtualBorderRouterRequest) (response *TerminateVirtualBorderRouterResponse, err error) { + response = CreateTerminateVirtualBorderRouterResponse() + err = client.DoAction(request, response) + return +} + +// TerminateVirtualBorderRouterWithChan invokes the ecs.TerminateVirtualBorderRouter API asynchronously +// api document: https://help.aliyun.com/api/ecs/terminatevirtualborderrouter.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) TerminateVirtualBorderRouterWithChan(request *TerminateVirtualBorderRouterRequest) (<-chan *TerminateVirtualBorderRouterResponse, <-chan error) { + responseChan := make(chan *TerminateVirtualBorderRouterResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.TerminateVirtualBorderRouter(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// TerminateVirtualBorderRouterWithCallback invokes the ecs.TerminateVirtualBorderRouter API asynchronously +// api document: https://help.aliyun.com/api/ecs/terminatevirtualborderrouter.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) TerminateVirtualBorderRouterWithCallback(request *TerminateVirtualBorderRouterRequest, callback func(response *TerminateVirtualBorderRouterResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *TerminateVirtualBorderRouterResponse + var err error + defer close(result) + response, err = client.TerminateVirtualBorderRouter(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// TerminateVirtualBorderRouterRequest is the request struct for api TerminateVirtualBorderRouter +type TerminateVirtualBorderRouterRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + UserCidr string `position:"Query" name:"UserCidr"` + VbrId string `position:"Query" name:"VbrId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// TerminateVirtualBorderRouterResponse is the response struct for api TerminateVirtualBorderRouter +type TerminateVirtualBorderRouterResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateTerminateVirtualBorderRouterRequest creates a request to invoke TerminateVirtualBorderRouter API +func CreateTerminateVirtualBorderRouterRequest() (request *TerminateVirtualBorderRouterRequest) { + request = &TerminateVirtualBorderRouterRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "TerminateVirtualBorderRouter", "ecs", "openAPI") + return +} + +// CreateTerminateVirtualBorderRouterResponse creates a response to parse from TerminateVirtualBorderRouter response +func CreateTerminateVirtualBorderRouterResponse() (response *TerminateVirtualBorderRouterResponse) { + response = &TerminateVirtualBorderRouterResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/unassign_ipv6_addresses.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/unassign_ipv6_addresses.go new file mode 100644 index 000000000..7f3cdcc36 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/unassign_ipv6_addresses.go @@ -0,0 +1,108 @@ +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" +) + +// UnassignIpv6Addresses invokes the ecs.UnassignIpv6Addresses API synchronously +// api document: https://help.aliyun.com/api/ecs/unassignipv6addresses.html +func (client *Client) UnassignIpv6Addresses(request *UnassignIpv6AddressesRequest) (response *UnassignIpv6AddressesResponse, err error) { + response = CreateUnassignIpv6AddressesResponse() + err = client.DoAction(request, response) + return +} + +// UnassignIpv6AddressesWithChan invokes the ecs.UnassignIpv6Addresses API asynchronously +// api document: https://help.aliyun.com/api/ecs/unassignipv6addresses.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) UnassignIpv6AddressesWithChan(request *UnassignIpv6AddressesRequest) (<-chan *UnassignIpv6AddressesResponse, <-chan error) { + responseChan := make(chan *UnassignIpv6AddressesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.UnassignIpv6Addresses(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// UnassignIpv6AddressesWithCallback invokes the ecs.UnassignIpv6Addresses API asynchronously +// api document: https://help.aliyun.com/api/ecs/unassignipv6addresses.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) UnassignIpv6AddressesWithCallback(request *UnassignIpv6AddressesRequest, callback func(response *UnassignIpv6AddressesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *UnassignIpv6AddressesResponse + var err error + defer close(result) + response, err = client.UnassignIpv6Addresses(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// UnassignIpv6AddressesRequest is the request struct for api UnassignIpv6Addresses +type UnassignIpv6AddressesRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + NetworkInterfaceId string `position:"Query" name:"NetworkInterfaceId"` + Ipv6Address *[]string `position:"Query" name:"Ipv6Address" type:"Repeated"` +} + +// UnassignIpv6AddressesResponse is the response struct for api UnassignIpv6Addresses +type UnassignIpv6AddressesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateUnassignIpv6AddressesRequest creates a request to invoke UnassignIpv6Addresses API +func CreateUnassignIpv6AddressesRequest() (request *UnassignIpv6AddressesRequest) { + request = &UnassignIpv6AddressesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "UnassignIpv6Addresses", "ecs", "openAPI") + return +} + +// CreateUnassignIpv6AddressesResponse creates a response to parse from UnassignIpv6Addresses response +func CreateUnassignIpv6AddressesResponse() (response *UnassignIpv6AddressesResponse) { + response = &UnassignIpv6AddressesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/unassign_private_ip_addresses.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/unassign_private_ip_addresses.go new file mode 100644 index 000000000..91f8a10d8 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/unassign_private_ip_addresses.go @@ -0,0 +1,108 @@ +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" +) + +// UnassignPrivateIpAddresses invokes the ecs.UnassignPrivateIpAddresses API synchronously +// api document: https://help.aliyun.com/api/ecs/unassignprivateipaddresses.html +func (client *Client) UnassignPrivateIpAddresses(request *UnassignPrivateIpAddressesRequest) (response *UnassignPrivateIpAddressesResponse, err error) { + response = CreateUnassignPrivateIpAddressesResponse() + err = client.DoAction(request, response) + return +} + +// UnassignPrivateIpAddressesWithChan invokes the ecs.UnassignPrivateIpAddresses API asynchronously +// api document: https://help.aliyun.com/api/ecs/unassignprivateipaddresses.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) UnassignPrivateIpAddressesWithChan(request *UnassignPrivateIpAddressesRequest) (<-chan *UnassignPrivateIpAddressesResponse, <-chan error) { + responseChan := make(chan *UnassignPrivateIpAddressesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.UnassignPrivateIpAddresses(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// UnassignPrivateIpAddressesWithCallback invokes the ecs.UnassignPrivateIpAddresses API asynchronously +// api document: https://help.aliyun.com/api/ecs/unassignprivateipaddresses.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) UnassignPrivateIpAddressesWithCallback(request *UnassignPrivateIpAddressesRequest, callback func(response *UnassignPrivateIpAddressesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *UnassignPrivateIpAddressesResponse + var err error + defer close(result) + response, err = client.UnassignPrivateIpAddresses(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// UnassignPrivateIpAddressesRequest is the request struct for api UnassignPrivateIpAddresses +type UnassignPrivateIpAddressesRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PrivateIpAddress *[]string `position:"Query" name:"PrivateIpAddress" type:"Repeated"` + NetworkInterfaceId string `position:"Query" name:"NetworkInterfaceId"` +} + +// UnassignPrivateIpAddressesResponse is the response struct for api UnassignPrivateIpAddresses +type UnassignPrivateIpAddressesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateUnassignPrivateIpAddressesRequest creates a request to invoke UnassignPrivateIpAddresses API +func CreateUnassignPrivateIpAddressesRequest() (request *UnassignPrivateIpAddressesRequest) { + request = &UnassignPrivateIpAddressesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "UnassignPrivateIpAddresses", "ecs", "openAPI") + return +} + +// CreateUnassignPrivateIpAddressesResponse creates a response to parse from UnassignPrivateIpAddresses response +func CreateUnassignPrivateIpAddressesResponse() (response *UnassignPrivateIpAddressesResponse) { + response = &UnassignPrivateIpAddressesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/unassociate_eip_address.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/unassociate_eip_address.go new file mode 100644 index 000000000..f44a49679 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/unassociate_eip_address.go @@ -0,0 +1,109 @@ +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" +) + +// UnassociateEipAddress invokes the ecs.UnassociateEipAddress API synchronously +// api document: https://help.aliyun.com/api/ecs/unassociateeipaddress.html +func (client *Client) UnassociateEipAddress(request *UnassociateEipAddressRequest) (response *UnassociateEipAddressResponse, err error) { + response = CreateUnassociateEipAddressResponse() + err = client.DoAction(request, response) + return +} + +// UnassociateEipAddressWithChan invokes the ecs.UnassociateEipAddress API asynchronously +// api document: https://help.aliyun.com/api/ecs/unassociateeipaddress.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) UnassociateEipAddressWithChan(request *UnassociateEipAddressRequest) (<-chan *UnassociateEipAddressResponse, <-chan error) { + responseChan := make(chan *UnassociateEipAddressResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.UnassociateEipAddress(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// UnassociateEipAddressWithCallback invokes the ecs.UnassociateEipAddress API asynchronously +// api document: https://help.aliyun.com/api/ecs/unassociateeipaddress.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) UnassociateEipAddressWithCallback(request *UnassociateEipAddressRequest, callback func(response *UnassociateEipAddressResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *UnassociateEipAddressResponse + var err error + defer close(result) + response, err = client.UnassociateEipAddress(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// UnassociateEipAddressRequest is the request struct for api UnassociateEipAddress +type UnassociateEipAddressRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + InstanceId string `position:"Query" name:"InstanceId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + InstanceType string `position:"Query" name:"InstanceType"` + AllocationId string `position:"Query" name:"AllocationId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// UnassociateEipAddressResponse is the response struct for api UnassociateEipAddress +type UnassociateEipAddressResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateUnassociateEipAddressRequest creates a request to invoke UnassociateEipAddress API +func CreateUnassociateEipAddressRequest() (request *UnassociateEipAddressRequest) { + request = &UnassociateEipAddressRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "UnassociateEipAddress", "ecs", "openAPI") + return +} + +// CreateUnassociateEipAddressResponse creates a response to parse from UnassociateEipAddress response +func CreateUnassociateEipAddressResponse() (response *UnassociateEipAddressResponse) { + response = &UnassociateEipAddressResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/unassociate_ha_vip.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/unassociate_ha_vip.go new file mode 100644 index 000000000..cffa25abd --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/unassociate_ha_vip.go @@ -0,0 +1,110 @@ +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" +) + +// UnassociateHaVip invokes the ecs.UnassociateHaVip API synchronously +// api document: https://help.aliyun.com/api/ecs/unassociatehavip.html +func (client *Client) UnassociateHaVip(request *UnassociateHaVipRequest) (response *UnassociateHaVipResponse, err error) { + response = CreateUnassociateHaVipResponse() + err = client.DoAction(request, response) + return +} + +// UnassociateHaVipWithChan invokes the ecs.UnassociateHaVip API asynchronously +// api document: https://help.aliyun.com/api/ecs/unassociatehavip.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) UnassociateHaVipWithChan(request *UnassociateHaVipRequest) (<-chan *UnassociateHaVipResponse, <-chan error) { + responseChan := make(chan *UnassociateHaVipResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.UnassociateHaVip(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// UnassociateHaVipWithCallback invokes the ecs.UnassociateHaVip API asynchronously +// api document: https://help.aliyun.com/api/ecs/unassociatehavip.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) UnassociateHaVipWithCallback(request *UnassociateHaVipRequest, callback func(response *UnassociateHaVipResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *UnassociateHaVipResponse + var err error + defer close(result) + response, err = client.UnassociateHaVip(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// UnassociateHaVipRequest is the request struct for api UnassociateHaVip +type UnassociateHaVipRequest struct { + *requests.RpcRequest + HaVipId string `position:"Query" name:"HaVipId"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + InstanceId string `position:"Query" name:"InstanceId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Force string `position:"Query" name:"Force"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// UnassociateHaVipResponse is the response struct for api UnassociateHaVip +type UnassociateHaVipResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateUnassociateHaVipRequest creates a request to invoke UnassociateHaVip API +func CreateUnassociateHaVipRequest() (request *UnassociateHaVipRequest) { + request = &UnassociateHaVipRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "UnassociateHaVip", "ecs", "openAPI") + return +} + +// CreateUnassociateHaVipResponse creates a response to parse from UnassociateHaVip response +func CreateUnassociateHaVipResponse() (response *UnassociateHaVipResponse) { + response = &UnassociateHaVipResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/untag_resources.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/untag_resources.go new file mode 100644 index 000000000..3c83f26b7 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/untag_resources.go @@ -0,0 +1,110 @@ +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" +) + +// UntagResources invokes the ecs.UntagResources API synchronously +// api document: https://help.aliyun.com/api/ecs/untagresources.html +func (client *Client) UntagResources(request *UntagResourcesRequest) (response *UntagResourcesResponse, err error) { + response = CreateUntagResourcesResponse() + err = client.DoAction(request, response) + return +} + +// UntagResourcesWithChan invokes the ecs.UntagResources API asynchronously +// api document: https://help.aliyun.com/api/ecs/untagresources.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) UntagResourcesWithChan(request *UntagResourcesRequest) (<-chan *UntagResourcesResponse, <-chan error) { + responseChan := make(chan *UntagResourcesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.UntagResources(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// UntagResourcesWithCallback invokes the ecs.UntagResources API asynchronously +// api document: https://help.aliyun.com/api/ecs/untagresources.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) UntagResourcesWithCallback(request *UntagResourcesRequest, callback func(response *UntagResourcesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *UntagResourcesResponse + var err error + defer close(result) + response, err = client.UntagResources(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// UntagResourcesRequest is the request struct for api UntagResources +type UntagResourcesRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + All requests.Boolean `position:"Query" name:"All"` + ResourceId *[]string `position:"Query" name:"ResourceId" type:"Repeated"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + ResourceType string `position:"Query" name:"ResourceType"` + TagKey *[]string `position:"Query" name:"TagKey" type:"Repeated"` +} + +// UntagResourcesResponse is the response struct for api UntagResources +type UntagResourcesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateUntagResourcesRequest creates a request to invoke UntagResources API +func CreateUntagResourcesRequest() (request *UntagResourcesRequest) { + request = &UntagResourcesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ecs", "2014-05-26", "UntagResources", "ecs", "openAPI") + return +} + +// CreateUntagResourcesResponse creates a response to parse from UntagResources response +func CreateUntagResourcesResponse() (response *UntagResourcesResponse) { + response = &UntagResourcesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/add_user_to_group.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/add_user_to_group.go new file mode 100644 index 000000000..a678e28ad --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/add_user_to_group.go @@ -0,0 +1,104 @@ +package ram + +//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" +) + +// AddUserToGroup invokes the ram.AddUserToGroup API synchronously +// api document: https://help.aliyun.com/api/ram/addusertogroup.html +func (client *Client) AddUserToGroup(request *AddUserToGroupRequest) (response *AddUserToGroupResponse, err error) { + response = CreateAddUserToGroupResponse() + err = client.DoAction(request, response) + return +} + +// AddUserToGroupWithChan invokes the ram.AddUserToGroup API asynchronously +// api document: https://help.aliyun.com/api/ram/addusertogroup.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AddUserToGroupWithChan(request *AddUserToGroupRequest) (<-chan *AddUserToGroupResponse, <-chan error) { + responseChan := make(chan *AddUserToGroupResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.AddUserToGroup(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// AddUserToGroupWithCallback invokes the ram.AddUserToGroup API asynchronously +// api document: https://help.aliyun.com/api/ram/addusertogroup.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AddUserToGroupWithCallback(request *AddUserToGroupRequest, callback func(response *AddUserToGroupResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *AddUserToGroupResponse + var err error + defer close(result) + response, err = client.AddUserToGroup(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// AddUserToGroupRequest is the request struct for api AddUserToGroup +type AddUserToGroupRequest struct { + *requests.RpcRequest + GroupName string `position:"Query" name:"GroupName"` + UserName string `position:"Query" name:"UserName"` +} + +// AddUserToGroupResponse is the response struct for api AddUserToGroup +type AddUserToGroupResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateAddUserToGroupRequest creates a request to invoke AddUserToGroup API +func CreateAddUserToGroupRequest() (request *AddUserToGroupRequest) { + request = &AddUserToGroupRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "AddUserToGroup", "ram", "openAPI") + return +} + +// CreateAddUserToGroupResponse creates a response to parse from AddUserToGroup response +func CreateAddUserToGroupResponse() (response *AddUserToGroupResponse) { + response = &AddUserToGroupResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/attach_policy_to_group.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/attach_policy_to_group.go new file mode 100644 index 000000000..455b25ff3 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/attach_policy_to_group.go @@ -0,0 +1,105 @@ +package ram + +//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" +) + +// AttachPolicyToGroup invokes the ram.AttachPolicyToGroup API synchronously +// api document: https://help.aliyun.com/api/ram/attachpolicytogroup.html +func (client *Client) AttachPolicyToGroup(request *AttachPolicyToGroupRequest) (response *AttachPolicyToGroupResponse, err error) { + response = CreateAttachPolicyToGroupResponse() + err = client.DoAction(request, response) + return +} + +// AttachPolicyToGroupWithChan invokes the ram.AttachPolicyToGroup API asynchronously +// api document: https://help.aliyun.com/api/ram/attachpolicytogroup.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AttachPolicyToGroupWithChan(request *AttachPolicyToGroupRequest) (<-chan *AttachPolicyToGroupResponse, <-chan error) { + responseChan := make(chan *AttachPolicyToGroupResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.AttachPolicyToGroup(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// AttachPolicyToGroupWithCallback invokes the ram.AttachPolicyToGroup API asynchronously +// api document: https://help.aliyun.com/api/ram/attachpolicytogroup.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AttachPolicyToGroupWithCallback(request *AttachPolicyToGroupRequest, callback func(response *AttachPolicyToGroupResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *AttachPolicyToGroupResponse + var err error + defer close(result) + response, err = client.AttachPolicyToGroup(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// AttachPolicyToGroupRequest is the request struct for api AttachPolicyToGroup +type AttachPolicyToGroupRequest struct { + *requests.RpcRequest + PolicyType string `position:"Query" name:"PolicyType"` + PolicyName string `position:"Query" name:"PolicyName"` + GroupName string `position:"Query" name:"GroupName"` +} + +// AttachPolicyToGroupResponse is the response struct for api AttachPolicyToGroup +type AttachPolicyToGroupResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateAttachPolicyToGroupRequest creates a request to invoke AttachPolicyToGroup API +func CreateAttachPolicyToGroupRequest() (request *AttachPolicyToGroupRequest) { + request = &AttachPolicyToGroupRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "AttachPolicyToGroup", "ram", "openAPI") + return +} + +// CreateAttachPolicyToGroupResponse creates a response to parse from AttachPolicyToGroup response +func CreateAttachPolicyToGroupResponse() (response *AttachPolicyToGroupResponse) { + response = &AttachPolicyToGroupResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/attach_policy_to_role.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/attach_policy_to_role.go new file mode 100644 index 000000000..0fc99bafd --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/attach_policy_to_role.go @@ -0,0 +1,105 @@ +package ram + +//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" +) + +// AttachPolicyToRole invokes the ram.AttachPolicyToRole API synchronously +// api document: https://help.aliyun.com/api/ram/attachpolicytorole.html +func (client *Client) AttachPolicyToRole(request *AttachPolicyToRoleRequest) (response *AttachPolicyToRoleResponse, err error) { + response = CreateAttachPolicyToRoleResponse() + err = client.DoAction(request, response) + return +} + +// AttachPolicyToRoleWithChan invokes the ram.AttachPolicyToRole API asynchronously +// api document: https://help.aliyun.com/api/ram/attachpolicytorole.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AttachPolicyToRoleWithChan(request *AttachPolicyToRoleRequest) (<-chan *AttachPolicyToRoleResponse, <-chan error) { + responseChan := make(chan *AttachPolicyToRoleResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.AttachPolicyToRole(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// AttachPolicyToRoleWithCallback invokes the ram.AttachPolicyToRole API asynchronously +// api document: https://help.aliyun.com/api/ram/attachpolicytorole.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AttachPolicyToRoleWithCallback(request *AttachPolicyToRoleRequest, callback func(response *AttachPolicyToRoleResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *AttachPolicyToRoleResponse + var err error + defer close(result) + response, err = client.AttachPolicyToRole(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// AttachPolicyToRoleRequest is the request struct for api AttachPolicyToRole +type AttachPolicyToRoleRequest struct { + *requests.RpcRequest + PolicyType string `position:"Query" name:"PolicyType"` + RoleName string `position:"Query" name:"RoleName"` + PolicyName string `position:"Query" name:"PolicyName"` +} + +// AttachPolicyToRoleResponse is the response struct for api AttachPolicyToRole +type AttachPolicyToRoleResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateAttachPolicyToRoleRequest creates a request to invoke AttachPolicyToRole API +func CreateAttachPolicyToRoleRequest() (request *AttachPolicyToRoleRequest) { + request = &AttachPolicyToRoleRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "AttachPolicyToRole", "ram", "openAPI") + return +} + +// CreateAttachPolicyToRoleResponse creates a response to parse from AttachPolicyToRole response +func CreateAttachPolicyToRoleResponse() (response *AttachPolicyToRoleResponse) { + response = &AttachPolicyToRoleResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/attach_policy_to_user.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/attach_policy_to_user.go new file mode 100644 index 000000000..eec42ad1a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/attach_policy_to_user.go @@ -0,0 +1,105 @@ +package ram + +//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" +) + +// AttachPolicyToUser invokes the ram.AttachPolicyToUser API synchronously +// api document: https://help.aliyun.com/api/ram/attachpolicytouser.html +func (client *Client) AttachPolicyToUser(request *AttachPolicyToUserRequest) (response *AttachPolicyToUserResponse, err error) { + response = CreateAttachPolicyToUserResponse() + err = client.DoAction(request, response) + return +} + +// AttachPolicyToUserWithChan invokes the ram.AttachPolicyToUser API asynchronously +// api document: https://help.aliyun.com/api/ram/attachpolicytouser.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AttachPolicyToUserWithChan(request *AttachPolicyToUserRequest) (<-chan *AttachPolicyToUserResponse, <-chan error) { + responseChan := make(chan *AttachPolicyToUserResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.AttachPolicyToUser(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// AttachPolicyToUserWithCallback invokes the ram.AttachPolicyToUser API asynchronously +// api document: https://help.aliyun.com/api/ram/attachpolicytouser.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AttachPolicyToUserWithCallback(request *AttachPolicyToUserRequest, callback func(response *AttachPolicyToUserResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *AttachPolicyToUserResponse + var err error + defer close(result) + response, err = client.AttachPolicyToUser(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// AttachPolicyToUserRequest is the request struct for api AttachPolicyToUser +type AttachPolicyToUserRequest struct { + *requests.RpcRequest + PolicyType string `position:"Query" name:"PolicyType"` + PolicyName string `position:"Query" name:"PolicyName"` + UserName string `position:"Query" name:"UserName"` +} + +// AttachPolicyToUserResponse is the response struct for api AttachPolicyToUser +type AttachPolicyToUserResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateAttachPolicyToUserRequest creates a request to invoke AttachPolicyToUser API +func CreateAttachPolicyToUserRequest() (request *AttachPolicyToUserRequest) { + request = &AttachPolicyToUserRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "AttachPolicyToUser", "ram", "openAPI") + return +} + +// CreateAttachPolicyToUserResponse creates a response to parse from AttachPolicyToUser response +func CreateAttachPolicyToUserResponse() (response *AttachPolicyToUserResponse) { + response = &AttachPolicyToUserResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/bind_mfa_device.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/bind_mfa_device.go new file mode 100644 index 000000000..2256e087e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/bind_mfa_device.go @@ -0,0 +1,106 @@ +package ram + +//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" +) + +// BindMFADevice invokes the ram.BindMFADevice API synchronously +// api document: https://help.aliyun.com/api/ram/bindmfadevice.html +func (client *Client) BindMFADevice(request *BindMFADeviceRequest) (response *BindMFADeviceResponse, err error) { + response = CreateBindMFADeviceResponse() + err = client.DoAction(request, response) + return +} + +// BindMFADeviceWithChan invokes the ram.BindMFADevice API asynchronously +// api document: https://help.aliyun.com/api/ram/bindmfadevice.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) BindMFADeviceWithChan(request *BindMFADeviceRequest) (<-chan *BindMFADeviceResponse, <-chan error) { + responseChan := make(chan *BindMFADeviceResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.BindMFADevice(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// BindMFADeviceWithCallback invokes the ram.BindMFADevice API asynchronously +// api document: https://help.aliyun.com/api/ram/bindmfadevice.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) BindMFADeviceWithCallback(request *BindMFADeviceRequest, callback func(response *BindMFADeviceResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *BindMFADeviceResponse + var err error + defer close(result) + response, err = client.BindMFADevice(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// BindMFADeviceRequest is the request struct for api BindMFADevice +type BindMFADeviceRequest struct { + *requests.RpcRequest + SerialNumber string `position:"Query" name:"SerialNumber"` + AuthenticationCode2 string `position:"Query" name:"AuthenticationCode2"` + AuthenticationCode1 string `position:"Query" name:"AuthenticationCode1"` + UserName string `position:"Query" name:"UserName"` +} + +// BindMFADeviceResponse is the response struct for api BindMFADevice +type BindMFADeviceResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateBindMFADeviceRequest creates a request to invoke BindMFADevice API +func CreateBindMFADeviceRequest() (request *BindMFADeviceRequest) { + request = &BindMFADeviceRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "BindMFADevice", "ram", "openAPI") + return +} + +// CreateBindMFADeviceResponse creates a response to parse from BindMFADevice response +func CreateBindMFADeviceResponse() (response *BindMFADeviceResponse) { + response = &BindMFADeviceResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/change_password.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/change_password.go new file mode 100644 index 000000000..edda89480 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/change_password.go @@ -0,0 +1,104 @@ +package ram + +//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" +) + +// ChangePassword invokes the ram.ChangePassword API synchronously +// api document: https://help.aliyun.com/api/ram/changepassword.html +func (client *Client) ChangePassword(request *ChangePasswordRequest) (response *ChangePasswordResponse, err error) { + response = CreateChangePasswordResponse() + err = client.DoAction(request, response) + return +} + +// ChangePasswordWithChan invokes the ram.ChangePassword API asynchronously +// api document: https://help.aliyun.com/api/ram/changepassword.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ChangePasswordWithChan(request *ChangePasswordRequest) (<-chan *ChangePasswordResponse, <-chan error) { + responseChan := make(chan *ChangePasswordResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ChangePassword(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ChangePasswordWithCallback invokes the ram.ChangePassword API asynchronously +// api document: https://help.aliyun.com/api/ram/changepassword.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ChangePasswordWithCallback(request *ChangePasswordRequest, callback func(response *ChangePasswordResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ChangePasswordResponse + var err error + defer close(result) + response, err = client.ChangePassword(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ChangePasswordRequest is the request struct for api ChangePassword +type ChangePasswordRequest struct { + *requests.RpcRequest + OldPassword string `position:"Query" name:"OldPassword"` + NewPassword string `position:"Query" name:"NewPassword"` +} + +// ChangePasswordResponse is the response struct for api ChangePassword +type ChangePasswordResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateChangePasswordRequest creates a request to invoke ChangePassword API +func CreateChangePasswordRequest() (request *ChangePasswordRequest) { + request = &ChangePasswordRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "ChangePassword", "ram", "openAPI") + return +} + +// CreateChangePasswordResponse creates a response to parse from ChangePassword response +func CreateChangePasswordResponse() (response *ChangePasswordResponse) { + response = &ChangePasswordResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/clear_account_alias.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/clear_account_alias.go new file mode 100644 index 000000000..92d9b594d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/clear_account_alias.go @@ -0,0 +1,102 @@ +package ram + +//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" +) + +// ClearAccountAlias invokes the ram.ClearAccountAlias API synchronously +// api document: https://help.aliyun.com/api/ram/clearaccountalias.html +func (client *Client) ClearAccountAlias(request *ClearAccountAliasRequest) (response *ClearAccountAliasResponse, err error) { + response = CreateClearAccountAliasResponse() + err = client.DoAction(request, response) + return +} + +// ClearAccountAliasWithChan invokes the ram.ClearAccountAlias API asynchronously +// api document: https://help.aliyun.com/api/ram/clearaccountalias.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ClearAccountAliasWithChan(request *ClearAccountAliasRequest) (<-chan *ClearAccountAliasResponse, <-chan error) { + responseChan := make(chan *ClearAccountAliasResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ClearAccountAlias(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ClearAccountAliasWithCallback invokes the ram.ClearAccountAlias API asynchronously +// api document: https://help.aliyun.com/api/ram/clearaccountalias.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ClearAccountAliasWithCallback(request *ClearAccountAliasRequest, callback func(response *ClearAccountAliasResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ClearAccountAliasResponse + var err error + defer close(result) + response, err = client.ClearAccountAlias(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ClearAccountAliasRequest is the request struct for api ClearAccountAlias +type ClearAccountAliasRequest struct { + *requests.RpcRequest +} + +// ClearAccountAliasResponse is the response struct for api ClearAccountAlias +type ClearAccountAliasResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateClearAccountAliasRequest creates a request to invoke ClearAccountAlias API +func CreateClearAccountAliasRequest() (request *ClearAccountAliasRequest) { + request = &ClearAccountAliasRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "ClearAccountAlias", "ram", "openAPI") + return +} + +// CreateClearAccountAliasResponse creates a response to parse from ClearAccountAlias response +func CreateClearAccountAliasResponse() (response *ClearAccountAliasResponse) { + response = &ClearAccountAliasResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/client.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/client.go new file mode 100644 index 000000000..a277007a4 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/client.go @@ -0,0 +1,81 @@ +package ram + +//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" +) + +// 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 +} + +// 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://help.aliyun.com/document_detail/66217.html +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://help.aliyun.com/document_detail/66222.html +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://help.aliyun.com/document_detail/66222.html +func NewClientWithRamRoleArn(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (client *Client, err error) { + client = &Client{} + err = client.InitWithRamRoleArn(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName) + return +} + +// NewClientWithEcsRamRole is a shortcut to create sdk client with ecs ram role +// usage: https://help.aliyun.com/document_detail/66223.html +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 +// attention: rsa key pair auth is only Japan regions available +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/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/create_access_key.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/create_access_key.go new file mode 100644 index 000000000..bc93204d4 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/create_access_key.go @@ -0,0 +1,104 @@ +package ram + +//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" +) + +// CreateAccessKey invokes the ram.CreateAccessKey API synchronously +// api document: https://help.aliyun.com/api/ram/createaccesskey.html +func (client *Client) CreateAccessKey(request *CreateAccessKeyRequest) (response *CreateAccessKeyResponse, err error) { + response = CreateCreateAccessKeyResponse() + err = client.DoAction(request, response) + return +} + +// CreateAccessKeyWithChan invokes the ram.CreateAccessKey API asynchronously +// api document: https://help.aliyun.com/api/ram/createaccesskey.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateAccessKeyWithChan(request *CreateAccessKeyRequest) (<-chan *CreateAccessKeyResponse, <-chan error) { + responseChan := make(chan *CreateAccessKeyResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateAccessKey(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateAccessKeyWithCallback invokes the ram.CreateAccessKey API asynchronously +// api document: https://help.aliyun.com/api/ram/createaccesskey.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateAccessKeyWithCallback(request *CreateAccessKeyRequest, callback func(response *CreateAccessKeyResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateAccessKeyResponse + var err error + defer close(result) + response, err = client.CreateAccessKey(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateAccessKeyRequest is the request struct for api CreateAccessKey +type CreateAccessKeyRequest struct { + *requests.RpcRequest + UserName string `position:"Query" name:"UserName"` +} + +// CreateAccessKeyResponse is the response struct for api CreateAccessKey +type CreateAccessKeyResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + AccessKey AccessKey `json:"AccessKey" xml:"AccessKey"` +} + +// CreateCreateAccessKeyRequest creates a request to invoke CreateAccessKey API +func CreateCreateAccessKeyRequest() (request *CreateAccessKeyRequest) { + request = &CreateAccessKeyRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "CreateAccessKey", "ram", "openAPI") + return +} + +// CreateCreateAccessKeyResponse creates a response to parse from CreateAccessKey response +func CreateCreateAccessKeyResponse() (response *CreateAccessKeyResponse) { + response = &CreateAccessKeyResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/create_group.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/create_group.go new file mode 100644 index 000000000..b2c386fca --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/create_group.go @@ -0,0 +1,105 @@ +package ram + +//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" +) + +// CreateGroup invokes the ram.CreateGroup API synchronously +// api document: https://help.aliyun.com/api/ram/creategroup.html +func (client *Client) CreateGroup(request *CreateGroupRequest) (response *CreateGroupResponse, err error) { + response = CreateCreateGroupResponse() + err = client.DoAction(request, response) + return +} + +// CreateGroupWithChan invokes the ram.CreateGroup API asynchronously +// api document: https://help.aliyun.com/api/ram/creategroup.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateGroupWithChan(request *CreateGroupRequest) (<-chan *CreateGroupResponse, <-chan error) { + responseChan := make(chan *CreateGroupResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateGroup(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateGroupWithCallback invokes the ram.CreateGroup API asynchronously +// api document: https://help.aliyun.com/api/ram/creategroup.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateGroupWithCallback(request *CreateGroupRequest, callback func(response *CreateGroupResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateGroupResponse + var err error + defer close(result) + response, err = client.CreateGroup(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateGroupRequest is the request struct for api CreateGroup +type CreateGroupRequest struct { + *requests.RpcRequest + Comments string `position:"Query" name:"Comments"` + GroupName string `position:"Query" name:"GroupName"` +} + +// CreateGroupResponse is the response struct for api CreateGroup +type CreateGroupResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Group Group `json:"Group" xml:"Group"` +} + +// CreateCreateGroupRequest creates a request to invoke CreateGroup API +func CreateCreateGroupRequest() (request *CreateGroupRequest) { + request = &CreateGroupRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "CreateGroup", "ram", "openAPI") + return +} + +// CreateCreateGroupResponse creates a response to parse from CreateGroup response +func CreateCreateGroupResponse() (response *CreateGroupResponse) { + response = &CreateGroupResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/create_login_profile.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/create_login_profile.go new file mode 100644 index 000000000..2c521b606 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/create_login_profile.go @@ -0,0 +1,107 @@ +package ram + +//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" +) + +// CreateLoginProfile invokes the ram.CreateLoginProfile API synchronously +// api document: https://help.aliyun.com/api/ram/createloginprofile.html +func (client *Client) CreateLoginProfile(request *CreateLoginProfileRequest) (response *CreateLoginProfileResponse, err error) { + response = CreateCreateLoginProfileResponse() + err = client.DoAction(request, response) + return +} + +// CreateLoginProfileWithChan invokes the ram.CreateLoginProfile API asynchronously +// api document: https://help.aliyun.com/api/ram/createloginprofile.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateLoginProfileWithChan(request *CreateLoginProfileRequest) (<-chan *CreateLoginProfileResponse, <-chan error) { + responseChan := make(chan *CreateLoginProfileResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateLoginProfile(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateLoginProfileWithCallback invokes the ram.CreateLoginProfile API asynchronously +// api document: https://help.aliyun.com/api/ram/createloginprofile.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateLoginProfileWithCallback(request *CreateLoginProfileRequest, callback func(response *CreateLoginProfileResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateLoginProfileResponse + var err error + defer close(result) + response, err = client.CreateLoginProfile(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateLoginProfileRequest is the request struct for api CreateLoginProfile +type CreateLoginProfileRequest struct { + *requests.RpcRequest + Password string `position:"Query" name:"Password"` + PasswordResetRequired requests.Boolean `position:"Query" name:"PasswordResetRequired"` + MFABindRequired requests.Boolean `position:"Query" name:"MFABindRequired"` + UserName string `position:"Query" name:"UserName"` +} + +// CreateLoginProfileResponse is the response struct for api CreateLoginProfile +type CreateLoginProfileResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + LoginProfile LoginProfile `json:"LoginProfile" xml:"LoginProfile"` +} + +// CreateCreateLoginProfileRequest creates a request to invoke CreateLoginProfile API +func CreateCreateLoginProfileRequest() (request *CreateLoginProfileRequest) { + request = &CreateLoginProfileRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "CreateLoginProfile", "ram", "openAPI") + return +} + +// CreateCreateLoginProfileResponse creates a response to parse from CreateLoginProfile response +func CreateCreateLoginProfileResponse() (response *CreateLoginProfileResponse) { + response = &CreateLoginProfileResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/create_policy.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/create_policy.go new file mode 100644 index 000000000..c4d7de8a1 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/create_policy.go @@ -0,0 +1,106 @@ +package ram + +//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" +) + +// CreatePolicy invokes the ram.CreatePolicy API synchronously +// api document: https://help.aliyun.com/api/ram/createpolicy.html +func (client *Client) CreatePolicy(request *CreatePolicyRequest) (response *CreatePolicyResponse, err error) { + response = CreateCreatePolicyResponse() + err = client.DoAction(request, response) + return +} + +// CreatePolicyWithChan invokes the ram.CreatePolicy API asynchronously +// api document: https://help.aliyun.com/api/ram/createpolicy.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreatePolicyWithChan(request *CreatePolicyRequest) (<-chan *CreatePolicyResponse, <-chan error) { + responseChan := make(chan *CreatePolicyResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreatePolicy(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreatePolicyWithCallback invokes the ram.CreatePolicy API asynchronously +// api document: https://help.aliyun.com/api/ram/createpolicy.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreatePolicyWithCallback(request *CreatePolicyRequest, callback func(response *CreatePolicyResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreatePolicyResponse + var err error + defer close(result) + response, err = client.CreatePolicy(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreatePolicyRequest is the request struct for api CreatePolicy +type CreatePolicyRequest struct { + *requests.RpcRequest + Description string `position:"Query" name:"Description"` + PolicyName string `position:"Query" name:"PolicyName"` + PolicyDocument string `position:"Query" name:"PolicyDocument"` +} + +// CreatePolicyResponse is the response struct for api CreatePolicy +type CreatePolicyResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Policy Policy `json:"Policy" xml:"Policy"` +} + +// CreateCreatePolicyRequest creates a request to invoke CreatePolicy API +func CreateCreatePolicyRequest() (request *CreatePolicyRequest) { + request = &CreatePolicyRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "CreatePolicy", "ram", "openAPI") + return +} + +// CreateCreatePolicyResponse creates a response to parse from CreatePolicy response +func CreateCreatePolicyResponse() (response *CreatePolicyResponse) { + response = &CreatePolicyResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/create_policy_version.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/create_policy_version.go new file mode 100644 index 000000000..80ea9f0be --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/create_policy_version.go @@ -0,0 +1,106 @@ +package ram + +//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" +) + +// CreatePolicyVersion invokes the ram.CreatePolicyVersion API synchronously +// api document: https://help.aliyun.com/api/ram/createpolicyversion.html +func (client *Client) CreatePolicyVersion(request *CreatePolicyVersionRequest) (response *CreatePolicyVersionResponse, err error) { + response = CreateCreatePolicyVersionResponse() + err = client.DoAction(request, response) + return +} + +// CreatePolicyVersionWithChan invokes the ram.CreatePolicyVersion API asynchronously +// api document: https://help.aliyun.com/api/ram/createpolicyversion.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreatePolicyVersionWithChan(request *CreatePolicyVersionRequest) (<-chan *CreatePolicyVersionResponse, <-chan error) { + responseChan := make(chan *CreatePolicyVersionResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreatePolicyVersion(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreatePolicyVersionWithCallback invokes the ram.CreatePolicyVersion API asynchronously +// api document: https://help.aliyun.com/api/ram/createpolicyversion.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreatePolicyVersionWithCallback(request *CreatePolicyVersionRequest, callback func(response *CreatePolicyVersionResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreatePolicyVersionResponse + var err error + defer close(result) + response, err = client.CreatePolicyVersion(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreatePolicyVersionRequest is the request struct for api CreatePolicyVersion +type CreatePolicyVersionRequest struct { + *requests.RpcRequest + SetAsDefault requests.Boolean `position:"Query" name:"SetAsDefault"` + PolicyName string `position:"Query" name:"PolicyName"` + PolicyDocument string `position:"Query" name:"PolicyDocument"` +} + +// CreatePolicyVersionResponse is the response struct for api CreatePolicyVersion +type CreatePolicyVersionResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + PolicyVersion PolicyVersion `json:"PolicyVersion" xml:"PolicyVersion"` +} + +// CreateCreatePolicyVersionRequest creates a request to invoke CreatePolicyVersion API +func CreateCreatePolicyVersionRequest() (request *CreatePolicyVersionRequest) { + request = &CreatePolicyVersionRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "CreatePolicyVersion", "ram", "openAPI") + return +} + +// CreateCreatePolicyVersionResponse creates a response to parse from CreatePolicyVersion response +func CreateCreatePolicyVersionResponse() (response *CreatePolicyVersionResponse) { + response = &CreatePolicyVersionResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/create_role.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/create_role.go new file mode 100644 index 000000000..e00b3e222 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/create_role.go @@ -0,0 +1,106 @@ +package ram + +//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" +) + +// CreateRole invokes the ram.CreateRole API synchronously +// api document: https://help.aliyun.com/api/ram/createrole.html +func (client *Client) CreateRole(request *CreateRoleRequest) (response *CreateRoleResponse, err error) { + response = CreateCreateRoleResponse() + err = client.DoAction(request, response) + return +} + +// CreateRoleWithChan invokes the ram.CreateRole API asynchronously +// api document: https://help.aliyun.com/api/ram/createrole.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateRoleWithChan(request *CreateRoleRequest) (<-chan *CreateRoleResponse, <-chan error) { + responseChan := make(chan *CreateRoleResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateRole(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateRoleWithCallback invokes the ram.CreateRole API asynchronously +// api document: https://help.aliyun.com/api/ram/createrole.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateRoleWithCallback(request *CreateRoleRequest, callback func(response *CreateRoleResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateRoleResponse + var err error + defer close(result) + response, err = client.CreateRole(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateRoleRequest is the request struct for api CreateRole +type CreateRoleRequest struct { + *requests.RpcRequest + RoleName string `position:"Query" name:"RoleName"` + Description string `position:"Query" name:"Description"` + AssumeRolePolicyDocument string `position:"Query" name:"AssumeRolePolicyDocument"` +} + +// CreateRoleResponse is the response struct for api CreateRole +type CreateRoleResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Role Role `json:"Role" xml:"Role"` +} + +// CreateCreateRoleRequest creates a request to invoke CreateRole API +func CreateCreateRoleRequest() (request *CreateRoleRequest) { + request = &CreateRoleRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "CreateRole", "ram", "openAPI") + return +} + +// CreateCreateRoleResponse creates a response to parse from CreateRole response +func CreateCreateRoleResponse() (response *CreateRoleResponse) { + response = &CreateRoleResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/create_user.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/create_user.go new file mode 100644 index 000000000..e020b3112 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/create_user.go @@ -0,0 +1,108 @@ +package ram + +//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" +) + +// CreateUser invokes the ram.CreateUser API synchronously +// api document: https://help.aliyun.com/api/ram/createuser.html +func (client *Client) CreateUser(request *CreateUserRequest) (response *CreateUserResponse, err error) { + response = CreateCreateUserResponse() + err = client.DoAction(request, response) + return +} + +// CreateUserWithChan invokes the ram.CreateUser API asynchronously +// api document: https://help.aliyun.com/api/ram/createuser.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateUserWithChan(request *CreateUserRequest) (<-chan *CreateUserResponse, <-chan error) { + responseChan := make(chan *CreateUserResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateUser(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateUserWithCallback invokes the ram.CreateUser API asynchronously +// api document: https://help.aliyun.com/api/ram/createuser.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateUserWithCallback(request *CreateUserRequest, callback func(response *CreateUserResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateUserResponse + var err error + defer close(result) + response, err = client.CreateUser(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateUserRequest is the request struct for api CreateUser +type CreateUserRequest struct { + *requests.RpcRequest + Comments string `position:"Query" name:"Comments"` + DisplayName string `position:"Query" name:"DisplayName"` + MobilePhone string `position:"Query" name:"MobilePhone"` + Email string `position:"Query" name:"Email"` + UserName string `position:"Query" name:"UserName"` +} + +// CreateUserResponse is the response struct for api CreateUser +type CreateUserResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + User User `json:"User" xml:"User"` +} + +// CreateCreateUserRequest creates a request to invoke CreateUser API +func CreateCreateUserRequest() (request *CreateUserRequest) { + request = &CreateUserRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "CreateUser", "ram", "openAPI") + return +} + +// CreateCreateUserResponse creates a response to parse from CreateUser response +func CreateCreateUserResponse() (response *CreateUserResponse) { + response = &CreateUserResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/create_virtual_mfa_device.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/create_virtual_mfa_device.go new file mode 100644 index 000000000..473d99c39 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/create_virtual_mfa_device.go @@ -0,0 +1,104 @@ +package ram + +//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" +) + +// CreateVirtualMFADevice invokes the ram.CreateVirtualMFADevice API synchronously +// api document: https://help.aliyun.com/api/ram/createvirtualmfadevice.html +func (client *Client) CreateVirtualMFADevice(request *CreateVirtualMFADeviceRequest) (response *CreateVirtualMFADeviceResponse, err error) { + response = CreateCreateVirtualMFADeviceResponse() + err = client.DoAction(request, response) + return +} + +// CreateVirtualMFADeviceWithChan invokes the ram.CreateVirtualMFADevice API asynchronously +// api document: https://help.aliyun.com/api/ram/createvirtualmfadevice.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateVirtualMFADeviceWithChan(request *CreateVirtualMFADeviceRequest) (<-chan *CreateVirtualMFADeviceResponse, <-chan error) { + responseChan := make(chan *CreateVirtualMFADeviceResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateVirtualMFADevice(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateVirtualMFADeviceWithCallback invokes the ram.CreateVirtualMFADevice API asynchronously +// api document: https://help.aliyun.com/api/ram/createvirtualmfadevice.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateVirtualMFADeviceWithCallback(request *CreateVirtualMFADeviceRequest, callback func(response *CreateVirtualMFADeviceResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateVirtualMFADeviceResponse + var err error + defer close(result) + response, err = client.CreateVirtualMFADevice(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateVirtualMFADeviceRequest is the request struct for api CreateVirtualMFADevice +type CreateVirtualMFADeviceRequest struct { + *requests.RpcRequest + VirtualMFADeviceName string `position:"Query" name:"VirtualMFADeviceName"` +} + +// CreateVirtualMFADeviceResponse is the response struct for api CreateVirtualMFADevice +type CreateVirtualMFADeviceResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + VirtualMFADevice VirtualMFADevice `json:"VirtualMFADevice" xml:"VirtualMFADevice"` +} + +// CreateCreateVirtualMFADeviceRequest creates a request to invoke CreateVirtualMFADevice API +func CreateCreateVirtualMFADeviceRequest() (request *CreateVirtualMFADeviceRequest) { + request = &CreateVirtualMFADeviceRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "CreateVirtualMFADevice", "ram", "openAPI") + return +} + +// CreateCreateVirtualMFADeviceResponse creates a response to parse from CreateVirtualMFADevice response +func CreateCreateVirtualMFADeviceResponse() (response *CreateVirtualMFADeviceResponse) { + response = &CreateVirtualMFADeviceResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/delete_access_key.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/delete_access_key.go new file mode 100644 index 000000000..86aebc6aa --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/delete_access_key.go @@ -0,0 +1,104 @@ +package ram + +//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" +) + +// DeleteAccessKey invokes the ram.DeleteAccessKey API synchronously +// api document: https://help.aliyun.com/api/ram/deleteaccesskey.html +func (client *Client) DeleteAccessKey(request *DeleteAccessKeyRequest) (response *DeleteAccessKeyResponse, err error) { + response = CreateDeleteAccessKeyResponse() + err = client.DoAction(request, response) + return +} + +// DeleteAccessKeyWithChan invokes the ram.DeleteAccessKey API asynchronously +// api document: https://help.aliyun.com/api/ram/deleteaccesskey.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteAccessKeyWithChan(request *DeleteAccessKeyRequest) (<-chan *DeleteAccessKeyResponse, <-chan error) { + responseChan := make(chan *DeleteAccessKeyResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteAccessKey(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteAccessKeyWithCallback invokes the ram.DeleteAccessKey API asynchronously +// api document: https://help.aliyun.com/api/ram/deleteaccesskey.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteAccessKeyWithCallback(request *DeleteAccessKeyRequest, callback func(response *DeleteAccessKeyResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteAccessKeyResponse + var err error + defer close(result) + response, err = client.DeleteAccessKey(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteAccessKeyRequest is the request struct for api DeleteAccessKey +type DeleteAccessKeyRequest struct { + *requests.RpcRequest + UserAccessKeyId string `position:"Query" name:"UserAccessKeyId"` + UserName string `position:"Query" name:"UserName"` +} + +// DeleteAccessKeyResponse is the response struct for api DeleteAccessKey +type DeleteAccessKeyResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteAccessKeyRequest creates a request to invoke DeleteAccessKey API +func CreateDeleteAccessKeyRequest() (request *DeleteAccessKeyRequest) { + request = &DeleteAccessKeyRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "DeleteAccessKey", "ram", "openAPI") + return +} + +// CreateDeleteAccessKeyResponse creates a response to parse from DeleteAccessKey response +func CreateDeleteAccessKeyResponse() (response *DeleteAccessKeyResponse) { + response = &DeleteAccessKeyResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/delete_group.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/delete_group.go new file mode 100644 index 000000000..08d69c546 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/delete_group.go @@ -0,0 +1,103 @@ +package ram + +//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" +) + +// DeleteGroup invokes the ram.DeleteGroup API synchronously +// api document: https://help.aliyun.com/api/ram/deletegroup.html +func (client *Client) DeleteGroup(request *DeleteGroupRequest) (response *DeleteGroupResponse, err error) { + response = CreateDeleteGroupResponse() + err = client.DoAction(request, response) + return +} + +// DeleteGroupWithChan invokes the ram.DeleteGroup API asynchronously +// api document: https://help.aliyun.com/api/ram/deletegroup.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteGroupWithChan(request *DeleteGroupRequest) (<-chan *DeleteGroupResponse, <-chan error) { + responseChan := make(chan *DeleteGroupResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteGroup(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteGroupWithCallback invokes the ram.DeleteGroup API asynchronously +// api document: https://help.aliyun.com/api/ram/deletegroup.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteGroupWithCallback(request *DeleteGroupRequest, callback func(response *DeleteGroupResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteGroupResponse + var err error + defer close(result) + response, err = client.DeleteGroup(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteGroupRequest is the request struct for api DeleteGroup +type DeleteGroupRequest struct { + *requests.RpcRequest + GroupName string `position:"Query" name:"GroupName"` +} + +// DeleteGroupResponse is the response struct for api DeleteGroup +type DeleteGroupResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteGroupRequest creates a request to invoke DeleteGroup API +func CreateDeleteGroupRequest() (request *DeleteGroupRequest) { + request = &DeleteGroupRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "DeleteGroup", "ram", "openAPI") + return +} + +// CreateDeleteGroupResponse creates a response to parse from DeleteGroup response +func CreateDeleteGroupResponse() (response *DeleteGroupResponse) { + response = &DeleteGroupResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/delete_login_profile.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/delete_login_profile.go new file mode 100644 index 000000000..abc516956 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/delete_login_profile.go @@ -0,0 +1,103 @@ +package ram + +//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" +) + +// DeleteLoginProfile invokes the ram.DeleteLoginProfile API synchronously +// api document: https://help.aliyun.com/api/ram/deleteloginprofile.html +func (client *Client) DeleteLoginProfile(request *DeleteLoginProfileRequest) (response *DeleteLoginProfileResponse, err error) { + response = CreateDeleteLoginProfileResponse() + err = client.DoAction(request, response) + return +} + +// DeleteLoginProfileWithChan invokes the ram.DeleteLoginProfile API asynchronously +// api document: https://help.aliyun.com/api/ram/deleteloginprofile.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteLoginProfileWithChan(request *DeleteLoginProfileRequest) (<-chan *DeleteLoginProfileResponse, <-chan error) { + responseChan := make(chan *DeleteLoginProfileResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteLoginProfile(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteLoginProfileWithCallback invokes the ram.DeleteLoginProfile API asynchronously +// api document: https://help.aliyun.com/api/ram/deleteloginprofile.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteLoginProfileWithCallback(request *DeleteLoginProfileRequest, callback func(response *DeleteLoginProfileResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteLoginProfileResponse + var err error + defer close(result) + response, err = client.DeleteLoginProfile(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteLoginProfileRequest is the request struct for api DeleteLoginProfile +type DeleteLoginProfileRequest struct { + *requests.RpcRequest + UserName string `position:"Query" name:"UserName"` +} + +// DeleteLoginProfileResponse is the response struct for api DeleteLoginProfile +type DeleteLoginProfileResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteLoginProfileRequest creates a request to invoke DeleteLoginProfile API +func CreateDeleteLoginProfileRequest() (request *DeleteLoginProfileRequest) { + request = &DeleteLoginProfileRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "DeleteLoginProfile", "ram", "openAPI") + return +} + +// CreateDeleteLoginProfileResponse creates a response to parse from DeleteLoginProfile response +func CreateDeleteLoginProfileResponse() (response *DeleteLoginProfileResponse) { + response = &DeleteLoginProfileResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/delete_policy.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/delete_policy.go new file mode 100644 index 000000000..a5952d59c --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/delete_policy.go @@ -0,0 +1,103 @@ +package ram + +//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" +) + +// DeletePolicy invokes the ram.DeletePolicy API synchronously +// api document: https://help.aliyun.com/api/ram/deletepolicy.html +func (client *Client) DeletePolicy(request *DeletePolicyRequest) (response *DeletePolicyResponse, err error) { + response = CreateDeletePolicyResponse() + err = client.DoAction(request, response) + return +} + +// DeletePolicyWithChan invokes the ram.DeletePolicy API asynchronously +// api document: https://help.aliyun.com/api/ram/deletepolicy.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeletePolicyWithChan(request *DeletePolicyRequest) (<-chan *DeletePolicyResponse, <-chan error) { + responseChan := make(chan *DeletePolicyResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeletePolicy(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeletePolicyWithCallback invokes the ram.DeletePolicy API asynchronously +// api document: https://help.aliyun.com/api/ram/deletepolicy.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeletePolicyWithCallback(request *DeletePolicyRequest, callback func(response *DeletePolicyResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeletePolicyResponse + var err error + defer close(result) + response, err = client.DeletePolicy(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeletePolicyRequest is the request struct for api DeletePolicy +type DeletePolicyRequest struct { + *requests.RpcRequest + PolicyName string `position:"Query" name:"PolicyName"` +} + +// DeletePolicyResponse is the response struct for api DeletePolicy +type DeletePolicyResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeletePolicyRequest creates a request to invoke DeletePolicy API +func CreateDeletePolicyRequest() (request *DeletePolicyRequest) { + request = &DeletePolicyRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "DeletePolicy", "ram", "openAPI") + return +} + +// CreateDeletePolicyResponse creates a response to parse from DeletePolicy response +func CreateDeletePolicyResponse() (response *DeletePolicyResponse) { + response = &DeletePolicyResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/delete_policy_version.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/delete_policy_version.go new file mode 100644 index 000000000..937073169 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/delete_policy_version.go @@ -0,0 +1,104 @@ +package ram + +//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" +) + +// DeletePolicyVersion invokes the ram.DeletePolicyVersion API synchronously +// api document: https://help.aliyun.com/api/ram/deletepolicyversion.html +func (client *Client) DeletePolicyVersion(request *DeletePolicyVersionRequest) (response *DeletePolicyVersionResponse, err error) { + response = CreateDeletePolicyVersionResponse() + err = client.DoAction(request, response) + return +} + +// DeletePolicyVersionWithChan invokes the ram.DeletePolicyVersion API asynchronously +// api document: https://help.aliyun.com/api/ram/deletepolicyversion.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeletePolicyVersionWithChan(request *DeletePolicyVersionRequest) (<-chan *DeletePolicyVersionResponse, <-chan error) { + responseChan := make(chan *DeletePolicyVersionResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeletePolicyVersion(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeletePolicyVersionWithCallback invokes the ram.DeletePolicyVersion API asynchronously +// api document: https://help.aliyun.com/api/ram/deletepolicyversion.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeletePolicyVersionWithCallback(request *DeletePolicyVersionRequest, callback func(response *DeletePolicyVersionResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeletePolicyVersionResponse + var err error + defer close(result) + response, err = client.DeletePolicyVersion(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeletePolicyVersionRequest is the request struct for api DeletePolicyVersion +type DeletePolicyVersionRequest struct { + *requests.RpcRequest + VersionId string `position:"Query" name:"VersionId"` + PolicyName string `position:"Query" name:"PolicyName"` +} + +// DeletePolicyVersionResponse is the response struct for api DeletePolicyVersion +type DeletePolicyVersionResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeletePolicyVersionRequest creates a request to invoke DeletePolicyVersion API +func CreateDeletePolicyVersionRequest() (request *DeletePolicyVersionRequest) { + request = &DeletePolicyVersionRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "DeletePolicyVersion", "ram", "openAPI") + return +} + +// CreateDeletePolicyVersionResponse creates a response to parse from DeletePolicyVersion response +func CreateDeletePolicyVersionResponse() (response *DeletePolicyVersionResponse) { + response = &DeletePolicyVersionResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/delete_public_key.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/delete_public_key.go new file mode 100644 index 000000000..d9948bd58 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/delete_public_key.go @@ -0,0 +1,104 @@ +package ram + +//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" +) + +// DeletePublicKey invokes the ram.DeletePublicKey API synchronously +// api document: https://help.aliyun.com/api/ram/deletepublickey.html +func (client *Client) DeletePublicKey(request *DeletePublicKeyRequest) (response *DeletePublicKeyResponse, err error) { + response = CreateDeletePublicKeyResponse() + err = client.DoAction(request, response) + return +} + +// DeletePublicKeyWithChan invokes the ram.DeletePublicKey API asynchronously +// api document: https://help.aliyun.com/api/ram/deletepublickey.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeletePublicKeyWithChan(request *DeletePublicKeyRequest) (<-chan *DeletePublicKeyResponse, <-chan error) { + responseChan := make(chan *DeletePublicKeyResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeletePublicKey(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeletePublicKeyWithCallback invokes the ram.DeletePublicKey API asynchronously +// api document: https://help.aliyun.com/api/ram/deletepublickey.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeletePublicKeyWithCallback(request *DeletePublicKeyRequest, callback func(response *DeletePublicKeyResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeletePublicKeyResponse + var err error + defer close(result) + response, err = client.DeletePublicKey(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeletePublicKeyRequest is the request struct for api DeletePublicKey +type DeletePublicKeyRequest struct { + *requests.RpcRequest + UserPublicKeyId string `position:"Query" name:"UserPublicKeyId"` + UserName string `position:"Query" name:"UserName"` +} + +// DeletePublicKeyResponse is the response struct for api DeletePublicKey +type DeletePublicKeyResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeletePublicKeyRequest creates a request to invoke DeletePublicKey API +func CreateDeletePublicKeyRequest() (request *DeletePublicKeyRequest) { + request = &DeletePublicKeyRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "DeletePublicKey", "ram", "openAPI") + return +} + +// CreateDeletePublicKeyResponse creates a response to parse from DeletePublicKey response +func CreateDeletePublicKeyResponse() (response *DeletePublicKeyResponse) { + response = &DeletePublicKeyResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/delete_role.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/delete_role.go new file mode 100644 index 000000000..b7bc98505 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/delete_role.go @@ -0,0 +1,103 @@ +package ram + +//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" +) + +// DeleteRole invokes the ram.DeleteRole API synchronously +// api document: https://help.aliyun.com/api/ram/deleterole.html +func (client *Client) DeleteRole(request *DeleteRoleRequest) (response *DeleteRoleResponse, err error) { + response = CreateDeleteRoleResponse() + err = client.DoAction(request, response) + return +} + +// DeleteRoleWithChan invokes the ram.DeleteRole API asynchronously +// api document: https://help.aliyun.com/api/ram/deleterole.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteRoleWithChan(request *DeleteRoleRequest) (<-chan *DeleteRoleResponse, <-chan error) { + responseChan := make(chan *DeleteRoleResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteRole(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteRoleWithCallback invokes the ram.DeleteRole API asynchronously +// api document: https://help.aliyun.com/api/ram/deleterole.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteRoleWithCallback(request *DeleteRoleRequest, callback func(response *DeleteRoleResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteRoleResponse + var err error + defer close(result) + response, err = client.DeleteRole(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteRoleRequest is the request struct for api DeleteRole +type DeleteRoleRequest struct { + *requests.RpcRequest + RoleName string `position:"Query" name:"RoleName"` +} + +// DeleteRoleResponse is the response struct for api DeleteRole +type DeleteRoleResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteRoleRequest creates a request to invoke DeleteRole API +func CreateDeleteRoleRequest() (request *DeleteRoleRequest) { + request = &DeleteRoleRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "DeleteRole", "ram", "openAPI") + return +} + +// CreateDeleteRoleResponse creates a response to parse from DeleteRole response +func CreateDeleteRoleResponse() (response *DeleteRoleResponse) { + response = &DeleteRoleResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/delete_user.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/delete_user.go new file mode 100644 index 000000000..218064326 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/delete_user.go @@ -0,0 +1,103 @@ +package ram + +//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" +) + +// DeleteUser invokes the ram.DeleteUser API synchronously +// api document: https://help.aliyun.com/api/ram/deleteuser.html +func (client *Client) DeleteUser(request *DeleteUserRequest) (response *DeleteUserResponse, err error) { + response = CreateDeleteUserResponse() + err = client.DoAction(request, response) + return +} + +// DeleteUserWithChan invokes the ram.DeleteUser API asynchronously +// api document: https://help.aliyun.com/api/ram/deleteuser.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteUserWithChan(request *DeleteUserRequest) (<-chan *DeleteUserResponse, <-chan error) { + responseChan := make(chan *DeleteUserResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteUser(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteUserWithCallback invokes the ram.DeleteUser API asynchronously +// api document: https://help.aliyun.com/api/ram/deleteuser.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteUserWithCallback(request *DeleteUserRequest, callback func(response *DeleteUserResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteUserResponse + var err error + defer close(result) + response, err = client.DeleteUser(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteUserRequest is the request struct for api DeleteUser +type DeleteUserRequest struct { + *requests.RpcRequest + UserName string `position:"Query" name:"UserName"` +} + +// DeleteUserResponse is the response struct for api DeleteUser +type DeleteUserResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteUserRequest creates a request to invoke DeleteUser API +func CreateDeleteUserRequest() (request *DeleteUserRequest) { + request = &DeleteUserRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "DeleteUser", "ram", "openAPI") + return +} + +// CreateDeleteUserResponse creates a response to parse from DeleteUser response +func CreateDeleteUserResponse() (response *DeleteUserResponse) { + response = &DeleteUserResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/delete_virtual_mfa_device.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/delete_virtual_mfa_device.go new file mode 100644 index 000000000..de292703c --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/delete_virtual_mfa_device.go @@ -0,0 +1,103 @@ +package ram + +//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" +) + +// DeleteVirtualMFADevice invokes the ram.DeleteVirtualMFADevice API synchronously +// api document: https://help.aliyun.com/api/ram/deletevirtualmfadevice.html +func (client *Client) DeleteVirtualMFADevice(request *DeleteVirtualMFADeviceRequest) (response *DeleteVirtualMFADeviceResponse, err error) { + response = CreateDeleteVirtualMFADeviceResponse() + err = client.DoAction(request, response) + return +} + +// DeleteVirtualMFADeviceWithChan invokes the ram.DeleteVirtualMFADevice API asynchronously +// api document: https://help.aliyun.com/api/ram/deletevirtualmfadevice.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteVirtualMFADeviceWithChan(request *DeleteVirtualMFADeviceRequest) (<-chan *DeleteVirtualMFADeviceResponse, <-chan error) { + responseChan := make(chan *DeleteVirtualMFADeviceResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteVirtualMFADevice(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteVirtualMFADeviceWithCallback invokes the ram.DeleteVirtualMFADevice API asynchronously +// api document: https://help.aliyun.com/api/ram/deletevirtualmfadevice.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteVirtualMFADeviceWithCallback(request *DeleteVirtualMFADeviceRequest, callback func(response *DeleteVirtualMFADeviceResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteVirtualMFADeviceResponse + var err error + defer close(result) + response, err = client.DeleteVirtualMFADevice(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteVirtualMFADeviceRequest is the request struct for api DeleteVirtualMFADevice +type DeleteVirtualMFADeviceRequest struct { + *requests.RpcRequest + SerialNumber string `position:"Query" name:"SerialNumber"` +} + +// DeleteVirtualMFADeviceResponse is the response struct for api DeleteVirtualMFADevice +type DeleteVirtualMFADeviceResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteVirtualMFADeviceRequest creates a request to invoke DeleteVirtualMFADevice API +func CreateDeleteVirtualMFADeviceRequest() (request *DeleteVirtualMFADeviceRequest) { + request = &DeleteVirtualMFADeviceRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "DeleteVirtualMFADevice", "ram", "openAPI") + return +} + +// CreateDeleteVirtualMFADeviceResponse creates a response to parse from DeleteVirtualMFADevice response +func CreateDeleteVirtualMFADeviceResponse() (response *DeleteVirtualMFADeviceResponse) { + response = &DeleteVirtualMFADeviceResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/detach_policy_from_group.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/detach_policy_from_group.go new file mode 100644 index 000000000..89f2fca74 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/detach_policy_from_group.go @@ -0,0 +1,105 @@ +package ram + +//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" +) + +// DetachPolicyFromGroup invokes the ram.DetachPolicyFromGroup API synchronously +// api document: https://help.aliyun.com/api/ram/detachpolicyfromgroup.html +func (client *Client) DetachPolicyFromGroup(request *DetachPolicyFromGroupRequest) (response *DetachPolicyFromGroupResponse, err error) { + response = CreateDetachPolicyFromGroupResponse() + err = client.DoAction(request, response) + return +} + +// DetachPolicyFromGroupWithChan invokes the ram.DetachPolicyFromGroup API asynchronously +// api document: https://help.aliyun.com/api/ram/detachpolicyfromgroup.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DetachPolicyFromGroupWithChan(request *DetachPolicyFromGroupRequest) (<-chan *DetachPolicyFromGroupResponse, <-chan error) { + responseChan := make(chan *DetachPolicyFromGroupResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DetachPolicyFromGroup(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DetachPolicyFromGroupWithCallback invokes the ram.DetachPolicyFromGroup API asynchronously +// api document: https://help.aliyun.com/api/ram/detachpolicyfromgroup.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DetachPolicyFromGroupWithCallback(request *DetachPolicyFromGroupRequest, callback func(response *DetachPolicyFromGroupResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DetachPolicyFromGroupResponse + var err error + defer close(result) + response, err = client.DetachPolicyFromGroup(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DetachPolicyFromGroupRequest is the request struct for api DetachPolicyFromGroup +type DetachPolicyFromGroupRequest struct { + *requests.RpcRequest + PolicyType string `position:"Query" name:"PolicyType"` + PolicyName string `position:"Query" name:"PolicyName"` + GroupName string `position:"Query" name:"GroupName"` +} + +// DetachPolicyFromGroupResponse is the response struct for api DetachPolicyFromGroup +type DetachPolicyFromGroupResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDetachPolicyFromGroupRequest creates a request to invoke DetachPolicyFromGroup API +func CreateDetachPolicyFromGroupRequest() (request *DetachPolicyFromGroupRequest) { + request = &DetachPolicyFromGroupRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "DetachPolicyFromGroup", "ram", "openAPI") + return +} + +// CreateDetachPolicyFromGroupResponse creates a response to parse from DetachPolicyFromGroup response +func CreateDetachPolicyFromGroupResponse() (response *DetachPolicyFromGroupResponse) { + response = &DetachPolicyFromGroupResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/detach_policy_from_role.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/detach_policy_from_role.go new file mode 100644 index 000000000..d7041202b --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/detach_policy_from_role.go @@ -0,0 +1,105 @@ +package ram + +//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" +) + +// DetachPolicyFromRole invokes the ram.DetachPolicyFromRole API synchronously +// api document: https://help.aliyun.com/api/ram/detachpolicyfromrole.html +func (client *Client) DetachPolicyFromRole(request *DetachPolicyFromRoleRequest) (response *DetachPolicyFromRoleResponse, err error) { + response = CreateDetachPolicyFromRoleResponse() + err = client.DoAction(request, response) + return +} + +// DetachPolicyFromRoleWithChan invokes the ram.DetachPolicyFromRole API asynchronously +// api document: https://help.aliyun.com/api/ram/detachpolicyfromrole.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DetachPolicyFromRoleWithChan(request *DetachPolicyFromRoleRequest) (<-chan *DetachPolicyFromRoleResponse, <-chan error) { + responseChan := make(chan *DetachPolicyFromRoleResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DetachPolicyFromRole(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DetachPolicyFromRoleWithCallback invokes the ram.DetachPolicyFromRole API asynchronously +// api document: https://help.aliyun.com/api/ram/detachpolicyfromrole.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DetachPolicyFromRoleWithCallback(request *DetachPolicyFromRoleRequest, callback func(response *DetachPolicyFromRoleResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DetachPolicyFromRoleResponse + var err error + defer close(result) + response, err = client.DetachPolicyFromRole(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DetachPolicyFromRoleRequest is the request struct for api DetachPolicyFromRole +type DetachPolicyFromRoleRequest struct { + *requests.RpcRequest + PolicyType string `position:"Query" name:"PolicyType"` + RoleName string `position:"Query" name:"RoleName"` + PolicyName string `position:"Query" name:"PolicyName"` +} + +// DetachPolicyFromRoleResponse is the response struct for api DetachPolicyFromRole +type DetachPolicyFromRoleResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDetachPolicyFromRoleRequest creates a request to invoke DetachPolicyFromRole API +func CreateDetachPolicyFromRoleRequest() (request *DetachPolicyFromRoleRequest) { + request = &DetachPolicyFromRoleRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "DetachPolicyFromRole", "ram", "openAPI") + return +} + +// CreateDetachPolicyFromRoleResponse creates a response to parse from DetachPolicyFromRole response +func CreateDetachPolicyFromRoleResponse() (response *DetachPolicyFromRoleResponse) { + response = &DetachPolicyFromRoleResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/detach_policy_from_user.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/detach_policy_from_user.go new file mode 100644 index 000000000..22388f34e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/detach_policy_from_user.go @@ -0,0 +1,105 @@ +package ram + +//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" +) + +// DetachPolicyFromUser invokes the ram.DetachPolicyFromUser API synchronously +// api document: https://help.aliyun.com/api/ram/detachpolicyfromuser.html +func (client *Client) DetachPolicyFromUser(request *DetachPolicyFromUserRequest) (response *DetachPolicyFromUserResponse, err error) { + response = CreateDetachPolicyFromUserResponse() + err = client.DoAction(request, response) + return +} + +// DetachPolicyFromUserWithChan invokes the ram.DetachPolicyFromUser API asynchronously +// api document: https://help.aliyun.com/api/ram/detachpolicyfromuser.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DetachPolicyFromUserWithChan(request *DetachPolicyFromUserRequest) (<-chan *DetachPolicyFromUserResponse, <-chan error) { + responseChan := make(chan *DetachPolicyFromUserResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DetachPolicyFromUser(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DetachPolicyFromUserWithCallback invokes the ram.DetachPolicyFromUser API asynchronously +// api document: https://help.aliyun.com/api/ram/detachpolicyfromuser.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DetachPolicyFromUserWithCallback(request *DetachPolicyFromUserRequest, callback func(response *DetachPolicyFromUserResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DetachPolicyFromUserResponse + var err error + defer close(result) + response, err = client.DetachPolicyFromUser(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DetachPolicyFromUserRequest is the request struct for api DetachPolicyFromUser +type DetachPolicyFromUserRequest struct { + *requests.RpcRequest + PolicyType string `position:"Query" name:"PolicyType"` + PolicyName string `position:"Query" name:"PolicyName"` + UserName string `position:"Query" name:"UserName"` +} + +// DetachPolicyFromUserResponse is the response struct for api DetachPolicyFromUser +type DetachPolicyFromUserResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDetachPolicyFromUserRequest creates a request to invoke DetachPolicyFromUser API +func CreateDetachPolicyFromUserRequest() (request *DetachPolicyFromUserRequest) { + request = &DetachPolicyFromUserRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "DetachPolicyFromUser", "ram", "openAPI") + return +} + +// CreateDetachPolicyFromUserResponse creates a response to parse from DetachPolicyFromUser response +func CreateDetachPolicyFromUserResponse() (response *DetachPolicyFromUserResponse) { + response = &DetachPolicyFromUserResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_access_key_last_used.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_access_key_last_used.go new file mode 100644 index 000000000..61f187fb7 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_access_key_last_used.go @@ -0,0 +1,105 @@ +package ram + +//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" +) + +// GetAccessKeyLastUsed invokes the ram.GetAccessKeyLastUsed API synchronously +// api document: https://help.aliyun.com/api/ram/getaccesskeylastused.html +func (client *Client) GetAccessKeyLastUsed(request *GetAccessKeyLastUsedRequest) (response *GetAccessKeyLastUsedResponse, err error) { + response = CreateGetAccessKeyLastUsedResponse() + err = client.DoAction(request, response) + return +} + +// GetAccessKeyLastUsedWithChan invokes the ram.GetAccessKeyLastUsed API asynchronously +// api document: https://help.aliyun.com/api/ram/getaccesskeylastused.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) GetAccessKeyLastUsedWithChan(request *GetAccessKeyLastUsedRequest) (<-chan *GetAccessKeyLastUsedResponse, <-chan error) { + responseChan := make(chan *GetAccessKeyLastUsedResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.GetAccessKeyLastUsed(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// GetAccessKeyLastUsedWithCallback invokes the ram.GetAccessKeyLastUsed API asynchronously +// api document: https://help.aliyun.com/api/ram/getaccesskeylastused.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) GetAccessKeyLastUsedWithCallback(request *GetAccessKeyLastUsedRequest, callback func(response *GetAccessKeyLastUsedResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *GetAccessKeyLastUsedResponse + var err error + defer close(result) + response, err = client.GetAccessKeyLastUsed(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// GetAccessKeyLastUsedRequest is the request struct for api GetAccessKeyLastUsed +type GetAccessKeyLastUsedRequest struct { + *requests.RpcRequest + UserAccessKeyId string `position:"Query" name:"UserAccessKeyId"` + UserName string `position:"Query" name:"UserName"` +} + +// GetAccessKeyLastUsedResponse is the response struct for api GetAccessKeyLastUsed +type GetAccessKeyLastUsedResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + AccessKeyLastUsed AccessKeyLastUsed `json:"AccessKeyLastUsed" xml:"AccessKeyLastUsed"` +} + +// CreateGetAccessKeyLastUsedRequest creates a request to invoke GetAccessKeyLastUsed API +func CreateGetAccessKeyLastUsedRequest() (request *GetAccessKeyLastUsedRequest) { + request = &GetAccessKeyLastUsedRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "GetAccessKeyLastUsed", "ram", "openAPI") + return +} + +// CreateGetAccessKeyLastUsedResponse creates a response to parse from GetAccessKeyLastUsed response +func CreateGetAccessKeyLastUsedResponse() (response *GetAccessKeyLastUsedResponse) { + response = &GetAccessKeyLastUsedResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_account_alias.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_account_alias.go new file mode 100644 index 000000000..30c36847a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_account_alias.go @@ -0,0 +1,103 @@ +package ram + +//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" +) + +// GetAccountAlias invokes the ram.GetAccountAlias API synchronously +// api document: https://help.aliyun.com/api/ram/getaccountalias.html +func (client *Client) GetAccountAlias(request *GetAccountAliasRequest) (response *GetAccountAliasResponse, err error) { + response = CreateGetAccountAliasResponse() + err = client.DoAction(request, response) + return +} + +// GetAccountAliasWithChan invokes the ram.GetAccountAlias API asynchronously +// api document: https://help.aliyun.com/api/ram/getaccountalias.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) GetAccountAliasWithChan(request *GetAccountAliasRequest) (<-chan *GetAccountAliasResponse, <-chan error) { + responseChan := make(chan *GetAccountAliasResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.GetAccountAlias(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// GetAccountAliasWithCallback invokes the ram.GetAccountAlias API asynchronously +// api document: https://help.aliyun.com/api/ram/getaccountalias.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) GetAccountAliasWithCallback(request *GetAccountAliasRequest, callback func(response *GetAccountAliasResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *GetAccountAliasResponse + var err error + defer close(result) + response, err = client.GetAccountAlias(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// GetAccountAliasRequest is the request struct for api GetAccountAlias +type GetAccountAliasRequest struct { + *requests.RpcRequest +} + +// GetAccountAliasResponse is the response struct for api GetAccountAlias +type GetAccountAliasResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + AccountAlias string `json:"AccountAlias" xml:"AccountAlias"` +} + +// CreateGetAccountAliasRequest creates a request to invoke GetAccountAlias API +func CreateGetAccountAliasRequest() (request *GetAccountAliasRequest) { + request = &GetAccountAliasRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "GetAccountAlias", "ram", "openAPI") + return +} + +// CreateGetAccountAliasResponse creates a response to parse from GetAccountAlias response +func CreateGetAccountAliasResponse() (response *GetAccountAliasResponse) { + response = &GetAccountAliasResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_group.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_group.go new file mode 100644 index 000000000..9ba716042 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_group.go @@ -0,0 +1,104 @@ +package ram + +//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" +) + +// GetGroup invokes the ram.GetGroup API synchronously +// api document: https://help.aliyun.com/api/ram/getgroup.html +func (client *Client) GetGroup(request *GetGroupRequest) (response *GetGroupResponse, err error) { + response = CreateGetGroupResponse() + err = client.DoAction(request, response) + return +} + +// GetGroupWithChan invokes the ram.GetGroup API asynchronously +// api document: https://help.aliyun.com/api/ram/getgroup.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) GetGroupWithChan(request *GetGroupRequest) (<-chan *GetGroupResponse, <-chan error) { + responseChan := make(chan *GetGroupResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.GetGroup(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// GetGroupWithCallback invokes the ram.GetGroup API asynchronously +// api document: https://help.aliyun.com/api/ram/getgroup.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) GetGroupWithCallback(request *GetGroupRequest, callback func(response *GetGroupResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *GetGroupResponse + var err error + defer close(result) + response, err = client.GetGroup(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// GetGroupRequest is the request struct for api GetGroup +type GetGroupRequest struct { + *requests.RpcRequest + GroupName string `position:"Query" name:"GroupName"` +} + +// GetGroupResponse is the response struct for api GetGroup +type GetGroupResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Group Group `json:"Group" xml:"Group"` +} + +// CreateGetGroupRequest creates a request to invoke GetGroup API +func CreateGetGroupRequest() (request *GetGroupRequest) { + request = &GetGroupRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "GetGroup", "ram", "openAPI") + return +} + +// CreateGetGroupResponse creates a response to parse from GetGroup response +func CreateGetGroupResponse() (response *GetGroupResponse) { + response = &GetGroupResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_login_profile.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_login_profile.go new file mode 100644 index 000000000..f258dd5be --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_login_profile.go @@ -0,0 +1,104 @@ +package ram + +//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" +) + +// GetLoginProfile invokes the ram.GetLoginProfile API synchronously +// api document: https://help.aliyun.com/api/ram/getloginprofile.html +func (client *Client) GetLoginProfile(request *GetLoginProfileRequest) (response *GetLoginProfileResponse, err error) { + response = CreateGetLoginProfileResponse() + err = client.DoAction(request, response) + return +} + +// GetLoginProfileWithChan invokes the ram.GetLoginProfile API asynchronously +// api document: https://help.aliyun.com/api/ram/getloginprofile.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) GetLoginProfileWithChan(request *GetLoginProfileRequest) (<-chan *GetLoginProfileResponse, <-chan error) { + responseChan := make(chan *GetLoginProfileResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.GetLoginProfile(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// GetLoginProfileWithCallback invokes the ram.GetLoginProfile API asynchronously +// api document: https://help.aliyun.com/api/ram/getloginprofile.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) GetLoginProfileWithCallback(request *GetLoginProfileRequest, callback func(response *GetLoginProfileResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *GetLoginProfileResponse + var err error + defer close(result) + response, err = client.GetLoginProfile(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// GetLoginProfileRequest is the request struct for api GetLoginProfile +type GetLoginProfileRequest struct { + *requests.RpcRequest + UserName string `position:"Query" name:"UserName"` +} + +// GetLoginProfileResponse is the response struct for api GetLoginProfile +type GetLoginProfileResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + LoginProfile LoginProfile `json:"LoginProfile" xml:"LoginProfile"` +} + +// CreateGetLoginProfileRequest creates a request to invoke GetLoginProfile API +func CreateGetLoginProfileRequest() (request *GetLoginProfileRequest) { + request = &GetLoginProfileRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "GetLoginProfile", "ram", "openAPI") + return +} + +// CreateGetLoginProfileResponse creates a response to parse from GetLoginProfile response +func CreateGetLoginProfileResponse() (response *GetLoginProfileResponse) { + response = &GetLoginProfileResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_password_policy.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_password_policy.go new file mode 100644 index 000000000..b7b0e0658 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_password_policy.go @@ -0,0 +1,103 @@ +package ram + +//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" +) + +// GetPasswordPolicy invokes the ram.GetPasswordPolicy API synchronously +// api document: https://help.aliyun.com/api/ram/getpasswordpolicy.html +func (client *Client) GetPasswordPolicy(request *GetPasswordPolicyRequest) (response *GetPasswordPolicyResponse, err error) { + response = CreateGetPasswordPolicyResponse() + err = client.DoAction(request, response) + return +} + +// GetPasswordPolicyWithChan invokes the ram.GetPasswordPolicy API asynchronously +// api document: https://help.aliyun.com/api/ram/getpasswordpolicy.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) GetPasswordPolicyWithChan(request *GetPasswordPolicyRequest) (<-chan *GetPasswordPolicyResponse, <-chan error) { + responseChan := make(chan *GetPasswordPolicyResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.GetPasswordPolicy(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// GetPasswordPolicyWithCallback invokes the ram.GetPasswordPolicy API asynchronously +// api document: https://help.aliyun.com/api/ram/getpasswordpolicy.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) GetPasswordPolicyWithCallback(request *GetPasswordPolicyRequest, callback func(response *GetPasswordPolicyResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *GetPasswordPolicyResponse + var err error + defer close(result) + response, err = client.GetPasswordPolicy(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// GetPasswordPolicyRequest is the request struct for api GetPasswordPolicy +type GetPasswordPolicyRequest struct { + *requests.RpcRequest +} + +// GetPasswordPolicyResponse is the response struct for api GetPasswordPolicy +type GetPasswordPolicyResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + PasswordPolicy PasswordPolicy `json:"PasswordPolicy" xml:"PasswordPolicy"` +} + +// CreateGetPasswordPolicyRequest creates a request to invoke GetPasswordPolicy API +func CreateGetPasswordPolicyRequest() (request *GetPasswordPolicyRequest) { + request = &GetPasswordPolicyRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "GetPasswordPolicy", "ram", "openAPI") + return +} + +// CreateGetPasswordPolicyResponse creates a response to parse from GetPasswordPolicy response +func CreateGetPasswordPolicyResponse() (response *GetPasswordPolicyResponse) { + response = &GetPasswordPolicyResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_policy.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_policy.go new file mode 100644 index 000000000..7b193e6ad --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_policy.go @@ -0,0 +1,105 @@ +package ram + +//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" +) + +// GetPolicy invokes the ram.GetPolicy API synchronously +// api document: https://help.aliyun.com/api/ram/getpolicy.html +func (client *Client) GetPolicy(request *GetPolicyRequest) (response *GetPolicyResponse, err error) { + response = CreateGetPolicyResponse() + err = client.DoAction(request, response) + return +} + +// GetPolicyWithChan invokes the ram.GetPolicy API asynchronously +// api document: https://help.aliyun.com/api/ram/getpolicy.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) GetPolicyWithChan(request *GetPolicyRequest) (<-chan *GetPolicyResponse, <-chan error) { + responseChan := make(chan *GetPolicyResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.GetPolicy(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// GetPolicyWithCallback invokes the ram.GetPolicy API asynchronously +// api document: https://help.aliyun.com/api/ram/getpolicy.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) GetPolicyWithCallback(request *GetPolicyRequest, callback func(response *GetPolicyResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *GetPolicyResponse + var err error + defer close(result) + response, err = client.GetPolicy(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// GetPolicyRequest is the request struct for api GetPolicy +type GetPolicyRequest struct { + *requests.RpcRequest + PolicyType string `position:"Query" name:"PolicyType"` + PolicyName string `position:"Query" name:"PolicyName"` +} + +// GetPolicyResponse is the response struct for api GetPolicy +type GetPolicyResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Policy Policy `json:"Policy" xml:"Policy"` +} + +// CreateGetPolicyRequest creates a request to invoke GetPolicy API +func CreateGetPolicyRequest() (request *GetPolicyRequest) { + request = &GetPolicyRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "GetPolicy", "ram", "openAPI") + return +} + +// CreateGetPolicyResponse creates a response to parse from GetPolicy response +func CreateGetPolicyResponse() (response *GetPolicyResponse) { + response = &GetPolicyResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_policy_version.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_policy_version.go new file mode 100644 index 000000000..6cf49b0bd --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_policy_version.go @@ -0,0 +1,106 @@ +package ram + +//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" +) + +// GetPolicyVersion invokes the ram.GetPolicyVersion API synchronously +// api document: https://help.aliyun.com/api/ram/getpolicyversion.html +func (client *Client) GetPolicyVersion(request *GetPolicyVersionRequest) (response *GetPolicyVersionResponse, err error) { + response = CreateGetPolicyVersionResponse() + err = client.DoAction(request, response) + return +} + +// GetPolicyVersionWithChan invokes the ram.GetPolicyVersion API asynchronously +// api document: https://help.aliyun.com/api/ram/getpolicyversion.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) GetPolicyVersionWithChan(request *GetPolicyVersionRequest) (<-chan *GetPolicyVersionResponse, <-chan error) { + responseChan := make(chan *GetPolicyVersionResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.GetPolicyVersion(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// GetPolicyVersionWithCallback invokes the ram.GetPolicyVersion API asynchronously +// api document: https://help.aliyun.com/api/ram/getpolicyversion.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) GetPolicyVersionWithCallback(request *GetPolicyVersionRequest, callback func(response *GetPolicyVersionResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *GetPolicyVersionResponse + var err error + defer close(result) + response, err = client.GetPolicyVersion(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// GetPolicyVersionRequest is the request struct for api GetPolicyVersion +type GetPolicyVersionRequest struct { + *requests.RpcRequest + VersionId string `position:"Query" name:"VersionId"` + PolicyType string `position:"Query" name:"PolicyType"` + PolicyName string `position:"Query" name:"PolicyName"` +} + +// GetPolicyVersionResponse is the response struct for api GetPolicyVersion +type GetPolicyVersionResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + PolicyVersion PolicyVersion `json:"PolicyVersion" xml:"PolicyVersion"` +} + +// CreateGetPolicyVersionRequest creates a request to invoke GetPolicyVersion API +func CreateGetPolicyVersionRequest() (request *GetPolicyVersionRequest) { + request = &GetPolicyVersionRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "GetPolicyVersion", "ram", "openAPI") + return +} + +// CreateGetPolicyVersionResponse creates a response to parse from GetPolicyVersion response +func CreateGetPolicyVersionResponse() (response *GetPolicyVersionResponse) { + response = &GetPolicyVersionResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_public_key.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_public_key.go new file mode 100644 index 000000000..dec0d692b --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_public_key.go @@ -0,0 +1,105 @@ +package ram + +//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" +) + +// GetPublicKey invokes the ram.GetPublicKey API synchronously +// api document: https://help.aliyun.com/api/ram/getpublickey.html +func (client *Client) GetPublicKey(request *GetPublicKeyRequest) (response *GetPublicKeyResponse, err error) { + response = CreateGetPublicKeyResponse() + err = client.DoAction(request, response) + return +} + +// GetPublicKeyWithChan invokes the ram.GetPublicKey API asynchronously +// api document: https://help.aliyun.com/api/ram/getpublickey.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) GetPublicKeyWithChan(request *GetPublicKeyRequest) (<-chan *GetPublicKeyResponse, <-chan error) { + responseChan := make(chan *GetPublicKeyResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.GetPublicKey(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// GetPublicKeyWithCallback invokes the ram.GetPublicKey API asynchronously +// api document: https://help.aliyun.com/api/ram/getpublickey.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) GetPublicKeyWithCallback(request *GetPublicKeyRequest, callback func(response *GetPublicKeyResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *GetPublicKeyResponse + var err error + defer close(result) + response, err = client.GetPublicKey(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// GetPublicKeyRequest is the request struct for api GetPublicKey +type GetPublicKeyRequest struct { + *requests.RpcRequest + UserPublicKeyId string `position:"Query" name:"UserPublicKeyId"` + UserName string `position:"Query" name:"UserName"` +} + +// GetPublicKeyResponse is the response struct for api GetPublicKey +type GetPublicKeyResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + PublicKey PublicKey `json:"PublicKey" xml:"PublicKey"` +} + +// CreateGetPublicKeyRequest creates a request to invoke GetPublicKey API +func CreateGetPublicKeyRequest() (request *GetPublicKeyRequest) { + request = &GetPublicKeyRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "GetPublicKey", "ram", "openAPI") + return +} + +// CreateGetPublicKeyResponse creates a response to parse from GetPublicKey response +func CreateGetPublicKeyResponse() (response *GetPublicKeyResponse) { + response = &GetPublicKeyResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_role.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_role.go new file mode 100644 index 000000000..62f998abd --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_role.go @@ -0,0 +1,104 @@ +package ram + +//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" +) + +// GetRole invokes the ram.GetRole API synchronously +// api document: https://help.aliyun.com/api/ram/getrole.html +func (client *Client) GetRole(request *GetRoleRequest) (response *GetRoleResponse, err error) { + response = CreateGetRoleResponse() + err = client.DoAction(request, response) + return +} + +// GetRoleWithChan invokes the ram.GetRole API asynchronously +// api document: https://help.aliyun.com/api/ram/getrole.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) GetRoleWithChan(request *GetRoleRequest) (<-chan *GetRoleResponse, <-chan error) { + responseChan := make(chan *GetRoleResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.GetRole(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// GetRoleWithCallback invokes the ram.GetRole API asynchronously +// api document: https://help.aliyun.com/api/ram/getrole.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) GetRoleWithCallback(request *GetRoleRequest, callback func(response *GetRoleResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *GetRoleResponse + var err error + defer close(result) + response, err = client.GetRole(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// GetRoleRequest is the request struct for api GetRole +type GetRoleRequest struct { + *requests.RpcRequest + RoleName string `position:"Query" name:"RoleName"` +} + +// GetRoleResponse is the response struct for api GetRole +type GetRoleResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Role Role `json:"Role" xml:"Role"` +} + +// CreateGetRoleRequest creates a request to invoke GetRole API +func CreateGetRoleRequest() (request *GetRoleRequest) { + request = &GetRoleRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "GetRole", "ram", "openAPI") + return +} + +// CreateGetRoleResponse creates a response to parse from GetRole response +func CreateGetRoleResponse() (response *GetRoleResponse) { + response = &GetRoleResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_security_preference.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_security_preference.go new file mode 100644 index 000000000..f3a3d18d1 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_security_preference.go @@ -0,0 +1,103 @@ +package ram + +//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" +) + +// GetSecurityPreference invokes the ram.GetSecurityPreference API synchronously +// api document: https://help.aliyun.com/api/ram/getsecuritypreference.html +func (client *Client) GetSecurityPreference(request *GetSecurityPreferenceRequest) (response *GetSecurityPreferenceResponse, err error) { + response = CreateGetSecurityPreferenceResponse() + err = client.DoAction(request, response) + return +} + +// GetSecurityPreferenceWithChan invokes the ram.GetSecurityPreference API asynchronously +// api document: https://help.aliyun.com/api/ram/getsecuritypreference.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) GetSecurityPreferenceWithChan(request *GetSecurityPreferenceRequest) (<-chan *GetSecurityPreferenceResponse, <-chan error) { + responseChan := make(chan *GetSecurityPreferenceResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.GetSecurityPreference(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// GetSecurityPreferenceWithCallback invokes the ram.GetSecurityPreference API asynchronously +// api document: https://help.aliyun.com/api/ram/getsecuritypreference.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) GetSecurityPreferenceWithCallback(request *GetSecurityPreferenceRequest, callback func(response *GetSecurityPreferenceResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *GetSecurityPreferenceResponse + var err error + defer close(result) + response, err = client.GetSecurityPreference(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// GetSecurityPreferenceRequest is the request struct for api GetSecurityPreference +type GetSecurityPreferenceRequest struct { + *requests.RpcRequest +} + +// GetSecurityPreferenceResponse is the response struct for api GetSecurityPreference +type GetSecurityPreferenceResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + SecurityPreference SecurityPreference `json:"SecurityPreference" xml:"SecurityPreference"` +} + +// CreateGetSecurityPreferenceRequest creates a request to invoke GetSecurityPreference API +func CreateGetSecurityPreferenceRequest() (request *GetSecurityPreferenceRequest) { + request = &GetSecurityPreferenceRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "GetSecurityPreference", "ram", "openAPI") + return +} + +// CreateGetSecurityPreferenceResponse creates a response to parse from GetSecurityPreference response +func CreateGetSecurityPreferenceResponse() (response *GetSecurityPreferenceResponse) { + response = &GetSecurityPreferenceResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_user.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_user.go new file mode 100644 index 000000000..f38eb9e25 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_user.go @@ -0,0 +1,104 @@ +package ram + +//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" +) + +// GetUser invokes the ram.GetUser API synchronously +// api document: https://help.aliyun.com/api/ram/getuser.html +func (client *Client) GetUser(request *GetUserRequest) (response *GetUserResponse, err error) { + response = CreateGetUserResponse() + err = client.DoAction(request, response) + return +} + +// GetUserWithChan invokes the ram.GetUser API asynchronously +// api document: https://help.aliyun.com/api/ram/getuser.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) GetUserWithChan(request *GetUserRequest) (<-chan *GetUserResponse, <-chan error) { + responseChan := make(chan *GetUserResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.GetUser(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// GetUserWithCallback invokes the ram.GetUser API asynchronously +// api document: https://help.aliyun.com/api/ram/getuser.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) GetUserWithCallback(request *GetUserRequest, callback func(response *GetUserResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *GetUserResponse + var err error + defer close(result) + response, err = client.GetUser(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// GetUserRequest is the request struct for api GetUser +type GetUserRequest struct { + *requests.RpcRequest + UserName string `position:"Query" name:"UserName"` +} + +// GetUserResponse is the response struct for api GetUser +type GetUserResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + User User `json:"User" xml:"User"` +} + +// CreateGetUserRequest creates a request to invoke GetUser API +func CreateGetUserRequest() (request *GetUserRequest) { + request = &GetUserRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "GetUser", "ram", "openAPI") + return +} + +// CreateGetUserResponse creates a response to parse from GetUser response +func CreateGetUserResponse() (response *GetUserResponse) { + response = &GetUserResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_user_mfa_info.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_user_mfa_info.go new file mode 100644 index 000000000..f09ab63f0 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_user_mfa_info.go @@ -0,0 +1,104 @@ +package ram + +//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" +) + +// GetUserMFAInfo invokes the ram.GetUserMFAInfo API synchronously +// api document: https://help.aliyun.com/api/ram/getusermfainfo.html +func (client *Client) GetUserMFAInfo(request *GetUserMFAInfoRequest) (response *GetUserMFAInfoResponse, err error) { + response = CreateGetUserMFAInfoResponse() + err = client.DoAction(request, response) + return +} + +// GetUserMFAInfoWithChan invokes the ram.GetUserMFAInfo API asynchronously +// api document: https://help.aliyun.com/api/ram/getusermfainfo.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) GetUserMFAInfoWithChan(request *GetUserMFAInfoRequest) (<-chan *GetUserMFAInfoResponse, <-chan error) { + responseChan := make(chan *GetUserMFAInfoResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.GetUserMFAInfo(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// GetUserMFAInfoWithCallback invokes the ram.GetUserMFAInfo API asynchronously +// api document: https://help.aliyun.com/api/ram/getusermfainfo.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) GetUserMFAInfoWithCallback(request *GetUserMFAInfoRequest, callback func(response *GetUserMFAInfoResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *GetUserMFAInfoResponse + var err error + defer close(result) + response, err = client.GetUserMFAInfo(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// GetUserMFAInfoRequest is the request struct for api GetUserMFAInfo +type GetUserMFAInfoRequest struct { + *requests.RpcRequest + UserName string `position:"Query" name:"UserName"` +} + +// GetUserMFAInfoResponse is the response struct for api GetUserMFAInfo +type GetUserMFAInfoResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + MFADevice MFADevice `json:"MFADevice" xml:"MFADevice"` +} + +// CreateGetUserMFAInfoRequest creates a request to invoke GetUserMFAInfo API +func CreateGetUserMFAInfoRequest() (request *GetUserMFAInfoRequest) { + request = &GetUserMFAInfoRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "GetUserMFAInfo", "ram", "openAPI") + return +} + +// CreateGetUserMFAInfoResponse creates a response to parse from GetUserMFAInfo response +func CreateGetUserMFAInfoResponse() (response *GetUserMFAInfoResponse) { + response = &GetUserMFAInfoResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_access_keys.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_access_keys.go new file mode 100644 index 000000000..648d826ea --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_access_keys.go @@ -0,0 +1,104 @@ +package ram + +//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" +) + +// ListAccessKeys invokes the ram.ListAccessKeys API synchronously +// api document: https://help.aliyun.com/api/ram/listaccesskeys.html +func (client *Client) ListAccessKeys(request *ListAccessKeysRequest) (response *ListAccessKeysResponse, err error) { + response = CreateListAccessKeysResponse() + err = client.DoAction(request, response) + return +} + +// ListAccessKeysWithChan invokes the ram.ListAccessKeys API asynchronously +// api document: https://help.aliyun.com/api/ram/listaccesskeys.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ListAccessKeysWithChan(request *ListAccessKeysRequest) (<-chan *ListAccessKeysResponse, <-chan error) { + responseChan := make(chan *ListAccessKeysResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ListAccessKeys(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ListAccessKeysWithCallback invokes the ram.ListAccessKeys API asynchronously +// api document: https://help.aliyun.com/api/ram/listaccesskeys.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ListAccessKeysWithCallback(request *ListAccessKeysRequest, callback func(response *ListAccessKeysResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ListAccessKeysResponse + var err error + defer close(result) + response, err = client.ListAccessKeys(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ListAccessKeysRequest is the request struct for api ListAccessKeys +type ListAccessKeysRequest struct { + *requests.RpcRequest + UserName string `position:"Query" name:"UserName"` +} + +// ListAccessKeysResponse is the response struct for api ListAccessKeys +type ListAccessKeysResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + AccessKeys AccessKeys `json:"AccessKeys" xml:"AccessKeys"` +} + +// CreateListAccessKeysRequest creates a request to invoke ListAccessKeys API +func CreateListAccessKeysRequest() (request *ListAccessKeysRequest) { + request = &ListAccessKeysRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "ListAccessKeys", "ram", "openAPI") + return +} + +// CreateListAccessKeysResponse creates a response to parse from ListAccessKeys response +func CreateListAccessKeysResponse() (response *ListAccessKeysResponse) { + response = &ListAccessKeysResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_entities_for_policy.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_entities_for_policy.go new file mode 100644 index 000000000..8586884f8 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_entities_for_policy.go @@ -0,0 +1,107 @@ +package ram + +//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" +) + +// ListEntitiesForPolicy invokes the ram.ListEntitiesForPolicy API synchronously +// api document: https://help.aliyun.com/api/ram/listentitiesforpolicy.html +func (client *Client) ListEntitiesForPolicy(request *ListEntitiesForPolicyRequest) (response *ListEntitiesForPolicyResponse, err error) { + response = CreateListEntitiesForPolicyResponse() + err = client.DoAction(request, response) + return +} + +// ListEntitiesForPolicyWithChan invokes the ram.ListEntitiesForPolicy API asynchronously +// api document: https://help.aliyun.com/api/ram/listentitiesforpolicy.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ListEntitiesForPolicyWithChan(request *ListEntitiesForPolicyRequest) (<-chan *ListEntitiesForPolicyResponse, <-chan error) { + responseChan := make(chan *ListEntitiesForPolicyResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ListEntitiesForPolicy(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ListEntitiesForPolicyWithCallback invokes the ram.ListEntitiesForPolicy API asynchronously +// api document: https://help.aliyun.com/api/ram/listentitiesforpolicy.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ListEntitiesForPolicyWithCallback(request *ListEntitiesForPolicyRequest, callback func(response *ListEntitiesForPolicyResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ListEntitiesForPolicyResponse + var err error + defer close(result) + response, err = client.ListEntitiesForPolicy(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ListEntitiesForPolicyRequest is the request struct for api ListEntitiesForPolicy +type ListEntitiesForPolicyRequest struct { + *requests.RpcRequest + PolicyType string `position:"Query" name:"PolicyType"` + PolicyName string `position:"Query" name:"PolicyName"` +} + +// ListEntitiesForPolicyResponse is the response struct for api ListEntitiesForPolicy +type ListEntitiesForPolicyResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Groups GroupsInListEntitiesForPolicy `json:"Groups" xml:"Groups"` + Users UsersInListEntitiesForPolicy `json:"Users" xml:"Users"` + Roles RolesInListEntitiesForPolicy `json:"Roles" xml:"Roles"` +} + +// CreateListEntitiesForPolicyRequest creates a request to invoke ListEntitiesForPolicy API +func CreateListEntitiesForPolicyRequest() (request *ListEntitiesForPolicyRequest) { + request = &ListEntitiesForPolicyRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "ListEntitiesForPolicy", "ram", "openAPI") + return +} + +// CreateListEntitiesForPolicyResponse creates a response to parse from ListEntitiesForPolicy response +func CreateListEntitiesForPolicyResponse() (response *ListEntitiesForPolicyResponse) { + response = &ListEntitiesForPolicyResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_groups.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_groups.go new file mode 100644 index 000000000..8719ce0e7 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_groups.go @@ -0,0 +1,107 @@ +package ram + +//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" +) + +// ListGroups invokes the ram.ListGroups API synchronously +// api document: https://help.aliyun.com/api/ram/listgroups.html +func (client *Client) ListGroups(request *ListGroupsRequest) (response *ListGroupsResponse, err error) { + response = CreateListGroupsResponse() + err = client.DoAction(request, response) + return +} + +// ListGroupsWithChan invokes the ram.ListGroups API asynchronously +// api document: https://help.aliyun.com/api/ram/listgroups.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ListGroupsWithChan(request *ListGroupsRequest) (<-chan *ListGroupsResponse, <-chan error) { + responseChan := make(chan *ListGroupsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ListGroups(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ListGroupsWithCallback invokes the ram.ListGroups API asynchronously +// api document: https://help.aliyun.com/api/ram/listgroups.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ListGroupsWithCallback(request *ListGroupsRequest, callback func(response *ListGroupsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ListGroupsResponse + var err error + defer close(result) + response, err = client.ListGroups(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ListGroupsRequest is the request struct for api ListGroups +type ListGroupsRequest struct { + *requests.RpcRequest + Marker string `position:"Query" name:"Marker"` + MaxItems requests.Integer `position:"Query" name:"MaxItems"` +} + +// ListGroupsResponse is the response struct for api ListGroups +type ListGroupsResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + IsTruncated bool `json:"IsTruncated" xml:"IsTruncated"` + Marker string `json:"Marker" xml:"Marker"` + Groups GroupsInListGroups `json:"Groups" xml:"Groups"` +} + +// CreateListGroupsRequest creates a request to invoke ListGroups API +func CreateListGroupsRequest() (request *ListGroupsRequest) { + request = &ListGroupsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "ListGroups", "ram", "openAPI") + return +} + +// CreateListGroupsResponse creates a response to parse from ListGroups response +func CreateListGroupsResponse() (response *ListGroupsResponse) { + response = &ListGroupsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_groups_for_user.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_groups_for_user.go new file mode 100644 index 000000000..d529b60ab --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_groups_for_user.go @@ -0,0 +1,104 @@ +package ram + +//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" +) + +// ListGroupsForUser invokes the ram.ListGroupsForUser API synchronously +// api document: https://help.aliyun.com/api/ram/listgroupsforuser.html +func (client *Client) ListGroupsForUser(request *ListGroupsForUserRequest) (response *ListGroupsForUserResponse, err error) { + response = CreateListGroupsForUserResponse() + err = client.DoAction(request, response) + return +} + +// ListGroupsForUserWithChan invokes the ram.ListGroupsForUser API asynchronously +// api document: https://help.aliyun.com/api/ram/listgroupsforuser.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ListGroupsForUserWithChan(request *ListGroupsForUserRequest) (<-chan *ListGroupsForUserResponse, <-chan error) { + responseChan := make(chan *ListGroupsForUserResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ListGroupsForUser(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ListGroupsForUserWithCallback invokes the ram.ListGroupsForUser API asynchronously +// api document: https://help.aliyun.com/api/ram/listgroupsforuser.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ListGroupsForUserWithCallback(request *ListGroupsForUserRequest, callback func(response *ListGroupsForUserResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ListGroupsForUserResponse + var err error + defer close(result) + response, err = client.ListGroupsForUser(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ListGroupsForUserRequest is the request struct for api ListGroupsForUser +type ListGroupsForUserRequest struct { + *requests.RpcRequest + UserName string `position:"Query" name:"UserName"` +} + +// ListGroupsForUserResponse is the response struct for api ListGroupsForUser +type ListGroupsForUserResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Groups GroupsInListGroupsForUser `json:"Groups" xml:"Groups"` +} + +// CreateListGroupsForUserRequest creates a request to invoke ListGroupsForUser API +func CreateListGroupsForUserRequest() (request *ListGroupsForUserRequest) { + request = &ListGroupsForUserRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "ListGroupsForUser", "ram", "openAPI") + return +} + +// CreateListGroupsForUserResponse creates a response to parse from ListGroupsForUser response +func CreateListGroupsForUserResponse() (response *ListGroupsForUserResponse) { + response = &ListGroupsForUserResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_policies.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_policies.go new file mode 100644 index 000000000..2d567153e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_policies.go @@ -0,0 +1,108 @@ +package ram + +//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" +) + +// ListPolicies invokes the ram.ListPolicies API synchronously +// api document: https://help.aliyun.com/api/ram/listpolicies.html +func (client *Client) ListPolicies(request *ListPoliciesRequest) (response *ListPoliciesResponse, err error) { + response = CreateListPoliciesResponse() + err = client.DoAction(request, response) + return +} + +// ListPoliciesWithChan invokes the ram.ListPolicies API asynchronously +// api document: https://help.aliyun.com/api/ram/listpolicies.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ListPoliciesWithChan(request *ListPoliciesRequest) (<-chan *ListPoliciesResponse, <-chan error) { + responseChan := make(chan *ListPoliciesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ListPolicies(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ListPoliciesWithCallback invokes the ram.ListPolicies API asynchronously +// api document: https://help.aliyun.com/api/ram/listpolicies.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ListPoliciesWithCallback(request *ListPoliciesRequest, callback func(response *ListPoliciesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ListPoliciesResponse + var err error + defer close(result) + response, err = client.ListPolicies(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ListPoliciesRequest is the request struct for api ListPolicies +type ListPoliciesRequest struct { + *requests.RpcRequest + PolicyType string `position:"Query" name:"PolicyType"` + Marker string `position:"Query" name:"Marker"` + MaxItems requests.Integer `position:"Query" name:"MaxItems"` +} + +// ListPoliciesResponse is the response struct for api ListPolicies +type ListPoliciesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + IsTruncated bool `json:"IsTruncated" xml:"IsTruncated"` + Marker string `json:"Marker" xml:"Marker"` + Policies PoliciesInListPolicies `json:"Policies" xml:"Policies"` +} + +// CreateListPoliciesRequest creates a request to invoke ListPolicies API +func CreateListPoliciesRequest() (request *ListPoliciesRequest) { + request = &ListPoliciesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "ListPolicies", "ram", "openAPI") + return +} + +// CreateListPoliciesResponse creates a response to parse from ListPolicies response +func CreateListPoliciesResponse() (response *ListPoliciesResponse) { + response = &ListPoliciesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_policies_for_group.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_policies_for_group.go new file mode 100644 index 000000000..b6903638a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_policies_for_group.go @@ -0,0 +1,104 @@ +package ram + +//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" +) + +// ListPoliciesForGroup invokes the ram.ListPoliciesForGroup API synchronously +// api document: https://help.aliyun.com/api/ram/listpoliciesforgroup.html +func (client *Client) ListPoliciesForGroup(request *ListPoliciesForGroupRequest) (response *ListPoliciesForGroupResponse, err error) { + response = CreateListPoliciesForGroupResponse() + err = client.DoAction(request, response) + return +} + +// ListPoliciesForGroupWithChan invokes the ram.ListPoliciesForGroup API asynchronously +// api document: https://help.aliyun.com/api/ram/listpoliciesforgroup.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ListPoliciesForGroupWithChan(request *ListPoliciesForGroupRequest) (<-chan *ListPoliciesForGroupResponse, <-chan error) { + responseChan := make(chan *ListPoliciesForGroupResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ListPoliciesForGroup(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ListPoliciesForGroupWithCallback invokes the ram.ListPoliciesForGroup API asynchronously +// api document: https://help.aliyun.com/api/ram/listpoliciesforgroup.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ListPoliciesForGroupWithCallback(request *ListPoliciesForGroupRequest, callback func(response *ListPoliciesForGroupResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ListPoliciesForGroupResponse + var err error + defer close(result) + response, err = client.ListPoliciesForGroup(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ListPoliciesForGroupRequest is the request struct for api ListPoliciesForGroup +type ListPoliciesForGroupRequest struct { + *requests.RpcRequest + GroupName string `position:"Query" name:"GroupName"` +} + +// ListPoliciesForGroupResponse is the response struct for api ListPoliciesForGroup +type ListPoliciesForGroupResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Policies PoliciesInListPoliciesForGroup `json:"Policies" xml:"Policies"` +} + +// CreateListPoliciesForGroupRequest creates a request to invoke ListPoliciesForGroup API +func CreateListPoliciesForGroupRequest() (request *ListPoliciesForGroupRequest) { + request = &ListPoliciesForGroupRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "ListPoliciesForGroup", "ram", "openAPI") + return +} + +// CreateListPoliciesForGroupResponse creates a response to parse from ListPoliciesForGroup response +func CreateListPoliciesForGroupResponse() (response *ListPoliciesForGroupResponse) { + response = &ListPoliciesForGroupResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_policies_for_role.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_policies_for_role.go new file mode 100644 index 000000000..689f7a944 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_policies_for_role.go @@ -0,0 +1,104 @@ +package ram + +//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" +) + +// ListPoliciesForRole invokes the ram.ListPoliciesForRole API synchronously +// api document: https://help.aliyun.com/api/ram/listpoliciesforrole.html +func (client *Client) ListPoliciesForRole(request *ListPoliciesForRoleRequest) (response *ListPoliciesForRoleResponse, err error) { + response = CreateListPoliciesForRoleResponse() + err = client.DoAction(request, response) + return +} + +// ListPoliciesForRoleWithChan invokes the ram.ListPoliciesForRole API asynchronously +// api document: https://help.aliyun.com/api/ram/listpoliciesforrole.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ListPoliciesForRoleWithChan(request *ListPoliciesForRoleRequest) (<-chan *ListPoliciesForRoleResponse, <-chan error) { + responseChan := make(chan *ListPoliciesForRoleResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ListPoliciesForRole(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ListPoliciesForRoleWithCallback invokes the ram.ListPoliciesForRole API asynchronously +// api document: https://help.aliyun.com/api/ram/listpoliciesforrole.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ListPoliciesForRoleWithCallback(request *ListPoliciesForRoleRequest, callback func(response *ListPoliciesForRoleResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ListPoliciesForRoleResponse + var err error + defer close(result) + response, err = client.ListPoliciesForRole(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ListPoliciesForRoleRequest is the request struct for api ListPoliciesForRole +type ListPoliciesForRoleRequest struct { + *requests.RpcRequest + RoleName string `position:"Query" name:"RoleName"` +} + +// ListPoliciesForRoleResponse is the response struct for api ListPoliciesForRole +type ListPoliciesForRoleResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Policies PoliciesInListPoliciesForRole `json:"Policies" xml:"Policies"` +} + +// CreateListPoliciesForRoleRequest creates a request to invoke ListPoliciesForRole API +func CreateListPoliciesForRoleRequest() (request *ListPoliciesForRoleRequest) { + request = &ListPoliciesForRoleRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "ListPoliciesForRole", "ram", "openAPI") + return +} + +// CreateListPoliciesForRoleResponse creates a response to parse from ListPoliciesForRole response +func CreateListPoliciesForRoleResponse() (response *ListPoliciesForRoleResponse) { + response = &ListPoliciesForRoleResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_policies_for_user.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_policies_for_user.go new file mode 100644 index 000000000..653a414c4 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_policies_for_user.go @@ -0,0 +1,104 @@ +package ram + +//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" +) + +// ListPoliciesForUser invokes the ram.ListPoliciesForUser API synchronously +// api document: https://help.aliyun.com/api/ram/listpoliciesforuser.html +func (client *Client) ListPoliciesForUser(request *ListPoliciesForUserRequest) (response *ListPoliciesForUserResponse, err error) { + response = CreateListPoliciesForUserResponse() + err = client.DoAction(request, response) + return +} + +// ListPoliciesForUserWithChan invokes the ram.ListPoliciesForUser API asynchronously +// api document: https://help.aliyun.com/api/ram/listpoliciesforuser.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ListPoliciesForUserWithChan(request *ListPoliciesForUserRequest) (<-chan *ListPoliciesForUserResponse, <-chan error) { + responseChan := make(chan *ListPoliciesForUserResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ListPoliciesForUser(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ListPoliciesForUserWithCallback invokes the ram.ListPoliciesForUser API asynchronously +// api document: https://help.aliyun.com/api/ram/listpoliciesforuser.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ListPoliciesForUserWithCallback(request *ListPoliciesForUserRequest, callback func(response *ListPoliciesForUserResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ListPoliciesForUserResponse + var err error + defer close(result) + response, err = client.ListPoliciesForUser(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ListPoliciesForUserRequest is the request struct for api ListPoliciesForUser +type ListPoliciesForUserRequest struct { + *requests.RpcRequest + UserName string `position:"Query" name:"UserName"` +} + +// ListPoliciesForUserResponse is the response struct for api ListPoliciesForUser +type ListPoliciesForUserResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Policies PoliciesInListPoliciesForUser `json:"Policies" xml:"Policies"` +} + +// CreateListPoliciesForUserRequest creates a request to invoke ListPoliciesForUser API +func CreateListPoliciesForUserRequest() (request *ListPoliciesForUserRequest) { + request = &ListPoliciesForUserRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "ListPoliciesForUser", "ram", "openAPI") + return +} + +// CreateListPoliciesForUserResponse creates a response to parse from ListPoliciesForUser response +func CreateListPoliciesForUserResponse() (response *ListPoliciesForUserResponse) { + response = &ListPoliciesForUserResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_policy_versions.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_policy_versions.go new file mode 100644 index 000000000..7c4c5728c --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_policy_versions.go @@ -0,0 +1,105 @@ +package ram + +//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" +) + +// ListPolicyVersions invokes the ram.ListPolicyVersions API synchronously +// api document: https://help.aliyun.com/api/ram/listpolicyversions.html +func (client *Client) ListPolicyVersions(request *ListPolicyVersionsRequest) (response *ListPolicyVersionsResponse, err error) { + response = CreateListPolicyVersionsResponse() + err = client.DoAction(request, response) + return +} + +// ListPolicyVersionsWithChan invokes the ram.ListPolicyVersions API asynchronously +// api document: https://help.aliyun.com/api/ram/listpolicyversions.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ListPolicyVersionsWithChan(request *ListPolicyVersionsRequest) (<-chan *ListPolicyVersionsResponse, <-chan error) { + responseChan := make(chan *ListPolicyVersionsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ListPolicyVersions(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ListPolicyVersionsWithCallback invokes the ram.ListPolicyVersions API asynchronously +// api document: https://help.aliyun.com/api/ram/listpolicyversions.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ListPolicyVersionsWithCallback(request *ListPolicyVersionsRequest, callback func(response *ListPolicyVersionsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ListPolicyVersionsResponse + var err error + defer close(result) + response, err = client.ListPolicyVersions(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ListPolicyVersionsRequest is the request struct for api ListPolicyVersions +type ListPolicyVersionsRequest struct { + *requests.RpcRequest + PolicyType string `position:"Query" name:"PolicyType"` + PolicyName string `position:"Query" name:"PolicyName"` +} + +// ListPolicyVersionsResponse is the response struct for api ListPolicyVersions +type ListPolicyVersionsResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + PolicyVersions PolicyVersions `json:"PolicyVersions" xml:"PolicyVersions"` +} + +// CreateListPolicyVersionsRequest creates a request to invoke ListPolicyVersions API +func CreateListPolicyVersionsRequest() (request *ListPolicyVersionsRequest) { + request = &ListPolicyVersionsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "ListPolicyVersions", "ram", "openAPI") + return +} + +// CreateListPolicyVersionsResponse creates a response to parse from ListPolicyVersions response +func CreateListPolicyVersionsResponse() (response *ListPolicyVersionsResponse) { + response = &ListPolicyVersionsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_public_keys.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_public_keys.go new file mode 100644 index 000000000..e50be56a6 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_public_keys.go @@ -0,0 +1,104 @@ +package ram + +//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" +) + +// ListPublicKeys invokes the ram.ListPublicKeys API synchronously +// api document: https://help.aliyun.com/api/ram/listpublickeys.html +func (client *Client) ListPublicKeys(request *ListPublicKeysRequest) (response *ListPublicKeysResponse, err error) { + response = CreateListPublicKeysResponse() + err = client.DoAction(request, response) + return +} + +// ListPublicKeysWithChan invokes the ram.ListPublicKeys API asynchronously +// api document: https://help.aliyun.com/api/ram/listpublickeys.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ListPublicKeysWithChan(request *ListPublicKeysRequest) (<-chan *ListPublicKeysResponse, <-chan error) { + responseChan := make(chan *ListPublicKeysResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ListPublicKeys(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ListPublicKeysWithCallback invokes the ram.ListPublicKeys API asynchronously +// api document: https://help.aliyun.com/api/ram/listpublickeys.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ListPublicKeysWithCallback(request *ListPublicKeysRequest, callback func(response *ListPublicKeysResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ListPublicKeysResponse + var err error + defer close(result) + response, err = client.ListPublicKeys(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ListPublicKeysRequest is the request struct for api ListPublicKeys +type ListPublicKeysRequest struct { + *requests.RpcRequest + UserName string `position:"Query" name:"UserName"` +} + +// ListPublicKeysResponse is the response struct for api ListPublicKeys +type ListPublicKeysResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + PublicKeys PublicKeys `json:"PublicKeys" xml:"PublicKeys"` +} + +// CreateListPublicKeysRequest creates a request to invoke ListPublicKeys API +func CreateListPublicKeysRequest() (request *ListPublicKeysRequest) { + request = &ListPublicKeysRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "ListPublicKeys", "ram", "openAPI") + return +} + +// CreateListPublicKeysResponse creates a response to parse from ListPublicKeys response +func CreateListPublicKeysResponse() (response *ListPublicKeysResponse) { + response = &ListPublicKeysResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_roles.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_roles.go new file mode 100644 index 000000000..15412ba2f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_roles.go @@ -0,0 +1,107 @@ +package ram + +//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" +) + +// ListRoles invokes the ram.ListRoles API synchronously +// api document: https://help.aliyun.com/api/ram/listroles.html +func (client *Client) ListRoles(request *ListRolesRequest) (response *ListRolesResponse, err error) { + response = CreateListRolesResponse() + err = client.DoAction(request, response) + return +} + +// ListRolesWithChan invokes the ram.ListRoles API asynchronously +// api document: https://help.aliyun.com/api/ram/listroles.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ListRolesWithChan(request *ListRolesRequest) (<-chan *ListRolesResponse, <-chan error) { + responseChan := make(chan *ListRolesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ListRoles(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ListRolesWithCallback invokes the ram.ListRoles API asynchronously +// api document: https://help.aliyun.com/api/ram/listroles.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ListRolesWithCallback(request *ListRolesRequest, callback func(response *ListRolesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ListRolesResponse + var err error + defer close(result) + response, err = client.ListRoles(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ListRolesRequest is the request struct for api ListRoles +type ListRolesRequest struct { + *requests.RpcRequest + Marker string `position:"Query" name:"Marker"` + MaxItems requests.Integer `position:"Query" name:"MaxItems"` +} + +// ListRolesResponse is the response struct for api ListRoles +type ListRolesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + IsTruncated bool `json:"IsTruncated" xml:"IsTruncated"` + Marker string `json:"Marker" xml:"Marker"` + Roles RolesInListRoles `json:"Roles" xml:"Roles"` +} + +// CreateListRolesRequest creates a request to invoke ListRoles API +func CreateListRolesRequest() (request *ListRolesRequest) { + request = &ListRolesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "ListRoles", "ram", "openAPI") + return +} + +// CreateListRolesResponse creates a response to parse from ListRoles response +func CreateListRolesResponse() (response *ListRolesResponse) { + response = &ListRolesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_users.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_users.go new file mode 100644 index 000000000..3b5e187d0 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_users.go @@ -0,0 +1,107 @@ +package ram + +//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" +) + +// ListUsers invokes the ram.ListUsers API synchronously +// api document: https://help.aliyun.com/api/ram/listusers.html +func (client *Client) ListUsers(request *ListUsersRequest) (response *ListUsersResponse, err error) { + response = CreateListUsersResponse() + err = client.DoAction(request, response) + return +} + +// ListUsersWithChan invokes the ram.ListUsers API asynchronously +// api document: https://help.aliyun.com/api/ram/listusers.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ListUsersWithChan(request *ListUsersRequest) (<-chan *ListUsersResponse, <-chan error) { + responseChan := make(chan *ListUsersResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ListUsers(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ListUsersWithCallback invokes the ram.ListUsers API asynchronously +// api document: https://help.aliyun.com/api/ram/listusers.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ListUsersWithCallback(request *ListUsersRequest, callback func(response *ListUsersResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ListUsersResponse + var err error + defer close(result) + response, err = client.ListUsers(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ListUsersRequest is the request struct for api ListUsers +type ListUsersRequest struct { + *requests.RpcRequest + Marker string `position:"Query" name:"Marker"` + MaxItems requests.Integer `position:"Query" name:"MaxItems"` +} + +// ListUsersResponse is the response struct for api ListUsers +type ListUsersResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + IsTruncated bool `json:"IsTruncated" xml:"IsTruncated"` + Marker string `json:"Marker" xml:"Marker"` + Users UsersInListUsers `json:"Users" xml:"Users"` +} + +// CreateListUsersRequest creates a request to invoke ListUsers API +func CreateListUsersRequest() (request *ListUsersRequest) { + request = &ListUsersRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "ListUsers", "ram", "openAPI") + return +} + +// CreateListUsersResponse creates a response to parse from ListUsers response +func CreateListUsersResponse() (response *ListUsersResponse) { + response = &ListUsersResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_users_for_group.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_users_for_group.go new file mode 100644 index 000000000..2caa5ac4d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_users_for_group.go @@ -0,0 +1,108 @@ +package ram + +//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" +) + +// ListUsersForGroup invokes the ram.ListUsersForGroup API synchronously +// api document: https://help.aliyun.com/api/ram/listusersforgroup.html +func (client *Client) ListUsersForGroup(request *ListUsersForGroupRequest) (response *ListUsersForGroupResponse, err error) { + response = CreateListUsersForGroupResponse() + err = client.DoAction(request, response) + return +} + +// ListUsersForGroupWithChan invokes the ram.ListUsersForGroup API asynchronously +// api document: https://help.aliyun.com/api/ram/listusersforgroup.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ListUsersForGroupWithChan(request *ListUsersForGroupRequest) (<-chan *ListUsersForGroupResponse, <-chan error) { + responseChan := make(chan *ListUsersForGroupResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ListUsersForGroup(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ListUsersForGroupWithCallback invokes the ram.ListUsersForGroup API asynchronously +// api document: https://help.aliyun.com/api/ram/listusersforgroup.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ListUsersForGroupWithCallback(request *ListUsersForGroupRequest, callback func(response *ListUsersForGroupResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ListUsersForGroupResponse + var err error + defer close(result) + response, err = client.ListUsersForGroup(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ListUsersForGroupRequest is the request struct for api ListUsersForGroup +type ListUsersForGroupRequest struct { + *requests.RpcRequest + Marker string `position:"Query" name:"Marker"` + MaxItems requests.Integer `position:"Query" name:"MaxItems"` + GroupName string `position:"Query" name:"GroupName"` +} + +// ListUsersForGroupResponse is the response struct for api ListUsersForGroup +type ListUsersForGroupResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + IsTruncated bool `json:"IsTruncated" xml:"IsTruncated"` + Marker string `json:"Marker" xml:"Marker"` + Users UsersInListUsersForGroup `json:"Users" xml:"Users"` +} + +// CreateListUsersForGroupRequest creates a request to invoke ListUsersForGroup API +func CreateListUsersForGroupRequest() (request *ListUsersForGroupRequest) { + request = &ListUsersForGroupRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "ListUsersForGroup", "ram", "openAPI") + return +} + +// CreateListUsersForGroupResponse creates a response to parse from ListUsersForGroup response +func CreateListUsersForGroupResponse() (response *ListUsersForGroupResponse) { + response = &ListUsersForGroupResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_virtual_mfa_devices.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_virtual_mfa_devices.go new file mode 100644 index 000000000..7873023e5 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_virtual_mfa_devices.go @@ -0,0 +1,103 @@ +package ram + +//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" +) + +// ListVirtualMFADevices invokes the ram.ListVirtualMFADevices API synchronously +// api document: https://help.aliyun.com/api/ram/listvirtualmfadevices.html +func (client *Client) ListVirtualMFADevices(request *ListVirtualMFADevicesRequest) (response *ListVirtualMFADevicesResponse, err error) { + response = CreateListVirtualMFADevicesResponse() + err = client.DoAction(request, response) + return +} + +// ListVirtualMFADevicesWithChan invokes the ram.ListVirtualMFADevices API asynchronously +// api document: https://help.aliyun.com/api/ram/listvirtualmfadevices.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ListVirtualMFADevicesWithChan(request *ListVirtualMFADevicesRequest) (<-chan *ListVirtualMFADevicesResponse, <-chan error) { + responseChan := make(chan *ListVirtualMFADevicesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ListVirtualMFADevices(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ListVirtualMFADevicesWithCallback invokes the ram.ListVirtualMFADevices API asynchronously +// api document: https://help.aliyun.com/api/ram/listvirtualmfadevices.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ListVirtualMFADevicesWithCallback(request *ListVirtualMFADevicesRequest, callback func(response *ListVirtualMFADevicesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ListVirtualMFADevicesResponse + var err error + defer close(result) + response, err = client.ListVirtualMFADevices(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ListVirtualMFADevicesRequest is the request struct for api ListVirtualMFADevices +type ListVirtualMFADevicesRequest struct { + *requests.RpcRequest +} + +// ListVirtualMFADevicesResponse is the response struct for api ListVirtualMFADevices +type ListVirtualMFADevicesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + VirtualMFADevices VirtualMFADevices `json:"VirtualMFADevices" xml:"VirtualMFADevices"` +} + +// CreateListVirtualMFADevicesRequest creates a request to invoke ListVirtualMFADevices API +func CreateListVirtualMFADevicesRequest() (request *ListVirtualMFADevicesRequest) { + request = &ListVirtualMFADevicesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "ListVirtualMFADevices", "ram", "openAPI") + return +} + +// CreateListVirtualMFADevicesResponse creates a response to parse from ListVirtualMFADevices response +func CreateListVirtualMFADevicesResponse() (response *ListVirtualMFADevicesResponse) { + response = &ListVirtualMFADevicesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/remove_user_from_group.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/remove_user_from_group.go new file mode 100644 index 000000000..794afc50a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/remove_user_from_group.go @@ -0,0 +1,104 @@ +package ram + +//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" +) + +// RemoveUserFromGroup invokes the ram.RemoveUserFromGroup API synchronously +// api document: https://help.aliyun.com/api/ram/removeuserfromgroup.html +func (client *Client) RemoveUserFromGroup(request *RemoveUserFromGroupRequest) (response *RemoveUserFromGroupResponse, err error) { + response = CreateRemoveUserFromGroupResponse() + err = client.DoAction(request, response) + return +} + +// RemoveUserFromGroupWithChan invokes the ram.RemoveUserFromGroup API asynchronously +// api document: https://help.aliyun.com/api/ram/removeuserfromgroup.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) RemoveUserFromGroupWithChan(request *RemoveUserFromGroupRequest) (<-chan *RemoveUserFromGroupResponse, <-chan error) { + responseChan := make(chan *RemoveUserFromGroupResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.RemoveUserFromGroup(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// RemoveUserFromGroupWithCallback invokes the ram.RemoveUserFromGroup API asynchronously +// api document: https://help.aliyun.com/api/ram/removeuserfromgroup.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) RemoveUserFromGroupWithCallback(request *RemoveUserFromGroupRequest, callback func(response *RemoveUserFromGroupResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *RemoveUserFromGroupResponse + var err error + defer close(result) + response, err = client.RemoveUserFromGroup(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// RemoveUserFromGroupRequest is the request struct for api RemoveUserFromGroup +type RemoveUserFromGroupRequest struct { + *requests.RpcRequest + GroupName string `position:"Query" name:"GroupName"` + UserName string `position:"Query" name:"UserName"` +} + +// RemoveUserFromGroupResponse is the response struct for api RemoveUserFromGroup +type RemoveUserFromGroupResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateRemoveUserFromGroupRequest creates a request to invoke RemoveUserFromGroup API +func CreateRemoveUserFromGroupRequest() (request *RemoveUserFromGroupRequest) { + request = &RemoveUserFromGroupRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "RemoveUserFromGroup", "ram", "openAPI") + return +} + +// CreateRemoveUserFromGroupResponse creates a response to parse from RemoveUserFromGroup response +func CreateRemoveUserFromGroupResponse() (response *RemoveUserFromGroupResponse) { + response = &RemoveUserFromGroupResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/set_account_alias.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/set_account_alias.go new file mode 100644 index 000000000..554d66147 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/set_account_alias.go @@ -0,0 +1,103 @@ +package ram + +//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" +) + +// SetAccountAlias invokes the ram.SetAccountAlias API synchronously +// api document: https://help.aliyun.com/api/ram/setaccountalias.html +func (client *Client) SetAccountAlias(request *SetAccountAliasRequest) (response *SetAccountAliasResponse, err error) { + response = CreateSetAccountAliasResponse() + err = client.DoAction(request, response) + return +} + +// SetAccountAliasWithChan invokes the ram.SetAccountAlias API asynchronously +// api document: https://help.aliyun.com/api/ram/setaccountalias.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) SetAccountAliasWithChan(request *SetAccountAliasRequest) (<-chan *SetAccountAliasResponse, <-chan error) { + responseChan := make(chan *SetAccountAliasResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.SetAccountAlias(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// SetAccountAliasWithCallback invokes the ram.SetAccountAlias API asynchronously +// api document: https://help.aliyun.com/api/ram/setaccountalias.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) SetAccountAliasWithCallback(request *SetAccountAliasRequest, callback func(response *SetAccountAliasResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *SetAccountAliasResponse + var err error + defer close(result) + response, err = client.SetAccountAlias(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// SetAccountAliasRequest is the request struct for api SetAccountAlias +type SetAccountAliasRequest struct { + *requests.RpcRequest + AccountAlias string `position:"Query" name:"AccountAlias"` +} + +// SetAccountAliasResponse is the response struct for api SetAccountAlias +type SetAccountAliasResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateSetAccountAliasRequest creates a request to invoke SetAccountAlias API +func CreateSetAccountAliasRequest() (request *SetAccountAliasRequest) { + request = &SetAccountAliasRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "SetAccountAlias", "ram", "openAPI") + return +} + +// CreateSetAccountAliasResponse creates a response to parse from SetAccountAlias response +func CreateSetAccountAliasResponse() (response *SetAccountAliasResponse) { + response = &SetAccountAliasResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/set_default_policy_version.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/set_default_policy_version.go new file mode 100644 index 000000000..a511b19b7 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/set_default_policy_version.go @@ -0,0 +1,104 @@ +package ram + +//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" +) + +// SetDefaultPolicyVersion invokes the ram.SetDefaultPolicyVersion API synchronously +// api document: https://help.aliyun.com/api/ram/setdefaultpolicyversion.html +func (client *Client) SetDefaultPolicyVersion(request *SetDefaultPolicyVersionRequest) (response *SetDefaultPolicyVersionResponse, err error) { + response = CreateSetDefaultPolicyVersionResponse() + err = client.DoAction(request, response) + return +} + +// SetDefaultPolicyVersionWithChan invokes the ram.SetDefaultPolicyVersion API asynchronously +// api document: https://help.aliyun.com/api/ram/setdefaultpolicyversion.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) SetDefaultPolicyVersionWithChan(request *SetDefaultPolicyVersionRequest) (<-chan *SetDefaultPolicyVersionResponse, <-chan error) { + responseChan := make(chan *SetDefaultPolicyVersionResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.SetDefaultPolicyVersion(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// SetDefaultPolicyVersionWithCallback invokes the ram.SetDefaultPolicyVersion API asynchronously +// api document: https://help.aliyun.com/api/ram/setdefaultpolicyversion.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) SetDefaultPolicyVersionWithCallback(request *SetDefaultPolicyVersionRequest, callback func(response *SetDefaultPolicyVersionResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *SetDefaultPolicyVersionResponse + var err error + defer close(result) + response, err = client.SetDefaultPolicyVersion(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// SetDefaultPolicyVersionRequest is the request struct for api SetDefaultPolicyVersion +type SetDefaultPolicyVersionRequest struct { + *requests.RpcRequest + VersionId string `position:"Query" name:"VersionId"` + PolicyName string `position:"Query" name:"PolicyName"` +} + +// SetDefaultPolicyVersionResponse is the response struct for api SetDefaultPolicyVersion +type SetDefaultPolicyVersionResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateSetDefaultPolicyVersionRequest creates a request to invoke SetDefaultPolicyVersion API +func CreateSetDefaultPolicyVersionRequest() (request *SetDefaultPolicyVersionRequest) { + request = &SetDefaultPolicyVersionRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "SetDefaultPolicyVersion", "ram", "openAPI") + return +} + +// CreateSetDefaultPolicyVersionResponse creates a response to parse from SetDefaultPolicyVersion response +func CreateSetDefaultPolicyVersionResponse() (response *SetDefaultPolicyVersionResponse) { + response = &SetDefaultPolicyVersionResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/set_password_policy.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/set_password_policy.go new file mode 100644 index 000000000..e89900862 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/set_password_policy.go @@ -0,0 +1,112 @@ +package ram + +//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" +) + +// SetPasswordPolicy invokes the ram.SetPasswordPolicy API synchronously +// api document: https://help.aliyun.com/api/ram/setpasswordpolicy.html +func (client *Client) SetPasswordPolicy(request *SetPasswordPolicyRequest) (response *SetPasswordPolicyResponse, err error) { + response = CreateSetPasswordPolicyResponse() + err = client.DoAction(request, response) + return +} + +// SetPasswordPolicyWithChan invokes the ram.SetPasswordPolicy API asynchronously +// api document: https://help.aliyun.com/api/ram/setpasswordpolicy.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) SetPasswordPolicyWithChan(request *SetPasswordPolicyRequest) (<-chan *SetPasswordPolicyResponse, <-chan error) { + responseChan := make(chan *SetPasswordPolicyResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.SetPasswordPolicy(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// SetPasswordPolicyWithCallback invokes the ram.SetPasswordPolicy API asynchronously +// api document: https://help.aliyun.com/api/ram/setpasswordpolicy.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) SetPasswordPolicyWithCallback(request *SetPasswordPolicyRequest, callback func(response *SetPasswordPolicyResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *SetPasswordPolicyResponse + var err error + defer close(result) + response, err = client.SetPasswordPolicy(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// SetPasswordPolicyRequest is the request struct for api SetPasswordPolicy +type SetPasswordPolicyRequest struct { + *requests.RpcRequest + RequireNumbers requests.Boolean `position:"Query" name:"RequireNumbers"` + PasswordReusePrevention requests.Integer `position:"Query" name:"PasswordReusePrevention"` + RequireUppercaseCharacters requests.Boolean `position:"Query" name:"RequireUppercaseCharacters"` + MaxPasswordAge requests.Integer `position:"Query" name:"MaxPasswordAge"` + MaxLoginAttemps requests.Integer `position:"Query" name:"MaxLoginAttemps"` + HardExpiry requests.Boolean `position:"Query" name:"HardExpiry"` + MinimumPasswordLength requests.Integer `position:"Query" name:"MinimumPasswordLength"` + RequireLowercaseCharacters requests.Boolean `position:"Query" name:"RequireLowercaseCharacters"` + RequireSymbols requests.Boolean `position:"Query" name:"RequireSymbols"` +} + +// SetPasswordPolicyResponse is the response struct for api SetPasswordPolicy +type SetPasswordPolicyResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + PasswordPolicy PasswordPolicy `json:"PasswordPolicy" xml:"PasswordPolicy"` +} + +// CreateSetPasswordPolicyRequest creates a request to invoke SetPasswordPolicy API +func CreateSetPasswordPolicyRequest() (request *SetPasswordPolicyRequest) { + request = &SetPasswordPolicyRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "SetPasswordPolicy", "ram", "openAPI") + return +} + +// CreateSetPasswordPolicyResponse creates a response to parse from SetPasswordPolicy response +func CreateSetPasswordPolicyResponse() (response *SetPasswordPolicyResponse) { + response = &SetPasswordPolicyResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/set_security_preference.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/set_security_preference.go new file mode 100644 index 000000000..fbf4c7656 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/set_security_preference.go @@ -0,0 +1,110 @@ +package ram + +//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" +) + +// SetSecurityPreference invokes the ram.SetSecurityPreference API synchronously +// api document: https://help.aliyun.com/api/ram/setsecuritypreference.html +func (client *Client) SetSecurityPreference(request *SetSecurityPreferenceRequest) (response *SetSecurityPreferenceResponse, err error) { + response = CreateSetSecurityPreferenceResponse() + err = client.DoAction(request, response) + return +} + +// SetSecurityPreferenceWithChan invokes the ram.SetSecurityPreference API asynchronously +// api document: https://help.aliyun.com/api/ram/setsecuritypreference.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) SetSecurityPreferenceWithChan(request *SetSecurityPreferenceRequest) (<-chan *SetSecurityPreferenceResponse, <-chan error) { + responseChan := make(chan *SetSecurityPreferenceResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.SetSecurityPreference(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// SetSecurityPreferenceWithCallback invokes the ram.SetSecurityPreference API asynchronously +// api document: https://help.aliyun.com/api/ram/setsecuritypreference.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) SetSecurityPreferenceWithCallback(request *SetSecurityPreferenceRequest, callback func(response *SetSecurityPreferenceResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *SetSecurityPreferenceResponse + var err error + defer close(result) + response, err = client.SetSecurityPreference(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// SetSecurityPreferenceRequest is the request struct for api SetSecurityPreference +type SetSecurityPreferenceRequest struct { + *requests.RpcRequest + AllowUserToManageAccessKeys requests.Boolean `position:"Query" name:"AllowUserToManageAccessKeys"` + AllowUserToManageMFADevices requests.Boolean `position:"Query" name:"AllowUserToManageMFADevices"` + AllowUserToManagePublicKeys requests.Boolean `position:"Query" name:"AllowUserToManagePublicKeys"` + EnableSaveMFATicket requests.Boolean `position:"Query" name:"EnableSaveMFATicket"` + LoginNetworkMasks string `position:"Query" name:"LoginNetworkMasks"` + AllowUserToChangePassword requests.Boolean `position:"Query" name:"AllowUserToChangePassword"` + LoginSessionDuration requests.Integer `position:"Query" name:"LoginSessionDuration"` +} + +// SetSecurityPreferenceResponse is the response struct for api SetSecurityPreference +type SetSecurityPreferenceResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + SecurityPreference SecurityPreference `json:"SecurityPreference" xml:"SecurityPreference"` +} + +// CreateSetSecurityPreferenceRequest creates a request to invoke SetSecurityPreference API +func CreateSetSecurityPreferenceRequest() (request *SetSecurityPreferenceRequest) { + request = &SetSecurityPreferenceRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "SetSecurityPreference", "ram", "openAPI") + return +} + +// CreateSetSecurityPreferenceResponse creates a response to parse from SetSecurityPreference response +func CreateSetSecurityPreferenceResponse() (response *SetSecurityPreferenceResponse) { + response = &SetSecurityPreferenceResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_access_key.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_access_key.go new file mode 100644 index 000000000..df645195f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_access_key.go @@ -0,0 +1,24 @@ +package ram + +//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. + +// AccessKey is a nested struct in ram response +type AccessKey struct { + AccessKeySecret string `json:"AccessKeySecret" xml:"AccessKeySecret"` + CreateDate string `json:"CreateDate" xml:"CreateDate"` + Status string `json:"Status" xml:"Status"` + AccessKeyId string `json:"AccessKeyId" xml:"AccessKeyId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_access_key_last_used.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_access_key_last_used.go new file mode 100644 index 000000000..7d9c94e39 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_access_key_last_used.go @@ -0,0 +1,21 @@ +package ram + +//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. + +// AccessKeyLastUsed is a nested struct in ram response +type AccessKeyLastUsed struct { + LastUsedDate string `json:"LastUsedDate" xml:"LastUsedDate"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_access_key_preference.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_access_key_preference.go new file mode 100644 index 000000000..379d041d7 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_access_key_preference.go @@ -0,0 +1,21 @@ +package ram + +//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. + +// AccessKeyPreference is a nested struct in ram response +type AccessKeyPreference struct { + AllowUserToManageAccessKeys bool `json:"AllowUserToManageAccessKeys" xml:"AllowUserToManageAccessKeys"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_access_keys.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_access_keys.go new file mode 100644 index 000000000..ecea1d7d3 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_access_keys.go @@ -0,0 +1,21 @@ +package ram + +//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. + +// AccessKeys is a nested struct in ram response +type AccessKeys struct { + AccessKey []AccessKey `json:"AccessKey" xml:"AccessKey"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_group.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_group.go new file mode 100644 index 000000000..0d8941a23 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_group.go @@ -0,0 +1,26 @@ +package ram + +//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. + +// Group is a nested struct in ram response +type Group struct { + Comments string `json:"Comments" xml:"Comments"` + AttachDate string `json:"AttachDate" xml:"AttachDate"` + CreateDate string `json:"CreateDate" xml:"CreateDate"` + UpdateDate string `json:"UpdateDate" xml:"UpdateDate"` + GroupName string `json:"GroupName" xml:"GroupName"` + JoinDate string `json:"JoinDate" xml:"JoinDate"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_groups_in_list_entities_for_policy.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_groups_in_list_entities_for_policy.go new file mode 100644 index 000000000..ab33a2964 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_groups_in_list_entities_for_policy.go @@ -0,0 +1,21 @@ +package ram + +//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. + +// GroupsInListEntitiesForPolicy is a nested struct in ram response +type GroupsInListEntitiesForPolicy struct { + Group []Group `json:"Group" xml:"Group"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_groups_in_list_groups.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_groups_in_list_groups.go new file mode 100644 index 000000000..7765486ad --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_groups_in_list_groups.go @@ -0,0 +1,21 @@ +package ram + +//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. + +// GroupsInListGroups is a nested struct in ram response +type GroupsInListGroups struct { + Group []Group `json:"Group" xml:"Group"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_groups_in_list_groups_for_user.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_groups_in_list_groups_for_user.go new file mode 100644 index 000000000..c8596fb48 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_groups_in_list_groups_for_user.go @@ -0,0 +1,21 @@ +package ram + +//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. + +// GroupsInListGroupsForUser is a nested struct in ram response +type GroupsInListGroupsForUser struct { + Group []Group `json:"Group" xml:"Group"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_login_profile.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_login_profile.go new file mode 100644 index 000000000..015f76ae0 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_login_profile.go @@ -0,0 +1,24 @@ +package ram + +//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. + +// LoginProfile is a nested struct in ram response +type LoginProfile struct { + MFABindRequired bool `json:"MFABindRequired" xml:"MFABindRequired"` + CreateDate string `json:"CreateDate" xml:"CreateDate"` + UserName string `json:"UserName" xml:"UserName"` + PasswordResetRequired bool `json:"PasswordResetRequired" xml:"PasswordResetRequired"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_login_profile_preference.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_login_profile_preference.go new file mode 100644 index 000000000..b9e759eef --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_login_profile_preference.go @@ -0,0 +1,24 @@ +package ram + +//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. + +// LoginProfilePreference is a nested struct in ram response +type LoginProfilePreference struct { + LoginNetworkMasks string `json:"LoginNetworkMasks" xml:"LoginNetworkMasks"` + LoginSessionDuration int `json:"LoginSessionDuration" xml:"LoginSessionDuration"` + EnableSaveMFATicket bool `json:"EnableSaveMFATicket" xml:"EnableSaveMFATicket"` + AllowUserToChangePassword bool `json:"AllowUserToChangePassword" xml:"AllowUserToChangePassword"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_mfa_device.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_mfa_device.go new file mode 100644 index 000000000..eea8969c9 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_mfa_device.go @@ -0,0 +1,21 @@ +package ram + +//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. + +// MFADevice is a nested struct in ram response +type MFADevice struct { + SerialNumber string `json:"SerialNumber" xml:"SerialNumber"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_mfa_preference.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_mfa_preference.go new file mode 100644 index 000000000..8fc3783b8 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_mfa_preference.go @@ -0,0 +1,21 @@ +package ram + +//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. + +// MFAPreference is a nested struct in ram response +type MFAPreference struct { + AllowUserToManageMFADevices bool `json:"AllowUserToManageMFADevices" xml:"AllowUserToManageMFADevices"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_password_policy.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_password_policy.go new file mode 100644 index 000000000..66b89be98 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_password_policy.go @@ -0,0 +1,29 @@ +package ram + +//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. + +// PasswordPolicy is a nested struct in ram response +type PasswordPolicy struct { + RequireUppercaseCharacters bool `json:"RequireUppercaseCharacters" xml:"RequireUppercaseCharacters"` + MaxPasswordAge int `json:"MaxPasswordAge" xml:"MaxPasswordAge"` + RequireSymbols bool `json:"RequireSymbols" xml:"RequireSymbols"` + RequireLowercaseCharacters bool `json:"RequireLowercaseCharacters" xml:"RequireLowercaseCharacters"` + PasswordReusePrevention int `json:"PasswordReusePrevention" xml:"PasswordReusePrevention"` + HardExpiry bool `json:"HardExpiry" xml:"HardExpiry"` + MaxLoginAttemps int `json:"MaxLoginAttemps" xml:"MaxLoginAttemps"` + MinimumPasswordLength int `json:"MinimumPasswordLength" xml:"MinimumPasswordLength"` + RequireNumbers bool `json:"RequireNumbers" xml:"RequireNumbers"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_policies_in_list_policies.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_policies_in_list_policies.go new file mode 100644 index 000000000..b4f9e91f5 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_policies_in_list_policies.go @@ -0,0 +1,21 @@ +package ram + +//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. + +// PoliciesInListPolicies is a nested struct in ram response +type PoliciesInListPolicies struct { + Policy []Policy `json:"Policy" xml:"Policy"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_policies_in_list_policies_for_group.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_policies_in_list_policies_for_group.go new file mode 100644 index 000000000..60464613f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_policies_in_list_policies_for_group.go @@ -0,0 +1,21 @@ +package ram + +//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. + +// PoliciesInListPoliciesForGroup is a nested struct in ram response +type PoliciesInListPoliciesForGroup struct { + Policy []Policy `json:"Policy" xml:"Policy"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_policies_in_list_policies_for_role.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_policies_in_list_policies_for_role.go new file mode 100644 index 000000000..9bc518e84 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_policies_in_list_policies_for_role.go @@ -0,0 +1,21 @@ +package ram + +//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. + +// PoliciesInListPoliciesForRole is a nested struct in ram response +type PoliciesInListPoliciesForRole struct { + Policy []Policy `json:"Policy" xml:"Policy"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_policies_in_list_policies_for_user.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_policies_in_list_policies_for_user.go new file mode 100644 index 000000000..1b60c9a02 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_policies_in_list_policies_for_user.go @@ -0,0 +1,21 @@ +package ram + +//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. + +// PoliciesInListPoliciesForUser is a nested struct in ram response +type PoliciesInListPoliciesForUser struct { + Policy []Policy `json:"Policy" xml:"Policy"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_policy.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_policy.go new file mode 100644 index 000000000..37a8bb103 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_policy.go @@ -0,0 +1,29 @@ +package ram + +//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. + +// Policy is a nested struct in ram response +type Policy struct { + PolicyDocument string `json:"PolicyDocument" xml:"PolicyDocument"` + AttachDate string `json:"AttachDate" xml:"AttachDate"` + CreateDate string `json:"CreateDate" xml:"CreateDate"` + PolicyType string `json:"PolicyType" xml:"PolicyType"` + UpdateDate string `json:"UpdateDate" xml:"UpdateDate"` + AttachmentCount int `json:"AttachmentCount" xml:"AttachmentCount"` + PolicyName string `json:"PolicyName" xml:"PolicyName"` + DefaultVersion string `json:"DefaultVersion" xml:"DefaultVersion"` + Description string `json:"Description" xml:"Description"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_policy_version.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_policy_version.go new file mode 100644 index 000000000..d58fcbf3b --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_policy_version.go @@ -0,0 +1,24 @@ +package ram + +//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. + +// PolicyVersion is a nested struct in ram response +type PolicyVersion struct { + VersionId string `json:"VersionId" xml:"VersionId"` + PolicyDocument string `json:"PolicyDocument" xml:"PolicyDocument"` + CreateDate string `json:"CreateDate" xml:"CreateDate"` + IsDefaultVersion bool `json:"IsDefaultVersion" xml:"IsDefaultVersion"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_policy_versions.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_policy_versions.go new file mode 100644 index 000000000..41952d57a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_policy_versions.go @@ -0,0 +1,21 @@ +package ram + +//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. + +// PolicyVersions is a nested struct in ram response +type PolicyVersions struct { + PolicyVersion []PolicyVersion `json:"PolicyVersion" xml:"PolicyVersion"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_public_key.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_public_key.go new file mode 100644 index 000000000..08d23d934 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_public_key.go @@ -0,0 +1,24 @@ +package ram + +//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. + +// PublicKey is a nested struct in ram response +type PublicKey struct { + CreateDate string `json:"CreateDate" xml:"CreateDate"` + PublicKeyId string `json:"PublicKeyId" xml:"PublicKeyId"` + Status string `json:"Status" xml:"Status"` + PublicKeySpec string `json:"PublicKeySpec" xml:"PublicKeySpec"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_public_key_preference.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_public_key_preference.go new file mode 100644 index 000000000..52d215d01 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_public_key_preference.go @@ -0,0 +1,21 @@ +package ram + +//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. + +// PublicKeyPreference is a nested struct in ram response +type PublicKeyPreference struct { + AllowUserToManagePublicKeys bool `json:"AllowUserToManagePublicKeys" xml:"AllowUserToManagePublicKeys"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_public_keys.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_public_keys.go new file mode 100644 index 000000000..c80e4efc9 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_public_keys.go @@ -0,0 +1,21 @@ +package ram + +//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. + +// PublicKeys is a nested struct in ram response +type PublicKeys struct { + PublicKey []PublicKey `json:"PublicKey" xml:"PublicKey"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_role.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_role.go new file mode 100644 index 000000000..301f0aa0f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_role.go @@ -0,0 +1,28 @@ +package ram + +//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. + +// Role is a nested struct in ram response +type Role struct { + RoleId string `json:"RoleId" xml:"RoleId"` + CreateDate string `json:"CreateDate" xml:"CreateDate"` + AttachDate string `json:"AttachDate" xml:"AttachDate"` + Arn string `json:"Arn" xml:"Arn"` + UpdateDate string `json:"UpdateDate" xml:"UpdateDate"` + Description string `json:"Description" xml:"Description"` + RoleName string `json:"RoleName" xml:"RoleName"` + AssumeRolePolicyDocument string `json:"AssumeRolePolicyDocument" xml:"AssumeRolePolicyDocument"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_roles_in_list_entities_for_policy.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_roles_in_list_entities_for_policy.go new file mode 100644 index 000000000..d72583f5c --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_roles_in_list_entities_for_policy.go @@ -0,0 +1,21 @@ +package ram + +//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. + +// RolesInListEntitiesForPolicy is a nested struct in ram response +type RolesInListEntitiesForPolicy struct { + Role []Role `json:"Role" xml:"Role"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_roles_in_list_roles.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_roles_in_list_roles.go new file mode 100644 index 000000000..ae81bc62b --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_roles_in_list_roles.go @@ -0,0 +1,21 @@ +package ram + +//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. + +// RolesInListRoles is a nested struct in ram response +type RolesInListRoles struct { + Role []Role `json:"Role" xml:"Role"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_security_preference.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_security_preference.go new file mode 100644 index 000000000..95a6226e4 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_security_preference.go @@ -0,0 +1,24 @@ +package ram + +//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. + +// SecurityPreference is a nested struct in ram response +type SecurityPreference struct { + MFAPreference MFAPreference `json:"MFAPreference" xml:"MFAPreference"` + LoginProfilePreference LoginProfilePreference `json:"LoginProfilePreference" xml:"LoginProfilePreference"` + PublicKeyPreference PublicKeyPreference `json:"PublicKeyPreference" xml:"PublicKeyPreference"` + AccessKeyPreference AccessKeyPreference `json:"AccessKeyPreference" xml:"AccessKeyPreference"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_user.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_user.go new file mode 100644 index 000000000..ba9597da9 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_user.go @@ -0,0 +1,31 @@ +package ram + +//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. + +// User is a nested struct in ram response +type User struct { + MobilePhone string `json:"MobilePhone" xml:"MobilePhone"` + Comments string `json:"Comments" xml:"Comments"` + CreateDate string `json:"CreateDate" xml:"CreateDate"` + AttachDate string `json:"AttachDate" xml:"AttachDate"` + Email string `json:"Email" xml:"Email"` + UserId string `json:"UserId" xml:"UserId"` + UpdateDate string `json:"UpdateDate" xml:"UpdateDate"` + UserName string `json:"UserName" xml:"UserName"` + JoinDate string `json:"JoinDate" xml:"JoinDate"` + LastLoginDate string `json:"LastLoginDate" xml:"LastLoginDate"` + DisplayName string `json:"DisplayName" xml:"DisplayName"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_users_in_list_entities_for_policy.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_users_in_list_entities_for_policy.go new file mode 100644 index 000000000..fa864369b --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_users_in_list_entities_for_policy.go @@ -0,0 +1,21 @@ +package ram + +//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. + +// UsersInListEntitiesForPolicy is a nested struct in ram response +type UsersInListEntitiesForPolicy struct { + User []User `json:"User" xml:"User"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_users_in_list_users.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_users_in_list_users.go new file mode 100644 index 000000000..48596725a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_users_in_list_users.go @@ -0,0 +1,21 @@ +package ram + +//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. + +// UsersInListUsers is a nested struct in ram response +type UsersInListUsers struct { + User []User `json:"User" xml:"User"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_users_in_list_users_for_group.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_users_in_list_users_for_group.go new file mode 100644 index 000000000..711484562 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_users_in_list_users_for_group.go @@ -0,0 +1,21 @@ +package ram + +//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. + +// UsersInListUsersForGroup is a nested struct in ram response +type UsersInListUsersForGroup struct { + User []User `json:"User" xml:"User"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_virtual_mfa_device.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_virtual_mfa_device.go new file mode 100644 index 000000000..f91b513cf --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_virtual_mfa_device.go @@ -0,0 +1,25 @@ +package ram + +//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. + +// VirtualMFADevice is a nested struct in ram response +type VirtualMFADevice struct { + QRCodePNG string `json:"QRCodePNG" xml:"QRCodePNG"` + ActivateDate string `json:"ActivateDate" xml:"ActivateDate"` + Base32StringSeed string `json:"Base32StringSeed" xml:"Base32StringSeed"` + SerialNumber string `json:"SerialNumber" xml:"SerialNumber"` + User User `json:"User" xml:"User"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_virtual_mfa_devices.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_virtual_mfa_devices.go new file mode 100644 index 000000000..675148a8e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_virtual_mfa_devices.go @@ -0,0 +1,21 @@ +package ram + +//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. + +// VirtualMFADevices is a nested struct in ram response +type VirtualMFADevices struct { + VirtualMFADevice []VirtualMFADevice `json:"VirtualMFADevice" xml:"VirtualMFADevice"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/unbind_mfa_device.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/unbind_mfa_device.go new file mode 100644 index 000000000..6f66d99e8 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/unbind_mfa_device.go @@ -0,0 +1,104 @@ +package ram + +//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" +) + +// UnbindMFADevice invokes the ram.UnbindMFADevice API synchronously +// api document: https://help.aliyun.com/api/ram/unbindmfadevice.html +func (client *Client) UnbindMFADevice(request *UnbindMFADeviceRequest) (response *UnbindMFADeviceResponse, err error) { + response = CreateUnbindMFADeviceResponse() + err = client.DoAction(request, response) + return +} + +// UnbindMFADeviceWithChan invokes the ram.UnbindMFADevice API asynchronously +// api document: https://help.aliyun.com/api/ram/unbindmfadevice.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) UnbindMFADeviceWithChan(request *UnbindMFADeviceRequest) (<-chan *UnbindMFADeviceResponse, <-chan error) { + responseChan := make(chan *UnbindMFADeviceResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.UnbindMFADevice(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// UnbindMFADeviceWithCallback invokes the ram.UnbindMFADevice API asynchronously +// api document: https://help.aliyun.com/api/ram/unbindmfadevice.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) UnbindMFADeviceWithCallback(request *UnbindMFADeviceRequest, callback func(response *UnbindMFADeviceResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *UnbindMFADeviceResponse + var err error + defer close(result) + response, err = client.UnbindMFADevice(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// UnbindMFADeviceRequest is the request struct for api UnbindMFADevice +type UnbindMFADeviceRequest struct { + *requests.RpcRequest + UserName string `position:"Query" name:"UserName"` +} + +// UnbindMFADeviceResponse is the response struct for api UnbindMFADevice +type UnbindMFADeviceResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + MFADevice MFADevice `json:"MFADevice" xml:"MFADevice"` +} + +// CreateUnbindMFADeviceRequest creates a request to invoke UnbindMFADevice API +func CreateUnbindMFADeviceRequest() (request *UnbindMFADeviceRequest) { + request = &UnbindMFADeviceRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "UnbindMFADevice", "ram", "openAPI") + return +} + +// CreateUnbindMFADeviceResponse creates a response to parse from UnbindMFADevice response +func CreateUnbindMFADeviceResponse() (response *UnbindMFADeviceResponse) { + response = &UnbindMFADeviceResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/update_access_key.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/update_access_key.go new file mode 100644 index 000000000..4e376619f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/update_access_key.go @@ -0,0 +1,105 @@ +package ram + +//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" +) + +// UpdateAccessKey invokes the ram.UpdateAccessKey API synchronously +// api document: https://help.aliyun.com/api/ram/updateaccesskey.html +func (client *Client) UpdateAccessKey(request *UpdateAccessKeyRequest) (response *UpdateAccessKeyResponse, err error) { + response = CreateUpdateAccessKeyResponse() + err = client.DoAction(request, response) + return +} + +// UpdateAccessKeyWithChan invokes the ram.UpdateAccessKey API asynchronously +// api document: https://help.aliyun.com/api/ram/updateaccesskey.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) UpdateAccessKeyWithChan(request *UpdateAccessKeyRequest) (<-chan *UpdateAccessKeyResponse, <-chan error) { + responseChan := make(chan *UpdateAccessKeyResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.UpdateAccessKey(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// UpdateAccessKeyWithCallback invokes the ram.UpdateAccessKey API asynchronously +// api document: https://help.aliyun.com/api/ram/updateaccesskey.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) UpdateAccessKeyWithCallback(request *UpdateAccessKeyRequest, callback func(response *UpdateAccessKeyResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *UpdateAccessKeyResponse + var err error + defer close(result) + response, err = client.UpdateAccessKey(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// UpdateAccessKeyRequest is the request struct for api UpdateAccessKey +type UpdateAccessKeyRequest struct { + *requests.RpcRequest + UserAccessKeyId string `position:"Query" name:"UserAccessKeyId"` + UserName string `position:"Query" name:"UserName"` + Status string `position:"Query" name:"Status"` +} + +// UpdateAccessKeyResponse is the response struct for api UpdateAccessKey +type UpdateAccessKeyResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateUpdateAccessKeyRequest creates a request to invoke UpdateAccessKey API +func CreateUpdateAccessKeyRequest() (request *UpdateAccessKeyRequest) { + request = &UpdateAccessKeyRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "UpdateAccessKey", "ram", "openAPI") + return +} + +// CreateUpdateAccessKeyResponse creates a response to parse from UpdateAccessKey response +func CreateUpdateAccessKeyResponse() (response *UpdateAccessKeyResponse) { + response = &UpdateAccessKeyResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/update_group.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/update_group.go new file mode 100644 index 000000000..d8bf3201e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/update_group.go @@ -0,0 +1,106 @@ +package ram + +//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" +) + +// UpdateGroup invokes the ram.UpdateGroup API synchronously +// api document: https://help.aliyun.com/api/ram/updategroup.html +func (client *Client) UpdateGroup(request *UpdateGroupRequest) (response *UpdateGroupResponse, err error) { + response = CreateUpdateGroupResponse() + err = client.DoAction(request, response) + return +} + +// UpdateGroupWithChan invokes the ram.UpdateGroup API asynchronously +// api document: https://help.aliyun.com/api/ram/updategroup.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) UpdateGroupWithChan(request *UpdateGroupRequest) (<-chan *UpdateGroupResponse, <-chan error) { + responseChan := make(chan *UpdateGroupResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.UpdateGroup(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// UpdateGroupWithCallback invokes the ram.UpdateGroup API asynchronously +// api document: https://help.aliyun.com/api/ram/updategroup.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) UpdateGroupWithCallback(request *UpdateGroupRequest, callback func(response *UpdateGroupResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *UpdateGroupResponse + var err error + defer close(result) + response, err = client.UpdateGroup(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// UpdateGroupRequest is the request struct for api UpdateGroup +type UpdateGroupRequest struct { + *requests.RpcRequest + NewGroupName string `position:"Query" name:"NewGroupName"` + NewComments string `position:"Query" name:"NewComments"` + GroupName string `position:"Query" name:"GroupName"` +} + +// UpdateGroupResponse is the response struct for api UpdateGroup +type UpdateGroupResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Group Group `json:"Group" xml:"Group"` +} + +// CreateUpdateGroupRequest creates a request to invoke UpdateGroup API +func CreateUpdateGroupRequest() (request *UpdateGroupRequest) { + request = &UpdateGroupRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "UpdateGroup", "ram", "openAPI") + return +} + +// CreateUpdateGroupResponse creates a response to parse from UpdateGroup response +func CreateUpdateGroupResponse() (response *UpdateGroupResponse) { + response = &UpdateGroupResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/update_login_profile.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/update_login_profile.go new file mode 100644 index 000000000..cc2d80d04 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/update_login_profile.go @@ -0,0 +1,106 @@ +package ram + +//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" +) + +// UpdateLoginProfile invokes the ram.UpdateLoginProfile API synchronously +// api document: https://help.aliyun.com/api/ram/updateloginprofile.html +func (client *Client) UpdateLoginProfile(request *UpdateLoginProfileRequest) (response *UpdateLoginProfileResponse, err error) { + response = CreateUpdateLoginProfileResponse() + err = client.DoAction(request, response) + return +} + +// UpdateLoginProfileWithChan invokes the ram.UpdateLoginProfile API asynchronously +// api document: https://help.aliyun.com/api/ram/updateloginprofile.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) UpdateLoginProfileWithChan(request *UpdateLoginProfileRequest) (<-chan *UpdateLoginProfileResponse, <-chan error) { + responseChan := make(chan *UpdateLoginProfileResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.UpdateLoginProfile(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// UpdateLoginProfileWithCallback invokes the ram.UpdateLoginProfile API asynchronously +// api document: https://help.aliyun.com/api/ram/updateloginprofile.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) UpdateLoginProfileWithCallback(request *UpdateLoginProfileRequest, callback func(response *UpdateLoginProfileResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *UpdateLoginProfileResponse + var err error + defer close(result) + response, err = client.UpdateLoginProfile(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// UpdateLoginProfileRequest is the request struct for api UpdateLoginProfile +type UpdateLoginProfileRequest struct { + *requests.RpcRequest + Password string `position:"Query" name:"Password"` + PasswordResetRequired requests.Boolean `position:"Query" name:"PasswordResetRequired"` + MFABindRequired requests.Boolean `position:"Query" name:"MFABindRequired"` + UserName string `position:"Query" name:"UserName"` +} + +// UpdateLoginProfileResponse is the response struct for api UpdateLoginProfile +type UpdateLoginProfileResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateUpdateLoginProfileRequest creates a request to invoke UpdateLoginProfile API +func CreateUpdateLoginProfileRequest() (request *UpdateLoginProfileRequest) { + request = &UpdateLoginProfileRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "UpdateLoginProfile", "ram", "openAPI") + return +} + +// CreateUpdateLoginProfileResponse creates a response to parse from UpdateLoginProfile response +func CreateUpdateLoginProfileResponse() (response *UpdateLoginProfileResponse) { + response = &UpdateLoginProfileResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/update_public_key.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/update_public_key.go new file mode 100644 index 000000000..a698eb837 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/update_public_key.go @@ -0,0 +1,105 @@ +package ram + +//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" +) + +// UpdatePublicKey invokes the ram.UpdatePublicKey API synchronously +// api document: https://help.aliyun.com/api/ram/updatepublickey.html +func (client *Client) UpdatePublicKey(request *UpdatePublicKeyRequest) (response *UpdatePublicKeyResponse, err error) { + response = CreateUpdatePublicKeyResponse() + err = client.DoAction(request, response) + return +} + +// UpdatePublicKeyWithChan invokes the ram.UpdatePublicKey API asynchronously +// api document: https://help.aliyun.com/api/ram/updatepublickey.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) UpdatePublicKeyWithChan(request *UpdatePublicKeyRequest) (<-chan *UpdatePublicKeyResponse, <-chan error) { + responseChan := make(chan *UpdatePublicKeyResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.UpdatePublicKey(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// UpdatePublicKeyWithCallback invokes the ram.UpdatePublicKey API asynchronously +// api document: https://help.aliyun.com/api/ram/updatepublickey.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) UpdatePublicKeyWithCallback(request *UpdatePublicKeyRequest, callback func(response *UpdatePublicKeyResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *UpdatePublicKeyResponse + var err error + defer close(result) + response, err = client.UpdatePublicKey(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// UpdatePublicKeyRequest is the request struct for api UpdatePublicKey +type UpdatePublicKeyRequest struct { + *requests.RpcRequest + UserPublicKeyId string `position:"Query" name:"UserPublicKeyId"` + UserName string `position:"Query" name:"UserName"` + Status string `position:"Query" name:"Status"` +} + +// UpdatePublicKeyResponse is the response struct for api UpdatePublicKey +type UpdatePublicKeyResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateUpdatePublicKeyRequest creates a request to invoke UpdatePublicKey API +func CreateUpdatePublicKeyRequest() (request *UpdatePublicKeyRequest) { + request = &UpdatePublicKeyRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "UpdatePublicKey", "ram", "openAPI") + return +} + +// CreateUpdatePublicKeyResponse creates a response to parse from UpdatePublicKey response +func CreateUpdatePublicKeyResponse() (response *UpdatePublicKeyResponse) { + response = &UpdatePublicKeyResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/update_role.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/update_role.go new file mode 100644 index 000000000..6f2b4af0c --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/update_role.go @@ -0,0 +1,105 @@ +package ram + +//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" +) + +// UpdateRole invokes the ram.UpdateRole API synchronously +// api document: https://help.aliyun.com/api/ram/updaterole.html +func (client *Client) UpdateRole(request *UpdateRoleRequest) (response *UpdateRoleResponse, err error) { + response = CreateUpdateRoleResponse() + err = client.DoAction(request, response) + return +} + +// UpdateRoleWithChan invokes the ram.UpdateRole API asynchronously +// api document: https://help.aliyun.com/api/ram/updaterole.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) UpdateRoleWithChan(request *UpdateRoleRequest) (<-chan *UpdateRoleResponse, <-chan error) { + responseChan := make(chan *UpdateRoleResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.UpdateRole(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// UpdateRoleWithCallback invokes the ram.UpdateRole API asynchronously +// api document: https://help.aliyun.com/api/ram/updaterole.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) UpdateRoleWithCallback(request *UpdateRoleRequest, callback func(response *UpdateRoleResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *UpdateRoleResponse + var err error + defer close(result) + response, err = client.UpdateRole(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// UpdateRoleRequest is the request struct for api UpdateRole +type UpdateRoleRequest struct { + *requests.RpcRequest + NewAssumeRolePolicyDocument string `position:"Query" name:"NewAssumeRolePolicyDocument"` + RoleName string `position:"Query" name:"RoleName"` +} + +// UpdateRoleResponse is the response struct for api UpdateRole +type UpdateRoleResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Role Role `json:"Role" xml:"Role"` +} + +// CreateUpdateRoleRequest creates a request to invoke UpdateRole API +func CreateUpdateRoleRequest() (request *UpdateRoleRequest) { + request = &UpdateRoleRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "UpdateRole", "ram", "openAPI") + return +} + +// CreateUpdateRoleResponse creates a response to parse from UpdateRole response +func CreateUpdateRoleResponse() (response *UpdateRoleResponse) { + response = &UpdateRoleResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/update_user.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/update_user.go new file mode 100644 index 000000000..1c8f16a37 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/update_user.go @@ -0,0 +1,109 @@ +package ram + +//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" +) + +// UpdateUser invokes the ram.UpdateUser API synchronously +// api document: https://help.aliyun.com/api/ram/updateuser.html +func (client *Client) UpdateUser(request *UpdateUserRequest) (response *UpdateUserResponse, err error) { + response = CreateUpdateUserResponse() + err = client.DoAction(request, response) + return +} + +// UpdateUserWithChan invokes the ram.UpdateUser API asynchronously +// api document: https://help.aliyun.com/api/ram/updateuser.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) UpdateUserWithChan(request *UpdateUserRequest) (<-chan *UpdateUserResponse, <-chan error) { + responseChan := make(chan *UpdateUserResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.UpdateUser(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// UpdateUserWithCallback invokes the ram.UpdateUser API asynchronously +// api document: https://help.aliyun.com/api/ram/updateuser.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) UpdateUserWithCallback(request *UpdateUserRequest, callback func(response *UpdateUserResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *UpdateUserResponse + var err error + defer close(result) + response, err = client.UpdateUser(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// UpdateUserRequest is the request struct for api UpdateUser +type UpdateUserRequest struct { + *requests.RpcRequest + NewUserName string `position:"Query" name:"NewUserName"` + NewDisplayName string `position:"Query" name:"NewDisplayName"` + NewMobilePhone string `position:"Query" name:"NewMobilePhone"` + NewComments string `position:"Query" name:"NewComments"` + NewEmail string `position:"Query" name:"NewEmail"` + UserName string `position:"Query" name:"UserName"` +} + +// UpdateUserResponse is the response struct for api UpdateUser +type UpdateUserResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + User User `json:"User" xml:"User"` +} + +// CreateUpdateUserRequest creates a request to invoke UpdateUser API +func CreateUpdateUserRequest() (request *UpdateUserRequest) { + request = &UpdateUserRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "UpdateUser", "ram", "openAPI") + return +} + +// CreateUpdateUserResponse creates a response to parse from UpdateUser response +func CreateUpdateUserResponse() (response *UpdateUserResponse) { + response = &UpdateUserResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/upload_public_key.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/upload_public_key.go new file mode 100644 index 000000000..3bd708870 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/upload_public_key.go @@ -0,0 +1,105 @@ +package ram + +//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" +) + +// UploadPublicKey invokes the ram.UploadPublicKey API synchronously +// api document: https://help.aliyun.com/api/ram/uploadpublickey.html +func (client *Client) UploadPublicKey(request *UploadPublicKeyRequest) (response *UploadPublicKeyResponse, err error) { + response = CreateUploadPublicKeyResponse() + err = client.DoAction(request, response) + return +} + +// UploadPublicKeyWithChan invokes the ram.UploadPublicKey API asynchronously +// api document: https://help.aliyun.com/api/ram/uploadpublickey.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) UploadPublicKeyWithChan(request *UploadPublicKeyRequest) (<-chan *UploadPublicKeyResponse, <-chan error) { + responseChan := make(chan *UploadPublicKeyResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.UploadPublicKey(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// UploadPublicKeyWithCallback invokes the ram.UploadPublicKey API asynchronously +// api document: https://help.aliyun.com/api/ram/uploadpublickey.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) UploadPublicKeyWithCallback(request *UploadPublicKeyRequest, callback func(response *UploadPublicKeyResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *UploadPublicKeyResponse + var err error + defer close(result) + response, err = client.UploadPublicKey(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// UploadPublicKeyRequest is the request struct for api UploadPublicKey +type UploadPublicKeyRequest struct { + *requests.RpcRequest + PublicKeySpec string `position:"Query" name:"PublicKeySpec"` + UserName string `position:"Query" name:"UserName"` +} + +// UploadPublicKeyResponse is the response struct for api UploadPublicKey +type UploadPublicKeyResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + PublicKey PublicKey `json:"PublicKey" xml:"PublicKey"` +} + +// CreateUploadPublicKeyRequest creates a request to invoke UploadPublicKey API +func CreateUploadPublicKeyRequest() (request *UploadPublicKeyRequest) { + request = &UploadPublicKeyRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Ram", "2015-05-01", "UploadPublicKey", "ram", "openAPI") + return +} + +// CreateUploadPublicKeyResponse creates a response to parse from UploadPublicKey response +func CreateUploadPublicKeyResponse() (response *UploadPublicKeyResponse) { + response = &UploadPublicKeyResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/denverdino/aliyungo/common/client.go b/vendor/github.com/denverdino/aliyungo/common/client.go deleted file mode 100644 index 6c00d1c19..000000000 --- a/vendor/github.com/denverdino/aliyungo/common/client.go +++ /dev/null @@ -1,550 +0,0 @@ -package common - -import ( - "bytes" - "encoding/json" - "errors" - "fmt" - "io/ioutil" - "log" - "net/http" - "net/url" - "os" - "strconv" - "strings" - "time" - - "github.com/denverdino/aliyungo/util" -) - -// RemovalPolicy.N add index to array item -// RemovalPolicy=["a", "b"] => RemovalPolicy.1="a" RemovalPolicy.2="b" -type FlattenArray []string - -// string contains underline which will be replaced with dot -// SystemDisk_Category => SystemDisk.Category -type UnderlineString string - -// A Client represents a client of ECS services -type Client struct { - AccessKeyId string //Access Key Id - AccessKeySecret string //Access Key Secret - securityToken string - debug bool - httpClient *http.Client - endpoint string - version string - serviceCode string - regionID Region - businessInfo string - userAgent string -} - -// Initialize properties of a client instance -func (client *Client) Init(endpoint, version, accessKeyId, accessKeySecret string) { - client.AccessKeyId = accessKeyId - ak := accessKeySecret - if !strings.HasSuffix(ak, "&") { - ak += "&" - } - client.AccessKeySecret = ak - client.debug = false - handshakeTimeout, err := strconv.Atoi(os.Getenv("TLSHandshakeTimeout")) - if err != nil { - handshakeTimeout = 0 - } - if handshakeTimeout == 0 { - client.httpClient = &http.Client{} - } else { - t := &http.Transport{ - TLSHandshakeTimeout: time.Duration(handshakeTimeout) * time.Second} - client.httpClient = &http.Client{Transport: t} - } - client.endpoint = endpoint - client.version = version -} - -// Initialize properties of a client instance including regionID -func (client *Client) NewInit(endpoint, version, accessKeyId, accessKeySecret, serviceCode string, regionID Region) { - client.Init(endpoint, version, accessKeyId, accessKeySecret) - client.serviceCode = serviceCode - client.regionID = regionID -} - -// Intialize client object when all properties are ready -func (client *Client) InitClient() *Client { - client.debug = false - handshakeTimeout, err := strconv.Atoi(os.Getenv("TLSHandshakeTimeout")) - if err != nil { - handshakeTimeout = 0 - } - if handshakeTimeout == 0 { - client.httpClient = &http.Client{} - } else { - t := &http.Transport{ - TLSHandshakeTimeout: time.Duration(handshakeTimeout) * time.Second} - client.httpClient = &http.Client{Transport: t} - } - return client -} - -func (client *Client) NewInitForAssumeRole(endpoint, version, accessKeyId, accessKeySecret, serviceCode string, regionID Region, securityToken string) { - client.NewInit(endpoint, version, accessKeyId, accessKeySecret, serviceCode, regionID) - client.securityToken = securityToken -} - -//getLocationEndpoint -func (client *Client) getEndpointByLocation() string { - locationClient := NewLocationClient(client.AccessKeyId, client.AccessKeySecret, client.securityToken) - locationClient.SetDebug(true) - return locationClient.DescribeOpenAPIEndpoint(client.regionID, client.serviceCode) -} - -//NewClient using location service -func (client *Client) setEndpointByLocation(region Region, serviceCode, accessKeyId, accessKeySecret, securityToken string) { - locationClient := NewLocationClient(accessKeyId, accessKeySecret, securityToken) - locationClient.SetDebug(true) - ep := locationClient.DescribeOpenAPIEndpoint(region, serviceCode) - if ep == "" { - ep = loadEndpointFromFile(region, serviceCode) - } - - if ep != "" { - client.endpoint = ep - } -} - -// Ensure all necessary properties are valid -func (client *Client) ensureProperties() error { - var msg string - - if client.endpoint == "" { - msg = fmt.Sprintf("endpoint cannot be empty!") - } else if client.version == "" { - msg = fmt.Sprintf("version cannot be empty!") - } else if client.AccessKeyId == "" { - msg = fmt.Sprintf("AccessKeyId cannot be empty!") - } else if client.AccessKeySecret == "" { - msg = fmt.Sprintf("AccessKeySecret cannot be empty!") - } - - if msg != "" { - return errors.New(msg) - } - - return nil -} - -// ---------------------------------------------------- -// WithXXX methods -// ---------------------------------------------------- - -// WithEndpoint sets custom endpoint -func (client *Client) WithEndpoint(endpoint string) *Client { - client.SetEndpoint(endpoint) - return client -} - -// WithVersion sets custom version -func (client *Client) WithVersion(version string) *Client { - client.SetVersion(version) - return client -} - -// WithRegionID sets Region ID -func (client *Client) WithRegionID(regionID Region) *Client { - client.SetRegionID(regionID) - return client -} - -//WithServiceCode sets serviceCode -func (client *Client) WithServiceCode(serviceCode string) *Client { - client.SetServiceCode(serviceCode) - return client -} - -// WithAccessKeyId sets new AccessKeyId -func (client *Client) WithAccessKeyId(id string) *Client { - client.SetAccessKeyId(id) - return client -} - -// WithAccessKeySecret sets new AccessKeySecret -func (client *Client) WithAccessKeySecret(secret string) *Client { - client.SetAccessKeySecret(secret) - return client -} - -// WithSecurityToken sets securityToken -func (client *Client) WithSecurityToken(securityToken string) *Client { - client.SetSecurityToken(securityToken) - return client -} - -// WithDebug sets debug mode to log the request/response message -func (client *Client) WithDebug(debug bool) *Client { - client.SetDebug(debug) - return client -} - -// WithBusinessInfo sets business info to log the request/response message -func (client *Client) WithBusinessInfo(businessInfo string) *Client { - client.SetBusinessInfo(businessInfo) - return client -} - -// WithUserAgent sets user agent to the request/response message -func (client *Client) WithUserAgent(userAgent string) *Client { - client.SetUserAgent(userAgent) - return client -} - -// ---------------------------------------------------- -// SetXXX methods -// ---------------------------------------------------- - -// SetEndpoint sets custom endpoint -func (client *Client) SetEndpoint(endpoint string) { - client.endpoint = endpoint -} - -// SetEndpoint sets custom version -func (client *Client) SetVersion(version string) { - client.version = version -} - -// SetEndpoint sets Region ID -func (client *Client) SetRegionID(regionID Region) { - client.regionID = regionID -} - -//SetServiceCode sets serviceCode -func (client *Client) SetServiceCode(serviceCode string) { - client.serviceCode = serviceCode -} - -// SetAccessKeyId sets new AccessKeyId -func (client *Client) SetAccessKeyId(id string) { - client.AccessKeyId = id -} - -// SetAccessKeySecret sets new AccessKeySecret -func (client *Client) SetAccessKeySecret(secret string) { - client.AccessKeySecret = secret + "&" -} - -// SetDebug sets debug mode to log the request/response message -func (client *Client) SetDebug(debug bool) { - client.debug = debug -} - -// SetBusinessInfo sets business info to log the request/response message -func (client *Client) SetBusinessInfo(businessInfo string) { - if strings.HasPrefix(businessInfo, "/") { - client.businessInfo = businessInfo - } else if businessInfo != "" { - client.businessInfo = "/" + businessInfo - } -} - -// SetUserAgent sets user agent to the request/response message -func (client *Client) SetUserAgent(userAgent string) { - client.userAgent = userAgent -} - -//set SecurityToken -func (client *Client) SetSecurityToken(securityToken string) { - client.securityToken = securityToken -} - -func (client *Client) initEndpoint() error { - // if set any value to "CUSTOMIZED_ENDPOINT" could skip location service. - // example: export CUSTOMIZED_ENDPOINT=true - if os.Getenv("CUSTOMIZED_ENDPOINT") != "" { - return nil - } - - if client.serviceCode != "" && client.regionID != "" { - endpoint := client.getEndpointByLocation() - if endpoint == "" { - return GetCustomError("InvalidEndpoint", "endpoint is empty,pls check") - } - client.endpoint = endpoint - } - return nil -} - -// Invoke sends the raw HTTP request for ECS services -func (client *Client) Invoke(action string, args interface{}, response interface{}) error { - if err := client.ensureProperties(); err != nil { - return err - } - - //init endpoint - if err := client.initEndpoint(); err != nil { - return err - } - - request := Request{} - request.init(client.version, action, client.AccessKeyId, client.securityToken, client.regionID) - - query := util.ConvertToQueryValues(request) - util.SetQueryValues(args, &query) - - // Sign request - signature := util.CreateSignatureForRequest(ECSRequestMethod, &query, client.AccessKeySecret) - - // Generate the request URL - requestURL := client.endpoint + "?" + query.Encode() + "&Signature=" + url.QueryEscape(signature) - - httpReq, err := http.NewRequest(ECSRequestMethod, requestURL, nil) - - if err != nil { - return GetClientError(err) - } - - // TODO move to util and add build val flag - httpReq.Header.Set("X-SDK-Client", `AliyunGO/`+Version+client.businessInfo) - - httpReq.Header.Set("User-Agent", httpReq.UserAgent()+" "+client.userAgent) - - t0 := time.Now() - httpResp, err := client.httpClient.Do(httpReq) - t1 := time.Now() - if err != nil { - return GetClientError(err) - } - statusCode := httpResp.StatusCode - - if client.debug { - log.Printf("Invoke %s %s %d (%v)", ECSRequestMethod, requestURL, statusCode, t1.Sub(t0)) - } - - defer httpResp.Body.Close() - body, err := ioutil.ReadAll(httpResp.Body) - - if err != nil { - return GetClientError(err) - } - - if client.debug { - var prettyJSON bytes.Buffer - err = json.Indent(&prettyJSON, body, "", " ") - log.Println(string(prettyJSON.Bytes())) - } - - if statusCode >= 400 && statusCode <= 599 { - errorResponse := ErrorResponse{} - err = json.Unmarshal(body, &errorResponse) - ecsError := &Error{ - ErrorResponse: errorResponse, - StatusCode: statusCode, - } - return ecsError - } - - err = json.Unmarshal(body, response) - //log.Printf("%++v", response) - if err != nil { - return GetClientError(err) - } - - return nil -} - -// Invoke sends the raw HTTP request for ECS services -func (client *Client) InvokeByFlattenMethod(action string, args interface{}, response interface{}) error { - if err := client.ensureProperties(); err != nil { - return err - } - - //init endpoint - if err := client.initEndpoint(); err != nil { - return err - } - - request := Request{} - request.init(client.version, action, client.AccessKeyId, client.securityToken, client.regionID) - - query := util.ConvertToQueryValues(request) - - util.SetQueryValueByFlattenMethod(args, &query) - - // Sign request - signature := util.CreateSignatureForRequest(ECSRequestMethod, &query, client.AccessKeySecret) - - // Generate the request URL - requestURL := client.endpoint + "?" + query.Encode() + "&Signature=" + url.QueryEscape(signature) - - httpReq, err := http.NewRequest(ECSRequestMethod, requestURL, nil) - - if err != nil { - return GetClientError(err) - } - - // TODO move to util and add build val flag - httpReq.Header.Set("X-SDK-Client", `AliyunGO/`+Version+client.businessInfo) - - httpReq.Header.Set("User-Agent", httpReq.UserAgent()+" "+client.userAgent) - - t0 := time.Now() - httpResp, err := client.httpClient.Do(httpReq) - t1 := time.Now() - if err != nil { - return GetClientError(err) - } - statusCode := httpResp.StatusCode - - if client.debug { - log.Printf("Invoke %s %s %d (%v)", ECSRequestMethod, requestURL, statusCode, t1.Sub(t0)) - } - - defer httpResp.Body.Close() - body, err := ioutil.ReadAll(httpResp.Body) - - if err != nil { - return GetClientError(err) - } - - if client.debug { - var prettyJSON bytes.Buffer - err = json.Indent(&prettyJSON, body, "", " ") - log.Println(string(prettyJSON.Bytes())) - } - - if statusCode >= 400 && statusCode <= 599 { - errorResponse := ErrorResponse{} - err = json.Unmarshal(body, &errorResponse) - ecsError := &Error{ - ErrorResponse: errorResponse, - StatusCode: statusCode, - } - return ecsError - } - - err = json.Unmarshal(body, response) - //log.Printf("%++v", response) - if err != nil { - return GetClientError(err) - } - - return nil -} - -// Invoke sends the raw HTTP request for ECS services -//改进了一下上面那个方法,可以使用各种Http方法 -//2017.1.30 增加了一个path参数,用来拓展访问的地址 -func (client *Client) InvokeByAnyMethod(method, action, path string, args interface{}, response interface{}) error { - if err := client.ensureProperties(); err != nil { - return err - } - - //init endpoint - if err := client.initEndpoint(); err != nil { - return err - } - - request := Request{} - request.init(client.version, action, client.AccessKeyId, client.securityToken, client.regionID) - data := util.ConvertToQueryValues(request) - util.SetQueryValues(args, &data) - - // Sign request - signature := util.CreateSignatureForRequest(method, &data, client.AccessKeySecret) - - data.Add("Signature", signature) - // Generate the request URL - var ( - httpReq *http.Request - err error - ) - if method == http.MethodGet { - requestURL := client.endpoint + path + "?" + data.Encode() - //fmt.Println(requestURL) - httpReq, err = http.NewRequest(method, requestURL, nil) - } else { - //fmt.Println(client.endpoint + path) - httpReq, err = http.NewRequest(method, client.endpoint+path, strings.NewReader(data.Encode())) - httpReq.Header.Set("Content-Type", "application/x-www-form-urlencoded") - } - - if err != nil { - return GetClientError(err) - } - - // TODO move to util and add build val flag - httpReq.Header.Set("X-SDK-Client", `AliyunGO/`+Version+client.businessInfo) - httpReq.Header.Set("User-Agent", httpReq.Header.Get("User-Agent")+" "+client.userAgent) - - t0 := time.Now() - httpResp, err := client.httpClient.Do(httpReq) - t1 := time.Now() - if err != nil { - return GetClientError(err) - } - statusCode := httpResp.StatusCode - - if client.debug { - log.Printf("Invoke %s %s %d (%v) %v", ECSRequestMethod, client.endpoint, statusCode, t1.Sub(t0), data.Encode()) - } - - defer httpResp.Body.Close() - body, err := ioutil.ReadAll(httpResp.Body) - - if err != nil { - return GetClientError(err) - } - - if client.debug { - var prettyJSON bytes.Buffer - err = json.Indent(&prettyJSON, body, "", " ") - log.Println(string(prettyJSON.Bytes())) - } - - if statusCode >= 400 && statusCode <= 599 { - errorResponse := ErrorResponse{} - err = json.Unmarshal(body, &errorResponse) - ecsError := &Error{ - ErrorResponse: errorResponse, - StatusCode: statusCode, - } - return ecsError - } - - err = json.Unmarshal(body, response) - //log.Printf("%++v", response) - if err != nil { - return GetClientError(err) - } - - return nil -} - -// GenerateClientToken generates the Client Token with random string -func (client *Client) GenerateClientToken() string { - return util.CreateRandomString() -} - -func GetClientErrorFromString(str string) error { - return &Error{ - ErrorResponse: ErrorResponse{ - Code: "AliyunGoClientFailure", - Message: str, - }, - StatusCode: -1, - } -} - -func GetClientError(err error) error { - return GetClientErrorFromString(err.Error()) -} - -func GetCustomError(code, message string) error { - return &Error{ - ErrorResponse: ErrorResponse{ - Code: code, - Message: message, - }, - StatusCode: 400, - } -} diff --git a/vendor/github.com/denverdino/aliyungo/common/endpoint.go b/vendor/github.com/denverdino/aliyungo/common/endpoint.go deleted file mode 100644 index 757f7a784..000000000 --- a/vendor/github.com/denverdino/aliyungo/common/endpoint.go +++ /dev/null @@ -1,208 +0,0 @@ -package common - -import ( - "encoding/xml" - "fmt" - "io/ioutil" - "log" - "os" - "strings" - "time" -) - -const ( - // LocationDefaultEndpoint is the default API endpoint of Location services - locationDefaultEndpoint = "https://location.aliyuncs.com" - locationAPIVersion = "2015-06-12" - HTTP_PROTOCOL = "http" - HTTPS_PROTOCOL = "https" -) - -var ( - endpoints = make(map[Region]map[string]string) - - SpecailEnpoints = map[Region]map[string]string{ - APNorthEast1: { - "ecs": "https://ecs.ap-northeast-1.aliyuncs.com", - "slb": "https://slb.ap-northeast-1.aliyuncs.com", - "rds": "https://rds.ap-northeast-1.aliyuncs.com", - "vpc": "https://vpc.ap-northeast-1.aliyuncs.com", - }, - APSouthEast2: { - "ecs": "https://ecs.ap-southeast-2.aliyuncs.com", - "slb": "https://slb.ap-southeast-2.aliyuncs.com", - "rds": "https://rds.ap-southeast-2.aliyuncs.com", - "vpc": "https://vpc.ap-southeast-2.aliyuncs.com", - }, - APSouthEast3: { - "ecs": "https://ecs.ap-southeast-3.aliyuncs.com", - "slb": "https://slb.ap-southeast-3.aliyuncs.com", - "rds": "https://rds.ap-southeast-3.aliyuncs.com", - "vpc": "https://vpc.ap-southeast-3.aliyuncs.com", - }, - MEEast1: { - "ecs": "https://ecs.me-east-1.aliyuncs.com", - "slb": "https://slb.me-east-1.aliyuncs.com", - "rds": "https://rds.me-east-1.aliyuncs.com", - "vpc": "https://vpc.me-east-1.aliyuncs.com", - }, - EUCentral1: { - "ecs": "https://ecs.eu-central-1.aliyuncs.com", - "slb": "https://slb.eu-central-1.aliyuncs.com", - "rds": "https://rds.eu-central-1.aliyuncs.com", - "vpc": "https://vpc.eu-central-1.aliyuncs.com", - }, - EUWest1: { - "ecs": "https://ecs.eu-west-1.aliyuncs.com", - "slb": "https://slb.eu-west-1.aliyuncs.com", - "rds": "https://rds.eu-west-1.aliyuncs.com", - "vpc": "https://vpc.eu-west-1.aliyuncs.com", - }, - Zhangjiakou: { - "ecs": "https://ecs.cn-zhangjiakou.aliyuncs.com", - "slb": "https://slb.cn-zhangjiakou.aliyuncs.com", - "rds": "https://rds.cn-zhangjiakou.aliyuncs.com", - "vpc": "https://vpc.cn-zhangjiakou.aliyuncs.com", - }, - Huhehaote: { - "ecs": "https://ecs.cn-huhehaote.aliyuncs.com", - "slb": "https://slb.cn-huhehaote.aliyuncs.com", - "rds": "https://rds.cn-huhehaote.aliyuncs.com", - "vpc": "https://vpc.cn-huhehaote.aliyuncs.com", - }, - } -) - -//init endpoints from file -func init() { - -} - -type LocationClient struct { - Client -} - -func NewLocationClient(accessKeyId, accessKeySecret, securityToken string) *LocationClient { - endpoint := os.Getenv("LOCATION_ENDPOINT") - if endpoint == "" { - endpoint = locationDefaultEndpoint - } - - client := &LocationClient{} - client.Init(endpoint, locationAPIVersion, accessKeyId, accessKeySecret) - client.securityToken = securityToken - return client -} - -func NewLocationClientWithSecurityToken(accessKeyId, accessKeySecret, securityToken string) *LocationClient { - endpoint := os.Getenv("LOCATION_ENDPOINT") - if endpoint == "" { - endpoint = locationDefaultEndpoint - } - - client := &LocationClient{} - client.WithEndpoint(endpoint). - WithVersion(locationAPIVersion). - WithAccessKeyId(accessKeyId). - WithAccessKeySecret(accessKeySecret). - WithSecurityToken(securityToken). - InitClient() - return client -} - -func (client *LocationClient) DescribeEndpoint(args *DescribeEndpointArgs) (*DescribeEndpointResponse, error) { - response := &DescribeEndpointResponse{} - err := client.Invoke("DescribeEndpoint", args, response) - if err != nil { - return nil, err - } - return response, err -} - -func (client *LocationClient) DescribeEndpoints(args *DescribeEndpointsArgs) (*DescribeEndpointsResponse, error) { - response := &DescribeEndpointsResponse{} - err := client.Invoke("DescribeEndpoints", args, response) - if err != nil { - return nil, err - } - return response, err -} - -func getProductRegionEndpoint(region Region, serviceCode string) string { - if sp, ok := endpoints[region]; ok { - if endpoint, ok := sp[serviceCode]; ok { - return endpoint - } - } - - return "" -} - -func setProductRegionEndpoint(region Region, serviceCode string, endpoint string) { - endpoints[region] = map[string]string{ - serviceCode: endpoint, - } -} - -func (client *LocationClient) DescribeOpenAPIEndpoint(region Region, serviceCode string) string { - if endpoint := getProductRegionEndpoint(region, serviceCode); endpoint != "" { - return endpoint - } - defaultProtocols := HTTP_PROTOCOL - - args := &DescribeEndpointsArgs{ - Id: region, - ServiceCode: serviceCode, - Type: "openAPI", - } - - var endpoint *DescribeEndpointsResponse - var err error - for index := 0; index < 5; index++ { - endpoint, err = client.DescribeEndpoints(args) - if err == nil && endpoint != nil && len(endpoint.Endpoints.Endpoint) > 0 { - break - } - time.Sleep(500 * time.Millisecond) - } - - if err != nil || endpoint == nil || len(endpoint.Endpoints.Endpoint) <= 0 { - log.Printf("aliyungo: can not get endpoint from service, use default. endpoint=[%v], error=[%v]\n", endpoint, err) - return "" - } - - for _, protocol := range endpoint.Endpoints.Endpoint[0].Protocols.Protocols { - if strings.ToLower(protocol) == HTTPS_PROTOCOL { - defaultProtocols = HTTPS_PROTOCOL - break - } - } - - ep := fmt.Sprintf("%s://%s", defaultProtocols, endpoint.Endpoints.Endpoint[0].Endpoint) - - setProductRegionEndpoint(region, serviceCode, ep) - return ep -} - -func loadEndpointFromFile(region Region, serviceCode string) string { - data, err := ioutil.ReadFile("./endpoints.xml") - if err != nil { - return "" - } - var endpoints Endpoints - err = xml.Unmarshal(data, &endpoints) - if err != nil { - return "" - } - for _, endpoint := range endpoints.Endpoint { - if endpoint.RegionIds.RegionId == string(region) { - for _, product := range endpoint.Products.Product { - if strings.ToLower(product.ProductName) == serviceCode { - return fmt.Sprintf("%s://%s", HTTPS_PROTOCOL, product.DomainName) - } - } - } - } - - return "" -} diff --git a/vendor/github.com/denverdino/aliyungo/common/endpoints.xml b/vendor/github.com/denverdino/aliyungo/common/endpoints.xml deleted file mode 100644 index 26ea765b2..000000000 --- a/vendor/github.com/denverdino/aliyungo/common/endpoints.xml +++ /dev/null @@ -1,1370 +0,0 @@ - - - - jp-fudao-1 - - Ecsecs-cn-hangzhou.aliyuncs.com - - - - me-east-1 - - Rdsrds.me-east-1.aliyuncs.com - Ecsecs.me-east-1.aliyuncs.com - Vpcvpc.me-east-1.aliyuncs.com - Kmskms.me-east-1.aliyuncs.com - Cmsmetrics.cn-hangzhou.aliyuncs.com - Slbslb.me-east-1.aliyuncs.com - - - - us-east-1 - - CScs.aliyuncs.com - Pushcloudpush.aliyuncs.com - COScos.aliyuncs.com - Essess.aliyuncs.com - Ace-opsace-ops.cn-hangzhou.aliyuncs.com - Billingbilling.aliyuncs.com - Dqsdqs.aliyuncs.com - Ddsmongodb.aliyuncs.com - Emremr.aliyuncs.com - Smssms.aliyuncs.com - Jaqjaq.aliyuncs.com - HPChpc.aliyuncs.com - Locationlocation.aliyuncs.com - ChargingServicechargingservice.aliyuncs.com - Msgmsg-inner.aliyuncs.com - Commondrivercommon.driver.aliyuncs.com - R-kvstorer-kvstore-cn-hangzhou.aliyuncs.com - Bssbss.aliyuncs.com - Workorderworkorder.aliyuncs.com - Ocsm-kvstore.aliyuncs.com - Yundunyundun-cn-hangzhou.aliyuncs.com - Ubsms-innerubsms-inner.aliyuncs.com - Dmdm.aliyuncs.com - Greengreen.aliyuncs.com - Riskrisk-cn-hangzhou.aliyuncs.com - oceanbaseoceanbase.aliyuncs.com - Mscmsc-inner.aliyuncs.com - Yundunhsmyundunhsm.aliyuncs.com - Iotiot.aliyuncs.com - jaqjaq.aliyuncs.com - Omsoms.aliyuncs.com - livelive.aliyuncs.com - Ecsecs-cn-hangzhou.aliyuncs.com - Ubsmsubsms.aliyuncs.com - Vpcvpc.aliyuncs.com - Alertalert.aliyuncs.com - Aceace.cn-hangzhou.aliyuncs.com - AMSams.aliyuncs.com - ROSros.aliyuncs.com - PTSpts.aliyuncs.com - Qualitycheckqualitycheck.aliyuncs.com - M-kvstorem-kvstore.aliyuncs.com - HighDDosyd-highddos-cn-hangzhou.aliyuncs.com - CmsSiteMonitorsitemonitor.aliyuncs.com - Rdsrds.aliyuncs.com - BatchComputebatchCompute.aliyuncs.com - CFcf.aliyuncs.com - Drdsdrds.aliyuncs.com - Acsacs.aliyun-inc.com - Httpdnshttpdns-api.aliyuncs.com - Location-innerlocation-inner.aliyuncs.com - Aasaas.aliyuncs.com - Stssts.aliyuncs.com - Dtsdts.aliyuncs.com - Drcdrc.aliyuncs.com - Vpc-innervpc-inner.aliyuncs.com - Cmsmetrics.cn-hangzhou.aliyuncs.com - Slbslb.aliyuncs.com - Crmcrm-cn-hangzhou.aliyuncs.com - Domaindomain.aliyuncs.com - Otsots-pop.aliyuncs.com - Ossoss-cn-hangzhou.aliyuncs.com - Ramram.aliyuncs.com - Salessales.cn-hangzhou.aliyuncs.com - OssAdminoss-admin.aliyuncs.com - Alidnsalidns.aliyuncs.com - Onsons.aliyuncs.com - Cdncdn.aliyuncs.com - YundunDdosinner-yundun-ddos.cn-hangzhou.aliyuncs.com - - - - ap-northeast-1 - - Rdsrds.ap-northeast-1.aliyuncs.com - Kmskms.ap-northeast-1.aliyuncs.com - Vpcvpc.ap-northeast-1.aliyuncs.com - Ecsecs.ap-northeast-1.aliyuncs.com - Cmsmetrics.ap-northeast-1.aliyuncs.com - Kvstorer-kvstore.ap-northeast-1.aliyuncs.com - Slbslb.ap-northeast-1.aliyuncs.com - - - - cn-hangzhou-bj-b01 - - Ecsecs-cn-hangzhou.aliyuncs.com - - - - cn-hongkong - - Pushcloudpush.aliyuncs.com - COScos.aliyuncs.com - Onsons.aliyuncs.com - Essess.aliyuncs.com - Ace-opsace-ops.cn-hangzhou.aliyuncs.com - Billingbilling.aliyuncs.com - Dqsdqs.aliyuncs.com - Ddsmongodb.aliyuncs.com - Emremr.aliyuncs.com - Smssms.aliyuncs.com - Jaqjaq.aliyuncs.com - CScs.aliyuncs.com - Kmskms.cn-hongkong.aliyuncs.com - Locationlocation.aliyuncs.com - Msgmsg-inner.aliyuncs.com - ChargingServicechargingservice.aliyuncs.com - R-kvstorer-kvstore-cn-hangzhou.aliyuncs.com - Alertalert.aliyuncs.com - Mscmsc-inner.aliyuncs.com - Drcdrc.aliyuncs.com - Yundunyundun-cn-hangzhou.aliyuncs.com - Ubsms-innerubsms-inner.aliyuncs.com - Ocsm-kvstore.aliyuncs.com - Dmdm.aliyuncs.com - Riskrisk-cn-hangzhou.aliyuncs.com - oceanbaseoceanbase.aliyuncs.com - Workorderworkorder.aliyuncs.com - Yundunhsmyundunhsm.aliyuncs.com - Iotiot.aliyuncs.com - HPChpc.aliyuncs.com - jaqjaq.aliyuncs.com - Omsoms.aliyuncs.com - livelive.aliyuncs.com - Ecsecs-cn-hangzhou.aliyuncs.com - M-kvstorem-kvstore.aliyuncs.com - Vpcvpc.aliyuncs.com - BatchComputebatchCompute.aliyuncs.com - AMSams.aliyuncs.com - ROSros.aliyuncs.com - PTSpts.aliyuncs.com - Qualitycheckqualitycheck.aliyuncs.com - Bssbss.aliyuncs.com - Ubsmsubsms.aliyuncs.com - CloudAPIapigateway.cn-hongkong.aliyuncs.com - Stssts.aliyuncs.com - CmsSiteMonitorsitemonitor.aliyuncs.com - Aceace.cn-hangzhou.aliyuncs.com - Mtsmts.cn-hongkong.aliyuncs.com - Location-innerlocation-inner.aliyuncs.com - CFcf.aliyuncs.com - Acsacs.aliyun-inc.com - Httpdnshttpdns-api.aliyuncs.com - Greengreen.aliyuncs.com - Aasaas.aliyuncs.com - Alidnsalidns.aliyuncs.com - Dtsdts.aliyuncs.com - HighDDosyd-highddos-cn-hangzhou.aliyuncs.com - Vpc-innervpc-inner.aliyuncs.com - Cmsmetrics.cn-hangzhou.aliyuncs.com - Slbslb.aliyuncs.com - Commondrivercommon.driver.aliyuncs.com - Domaindomain.aliyuncs.com - Otsots-pop.aliyuncs.com - Cdncdn.aliyuncs.com - Ramram.aliyuncs.com - Drdsdrds.aliyuncs.com - Rdsrds.aliyuncs.com - Crmcrm-cn-hangzhou.aliyuncs.com - OssAdminoss-admin.aliyuncs.com - Salessales.cn-hangzhou.aliyuncs.com - YundunDdosinner-yundun-ddos.cn-hangzhou.aliyuncs.com - Ossoss-cn-hongkong.aliyuncs.com - - - - cn-beijing-nu16-b01 - - Ecsecs-cn-hangzhou.aliyuncs.com - - - - cn-beijing-am13-c01 - - Ecsecs-cn-hangzhou.aliyuncs.com - Vpcvpc.aliyuncs.com - - - - in-west-antgroup-1 - - Ecsecs-cn-hangzhou.aliyuncs.com - - - - cn-guizhou-gov - - Ecsecs-cn-hangzhou.aliyuncs.com - Vpcvpc.aliyuncs.com - - - - in-west-antgroup-2 - - Ecsecs-cn-hangzhou.aliyuncs.com - - - - cn-qingdao-cm9 - - CScs.aliyuncs.com - Riskrisk-cn-hangzhou.aliyuncs.com - COScos.aliyuncs.com - Essess.aliyuncs.com - Billingbilling.aliyuncs.com - Dqsdqs.aliyuncs.com - Ddsmongodb.aliyuncs.com - Alidnsalidns.aliyuncs.com - Smssms.aliyuncs.com - Drdsdrds.aliyuncs.com - HPChpc.aliyuncs.com - Locationlocation.aliyuncs.com - Msgmsg-inner.aliyuncs.com - ChargingServicechargingservice.aliyuncs.com - Ocsm-kvstore.aliyuncs.com - Alertalert.aliyuncs.com - Mscmsc-inner.aliyuncs.com - HighDDosyd-highddos-cn-hangzhou.aliyuncs.com - R-kvstorer-kvstore-cn-hangzhou.aliyuncs.com - Yundunyundun-cn-hangzhou.aliyuncs.com - Ubsms-innerubsms-inner.aliyuncs.com - Dmdm.aliyuncs.com - Greengreen.aliyuncs.com - YundunDdosinner-yundun-ddos.cn-hangzhou.aliyuncs.com - oceanbaseoceanbase.aliyuncs.com - Workorderworkorder.aliyuncs.com - Yundunhsmyundunhsm.aliyuncs.com - Iotiot.aliyuncs.com - jaqjaq.aliyuncs.com - Omsoms.aliyuncs.com - livelive.aliyuncs.com - Ecsecs-cn-hangzhou.aliyuncs.com - Ubsmsubsms.aliyuncs.com - CmsSiteMonitorsitemonitor.aliyuncs.com - AMSams.aliyuncs.com - Crmcrm-cn-hangzhou.aliyuncs.com - PTSpts.aliyuncs.com - Qualitycheckqualitycheck.aliyuncs.com - Bssbss.aliyuncs.com - M-kvstorem-kvstore.aliyuncs.com - Aceace.cn-hangzhou.aliyuncs.com - Mtsmts.cn-qingdao.aliyuncs.com - CFcf.aliyuncs.com - Httpdnshttpdns-api.aliyuncs.com - Location-innerlocation-inner.aliyuncs.com - Aasaas.aliyuncs.com - Stssts.aliyuncs.com - Dtsdts.aliyuncs.com - Emremr.aliyuncs.com - Drcdrc.aliyuncs.com - Pushcloudpush.aliyuncs.com - Cmsmetrics.aliyuncs.com - Slbslb.aliyuncs.com - Commondrivercommon.driver.aliyuncs.com - Domaindomain.aliyuncs.com - Otsots-pop.aliyuncs.com - ROSros.aliyuncs.com - Ossoss-cn-hangzhou.aliyuncs.com - Ramram.aliyuncs.com - Salessales.cn-hangzhou.aliyuncs.com - Rdsrds.aliyuncs.com - OssAdminoss-admin.aliyuncs.com - Onsons.aliyuncs.com - Cdncdn.aliyuncs.com - - - - tw-snowcloud-kaohsiung - - Ecsecs-cn-hangzhou.aliyuncs.com - - - - cn-shanghai-finance-1 - - Kmskms.cn-shanghai-finance-1.aliyuncs.com - Ecsecs-cn-hangzhou.aliyuncs.com - Vpcvpc.aliyuncs.com - Rdsrds.aliyuncs.com - - - - cn-guizhou - - Ecsecs-cn-hangzhou.aliyuncs.com - Vpcvpc.aliyuncs.com - - - - cn-qingdao-finance - - Ossoss-cn-qdjbp-a.aliyuncs.com - - - - cn-beijing-gov-1 - - Ossoss-cn-haidian-a.aliyuncs.com - Rdsrds.aliyuncs.com - - - - cn-shanghai - - ARMSarms.cn-shanghai.aliyuncs.com - Riskrisk-cn-hangzhou.aliyuncs.com - COScos.aliyuncs.com - HPChpc.aliyuncs.com - Billingbilling.aliyuncs.com - Dqsdqs.aliyuncs.com - Drcdrc.aliyuncs.com - Alidnsalidns.aliyuncs.com - Smssms.aliyuncs.com - Drdsdrds.aliyuncs.com - CScs.aliyuncs.com - Kmskms.cn-shanghai.aliyuncs.com - Locationlocation.aliyuncs.com - Msgmsg-inner.aliyuncs.com - ChargingServicechargingservice.aliyuncs.com - Ocsm-kvstore.aliyuncs.com - Alertalert.aliyuncs.com - Mscmsc-inner.aliyuncs.com - R-kvstorer-kvstore-cn-hangzhou.aliyuncs.com - Yundunyundun-cn-hangzhou.aliyuncs.com - Ubsms-innerubsms-inner.aliyuncs.com - Dmdm.aliyuncs.com - Greengreen.cn-shanghai.aliyuncs.com - Commondrivercommon.driver.aliyuncs.com - oceanbaseoceanbase.aliyuncs.com - Workorderworkorder.aliyuncs.com - Yundunhsmyundunhsm.aliyuncs.com - Iotiot.aliyuncs.com - Bssbss.aliyuncs.com - Omsoms.aliyuncs.com - Ubsmsubsms.aliyuncs.com - livelive.aliyuncs.com - Ecsecs-cn-hangzhou.aliyuncs.com - Ace-opsace-ops.cn-hangzhou.aliyuncs.com - CmsSiteMonitorsitemonitor.aliyuncs.com - BatchComputebatchCompute.aliyuncs.com - AMSams.aliyuncs.com - ROSros.aliyuncs.com - PTSpts.aliyuncs.com - Qualitycheckqualitycheck.aliyuncs.com - M-kvstorem-kvstore.aliyuncs.com - Apigatewayapigateway.cn-shanghai.aliyuncs.com - CloudAPIapigateway.cn-shanghai.aliyuncs.com - Stssts.aliyuncs.com - Vpcvpc.aliyuncs.com - Aceace.cn-hangzhou.aliyuncs.com - Mtsmts.cn-shanghai.aliyuncs.com - Ddsmongodb.aliyuncs.com - CFcf.aliyuncs.com - Acsacs.aliyun-inc.com - Httpdnshttpdns-api.aliyuncs.com - Pushcloudpush.aliyuncs.com - Location-innerlocation-inner.aliyuncs.com - Aasaas.aliyuncs.com - Emremr.aliyuncs.com - Dtsdts.aliyuncs.com - HighDDosyd-highddos-cn-hangzhou.aliyuncs.com - Jaqjaq.aliyuncs.com - Cmsmetrics.cn-hangzhou.aliyuncs.com - Slbslb.aliyuncs.com - Crmcrm-cn-hangzhou.aliyuncs.com - Domaindomain.aliyuncs.com - Otsots-pop.aliyuncs.com - jaqjaq.aliyuncs.com - Cdncdn.aliyuncs.com - Ramram.aliyuncs.com - Salessales.cn-hangzhou.aliyuncs.com - Vpc-innervpc-inner.aliyuncs.com - Rdsrds.aliyuncs.com - OssAdminoss-admin.aliyuncs.com - Onsons.aliyuncs.com - Essess.aliyuncs.com - Ossoss-cn-shanghai.aliyuncs.com - YundunDdosinner-yundun-ddos.cn-hangzhou.aliyuncs.com - vodvod.cn-shanghai.aliyuncs.com - - - - cn-shenzhen-inner - - Riskrisk-cn-hangzhou.aliyuncs.com - COScos.aliyuncs.com - Onsons.aliyuncs.com - Essess.aliyuncs.com - Billingbilling.aliyuncs.com - Dqsdqs.aliyuncs.com - Ddsmongodb.aliyuncs.com - Alidnsalidns.aliyuncs.com - Smssms.aliyuncs.com - Salessales.cn-hangzhou.aliyuncs.com - HPChpc.aliyuncs.com - Locationlocation.aliyuncs.com - Msgmsg-inner.aliyuncs.com - ChargingServicechargingservice.aliyuncs.com - Ocsm-kvstore.aliyuncs.com - jaqjaq.aliyuncs.com - Mscmsc-inner.aliyuncs.com - HighDDosyd-highddos-cn-hangzhou.aliyuncs.com - R-kvstorer-kvstore-cn-hangzhou.aliyuncs.com - Bssbss.aliyuncs.com - Ubsms-innerubsms-inner.aliyuncs.com - Dmdm.aliyuncs.com - Commondrivercommon.driver.aliyuncs.com - oceanbaseoceanbase.aliyuncs.com - Workorderworkorder.aliyuncs.com - Yundunhsmyundunhsm.aliyuncs.com - Iotiot.aliyuncs.com - Alertalert.aliyuncs.com - Omsoms.aliyuncs.com - livelive.aliyuncs.com - Ecsecs-cn-hangzhou.aliyuncs.com - Ubsmsubsms.aliyuncs.com - CmsSiteMonitorsitemonitor.aliyuncs.com - AMSams.aliyuncs.com - Crmcrm-cn-hangzhou.aliyuncs.com - PTSpts.aliyuncs.com - Qualitycheckqualitycheck.aliyuncs.com - M-kvstorem-kvstore.aliyuncs.com - Stssts.aliyuncs.com - Aceace.cn-hangzhou.aliyuncs.com - Mtsmts.cn-shenzhen.aliyuncs.com - CFcf.aliyuncs.com - Httpdnshttpdns-api.aliyuncs.com - Greengreen.aliyuncs.com - Aasaas.aliyuncs.com - Emremr.aliyuncs.com - CScs.aliyuncs.com - Drcdrc.aliyuncs.com - Pushcloudpush.aliyuncs.com - Cmsmetrics.aliyuncs.com - Slbslb.aliyuncs.com - YundunDdosinner-yundun-ddos.cn-hangzhou.aliyuncs.com - Dtsdts.aliyuncs.com - Domaindomain.aliyuncs.com - Otsots-pop.aliyuncs.com - ROSros.aliyuncs.com - Cdncdn.aliyuncs.com - Ramram.aliyuncs.com - Drdsdrds.aliyuncs.com - Rdsrds.aliyuncs.com - OssAdminoss-admin.aliyuncs.com - Location-innerlocation-inner.aliyuncs.com - Yundunyundun-cn-hangzhou.aliyuncs.com - Ossoss-cn-hangzhou.aliyuncs.com - - - - cn-fujian - - Ecsecs-cn-hangzhou.aliyuncs.com - Rdsrds.aliyuncs.com - - - - in-mumbai-alipay - - Ecsecs-cn-hangzhou.aliyuncs.com - - - - us-west-1 - - CScs.aliyuncs.com - COScos.aliyuncs.com - Essess.aliyuncs.com - Ace-opsace-ops.cn-hangzhou.aliyuncs.com - Billingbilling.aliyuncs.com - Dqsdqs.aliyuncs.com - Ddsmongodb.aliyuncs.com - Stssts.aliyuncs.com - Smssms.aliyuncs.com - Jaqjaq.aliyuncs.com - Pushcloudpush.aliyuncs.com - Alidnsalidns.aliyuncs.com - Locationlocation.aliyuncs.com - Msgmsg-inner.aliyuncs.com - ChargingServicechargingservice.aliyuncs.com - Ocsm-kvstore.aliyuncs.com - Bssbss.aliyuncs.com - Mscmsc-inner.aliyuncs.com - R-kvstorer-kvstore-cn-hangzhou.aliyuncs.com - Yundunyundun-cn-hangzhou.aliyuncs.com - Ubsms-innerubsms-inner.aliyuncs.com - Dmdm.aliyuncs.com - Greengreen.aliyuncs.com - Riskrisk-cn-hangzhou.aliyuncs.com - oceanbaseoceanbase.aliyuncs.com - Workorderworkorder.aliyuncs.com - Yundunhsmyundunhsm.aliyuncs.com - Iotiot.aliyuncs.com - Alertalert.aliyuncs.com - Omsoms.aliyuncs.com - livelive.aliyuncs.com - Ecsecs-cn-hangzhou.aliyuncs.com - M-kvstorem-kvstore.aliyuncs.com - Vpcvpc.aliyuncs.com - BatchComputebatchCompute.aliyuncs.com - Aceace.cn-hangzhou.aliyuncs.com - AMSams.aliyuncs.com - ROSros.aliyuncs.com - PTSpts.aliyuncs.com - Qualitycheckqualitycheck.aliyuncs.com - Ubsmsubsms.aliyuncs.com - HighDDosyd-highddos-cn-hangzhou.aliyuncs.com - CmsSiteMonitorsitemonitor.aliyuncs.com - Rdsrds.aliyuncs.com - Mtsmts.us-west-1.aliyuncs.com - CFcf.aliyuncs.com - Acsacs.aliyun-inc.com - Httpdnshttpdns-api.aliyuncs.com - Location-innerlocation-inner.aliyuncs.com - Aasaas.aliyuncs.com - Emremr.aliyuncs.com - HPChpc.aliyuncs.com - Drcdrc.aliyuncs.com - Vpc-innervpc-inner.aliyuncs.com - Cmsmetrics.cn-hangzhou.aliyuncs.com - Slbslb.aliyuncs.com - Crmcrm-cn-hangzhou.aliyuncs.com - Dtsdts.aliyuncs.com - Domaindomain.aliyuncs.com - Otsots-pop.aliyuncs.com - Commondrivercommon.driver.aliyuncs.com - jaqjaq.aliyuncs.com - Cdncdn.aliyuncs.com - Ramram.aliyuncs.com - Drdsdrds.aliyuncs.com - OssAdminoss-admin.aliyuncs.com - Salessales.cn-hangzhou.aliyuncs.com - Onsons.aliyuncs.com - Ossoss-us-west-1.aliyuncs.com - YundunDdosinner-yundun-ddos.cn-hangzhou.aliyuncs.com - - - - cn-shanghai-inner - - CScs.aliyuncs.com - COScos.aliyuncs.com - Essess.aliyuncs.com - Billingbilling.aliyuncs.com - Dqsdqs.aliyuncs.com - Ddsmongodb.aliyuncs.com - Emremr.aliyuncs.com - Smssms.aliyuncs.com - Drdsdrds.aliyuncs.com - HPChpc.aliyuncs.com - Locationlocation.aliyuncs.com - ChargingServicechargingservice.aliyuncs.com - Msgmsg-inner.aliyuncs.com - Commondrivercommon.driver.aliyuncs.com - R-kvstorer-kvstore-cn-hangzhou.aliyuncs.com - jaqjaq.aliyuncs.com - Mscmsc-inner.aliyuncs.com - Ocsm-kvstore.aliyuncs.com - Yundunyundun-cn-hangzhou.aliyuncs.com - Ubsms-innerubsms-inner.aliyuncs.com - Dmdm.aliyuncs.com - Greengreen.aliyuncs.com - Riskrisk-cn-hangzhou.aliyuncs.com - oceanbaseoceanbase.aliyuncs.com - Workorderworkorder.aliyuncs.com - Yundunhsmyundunhsm.aliyuncs.com - Iotiot.aliyuncs.com - Bssbss.aliyuncs.com - Omsoms.aliyuncs.com - livelive.aliyuncs.com - Ecsecs-cn-hangzhou.aliyuncs.com - M-kvstorem-kvstore.aliyuncs.com - CmsSiteMonitorsitemonitor.aliyuncs.com - Alertalert.aliyuncs.com - Aceace.cn-hangzhou.aliyuncs.com - AMSams.aliyuncs.com - ROSros.aliyuncs.com - PTSpts.aliyuncs.com - Qualitycheckqualitycheck.aliyuncs.com - Ubsmsubsms.aliyuncs.com - HighDDosyd-highddos-cn-hangzhou.aliyuncs.com - Rdsrds.aliyuncs.com - Mtsmts.cn-shanghai.aliyuncs.com - CFcf.aliyuncs.com - Httpdnshttpdns-api.aliyuncs.com - Location-innerlocation-inner.aliyuncs.com - Aasaas.aliyuncs.com - Stssts.aliyuncs.com - Dtsdts.aliyuncs.com - Drcdrc.aliyuncs.com - Pushcloudpush.aliyuncs.com - Cmsmetrics.aliyuncs.com - Slbslb.aliyuncs.com - YundunDdosinner-yundun-ddos.cn-hangzhou.aliyuncs.com - Domaindomain.aliyuncs.com - Otsots-pop.aliyuncs.com - Ossoss-cn-hangzhou.aliyuncs.com - Ramram.aliyuncs.com - Salessales.cn-hangzhou.aliyuncs.com - Crmcrm-cn-hangzhou.aliyuncs.com - OssAdminoss-admin.aliyuncs.com - Alidnsalidns.aliyuncs.com - Onsons.aliyuncs.com - Cdncdn.aliyuncs.com - - - - cn-anhui-gov-1 - - Ecsecs-cn-hangzhou.aliyuncs.com - - - - cn-hangzhou-finance - - Ossoss-cn-hzjbp-b-console.aliyuncs.com - - - - cn-hangzhou - - ARMSarms.cn-hangzhou.aliyuncs.com - CScs.aliyuncs.com - COScos.aliyuncs.com - Essess.aliyuncs.com - Ace-opsace-ops.cn-hangzhou.aliyuncs.com - Billingbilling.aliyuncs.com - Dqsdqs.aliyuncs.com - Ddsmongodb.aliyuncs.com - Stssts.aliyuncs.com - Smssms.aliyuncs.com - Msgmsg-inner.aliyuncs.com - Jaqjaq.aliyuncs.com - Pushcloudpush.aliyuncs.com - Livelive.aliyuncs.com - Kmskms.cn-hangzhou.aliyuncs.com - Locationlocation.aliyuncs.com - Hpchpc.aliyuncs.com - ChargingServicechargingservice.aliyuncs.com - R-kvstorer-kvstore-cn-hangzhou.aliyuncs.com - Alertalert.aliyuncs.com - Mscmsc-inner.aliyuncs.com - Drcdrc.aliyuncs.com - Yundunyundun-cn-hangzhou.aliyuncs.com - Ubsms-innerubsms-inner.aliyuncs.com - Ocsm-kvstore.aliyuncs.com - Dmdm.aliyuncs.com - Greengreen.cn-hangzhou.aliyuncs.com - Commondrivercommon.driver.aliyuncs.com - oceanbaseoceanbase.aliyuncs.com - Workorderworkorder.aliyuncs.com - Yundunhsmyundunhsm.aliyuncs.com - Iotiot.aliyuncs.com - jaqjaq.aliyuncs.com - Omsoms.aliyuncs.com - livelive.aliyuncs.com - Ecsecs-cn-hangzhou.aliyuncs.com - M-kvstorem-kvstore.aliyuncs.com - Vpcvpc.aliyuncs.com - BatchComputebatchCompute.aliyuncs.com - Domaindomain.aliyuncs.com - AMSams.aliyuncs.com - ROSros.aliyuncs.com - PTSpts.aliyuncs.com - Qualitycheckqualitycheck.aliyuncs.com - Ubsmsubsms.aliyuncs.com - Apigatewayapigateway.cn-hangzhou.aliyuncs.com - CloudAPIapigateway.cn-hangzhou.aliyuncs.com - CmsSiteMonitorsitemonitor.aliyuncs.com - Aceace.cn-hangzhou.aliyuncs.com - Mtsmts.cn-hangzhou.aliyuncs.com - Oascn-hangzhou.oas.aliyuncs.com - CFcf.aliyuncs.com - Acsacs.aliyun-inc.com - Httpdnshttpdns-api.aliyuncs.com - Location-innerlocation-inner.aliyuncs.com - Aasaas.aliyuncs.com - Alidnsalidns.aliyuncs.com - HPChpc.aliyuncs.com - Emremr.aliyuncs.com - HighDDosyd-highddos-cn-hangzhou.aliyuncs.com - Vpc-innervpc-inner.aliyuncs.com - Cmsmetrics.cn-hangzhou.aliyuncs.com - Slbslb.aliyuncs.com - Riskrisk-cn-hangzhou.aliyuncs.com - Dtsdts.aliyuncs.com - Bssbss.aliyuncs.com - Otsots-pop.aliyuncs.com - Cdncdn.aliyuncs.com - Ramram.aliyuncs.com - Drdsdrds.aliyuncs.com - Rdsrds.aliyuncs.com - Crmcrm-cn-hangzhou.aliyuncs.com - OssAdminoss-admin.aliyuncs.com - Salessales.cn-hangzhou.aliyuncs.com - Onsons.aliyuncs.com - Ossoss-cn-hangzhou.aliyuncs.com - YundunDdosinner-yundun-ddos.cn-hangzhou.aliyuncs.com - - - - cn-beijing-inner - - Riskrisk-cn-hangzhou.aliyuncs.com - COScos.aliyuncs.com - HPChpc.aliyuncs.com - Billingbilling.aliyuncs.com - Dqsdqs.aliyuncs.com - Ddsmongodb.aliyuncs.com - Emremr.aliyuncs.com - Smssms.aliyuncs.com - Drdsdrds.aliyuncs.com - CScs.aliyuncs.com - Locationlocation.aliyuncs.com - ChargingServicechargingservice.aliyuncs.com - Msgmsg-inner.aliyuncs.com - Essess.aliyuncs.com - R-kvstorer-kvstore-cn-hangzhou.aliyuncs.com - Bssbss.aliyuncs.com - Workorderworkorder.aliyuncs.com - Drcdrc.aliyuncs.com - Yundunyundun-cn-hangzhou.aliyuncs.com - Ubsms-innerubsms-inner.aliyuncs.com - Ocsm-kvstore.aliyuncs.com - Dmdm.aliyuncs.com - YundunDdosinner-yundun-ddos.cn-hangzhou.aliyuncs.com - oceanbaseoceanbase.aliyuncs.com - Mscmsc-inner.aliyuncs.com - Yundunhsmyundunhsm.aliyuncs.com - Iotiot.aliyuncs.com - jaqjaq.aliyuncs.com - Omsoms.aliyuncs.com - M-kvstorem-kvstore.aliyuncs.com - livelive.aliyuncs.com - Ecsecs-cn-hangzhou.aliyuncs.com - Alertalert.aliyuncs.com - CmsSiteMonitorsitemonitor.aliyuncs.com - Aceace.cn-hangzhou.aliyuncs.com - AMSams.aliyuncs.com - Otsots-pop.aliyuncs.com - PTSpts.aliyuncs.com - Qualitycheckqualitycheck.aliyuncs.com - Ubsmsubsms.aliyuncs.com - Stssts.aliyuncs.com - Rdsrds.aliyuncs.com - Mtsmts.cn-beijing.aliyuncs.com - Location-innerlocation-inner.aliyuncs.com - CFcf.aliyuncs.com - Httpdnshttpdns-api.aliyuncs.com - Greengreen.aliyuncs.com - Aasaas.aliyuncs.com - Alidnsalidns.aliyuncs.com - Pushcloudpush.aliyuncs.com - HighDDosyd-highddos-cn-hangzhou.aliyuncs.com - Cmsmetrics.aliyuncs.com - Slbslb.aliyuncs.com - Commondrivercommon.driver.aliyuncs.com - Dtsdts.aliyuncs.com - Domaindomain.aliyuncs.com - ROSros.aliyuncs.com - Ossoss-cn-hangzhou.aliyuncs.com - Ramram.aliyuncs.com - Salessales.cn-hangzhou.aliyuncs.com - Crmcrm-cn-hangzhou.aliyuncs.com - OssAdminoss-admin.aliyuncs.com - Onsons.aliyuncs.com - Cdncdn.aliyuncs.com - - - - cn-haidian-cm12-c01 - - Ecsecs-cn-hangzhou.aliyuncs.com - Vpcvpc.aliyuncs.com - Rdsrds.aliyuncs.com - - - - cn-anhui-gov - - Ecsecs-cn-hangzhou.aliyuncs.com - Vpcvpc.aliyuncs.com - - - - cn-shenzhen - - ARMSarms.cn-shenzhen.aliyuncs.com - CScs.aliyuncs.com - COScos.aliyuncs.com - Onsons.aliyuncs.com - Essess.aliyuncs.com - Dqsdqs.aliyuncs.com - Ddsmongodb.aliyuncs.com - Alidnsalidns.aliyuncs.com - Smssms.aliyuncs.com - Jaqjaq.aliyuncs.com - Pushcloudpush.aliyuncs.com - Kmskms.cn-shenzhen.aliyuncs.com - Locationlocation.aliyuncs.com - Ocsm-kvstore.aliyuncs.com - Alertalert.aliyuncs.com - Drcdrc.aliyuncs.com - R-kvstorer-kvstore-cn-hangzhou.aliyuncs.com - Yundunyundun-cn-hangzhou.aliyuncs.com - Ubsms-innerubsms-inner.aliyuncs.com - Dmdm.aliyuncs.com - Commondrivercommon.driver.aliyuncs.com - oceanbaseoceanbase.aliyuncs.com - Iotiot.aliyuncs.com - HPChpc.aliyuncs.com - Bssbss.aliyuncs.com - Omsoms.aliyuncs.com - Ubsmsubsms.aliyuncs.com - livelive.aliyuncs.com - Ecsecs-cn-hangzhou.aliyuncs.com - M-kvstorem-kvstore.aliyuncs.com - CmsSiteMonitorsitemonitor.aliyuncs.com - BatchComputebatchcompute.cn-shenzhen.aliyuncs.com - Aceace.cn-hangzhou.aliyuncs.com - ROSros.aliyuncs.com - PTSpts.aliyuncs.com - Ace-opsace-ops.cn-hangzhou.aliyuncs.com - Apigatewayapigateway.cn-shenzhen.aliyuncs.com - CloudAPIapigateway.cn-shenzhen.aliyuncs.com - Stssts.aliyuncs.com - Vpcvpc.aliyuncs.com - Rdsrds.aliyuncs.com - Mtsmts.cn-shenzhen.aliyuncs.com - Oascn-shenzhen.oas.aliyuncs.com - CFcf.aliyuncs.com - Acsacs.aliyun-inc.com - Crmcrm-cn-hangzhou.aliyuncs.com - Location-innerlocation-inner.aliyuncs.com - Aasaas.aliyuncs.com - Emremr.aliyuncs.com - Dtsdts.aliyuncs.com - HighDDosyd-highddos-cn-hangzhou.aliyuncs.com - Vpc-innervpc-inner.aliyuncs.com - Cmsmetrics.cn-hangzhou.aliyuncs.com - Slbslb.aliyuncs.com - Riskrisk-cn-hangzhou.aliyuncs.com - Domaindomain.aliyuncs.com - Otsots-pop.aliyuncs.com - jaqjaq.aliyuncs.com - Cdncdn.aliyuncs.com - Ramram.aliyuncs.com - Drdsdrds.aliyuncs.com - OssAdminoss-admin.aliyuncs.com - Greengreen.aliyuncs.com - Httpdnshttpdns-api.aliyuncs.com - Ossoss-cn-shenzhen.aliyuncs.com - - - - ap-southeast-2 - - Rdsrds.ap-southeast-2.aliyuncs.com - Kmskms.ap-southeast-2.aliyuncs.com - Vpcvpc.ap-southeast-2.aliyuncs.com - Ecsecs.ap-southeast-2.aliyuncs.com - Cmsmetrics.cn-hangzhou.aliyuncs.com - Slbslb.ap-southeast-2.aliyuncs.com - - - - cn-qingdao - - CScs.aliyuncs.com - COScos.aliyuncs.com - HPChpc.aliyuncs.com - Dqsdqs.aliyuncs.com - Ddsmongodb.aliyuncs.com - Emremr.cn-qingdao.aliyuncs.com - Smssms.aliyuncs.com - Jaqjaq.aliyuncs.com - Dtsdts.aliyuncs.com - Locationlocation.aliyuncs.com - Essess.aliyuncs.com - R-kvstorer-kvstore-cn-hangzhou.aliyuncs.com - Alertalert.aliyuncs.com - Drcdrc.aliyuncs.com - Yundunyundun-cn-hangzhou.aliyuncs.com - Ubsms-innerubsms-inner.cn-qingdao.aliyuncs.com - Ocsm-kvstore.aliyuncs.com - Dmdm.aliyuncs.com - Riskrisk-cn-hangzhou.aliyuncs.com - oceanbaseoceanbase.aliyuncs.com - Iotiot.aliyuncs.com - Bssbss.aliyuncs.com - Omsoms.aliyuncs.com - Ubsmsubsms.cn-qingdao.aliyuncs.com - livelive.aliyuncs.com - Ecsecs-cn-hangzhou.aliyuncs.com - M-kvstorem-kvstore.aliyuncs.com - CmsSiteMonitorsitemonitor.aliyuncs.com - BatchComputebatchcompute.cn-qingdao.aliyuncs.com - Aceace.cn-hangzhou.aliyuncs.com - Otsots-pop.aliyuncs.com - PTSpts.aliyuncs.com - Ace-opsace-ops.cn-hangzhou.aliyuncs.com - Apigatewayapigateway.cn-qingdao.aliyuncs.com - CloudAPIapigateway.cn-qingdao.aliyuncs.com - Stssts.aliyuncs.com - Rdsrds.aliyuncs.com - Mtsmts.cn-qingdao.aliyuncs.com - Location-innerlocation-inner.aliyuncs.com - CFcf.aliyuncs.com - Acsacs.aliyun-inc.com - Httpdnshttpdns-api.aliyuncs.com - Greengreen.aliyuncs.com - Aasaas.aliyuncs.com - Alidnsalidns.aliyuncs.com - Pushcloudpush.aliyuncs.com - HighDDosyd-highddos-cn-hangzhou.aliyuncs.com - Vpc-innervpc-inner.aliyuncs.com - Cmsmetrics.cn-hangzhou.aliyuncs.com - Slbslb.aliyuncs.com - Commondrivercommon.driver.aliyuncs.com - Domaindomain.aliyuncs.com - ROSros.aliyuncs.com - jaqjaq.aliyuncs.com - Cdncdn.aliyuncs.com - Ramram.aliyuncs.com - Drdsdrds.aliyuncs.com - Crmcrm-cn-hangzhou.aliyuncs.com - OssAdminoss-admin.aliyuncs.com - Onsons.aliyuncs.com - Ossoss-cn-qingdao.aliyuncs.com - - - - cn-shenzhen-su18-b02 - - Ecsecs-cn-hangzhou.aliyuncs.com - - - - cn-shenzhen-su18-b03 - - Ecsecs-cn-hangzhou.aliyuncs.com - - - - cn-shenzhen-su18-b01 - - Ecsecs-cn-hangzhou.aliyuncs.com - - - - ap-southeast-antgroup-1 - - Ecsecs-cn-hangzhou.aliyuncs.com - - - - oss-cn-bjzwy - - Ossoss-cn-bjzwy.aliyuncs.com - - - - cn-henan-am12001 - - Ecsecs-cn-hangzhou.aliyuncs.com - Vpcvpc.aliyuncs.com - - - - cn-beijing - - ARMSarms.cn-beijing.aliyuncs.com - CScs.aliyuncs.com - COScos.aliyuncs.com - Jaqjaq.aliyuncs.com - Essess.aliyuncs.com - Billingbilling.aliyuncs.com - Dqsdqs.aliyuncs.com - Ddsmongodb.aliyuncs.com - Stssts.aliyuncs.com - Smssms.aliyuncs.com - Msgmsg-inner.aliyuncs.com - Salessales.cn-hangzhou.aliyuncs.com - HPChpc.aliyuncs.com - Oascn-beijing.oas.aliyuncs.com - Locationlocation.aliyuncs.com - Onsons.aliyuncs.com - ChargingServicechargingservice.aliyuncs.com - Hpchpc.aliyuncs.com - Commondrivercommon.driver.aliyuncs.com - Ocsm-kvstore.aliyuncs.com - jaqjaq.aliyuncs.com - Workorderworkorder.aliyuncs.com - R-kvstorer-kvstore-cn-hangzhou.aliyuncs.com - Bssbss.aliyuncs.com - Ubsms-innerubsms-inner.aliyuncs.com - Dmdm.aliyuncs.com - Riskrisk-cn-hangzhou.aliyuncs.com - oceanbaseoceanbase.aliyuncs.com - Mscmsc-inner.aliyuncs.com - Yundunhsmyundunhsm.aliyuncs.com - Iotiot.aliyuncs.com - Alertalert.aliyuncs.com - Omsoms.aliyuncs.com - Ubsmsubsms.aliyuncs.com - livelive.aliyuncs.com - Ecsecs-cn-hangzhou.aliyuncs.com - Ace-opsace-ops.cn-hangzhou.aliyuncs.com - Vpcvpc.aliyuncs.com - BatchComputebatchCompute.aliyuncs.com - AMSams.aliyuncs.com - ROSros.aliyuncs.com - PTSpts.aliyuncs.com - M-kvstorem-kvstore.aliyuncs.com - Apigatewayapigateway.cn-beijing.aliyuncs.com - CloudAPIapigateway.cn-beijing.aliyuncs.com - Kmskms.cn-beijing.aliyuncs.com - HighDDosyd-highddos-cn-hangzhou.aliyuncs.com - CmsSiteMonitorsitemonitor.aliyuncs.com - Aceace.cn-hangzhou.aliyuncs.com - Mtsmts.cn-beijing.aliyuncs.com - CFcf.aliyuncs.com - Acsacs.aliyun-inc.com - Httpdnshttpdns-api.aliyuncs.com - Location-innerlocation-inner.aliyuncs.com - Aasaas.aliyuncs.com - Emremr.aliyuncs.com - Dtsdts.aliyuncs.com - Drcdrc.aliyuncs.com - Pushcloudpush.aliyuncs.com - Cmsmetrics.cn-hangzhou.aliyuncs.com - Slbslb.aliyuncs.com - Crmcrm-cn-hangzhou.aliyuncs.com - Domaindomain.aliyuncs.com - Otsots-pop.aliyuncs.com - Ossoss-cn-beijing.aliyuncs.com - Ramram.aliyuncs.com - Drdsdrds.aliyuncs.com - Vpc-innervpc-inner.aliyuncs.com - Rdsrds.aliyuncs.com - OssAdminoss-admin.aliyuncs.com - Alidnsalidns.aliyuncs.com - Greengreen.aliyuncs.com - Yundunyundun-cn-hangzhou.aliyuncs.com - Cdncdn.aliyuncs.com - YundunDdosinner-yundun-ddos.cn-hangzhou.aliyuncs.com - vodvod.cn-beijing.aliyuncs.com - - - - cn-hangzhou-d - - CScs.aliyuncs.com - COScos.aliyuncs.com - Essess.aliyuncs.com - Billingbilling.aliyuncs.com - Dqsdqs.aliyuncs.com - Ddsmongodb.aliyuncs.com - Emremr.aliyuncs.com - Smssms.aliyuncs.com - Salessales.cn-hangzhou.aliyuncs.com - Dtsdts.aliyuncs.com - Locationlocation.aliyuncs.com - Msgmsg-inner.aliyuncs.com - ChargingServicechargingservice.aliyuncs.com - R-kvstorer-kvstore-cn-hangzhou.aliyuncs.com - Bssbss.aliyuncs.com - Mscmsc-inner.aliyuncs.com - Ocsm-kvstore.aliyuncs.com - Yundunyundun-cn-hangzhou.aliyuncs.com - Ubsms-innerubsms-inner.aliyuncs.com - Dmdm.aliyuncs.com - Riskrisk-cn-hangzhou.aliyuncs.com - oceanbaseoceanbase.aliyuncs.com - Workorderworkorder.aliyuncs.com - Alidnsalidns.aliyuncs.com - Iotiot.aliyuncs.com - HPChpc.aliyuncs.com - jaqjaq.aliyuncs.com - Omsoms.aliyuncs.com - livelive.aliyuncs.com - Ecsecs-cn-hangzhou.aliyuncs.com - M-kvstorem-kvstore.aliyuncs.com - CmsSiteMonitorsitemonitor.aliyuncs.com - Alertalert.aliyuncs.com - Aceace.cn-hangzhou.aliyuncs.com - AMSams.aliyuncs.com - Otsots-pop.aliyuncs.com - PTSpts.aliyuncs.com - Qualitycheckqualitycheck.aliyuncs.com - Ubsmsubsms.aliyuncs.com - Rdsrds.aliyuncs.com - Mtsmts.cn-hangzhou.aliyuncs.com - Location-innerlocation-inner.aliyuncs.com - CFcf.aliyuncs.com - Httpdnshttpdns-api.aliyuncs.com - Greengreen.aliyuncs.com - Aasaas.aliyuncs.com - Stssts.aliyuncs.com - Pushcloudpush.aliyuncs.com - HighDDosyd-highddos-cn-hangzhou.aliyuncs.com - Cmsmetrics.aliyuncs.com - Slbslb.aliyuncs.com - YundunDdosinner-yundun-ddos.cn-hangzhou.aliyuncs.com - Domaindomain.aliyuncs.com - Commondrivercommon.driver.aliyuncs.com - ROSros.aliyuncs.com - Cdncdn.aliyuncs.com - Ramram.aliyuncs.com - Drdsdrds.aliyuncs.com - Crmcrm-cn-hangzhou.aliyuncs.com - OssAdminoss-admin.aliyuncs.com - Onsons.aliyuncs.com - Yundunhsmyundunhsm.aliyuncs.com - Drcdrc.aliyuncs.com - Ossoss-cn-hangzhou.aliyuncs.com - - - - cn-gansu-am6 - - Ecsecs-cn-hangzhou.aliyuncs.com - Vpcvpc.aliyuncs.com - Rdsrds.aliyuncs.com - - - - cn-ningxiazhongwei - - Ecsecs-cn-hangzhou.aliyuncs.com - Vpcvpc.aliyuncs.com - - - - cn-shanghai-et2-b01 - - CScs.aliyuncs.com - Riskrisk-cn-hangzhou.aliyuncs.com - COScos.aliyuncs.com - Onsons.aliyuncs.com - Essess.aliyuncs.com - Billingbilling.aliyuncs.com - Dqsdqs.aliyuncs.com - Ddsmongodb.aliyuncs.com - Alidnsalidns.aliyuncs.com - Smssms.aliyuncs.com - Jaqjaq.aliyuncs.com - Dtsdts.aliyuncs.com - Locationlocation.aliyuncs.com - Msgmsg-inner.aliyuncs.com - ChargingServicechargingservice.aliyuncs.com - Ocsm-kvstore.aliyuncs.com - Bssbss.aliyuncs.com - Mscmsc-inner.aliyuncs.com - R-kvstorer-kvstore-cn-hangzhou.aliyuncs.com - Yundunyundun-cn-hangzhou.aliyuncs.com - Ubsms-innerubsms-inner.aliyuncs.com - Dmdm.aliyuncs.com - Commondrivercommon.driver.aliyuncs.com - oceanbaseoceanbase.aliyuncs.com - Workorderworkorder.aliyuncs.com - Yundunhsmyundunhsm.aliyuncs.com - Iotiot.aliyuncs.com - jaqjaq.aliyuncs.com - Omsoms.aliyuncs.com - Ubsmsubsms.aliyuncs.com - livelive.aliyuncs.com - Ecsecs-cn-hangzhou.aliyuncs.com - Ace-opsace-ops.cn-hangzhou.aliyuncs.com - CmsSiteMonitorsitemonitor.aliyuncs.com - BatchComputebatchCompute.aliyuncs.com - Aceace.cn-hangzhou.aliyuncs.com - AMSams.aliyuncs.com - Otsots-pop.aliyuncs.com - PTSpts.aliyuncs.com - Qualitycheckqualitycheck.aliyuncs.com - M-kvstorem-kvstore.aliyuncs.com - Rdsrds.aliyuncs.com - Mtsmts.cn-hangzhou.aliyuncs.com - CFcf.aliyuncs.com - Acsacs.aliyun-inc.com - Httpdnshttpdns-api.aliyuncs.com - Location-innerlocation-inner.aliyuncs.com - Aasaas.aliyuncs.com - Stssts.aliyuncs.com - HPChpc.aliyuncs.com - Emremr.aliyuncs.com - HighDDosyd-highddos-cn-hangzhou.aliyuncs.com - Pushcloudpush.aliyuncs.com - Cmsmetrics.aliyuncs.com - Slbslb.aliyuncs.com - Crmcrm-cn-hangzhou.aliyuncs.com - Alertalert.aliyuncs.com - Domaindomain.aliyuncs.com - ROSros.aliyuncs.com - Cdncdn.aliyuncs.com - Ramram.aliyuncs.com - Drdsdrds.aliyuncs.com - Vpc-innervpc-inner.aliyuncs.com - OssAdminoss-admin.aliyuncs.com - Salessales.cn-hangzhou.aliyuncs.com - Greengreen.aliyuncs.com - Drcdrc.aliyuncs.com - Ossoss-cn-hangzhou.aliyuncs.com - YundunDdosinner-yundun-ddos.cn-hangzhou.aliyuncs.com - - - - cn-ningxia-am7-c01 - - Ecsecs-cn-hangzhou.aliyuncs.com - Vpcvpc.aliyuncs.com - - - - cn-shenzhen-finance-1 - - Kmskms.cn-shenzhen-finance-1.aliyuncs.com - Ecsecs-cn-hangzhou.aliyuncs.com - Rdsrds.aliyuncs.com - Vpcvpc.aliyuncs.com - - - - ap-southeast-1 - - CScs.aliyuncs.com - Riskrisk-cn-hangzhou.aliyuncs.com - COScos.aliyuncs.com - Essess.aliyuncs.com - Billingbilling.aliyuncs.com - Dqsdqs.aliyuncs.com - Ddsmongodb.aliyuncs.com - Alidnsalidns.aliyuncs.com - Smssms.aliyuncs.com - Drdsdrds.aliyuncs.com - Dtsdts.aliyuncs.com - Kmskms.ap-southeast-1.aliyuncs.com - Locationlocation.aliyuncs.com - Msgmsg-inner.aliyuncs.com - ChargingServicechargingservice.aliyuncs.com - R-kvstorer-kvstore-cn-hangzhou.aliyuncs.com - Alertalert.aliyuncs.com - Mscmsc-inner.aliyuncs.com - HighDDosyd-highddos-cn-hangzhou.aliyuncs.com - Yundunyundun-cn-hangzhou.aliyuncs.com - Ubsms-innerubsms-inner.aliyuncs.com - Ocsm-kvstore.aliyuncs.com - Dmdm.aliyuncs.com - Greengreen.aliyuncs.com - Commondrivercommon.driver.aliyuncs.com - oceanbaseoceanbase.aliyuncs.com - Workorderworkorder.aliyuncs.com - Yundunhsmyundunhsm.aliyuncs.com - Iotiot.aliyuncs.com - HPChpc.aliyuncs.com - jaqjaq.aliyuncs.com - Omsoms.aliyuncs.com - livelive.aliyuncs.com - Ecsecs-cn-hangzhou.aliyuncs.com - M-kvstorem-kvstore.aliyuncs.com - Vpcvpc.aliyuncs.com - BatchComputebatchCompute.aliyuncs.com - AMSams.aliyuncs.com - ROSros.aliyuncs.com - PTSpts.aliyuncs.com - Qualitycheckqualitycheck.aliyuncs.com - Bssbss.aliyuncs.com - Ubsmsubsms.aliyuncs.com - Apigatewayapigateway.ap-southeast-1.aliyuncs.com - CloudAPIapigateway.ap-southeast-1.aliyuncs.com - Stssts.aliyuncs.com - CmsSiteMonitorsitemonitor.aliyuncs.com - Aceace.cn-hangzhou.aliyuncs.com - Mtsmts.ap-southeast-1.aliyuncs.com - CFcf.aliyuncs.com - Crmcrm-cn-hangzhou.aliyuncs.com - Location-innerlocation-inner.aliyuncs.com - Aasaas.aliyuncs.com - Emremr.ap-southeast-1.aliyuncs.com - Httpdnshttpdns-api.aliyuncs.com - Drcdrc.aliyuncs.com - Pushcloudpush.aliyuncs.com - Cmsmetrics.cn-hangzhou.aliyuncs.com - Slbslb.aliyuncs.com - YundunDdosinner-yundun-ddos.cn-hangzhou.aliyuncs.com - Domaindomain.aliyuncs.com - Otsots-pop.aliyuncs.com - Cdncdn.aliyuncs.com - Ramram.aliyuncs.com - Salessales.cn-hangzhou.aliyuncs.com - Rdsrds.aliyuncs.com - OssAdminoss-admin.aliyuncs.com - Onsons.aliyuncs.com - Ossoss-ap-southeast-1.aliyuncs.com - - - - cn-shenzhen-st4-d01 - - Ecsecs-cn-hangzhou.aliyuncs.com - - - - eu-central-1 - - Rdsrds.eu-central-1.aliyuncs.com - Ecsecs.eu-central-1.aliyuncs.com - Vpcvpc.eu-central-1.aliyuncs.com - Kmskms.eu-central-1.aliyuncs.com - Cmsmetrics.cn-hangzhou.aliyuncs.com - Slbslb.eu-central-1.aliyuncs.com - - - - eu-west-1 - - Rdsrds.eu-west-1.aliyuncs.com - Ecsecs.eu-west-1.aliyuncs.com - Vpcvpc.eu-west-1.aliyuncs.com - Kmskms.eu-west-1.aliyuncs.com - Cmsmetrics.cn-hangzhou.aliyuncs.com - Slbslb.eu-west-1.aliyuncs.com - - - - cn-zhangjiakou - - Rdsrds.cn-zhangjiakou.aliyuncs.com - Ecsecs.cn-zhangjiakou.aliyuncs.com - Vpcvpc.cn-zhangjiakou.aliyuncs.com - Cmsmetrics.cn-hangzhou.aliyuncs.com - Slbslb.cn-zhangjiakou.aliyuncs.com - - - - cn-huhehaote - - Rdsrds.cn-huhehaote.aliyuncs.com - Ecsecs.cn-huhehaote.aliyuncs.com - Vpcvpc.cn-huhehaote.aliyuncs.com - Cmsmetrics.cn-hangzhou.aliyuncs.com - Slbslb.cn-huhehaote.aliyuncs.com - - - diff --git a/vendor/github.com/denverdino/aliyungo/common/regions.go b/vendor/github.com/denverdino/aliyungo/common/regions.go deleted file mode 100644 index e6bc728fe..000000000 --- a/vendor/github.com/denverdino/aliyungo/common/regions.go +++ /dev/null @@ -1,55 +0,0 @@ -package common - -// Region represents ECS region -type Region string - -// Constants of region definition -const ( - Hangzhou = Region("cn-hangzhou") - Qingdao = Region("cn-qingdao") - Beijing = Region("cn-beijing") - Hongkong = Region("cn-hongkong") - Shenzhen = Region("cn-shenzhen") - Shanghai = Region("cn-shanghai") - Zhangjiakou = Region("cn-zhangjiakou") - Huhehaote = Region("cn-huhehaote") - - APSouthEast1 = Region("ap-southeast-1") - APNorthEast1 = Region("ap-northeast-1") - APSouthEast2 = Region("ap-southeast-2") - APSouthEast3 = Region("ap-southeast-3") - APSouthEast5 = Region("ap-southeast-5") - - APSouth1 = Region("ap-south-1") - - USWest1 = Region("us-west-1") - USEast1 = Region("us-east-1") - - MEEast1 = Region("me-east-1") - - EUCentral1 = Region("eu-central-1") - EUWest1 = Region("eu-west-1") - - ShenZhenFinance = Region("cn-shenzhen-finance-1") - ShanghaiFinance = Region("cn-shanghai-finance-1") -) - -var ValidRegions = []Region{ - Hangzhou, Qingdao, Beijing, Shenzhen, Hongkong, Shanghai, Zhangjiakou, Huhehaote, - USWest1, USEast1, - APNorthEast1, APSouthEast1, APSouthEast2, APSouthEast3, APSouthEast5, - APSouth1, - MEEast1, - EUCentral1, EUWest1, - ShenZhenFinance, ShanghaiFinance, -} - -// IsValidRegion checks if r is an Ali supported region. -func IsValidRegion(r string) bool { - for _, v := range ValidRegions { - if r == string(v) { - return true - } - } - return false -} diff --git a/vendor/github.com/denverdino/aliyungo/common/request.go b/vendor/github.com/denverdino/aliyungo/common/request.go deleted file mode 100644 index f35c2990d..000000000 --- a/vendor/github.com/denverdino/aliyungo/common/request.go +++ /dev/null @@ -1,105 +0,0 @@ -package common - -import ( - "fmt" - "log" - "time" - - "github.com/denverdino/aliyungo/util" -) - -// Constants for Aliyun API requests -const ( - SignatureVersion = "1.0" - SignatureMethod = "HMAC-SHA1" - JSONResponseFormat = "JSON" - XMLResponseFormat = "XML" - ECSRequestMethod = "GET" -) - -type Request struct { - Format string - Version string - RegionId Region - AccessKeyId string - SecurityToken string - Signature string - SignatureMethod string - Timestamp util.ISO6801Time - SignatureVersion string - SignatureNonce string - ResourceOwnerAccount string - Action string -} - -func (request *Request) init(version string, action string, AccessKeyId string, securityToken string, regionId Region) { - request.Format = JSONResponseFormat - request.Timestamp = util.NewISO6801Time(time.Now().UTC()) - request.Version = version - request.SignatureVersion = SignatureVersion - request.SignatureMethod = SignatureMethod - request.SignatureNonce = util.CreateRandomString() - request.Action = action - request.AccessKeyId = AccessKeyId - request.SecurityToken = securityToken - request.RegionId = regionId -} - -type Response struct { - RequestId string -} - -type ErrorResponse struct { - Response - HostId string - Code string - Message string -} - -// An Error represents a custom error for Aliyun API failure response -type Error struct { - ErrorResponse - StatusCode int //Status Code of HTTP Response -} - -func (e *Error) Error() string { - return fmt.Sprintf("Aliyun API Error: RequestId: %s Status Code: %d Code: %s Message: %s", e.RequestId, e.StatusCode, e.Code, e.Message) -} - -type Pagination struct { - PageNumber int - PageSize int -} - -func (p *Pagination) SetPageSize(size int) { - p.PageSize = size -} - -func (p *Pagination) Validate() { - if p.PageNumber < 0 { - log.Printf("Invalid PageNumber: %d", p.PageNumber) - p.PageNumber = 1 - } - if p.PageSize < 0 { - log.Printf("Invalid PageSize: %d", p.PageSize) - p.PageSize = 10 - } else if p.PageSize > 50 { - log.Printf("Invalid PageSize: %d", p.PageSize) - p.PageSize = 50 - } -} - -// A PaginationResponse represents a response with pagination information -type PaginationResult struct { - TotalCount int - PageNumber int - PageSize int -} - -// NextPage gets the next page of the result set -func (r *PaginationResult) NextPage() *Pagination { - if r.PageNumber*r.PageSize >= r.TotalCount { - return nil - } - return &Pagination{PageNumber: r.PageNumber + 1, PageSize: r.PageSize} -} diff --git a/vendor/github.com/denverdino/aliyungo/common/types.go b/vendor/github.com/denverdino/aliyungo/common/types.go deleted file mode 100644 index cf161f11b..000000000 --- a/vendor/github.com/denverdino/aliyungo/common/types.go +++ /dev/null @@ -1,107 +0,0 @@ -package common - -type InternetChargeType string - -const ( - PayByBandwidth = InternetChargeType("PayByBandwidth") - PayByTraffic = InternetChargeType("PayByTraffic") -) - -type InstanceChargeType string - -const ( - PrePaid = InstanceChargeType("PrePaid") - PostPaid = InstanceChargeType("PostPaid") -) - -type DescribeEndpointArgs struct { - Id Region - ServiceCode string - Type string -} - -type EndpointItem struct { - Protocols struct { - Protocols []string - } - Type string - Namespace string - Id Region - SerivceCode string - Endpoint string -} - -type DescribeEndpointResponse struct { - Response - EndpointItem -} - -type DescribeEndpointsArgs struct { - Id Region - ServiceCode string - Type string -} - -type DescribeEndpointsResponse struct { - Response - Endpoints APIEndpoints - RequestId string - Success bool -} - -type APIEndpoints struct { - Endpoint []EndpointItem -} - -type NetType string - -const ( - Internet = NetType("Internet") - Intranet = NetType("Intranet") -) - -type TimeType string - -const ( - Hour = TimeType("Hour") - Day = TimeType("Day") - Week = TimeType("Week") - Month = TimeType("Month") - Year = TimeType("Year") -) - -type NetworkType string - -const ( - Classic = NetworkType("Classic") - VPC = NetworkType("VPC") -) - -type BusinessInfo struct { - Pack string `json:"pack,omitempty"` - ActivityId string `json:"activityId,omitempty"` -} - -//xml -type Endpoints struct { - Endpoint []Endpoint `xml:"Endpoint"` -} - -type Endpoint struct { - Name string `xml:"name,attr"` - RegionIds RegionIds `xml:"RegionIds"` - Products Products `xml:"Products"` -} - -type RegionIds struct { - RegionId string `xml:"RegionId"` -} - -type Products struct { - Product []Product `xml:"Product"` -} - -type Product struct { - ProductName string `xml:"ProductName"` - DomainName string `xml:"DomainName"` -} diff --git a/vendor/github.com/denverdino/aliyungo/common/version.go b/vendor/github.com/denverdino/aliyungo/common/version.go deleted file mode 100644 index 7cb3d3aff..000000000 --- a/vendor/github.com/denverdino/aliyungo/common/version.go +++ /dev/null @@ -1,3 +0,0 @@ -package common - -const Version = "0.1" diff --git a/vendor/github.com/denverdino/aliyungo/ecs/client.go b/vendor/github.com/denverdino/aliyungo/ecs/client.go deleted file mode 100644 index 7ae1fb52e..000000000 --- a/vendor/github.com/denverdino/aliyungo/ecs/client.go +++ /dev/null @@ -1,124 +0,0 @@ -package ecs - -import ( - "os" - - "github.com/denverdino/aliyungo/common" -) - -// Interval for checking status in WaitForXXX method -const DefaultWaitForInterval = 5 - -// Default timeout value for WaitForXXX method -const DefaultTimeout = 60 - -type Client struct { - common.Client -} - -const ( - // ECSDefaultEndpoint is the default API endpoint of ECS services - ECSDefaultEndpoint = "https://ecs-cn-hangzhou.aliyuncs.com" - ECSAPIVersion = "2014-05-26" - ECSServiceCode = "ecs" - - VPCDefaultEndpoint = "https://vpc.aliyuncs.com" - VPCAPIVersion = "2016-04-28" - VPCServiceCode = "vpc" -) - -// NewClient creates a new instance of ECS client -func NewClient(accessKeyId, accessKeySecret string) *Client { - endpoint := os.Getenv("ECS_ENDPOINT") - if endpoint == "" { - endpoint = ECSDefaultEndpoint - } - return NewClientWithEndpoint(endpoint, accessKeyId, accessKeySecret) -} - -func NewClientWithRegion(endpoint string, accessKeyId string, accessKeySecret string, regionID common.Region) *Client { - client := &Client{} - client.NewInit(endpoint, ECSAPIVersion, accessKeyId, accessKeySecret, ECSServiceCode, regionID) - return client -} - -func NewClientWithEndpoint(endpoint string, accessKeyId string, accessKeySecret string) *Client { - client := &Client{} - client.Init(endpoint, ECSAPIVersion, accessKeyId, accessKeySecret) - return client -} - -// --------------------------------------- -// NewECSClient creates a new instance of ECS client -// --------------------------------------- -func NewECSClient(accessKeyId, accessKeySecret string, regionID common.Region) *Client { - return NewECSClientWithSecurityToken(accessKeyId, accessKeySecret, "", regionID) -} - -func NewECSClientWithSecurityToken(accessKeyId string, accessKeySecret string, securityToken string, regionID common.Region) *Client { - endpoint := os.Getenv("ECS_ENDPOINT") - if endpoint == "" { - endpoint = ECSDefaultEndpoint - } - - return NewECSClientWithEndpointAndSecurityToken(endpoint, accessKeyId, accessKeySecret, securityToken, regionID) -} - -func NewECSClientWithEndpoint(endpoint string, accessKeyId string, accessKeySecret string, regionID common.Region) *Client { - return NewECSClientWithEndpointAndSecurityToken(endpoint, accessKeyId, accessKeySecret, "", regionID) -} - -func NewECSClientWithEndpointAndSecurityToken(endpoint string, accessKeyId string, accessKeySecret string, securityToken string, regionID common.Region) *Client { - client := &Client{} - client.WithEndpoint(endpoint). - WithVersion(ECSAPIVersion). - WithAccessKeyId(accessKeyId). - WithAccessKeySecret(accessKeySecret). - WithSecurityToken(securityToken). - WithServiceCode(ECSServiceCode). - WithRegionID(regionID). - InitClient() - return client -} - -// --------------------------------------- -// NewVPCClient creates a new instance of VPC client -// --------------------------------------- -func NewVPCClient(accessKeyId string, accessKeySecret string, regionID common.Region) *Client { - return NewVPCClientWithSecurityToken(accessKeyId, accessKeySecret, "", regionID) -} - -func NewVPCClientWithSecurityToken(accessKeyId string, accessKeySecret string, securityToken string, regionID common.Region) *Client { - endpoint := os.Getenv("VPC_ENDPOINT") - if endpoint == "" { - endpoint = VPCDefaultEndpoint - } - - return NewVPCClientWithEndpointAndSecurityToken(endpoint, accessKeyId, accessKeySecret, securityToken, regionID) -} - -func NewVPCClientWithEndpoint(endpoint string, accessKeyId string, accessKeySecret string, regionID common.Region) *Client { - return NewVPCClientWithEndpointAndSecurityToken(endpoint, accessKeyId, accessKeySecret, "", regionID) -} - -func NewVPCClientWithEndpointAndSecurityToken(endpoint string, accessKeyId string, accessKeySecret string, securityToken string, regionID common.Region) *Client { - client := &Client{} - client.WithEndpoint(endpoint). - WithVersion(VPCAPIVersion). - WithAccessKeyId(accessKeyId). - WithAccessKeySecret(accessKeySecret). - WithSecurityToken(securityToken). - WithServiceCode(VPCServiceCode). - WithRegionID(regionID). - InitClient() - return client -} - -// --------------------------------------- -// NewVPCClientWithRegion creates a new instance of VPC client automatically get endpoint -// --------------------------------------- -func NewVPCClientWithRegion(endpoint string, accessKeyId string, accessKeySecret string, regionID common.Region) *Client { - client := &Client{} - client.NewInit(endpoint, VPCAPIVersion, accessKeyId, accessKeySecret, VPCServiceCode, regionID) - return client -} diff --git a/vendor/github.com/denverdino/aliyungo/ecs/disks.go b/vendor/github.com/denverdino/aliyungo/ecs/disks.go deleted file mode 100644 index ae2c40872..000000000 --- a/vendor/github.com/denverdino/aliyungo/ecs/disks.go +++ /dev/null @@ -1,363 +0,0 @@ -package ecs - -import ( - "time" - - "github.com/denverdino/aliyungo/common" - "github.com/denverdino/aliyungo/util" -) - -// Types of disks -type DiskType string - -const ( - DiskTypeAll = DiskType("all") //Default - DiskTypeAllSystem = DiskType("system") - DiskTypeAllData = DiskType("data") -) - -// Categories of disks -type DiskCategory string - -const ( - DiskCategoryAll = DiskCategory("all") //Default - DiskCategoryCloud = DiskCategory("cloud") - DiskCategoryEphemeral = DiskCategory("ephemeral") - DiskCategoryEphemeralSSD = DiskCategory("ephemeral_ssd") - DiskCategoryCloudEfficiency = DiskCategory("cloud_efficiency") - DiskCategoryCloudSSD = DiskCategory("cloud_ssd") -) - -// Status of disks -type DiskStatus string - -const ( - DiskStatusInUse = DiskStatus("In_use") - DiskStatusAvailable = DiskStatus("Available") - DiskStatusAttaching = DiskStatus("Attaching") - DiskStatusDetaching = DiskStatus("Detaching") - DiskStatusCreating = DiskStatus("Creating") - DiskStatusReIniting = DiskStatus("ReIniting") - DiskStatusAll = DiskStatus("All") //Default -) - -// Charge type of disks -type DiskChargeType string - -const ( - PrePaid = DiskChargeType("PrePaid") - PostPaid = DiskChargeType("PostPaid") -) - -// A DescribeDisksArgs defines the arguments to describe disks -type DescribeDisksArgs struct { - RegionId common.Region - ZoneId string - DiskIds []string - InstanceId string - DiskType DiskType //enum for all(default) | system | data - Category DiskCategory //enum for all(default) | cloud | ephemeral - Status DiskStatus //enum for In_use | Available | Attaching | Detaching | Creating | ReIniting | All(default) - SnapshotId string - DiskName string - Portable *bool //optional - DeleteWithInstance *bool //optional - DeleteAutoSnapshot *bool //optional - EnableAutoSnapshot *bool //optional - DiskChargeType DiskChargeType - Tag map[string]string - common.Pagination -} - -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/datatype&diskitemtype -type DiskItemType struct { - DiskId string - RegionId common.Region - ZoneId string - DiskName string - Description string - Type DiskType - Encrypted bool - Category DiskCategory - Size int - ImageId string - SourceSnapshotId string - ProductCode string - Portable bool - Status DiskStatus - OperationLocks OperationLocksType - InstanceId string - Device string - DeleteWithInstance bool - DeleteAutoSnapshot bool - EnableAutoSnapshot bool - CreationTime util.ISO6801Time - AttachedTime util.ISO6801Time - DetachedTime util.ISO6801Time - DiskChargeType DiskChargeType -} - -type DescribeDisksResponse struct { - common.Response - common.PaginationResult - RegionId common.Region - Disks struct { - Disk []DiskItemType - } -} - -// DescribeDisks describes Disks -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/disk&describedisks -func (client *Client) DescribeDisks(args *DescribeDisksArgs) (disks []DiskItemType, pagination *common.PaginationResult, err error) { - response, err := client.DescribeDisksWithRaw(args) - if err != nil { - return nil, nil, err - } - - return response.Disks.Disk, &response.PaginationResult, err -} - -func (client *Client) DescribeDisksWithRaw(args *DescribeDisksArgs) (response *DescribeDisksResponse, err error) { - response = &DescribeDisksResponse{} - - err = client.Invoke("DescribeDisks", args, response) - - if err != nil { - return nil, err - } - - return response, err -} - -type CreateDiskArgs struct { - RegionId common.Region - ZoneId string - DiskName string - Description string - Encrypted bool - DiskCategory DiskCategory - Size int - SnapshotId string - ClientToken string -} - -type CreateDisksResponse struct { - common.Response - DiskId string -} - -// CreateDisk creates a new disk -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/disk&createdisk -func (client *Client) CreateDisk(args *CreateDiskArgs) (diskId string, err error) { - response := CreateDisksResponse{} - err = client.Invoke("CreateDisk", args, &response) - if err != nil { - return "", err - } - return response.DiskId, err -} - -type DeleteDiskArgs struct { - DiskId string -} - -type DeleteDiskResponse struct { - common.Response -} - -// DeleteDisk deletes disk -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/disk&deletedisk -func (client *Client) DeleteDisk(diskId string) error { - args := DeleteDiskArgs{ - DiskId: diskId, - } - response := DeleteDiskResponse{} - err := client.Invoke("DeleteDisk", &args, &response) - return err -} - -type ReInitDiskArgs struct { - DiskId string -} - -type ReInitDiskResponse struct { - common.Response -} - -// ReInitDisk reinitizes disk -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/disk&reinitdisk -func (client *Client) ReInitDisk(diskId string) error { - args := ReInitDiskArgs{ - DiskId: diskId, - } - response := ReInitDiskResponse{} - err := client.Invoke("ReInitDisk", &args, &response) - return err -} - -type AttachDiskArgs struct { - InstanceId string - DiskId string - Device string - DeleteWithInstance bool -} - -type AttachDiskResponse struct { - common.Response -} - -// AttachDisk attaches disk to instance -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/disk&attachdisk -func (client *Client) AttachDisk(args *AttachDiskArgs) error { - response := AttachDiskResponse{} - err := client.Invoke("AttachDisk", args, &response) - return err -} - -type DetachDiskArgs struct { - InstanceId string - DiskId string -} - -type DetachDiskResponse struct { - common.Response -} - -// DetachDisk detaches disk from instance -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/disk&detachdisk -func (client *Client) DetachDisk(instanceId string, diskId string) error { - args := DetachDiskArgs{ - InstanceId: instanceId, - DiskId: diskId, - } - response := DetachDiskResponse{} - err := client.Invoke("DetachDisk", &args, &response) - return err -} - -type ResizeDiskArgs struct { - DiskId string - NewSize int -} - -type ResizeDiskResponse struct { - common.Response -} - -// -// ResizeDisk can only support to enlarge disk size -// You can read doc at https://help.aliyun.com/document_detail/25522.html -func (client *Client) ResizeDisk(diskId string, sizeGB int) error { - args := ResizeDiskArgs{ - DiskId: diskId, - NewSize: sizeGB, - } - response := ResizeDiskResponse{} - err := client.Invoke("ResizeDisk", &args, &response) - return err -} - -type ResetDiskArgs struct { - DiskId string - SnapshotId string -} - -type ResetDiskResponse struct { - common.Response -} - -// ResetDisk resets disk to original status -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/disk&resetdisk -func (client *Client) ResetDisk(diskId string, snapshotId string) error { - args := ResetDiskArgs{ - SnapshotId: snapshotId, - DiskId: diskId, - } - response := ResetDiskResponse{} - err := client.Invoke("ResetDisk", &args, &response) - return err -} - -type ModifyDiskAttributeArgs struct { - DiskId string - DiskName string - Description string - DeleteWithInstance *bool - DeleteAutoSnapshot *bool - EnableAutoSnapshot *bool -} - -type ModifyDiskAttributeResponse struct { - common.Response -} - -// ModifyDiskAttribute modifies disk attribute -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/disk&modifydiskattribute -func (client *Client) ModifyDiskAttribute(args *ModifyDiskAttributeArgs) error { - response := ModifyDiskAttributeResponse{} - err := client.Invoke("ModifyDiskAttribute", args, &response) - return err -} - -type ReplaceSystemDiskArgs struct { - InstanceId string - ImageId string - SystemDisk SystemDiskType - ClientToken string -} - -type ReplaceSystemDiskResponse struct { - common.Response - DiskId string -} - -// ReplaceSystemDisk replace system disk -// -// You can read doc at https://help.aliyun.com/document_detail/ecs/open-api/disk/replacesystemdisk.html -func (client *Client) ReplaceSystemDisk(args *ReplaceSystemDiskArgs) (diskId string, err error) { - response := ReplaceSystemDiskResponse{} - err = client.Invoke("ReplaceSystemDisk", args, &response) - if err != nil { - return "", err - } - return response.DiskId, nil -} - -// WaitForDisk waits for disk to given status -func (client *Client) WaitForDisk(regionId common.Region, diskId string, status DiskStatus, timeout int) error { - if timeout <= 0 { - timeout = DefaultTimeout - } - args := DescribeDisksArgs{ - RegionId: regionId, - DiskIds: []string{diskId}, - } - - for { - disks, _, err := client.DescribeDisks(&args) - if err != nil { - return err - } - if disks == nil || len(disks) == 0 { - return common.GetClientErrorFromString("Not found") - } - if disks[0].Status == status { - break - } - timeout = timeout - DefaultWaitForInterval - if timeout <= 0 { - return common.GetClientErrorFromString("Timeout") - } - time.Sleep(DefaultWaitForInterval * time.Second) - } - return nil -} diff --git a/vendor/github.com/denverdino/aliyungo/ecs/eni.go b/vendor/github.com/denverdino/aliyungo/ecs/eni.go deleted file mode 100644 index 698d4fa70..000000000 --- a/vendor/github.com/denverdino/aliyungo/ecs/eni.go +++ /dev/null @@ -1,183 +0,0 @@ -package ecs - -import ( - "fmt" - "time" - - "github.com/denverdino/aliyungo/common" -) - -type CreateNetworkInterfaceArgs struct { - RegionId common.Region - VSwitchId string - PrimaryIpAddress string // optional - SecurityGroupId string - NetworkInterfaceName string // optional - Description string // optional - ClientToken string // optional -} - -type CreateNetworkInterfaceResponse struct { - common.Response - NetworkInterfaceId string -} -type DeleteNetworkInterfaceArgs struct { - RegionId common.Region - NetworkInterfaceId string -} - -type DeleteNetworkInterfaceResponse struct { - common.Response -} - -type DescribeNetworkInterfacesArgs struct { - RegionId common.Region - VSwitchId string - PrimaryIpAddress string - SecurityGroupId string - NetworkInterfaceName string - Type string - InstanceId string - NetworkInterfaceId []string `query:"list"` - PageNumber int - PageSize int -} -type NetworkInterfaceType struct { - NetworkInterfaceId string - NetworkInterfaceName string - PrimaryIpAddress string - MacAddress string - Status string - PrivateIpAddress string -} - -type DescribeNetworkInterfacesResponse struct { - common.Response - NetworkInterfaceSets struct { - NetworkInterfaceSet []NetworkInterfaceType - } - TotalCount int - PageNumber int - PageSize int -} -type AttachNetworkInterfaceArgs struct { - RegionId common.Region - NetworkInterfaceId string - InstanceId string -} - -type AttachNetworkInterfaceResponse common.Response - -type DetachNetworkInterfaceArgs AttachNetworkInterfaceArgs - -type DetachNetworkInterfaceResponse common.Response - -type ModifyNetworkInterfaceAttributeArgs struct { - RegionId common.Region - NetworkInterfaceId string - SecurityGroupId []string - NetworkInterfaceName string - Description string -} -type ModifyNetworkInterfaceAttributeResponse common.Response - -type UnassignPrivateIpAddressesArgs struct { - RegionId common.Region - NetworkInterfaceId string - PrivateIpAddress []string `query:"list"` -} - -type UnassignPrivateIpAddressesResponse common.Response - -type AssignPrivateIpAddressesArgs struct { - RegionId common.Region - NetworkInterfaceId string - PrivateIpAddress []string `query:"list"` // optional - SecondaryPrivateIpAddressCount int // optional -} - -type AssignPrivateIpAddressesResponse common.Response - -func (client *Client) CreateNetworkInterface(args *CreateNetworkInterfaceArgs) (resp *CreateNetworkInterfaceResponse, err error) { - resp = &CreateNetworkInterfaceResponse{} - err = client.Invoke("CreateNetworkInterface", args, resp) - return resp, err -} - -func (client *Client) DeleteNetworkInterface(args *DeleteNetworkInterfaceArgs) (resp *DeleteNetworkInterfaceResponse, err error) { - resp = &DeleteNetworkInterfaceResponse{} - err = client.Invoke("DeleteNetworkInterface", args, resp) - return resp, err -} - -func (client *Client) DescribeNetworkInterfaces(args *DescribeNetworkInterfacesArgs) (resp *DescribeNetworkInterfacesResponse, err error) { - resp = &DescribeNetworkInterfacesResponse{} - err = client.Invoke("DescribeNetworkInterfaces", args, resp) - return resp, err -} - -func (client *Client) AttachNetworkInterface(args *AttachNetworkInterfaceArgs) error { - resp := &AttachNetworkInterfaceResponse{} - err := client.Invoke("AttachNetworkInterface", args, resp) - return err -} - -func (client *Client) DetachNetworkInterface(args *DetachNetworkInterfaceArgs) (resp *DetachNetworkInterfaceResponse, err error) { - resp = &DetachNetworkInterfaceResponse{} - err = client.Invoke("DetachNetworkInterface", args, resp) - return resp, err -} - -func (client *Client) ModifyNetworkInterfaceAttribute(args *ModifyNetworkInterfaceAttributeArgs) (resp *ModifyNetworkInterfaceAttributeResponse, err error) { - resp = &ModifyNetworkInterfaceAttributeResponse{} - err = client.Invoke("ModifyNetworkInterfaceAttribute", args, resp) - return resp, err -} - -func (client *Client) UnassignPrivateIpAddresses(args *UnassignPrivateIpAddressesArgs) (resp *UnassignPrivateIpAddressesResponse, err error) { - resp = &UnassignPrivateIpAddressesResponse{} - err = client.Invoke("UnassignPrivateIpAddresses", args, resp) - return resp, err -} - -func (client *Client) AssignPrivateIpAddresses(args *AssignPrivateIpAddressesArgs) (resp *AssignPrivateIpAddressesResponse, err error) { - resp = &AssignPrivateIpAddressesResponse{} - err = client.Invoke("AssignPrivateIpAddresses", args, resp) - return resp, err -} - -// Default timeout value for WaitForInstance method -const NetworkInterfacesDefaultTimeout = 120 - -// WaitForInstance waits for instance to given status -func (client *Client) WaitForNetworkInterface(regionId common.Region, eniID string, status string, timeout int) error { - if timeout <= 0 { - timeout = NetworkInterfacesDefaultTimeout - } - for { - - eniIds := []string{eniID} - - describeNetworkInterfacesArgs := DescribeNetworkInterfacesArgs{ - RegionId: regionId, - NetworkInterfaceId: eniIds, - } - - nisResponse, err := client.DescribeNetworkInterfaces(&describeNetworkInterfacesArgs) - if err != nil { - return fmt.Errorf("Failed to describe network interface %v: %v", eniID, err) - } - - if len(nisResponse.NetworkInterfaceSets.NetworkInterfaceSet) > 0 && nisResponse.NetworkInterfaceSets.NetworkInterfaceSet[0].Status == status { - break - } - - timeout = timeout - DefaultWaitForInterval - if timeout <= 0 { - return fmt.Errorf("Timeout for waiting available status for network interfaces") - } - time.Sleep(DefaultWaitForInterval * time.Second) - - } - return nil -} diff --git a/vendor/github.com/denverdino/aliyungo/ecs/forward_entry.go b/vendor/github.com/denverdino/aliyungo/ecs/forward_entry.go deleted file mode 100644 index ad716a1a5..000000000 --- a/vendor/github.com/denverdino/aliyungo/ecs/forward_entry.go +++ /dev/null @@ -1,112 +0,0 @@ -package ecs - -import "github.com/denverdino/aliyungo/common" - -type CreateForwardEntryArgs struct { - RegionId common.Region - ForwardTableId string - ExternalIp string - ExternalPort string - IpProtocol string - InternalIp string - InternalPort string -} - -type CreateForwardEntryResponse struct { - common.Response - ForwardEntryId string -} - -type DescribeForwardTableEntriesArgs struct { - RegionId common.Region - ForwardTableId string - common.Pagination -} - -type ForwardTableEntrySetType struct { - RegionId common.Region - ExternalIp string - ExternalPort string - ForwardEntryId string - ForwardTableId string - InternalIp string - InternalPort string - IpProtocol string - Status string -} - -type DescribeForwardTableEntriesResponse struct { - common.Response - common.PaginationResult - ForwardTableEntries struct { - ForwardTableEntry []ForwardTableEntrySetType - } -} - -type ModifyForwardEntryArgs struct { - RegionId common.Region - ForwardTableId string - ForwardEntryId string - ExternalIp string - IpProtocol string - ExternalPort string - InternalIp string - InternalPort string -} - -type ModifyForwardEntryResponse struct { - common.Response -} - -type DeleteForwardEntryArgs struct { - RegionId common.Region - ForwardTableId string - ForwardEntryId string -} - -type DeleteForwardEntryResponse struct { - common.Response -} - -func (client *Client) CreateForwardEntry(args *CreateForwardEntryArgs) (resp *CreateForwardEntryResponse, err error) { - response := CreateForwardEntryResponse{} - err = client.Invoke("CreateForwardEntry", args, &response) - if err != nil { - return nil, err - } - return &response, err -} - -func (client *Client) DescribeForwardTableEntries(args *DescribeForwardTableEntriesArgs) (forwardTableEntries []ForwardTableEntrySetType, - pagination *common.PaginationResult, err error) { - response, err := client.DescribeForwardTableEntriesWithRaw(args) - if err != nil { - return nil, nil, err - } - - return response.ForwardTableEntries.ForwardTableEntry, &response.PaginationResult, nil -} - -func (client *Client) DescribeForwardTableEntriesWithRaw(args *DescribeForwardTableEntriesArgs) (response *DescribeForwardTableEntriesResponse, err error) { - args.Validate() - response = &DescribeForwardTableEntriesResponse{} - - err = client.Invoke("DescribeForwardTableEntries", args, response) - - if err != nil { - return nil, err - } - - return response, nil -} - -func (client *Client) ModifyForwardEntry(args *ModifyForwardEntryArgs) error { - response := ModifyForwardEntryResponse{} - return client.Invoke("ModifyForwardEntry", args, &response) -} - -func (client *Client) DeleteForwardEntry(args *DeleteForwardEntryArgs) error { - response := DeleteForwardEntryResponse{} - err := client.Invoke("DeleteForwardEntry", args, &response) - return err -} diff --git a/vendor/github.com/denverdino/aliyungo/ecs/images.go b/vendor/github.com/denverdino/aliyungo/ecs/images.go deleted file mode 100644 index e50297adc..000000000 --- a/vendor/github.com/denverdino/aliyungo/ecs/images.go +++ /dev/null @@ -1,347 +0,0 @@ -package ecs - -import ( - "net/url" - "strconv" - "time" - - "github.com/denverdino/aliyungo/common" - "github.com/denverdino/aliyungo/util" -) - -// ImageOwnerAlias represents image owner -type ImageOwnerAlias string - -// Constants of image owner -const ( - ImageOwnerSystem = ImageOwnerAlias("system") - ImageOwnerSelf = ImageOwnerAlias("self") - ImageOwnerOthers = ImageOwnerAlias("others") - ImageOwnerMarketplace = ImageOwnerAlias("marketplace") - ImageOwnerDefault = ImageOwnerAlias("") //Return the values for system, self, and others -) - -type ImageStatus string - -const ( - ImageStatusAvailable = ImageStatus("Available") - ImageStatusUnAvailable = ImageStatus("UnAvailable") - ImageStatusCreating = ImageStatus("Creating") - ImageStatusCreateFailed = ImageStatus("CreateFailed") -) - -type ImageUsage string - -const ( - ImageUsageInstance = ImageUsage("instance") - ImageUsageNone = ImageUsage("none") -) - -type ImageFormatType string - -const ( - RAW = ImageFormatType("RAW") - VHD = ImageFormatType("VHD") -) - -// DescribeImagesArgs repsents arguments to describe images -type DescribeImagesArgs struct { - RegionId common.Region - ImageId string - SnapshotId string - ImageName string - Status ImageStatus - ImageOwnerAlias ImageOwnerAlias - common.Pagination -} - -type DescribeImagesResponse struct { - common.Response - common.PaginationResult - - RegionId common.Region - Images struct { - Image []ImageType - } -} - -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/datatype&diskdevicemapping -type DiskDeviceMapping struct { - SnapshotId string - //Why Size Field is string-type. - Size string - // Now the key Size change to DiskImageSize - DiskImageSize string - Device string - //For import images - Format string - OSSBucket string - OSSObject string -} - -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/datatype&imagetype -type ImageType struct { - ImageId string - ImageVersion string - Architecture string - ImageName string - Description string - Size int - ImageOwnerAlias string - OSName string - OSType string - Platform string - DiskDeviceMappings struct { - DiskDeviceMapping []DiskDeviceMapping - } - ProductCode string - IsSubscribed bool - IsSelfShared string - IsCopied bool - IsSupportIoOptimized bool - Progress string - Usage ImageUsage - Status ImageStatus - CreationTime util.ISO6801Time -} - -// DescribeImages describes images -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/image&describeimages -func (client *Client) DescribeImages(args *DescribeImagesArgs) (images []ImageType, pagination *common.PaginationResult, err error) { - response, err := client.DescribeImagesWithRaw(args) - if err != nil { - return nil, nil, err - } - return response.Images.Image, &response.PaginationResult, nil -} - -func (client *Client) DescribeImagesWithRaw(args *DescribeImagesArgs) (response *DescribeImagesResponse, err error) { - args.Validate() - response = &DescribeImagesResponse{} - err = client.Invoke("DescribeImages", args, response) - if err != nil { - return nil, err - } - return response, nil -} - -// CreateImageArgs repsents arguments to create image -type CreateImageArgs struct { - RegionId common.Region - SnapshotId string - InstanceId string - ImageName string - ImageVersion string - Description string - ClientToken string -} - -type CreateImageResponse struct { - common.Response - - ImageId string -} - -// CreateImage creates a new image -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/image&createimage -func (client *Client) CreateImage(args *CreateImageArgs) (imageId string, err error) { - response := &CreateImageResponse{} - err = client.Invoke("CreateImage", args, &response) - if err != nil { - return "", err - } - return response.ImageId, nil -} - -type DeleteImageArgs struct { - RegionId common.Region - ImageId string - Force bool -} - -type DeleteImageResponse struct { - common.Response -} - -// DeleteImage deletes Image -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/image&deleteimage -func (client *Client) DeleteImage(regionId common.Region, imageId string) error { - args := DeleteImageArgs{ - RegionId: regionId, - ImageId: imageId, - } - - response := &DeleteImageResponse{} - return client.Invoke("DeleteImage", &args, &response) -} - -// DeleteImage deletes Image -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/image&deleteimage -func (client *Client) DeleteImageWithForce(regionId common.Region, imageId string, force bool) error { - args := DeleteImageArgs{ - RegionId: regionId, - ImageId: imageId, - Force: force, - } - - response := &DeleteImageResponse{} - return client.Invoke("DeleteImage", &args, &response) -} - -// ModifyImageSharePermission repsents arguments to share image -type ModifyImageSharePermissionArgs struct { - RegionId common.Region - ImageId string - AddAccount []string - RemoveAccount []string -} - -// You can read doc at http://help.aliyun.com/document_detail/ecs/open-api/image/modifyimagesharepermission.html -func (client *Client) ModifyImageSharePermission(args *ModifyImageSharePermissionArgs) error { - req := url.Values{} - req.Add("RegionId", string(args.RegionId)) - req.Add("ImageId", args.ImageId) - - for i, item := range args.AddAccount { - req.Add("AddAccount."+strconv.Itoa(i+1), item) - } - for i, item := range args.RemoveAccount { - req.Add("RemoveAccount."+strconv.Itoa(i+1), item) - } - - return client.Invoke("ModifyImageSharePermission", req, &common.Response{}) -} - -type AccountType struct { - AliyunId string -} -type ImageSharePermissionResponse struct { - common.Response - ImageId string - RegionId string - Accounts struct { - Account []AccountType - } - TotalCount int - PageNumber int - PageSize int -} - -func (client *Client) DescribeImageSharePermission(args *ModifyImageSharePermissionArgs) (*ImageSharePermissionResponse, error) { - response := ImageSharePermissionResponse{} - err := client.Invoke("DescribeImageSharePermission", args, &response) - return &response, err -} - -type CopyImageArgs struct { - RegionId common.Region - ImageId string - DestinationRegionId common.Region - DestinationImageName string - DestinationDescription string - ClientToken string -} - -type CopyImageResponse struct { - common.Response - ImageId string -} - -// You can read doc at https://help.aliyun.com/document_detail/25538.html -func (client *Client) CopyImage(args *CopyImageArgs) (string, error) { - response := &CopyImageResponse{} - err := client.Invoke("CopyImage", args, &response) - if err != nil { - return "", err - } - return response.ImageId, nil -} - -// ImportImageArgs repsents arguments to import image from oss -type ImportImageArgs struct { - RegionId common.Region - ImageName string - ImageVersion string - Description string - ClientToken string - Architecture string - OSType string - Platform string - DiskDeviceMappings struct { - DiskDeviceMapping []DiskDeviceMapping - } -} - -func (client *Client) ImportImage(args *ImportImageArgs) (string, error) { - response := &CopyImageResponse{} - err := client.Invoke("ImportImage", args, &response) - if err != nil { - return "", err - } - return response.ImageId, nil -} - -type ImportImageResponse struct { - common.Response - RegionId common.Region - ImageId string - ImportTaskId string -} - -// Default timeout value for WaitForImageReady method -const ImageDefaultTimeout = 120 - -//Wait Image ready -func (client *Client) WaitForImageReady(regionId common.Region, imageId string, timeout int) error { - if timeout <= 0 { - timeout = ImageDefaultTimeout - } - for { - args := DescribeImagesArgs{ - RegionId: regionId, - ImageId: imageId, - Status: ImageStatusCreating, - } - - images, _, err := client.DescribeImages(&args) - if err != nil { - return err - } - if images == nil || len(images) == 0 { - args.Status = ImageStatusAvailable - images, _, er := client.DescribeImages(&args) - if er == nil && len(images) == 1 { - break - } else { - return common.GetClientErrorFromString("Not found") - } - } - if images[0].Progress == "100%" { - break - } - timeout = timeout - DefaultWaitForInterval - if timeout <= 0 { - return common.GetClientErrorFromString("Timeout") - } - time.Sleep(DefaultWaitForInterval * time.Second) - } - return nil -} - -type CancelCopyImageRequest struct { - regionId common.Region - ImageId string -} - -// You can read doc at https://help.aliyun.com/document_detail/25539.html -func (client *Client) CancelCopyImage(regionId common.Region, imageId string) error { - response := &common.Response{} - err := client.Invoke("CancelCopyImage", &CancelCopyImageRequest{regionId, imageId}, &response) - return err -} diff --git a/vendor/github.com/denverdino/aliyungo/ecs/instance_types.go b/vendor/github.com/denverdino/aliyungo/ecs/instance_types.go deleted file mode 100644 index d26b5666a..000000000 --- a/vendor/github.com/denverdino/aliyungo/ecs/instance_types.go +++ /dev/null @@ -1,91 +0,0 @@ -package ecs - -import "github.com/denverdino/aliyungo/common" - -type DescribeInstanceTypesArgs struct { - InstanceTypeFamily string -} - -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/datatype&instancetypeitemtype -type InstanceTypeItemType struct { - InstanceTypeId string - CpuCoreCount int - MemorySize float64 - InstanceTypeFamily string - GPUAmount int - GPUSpec string - InitialCredit int - BaselineCredit int - EniQuantity int - EniPrivateIpAddressQuantity int - LocalStorageCapacity int - LocalStorageAmount int - LocalStorageCategory string -} - -type DescribeInstanceTypesResponse struct { - common.Response - InstanceTypes struct { - InstanceType []InstanceTypeItemType - } -} - -// DescribeInstanceTypes describes all instance types -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/other&describeinstancetypes -func (client *Client) DescribeInstanceTypes() (instanceTypes []InstanceTypeItemType, err error) { - response := DescribeInstanceTypesResponse{} - - err = client.Invoke("DescribeInstanceTypes", &DescribeInstanceTypesArgs{}, &response) - - if err != nil { - return []InstanceTypeItemType{}, err - } - return response.InstanceTypes.InstanceType, nil - -} - -// support user args -func (client *Client) DescribeInstanceTypesNew(args *DescribeInstanceTypesArgs) (instanceTypes []InstanceTypeItemType, err error) { - response := DescribeInstanceTypesResponse{} - - err = client.Invoke("DescribeInstanceTypes", args, &response) - - if err != nil { - return []InstanceTypeItemType{}, err - } - return response.InstanceTypes.InstanceType, nil - -} - -type DescribeInstanceTypeFamiliesArgs struct { - RegionId common.Region - Generation string -} - -type InstanceTypeFamilies struct { - InstanceTypeFamily []InstanceTypeFamily -} - -type InstanceTypeFamily struct { - InstanceTypeFamilyId string - Generation string -} - -type DescribeInstanceTypeFamiliesResponse struct { - common.Response - - InstanceTypeFamilies InstanceTypeFamilies -} - -func (client *Client) DescribeInstanceTypeFamilies(args *DescribeInstanceTypeFamiliesArgs) (*DescribeInstanceTypeFamiliesResponse, error) { - response := &DescribeInstanceTypeFamiliesResponse{} - - err := client.Invoke("DescribeInstanceTypeFamilies", args, response) - if err != nil { - return nil, err - } - - return response, nil -} diff --git a/vendor/github.com/denverdino/aliyungo/ecs/instances.go b/vendor/github.com/denverdino/aliyungo/ecs/instances.go deleted file mode 100644 index dd424f96b..000000000 --- a/vendor/github.com/denverdino/aliyungo/ecs/instances.go +++ /dev/null @@ -1,832 +0,0 @@ -package ecs - -import ( - "encoding/base64" - "encoding/json" - "strconv" - "time" - - "github.com/denverdino/aliyungo/common" - "github.com/denverdino/aliyungo/util" -) - -// InstanceStatus represents instance status -type InstanceStatus string - -// Constants of InstanceStatus -const ( - Creating = InstanceStatus("Creating") // For backward compatibility - Pending = InstanceStatus("Pending") - Running = InstanceStatus("Running") - Starting = InstanceStatus("Starting") - - Stopped = InstanceStatus("Stopped") - Stopping = InstanceStatus("Stopping") - Deleted = InstanceStatus("Deleted") -) - -type LockReason string - -const ( - LockReasonFinancial = LockReason("financial") - LockReasonSecurity = LockReason("security") -) - -type LockReasonType struct { - LockReason LockReason -} - -type DescribeUserdataArgs struct { - RegionId common.Region - InstanceId string -} - -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/datatype&instancestatusitemtype -type DescribeUserdataItemType struct { - UserData string - InstanceId string - RegionId string -} - -type DescribeUserdataResponse struct { - common.Response - DescribeUserdataItemType -} - -// DescribeInstanceStatus describes instance status -// -// You can read doc at https://intl.aliyun.com/help/doc-detail/49227.htm -func (client *Client) DescribeUserdata(args *DescribeUserdataArgs) (userData *DescribeUserdataItemType, err error) { - response := DescribeUserdataResponse{} - - err = client.Invoke("DescribeUserdata", args, &response) - - if err == nil { - return &response.DescribeUserdataItemType, nil - } - - return nil, err -} - -type DescribeInstanceStatusArgs struct { - RegionId common.Region - ZoneId string - common.Pagination -} - -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/datatype&instancestatusitemtype -type InstanceStatusItemType struct { - InstanceId string - Status InstanceStatus -} - -type DescribeInstanceStatusResponse struct { - common.Response - common.PaginationResult - InstanceStatuses struct { - InstanceStatus []InstanceStatusItemType - } -} - -// DescribeInstanceStatus describes instance status -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/instance&describeinstancestatus -func (client *Client) DescribeInstanceStatus(args *DescribeInstanceStatusArgs) (instanceStatuses []InstanceStatusItemType, pagination *common.PaginationResult, err error) { - response, err := client.DescribeInstanceStatusWithRaw(args) - - if err == nil { - return response.InstanceStatuses.InstanceStatus, &response.PaginationResult, nil - } - - return nil, nil, err -} - -func (client *Client) DescribeInstanceStatusWithRaw(args *DescribeInstanceStatusArgs) (response *DescribeInstanceStatusResponse, err error) { - args.Validate() - response = &DescribeInstanceStatusResponse{} - - err = client.Invoke("DescribeInstanceStatus", args, response) - if err != nil { - return nil, err - } - - return response, nil -} - -type StopInstanceArgs struct { - InstanceId string - ForceStop bool -} - -type StopInstanceResponse struct { - common.Response -} - -// StopInstance stops instance -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/instance&stopinstance -func (client *Client) StopInstance(instanceId string, forceStop bool) error { - args := StopInstanceArgs{ - InstanceId: instanceId, - ForceStop: forceStop, - } - response := StopInstanceResponse{} - err := client.Invoke("StopInstance", &args, &response) - return err -} - -type StartInstanceArgs struct { - InstanceId string -} - -type StartInstanceResponse struct { - common.Response -} - -// StartInstance starts instance -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/instance&startinstance -func (client *Client) StartInstance(instanceId string) error { - args := StartInstanceArgs{InstanceId: instanceId} - response := StartInstanceResponse{} - err := client.Invoke("StartInstance", &args, &response) - return err -} - -type RebootInstanceArgs struct { - InstanceId string - ForceStop bool -} - -type RebootInstanceResponse struct { - common.Response -} - -// RebootInstance reboot instance -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/instance&rebootinstance -func (client *Client) RebootInstance(instanceId string, forceStop bool) error { - request := RebootInstanceArgs{ - InstanceId: instanceId, - ForceStop: forceStop, - } - response := RebootInstanceResponse{} - err := client.Invoke("RebootInstance", &request, &response) - return err -} - -type DescribeInstanceAttributeArgs struct { - InstanceId string -} - -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/datatype&operationlockstype -type OperationLocksType struct { - LockReason []LockReasonType //enum for financial, security -} - -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/datatype&securitygroupidsettype -type SecurityGroupIdSetType struct { - SecurityGroupId string -} - -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/datatype&ipaddresssettype -type IpAddressSetType struct { - IpAddress []string -} - -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/datatype&vpcattributestype -type VpcAttributesType struct { - VpcId string - VSwitchId string - PrivateIpAddress IpAddressSetType - NatIpAddress string -} - -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/datatype&eipaddressassociatetype -type EipAddressAssociateType struct { - AllocationId string - IpAddress string - Bandwidth int - InternetChargeType common.InternetChargeType -} - -// Experimental feature -type SpotStrategyType string - -// Constants of SpotStrategyType -const ( - NoSpot = SpotStrategyType("NoSpot") - SpotWithPriceLimit = SpotStrategyType("SpotWithPriceLimit") - SpotAsPriceGo = SpotStrategyType("SpotAsPriceGo") -) - -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/datatype&instanceattributestype -type InstanceAttributesType struct { - InstanceId string - InstanceName string - Description string - ImageId string - RegionId common.Region - ZoneId string - CPU int - Memory int - ClusterId string - InstanceType string - InstanceTypeFamily string - HostName string - SerialNumber string - Status InstanceStatus - OperationLocks OperationLocksType - SecurityGroupIds struct { - SecurityGroupId []string - } - PublicIpAddress IpAddressSetType - InnerIpAddress IpAddressSetType - InstanceNetworkType string //enum Classic | Vpc - InternetMaxBandwidthIn int - InternetMaxBandwidthOut int - InternetChargeType common.InternetChargeType - CreationTime util.ISO6801Time //time.Time - VpcAttributes VpcAttributesType - EipAddress EipAddressAssociateType - IoOptimized StringOrBool - InstanceChargeType common.InstanceChargeType - ExpiredTime util.ISO6801Time - Tags struct { - Tag []TagItemType - } - SpotStrategy SpotStrategyType - SpotPriceLimit float64 - KeyPairName string -} - -type DescribeInstanceAttributeResponse struct { - common.Response - InstanceAttributesType -} - -// DescribeInstanceAttribute describes instance attribute -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/instance&describeinstanceattribute -func (client *Client) DescribeInstanceAttribute(instanceId string) (instance *InstanceAttributesType, err error) { - args := DescribeInstanceAttributeArgs{InstanceId: instanceId} - - response := DescribeInstanceAttributeResponse{} - err = client.Invoke("DescribeInstanceAttribute", &args, &response) - if err != nil { - return nil, err - } - return &response.InstanceAttributesType, err -} - -type ModifyInstanceAttributeArgs struct { - InstanceId string - InstanceName string - Description string - Password string - HostName string - UserData string -} - -type ModifyInstanceAttributeResponse struct { - common.Response -} - -//ModifyInstanceAttribute modify instance attrbute -// -// You can read doc at https://help.aliyun.com/document_detail/ecs/open-api/instance/modifyinstanceattribute.html -func (client *Client) ModifyInstanceAttribute(args *ModifyInstanceAttributeArgs) error { - response := ModifyInstanceAttributeResponse{} - err := client.Invoke("ModifyInstanceAttribute", args, &response) - return err -} - -// Default timeout value for WaitForInstance method -const InstanceDefaultTimeout = 120 - -// WaitForInstance waits for instance to given status -func (client *Client) WaitForInstance(instanceId string, status InstanceStatus, timeout int) error { - if timeout <= 0 { - timeout = InstanceDefaultTimeout - } - for { - instance, err := client.DescribeInstanceAttribute(instanceId) - if err != nil { - return err - } - if instance.Status == status { - //TODO - //Sleep one more time for timing issues - time.Sleep(DefaultWaitForInterval * time.Second) - break - } - timeout = timeout - DefaultWaitForInterval - if timeout <= 0 { - return common.GetClientErrorFromString("Timeout") - } - time.Sleep(DefaultWaitForInterval * time.Second) - - } - return nil -} - -// WaitForInstance waits for instance to given status -// when instance.NotFound wait until timeout -func (client *Client) WaitForInstanceAsyn(instanceId string, status InstanceStatus, timeout int) error { - if timeout <= 0 { - timeout = InstanceDefaultTimeout - } - for { - instance, err := client.DescribeInstanceAttribute(instanceId) - if err != nil { - e, _ := err.(*common.Error) - if e.Code != "InvalidInstanceId.NotFound" && e.Code != "Forbidden.InstanceNotFound" { - return err - } - } else if instance != nil && instance.Status == status { - //TODO - break - } - timeout = timeout - DefaultWaitForInterval - if timeout <= 0 { - return common.GetClientErrorFromString("Timeout") - } - time.Sleep(DefaultWaitForInterval * time.Second) - - } - return nil -} - -type DescribeInstanceVncUrlArgs struct { - RegionId common.Region - InstanceId string -} - -type DescribeInstanceVncUrlResponse struct { - common.Response - VncUrl string -} - -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/instance&describeinstancevncurl -func (client *Client) DescribeInstanceVncUrl(args *DescribeInstanceVncUrlArgs) (string, error) { - response := DescribeInstanceVncUrlResponse{} - - err := client.Invoke("DescribeInstanceVncUrl", args, &response) - - if err == nil { - return response.VncUrl, nil - } - - return "", err -} - -type DescribeInstancesArgs struct { - RegionId common.Region - VpcId string - VSwitchId string - ZoneId string - InstanceIds string - InstanceNetworkType string - InstanceName string - Status InstanceStatus - PrivateIpAddresses string - InnerIpAddresses string - PublicIpAddresses string - SecurityGroupId string - Tag map[string]string - InstanceType string - SpotStrategy SpotStrategyType - common.Pagination -} - -type DescribeInstancesResponse struct { - common.Response - common.PaginationResult - Instances struct { - Instance []InstanceAttributesType - } -} - -// DescribeInstances describes instances -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/instance&describeinstances -func (client *Client) DescribeInstances(args *DescribeInstancesArgs) (instances []InstanceAttributesType, pagination *common.PaginationResult, err error) { - response, err := client.DescribeInstancesWithRaw(args) - if err != nil { - return nil, nil, err - } - - return response.Instances.Instance, &response.PaginationResult, nil -} - -func (client *Client) DescribeInstancesWithRaw(args *DescribeInstancesArgs) (response *DescribeInstancesResponse, err error) { - args.Validate() - response = &DescribeInstancesResponse{} - - err = client.Invoke("DescribeInstances", args, &response) - if err != nil { - return nil, err - } - - return response, nil -} - -type ModifyInstanceAutoReleaseTimeArgs struct { - InstanceId string - AutoReleaseTime string -} - -type ModifyInstanceAutoReleaseTimeResponse struct { - common.Response -} - -// 对给定的实例设定自动释放时间。 -// -// You can read doc at https://help.aliyun.com/document_detail/47576.html -func (client *Client) ModifyInstanceAutoReleaseTime(instanceId, time string) error { - args := ModifyInstanceAutoReleaseTimeArgs{ - InstanceId: instanceId, - AutoReleaseTime: time, - } - response := ModifyInstanceAutoReleaseTimeResponse{} - err := client.Invoke("ModifyInstanceAutoReleaseTime", &args, &response) - return err -} - -type DeleteInstanceArgs struct { - InstanceId string -} - -type DeleteInstanceResponse struct { - common.Response -} - -// DeleteInstance deletes instance -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/instance&deleteinstance -func (client *Client) DeleteInstance(instanceId string) error { - args := DeleteInstanceArgs{InstanceId: instanceId} - response := DeleteInstanceResponse{} - err := client.Invoke("DeleteInstance", &args, &response) - return err -} - -type DataDiskType struct { - Size int - Category DiskCategory //Enum cloud, ephemeral, ephemeral_ssd - SnapshotId string - DiskName string - Description string - Device string - DeleteWithInstance bool -} - -type SystemDiskType struct { - Size int - Category DiskCategory //Enum cloud, ephemeral, ephemeral_ssd - DiskName string - Description string -} - -type IoOptimized string - -type StringOrBool struct { - Value bool -} - -// UnmarshalJSON implements the json.Unmarshaller interface. -func (io *StringOrBool) UnmarshalJSON(value []byte) error { - if value[0] == '"' { - var str string - err := json.Unmarshal(value, &str) - if err == nil { - io.Value = (str == "true" || str == "optimized") - } - return err - } - var boolVal bool - err := json.Unmarshal(value, &boolVal) - if err == nil { - io.Value = boolVal - } - return err -} - -func (io StringOrBool) Bool() bool { - return io.Value -} - -func (io StringOrBool) String() string { - return strconv.FormatBool(io.Value) -} - -var ( - IoOptimizedNone = IoOptimized("none") - IoOptimizedOptimized = IoOptimized("optimized") -) - -type SecurityEnhancementStrategy string - -var ( - InactiveSecurityEnhancementStrategy = SecurityEnhancementStrategy("Active") - DeactiveSecurityEnhancementStrategy = SecurityEnhancementStrategy("Deactive") -) - -type CreateInstanceArgs struct { - RegionId common.Region - ZoneId string - ImageId string - InstanceType string - SecurityGroupId string - InstanceName string - Description string - InternetChargeType common.InternetChargeType - InternetMaxBandwidthIn int - InternetMaxBandwidthOut int - HostName string - Password string - IoOptimized IoOptimized - SystemDisk SystemDiskType - DataDisk []DataDiskType - VSwitchId string - PrivateIpAddress string - ClientToken string - InstanceChargeType common.InstanceChargeType - Period int - PeriodUnit common.TimeType - UserData string - AutoRenew bool - AutoRenewPeriod int - SpotStrategy SpotStrategyType - SpotPriceLimit float64 - KeyPairName string - RamRoleName string - SecurityEnhancementStrategy SecurityEnhancementStrategy -} - -type CreateInstanceResponse struct { - common.Response - InstanceId string -} - -// CreateInstance creates instance -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/instance&createinstance -func (client *Client) CreateInstance(args *CreateInstanceArgs) (instanceId string, err error) { - if args.UserData != "" { - // Encode to base64 string - args.UserData = base64.StdEncoding.EncodeToString([]byte(args.UserData)) - } - response := CreateInstanceResponse{} - err = client.Invoke("CreateInstance", args, &response) - if err != nil { - return "", err - } - return response.InstanceId, err -} - -type RunInstanceArgs struct { - CreateInstanceArgs - MinAmount int - MaxAmount int - AutoReleaseTime string - NetworkType string - InnerIpAddress string - BusinessInfo string -} - -type RunInstanceResponse struct { - common.Response - InstanceIdSets InstanceIdSets -} - -type InstanceIdSets struct { - InstanceIdSet []string -} - -type BusinessInfo struct { - Pack string `json:"pack,omitempty"` - ActivityId string `json:"activityId,omitempty"` -} - -func (client *Client) RunInstances(args *RunInstanceArgs) (instanceIdSet []string, err error) { - if args.UserData != "" { - // Encode to base64 string - args.UserData = base64.StdEncoding.EncodeToString([]byte(args.UserData)) - } - response := RunInstanceResponse{} - err = client.Invoke("RunInstances", args, &response) - if err != nil { - return nil, err - } - return response.InstanceIdSets.InstanceIdSet, err -} - -type SecurityGroupArgs struct { - InstanceId string - SecurityGroupId string -} - -type SecurityGroupResponse struct { - common.Response -} - -//JoinSecurityGroup -// -//You can read doc at https://help.aliyun.com/document_detail/ecs/open-api/instance/joinsecuritygroup.html -func (client *Client) JoinSecurityGroup(instanceId string, securityGroupId string) error { - args := SecurityGroupArgs{InstanceId: instanceId, SecurityGroupId: securityGroupId} - response := SecurityGroupResponse{} - err := client.Invoke("JoinSecurityGroup", &args, &response) - return err -} - -//LeaveSecurityGroup -// -//You can read doc at https://help.aliyun.com/document_detail/ecs/open-api/instance/leavesecuritygroup.html -func (client *Client) LeaveSecurityGroup(instanceId string, securityGroupId string) error { - args := SecurityGroupArgs{InstanceId: instanceId, SecurityGroupId: securityGroupId} - response := SecurityGroupResponse{} - err := client.Invoke("LeaveSecurityGroup", &args, &response) - return err -} - -type AttachInstancesArgs struct { - RegionId common.Region - RamRoleName string - InstanceIds string -} - -// AttachInstanceRamRole attach instances to ram role -// -// You can read doc at https://help.aliyun.com/document_detail/54244.html?spm=5176.doc54245.6.811.zEJcS5 -func (client *Client) AttachInstanceRamRole(args *AttachInstancesArgs) (err error) { - response := common.Response{} - err = client.Invoke("AttachInstanceRamRole", args, &response) - if err != nil { - return err - } - return nil -} - -// DetachInstanceRamRole detach instances from ram role -// -// You can read doc at https://help.aliyun.com/document_detail/54245.html?spm=5176.doc54243.6.813.bt8RB3 -func (client *Client) DetachInstanceRamRole(args *AttachInstancesArgs) (err error) { - response := common.Response{} - err = client.Invoke("DetachInstanceRamRole", args, &response) - if err != nil { - return err - } - return nil -} - -type DescribeInstanceRamRoleResponse struct { - common.Response - InstanceRamRoleSets struct { - InstanceRamRoleSet []InstanceRamRoleSetType - } -} - -type InstanceRamRoleSetType struct { - InstanceId string - RamRoleName string -} - -// DescribeInstanceRamRole -// -// You can read doc at https://help.aliyun.com/document_detail/54243.html?spm=5176.doc54245.6.812.RgNCoi -func (client *Client) DescribeInstanceRamRole(args *AttachInstancesArgs) (resp *DescribeInstanceRamRoleResponse, err error) { - response := &DescribeInstanceRamRoleResponse{} - err = client.Invoke("DescribeInstanceRamRole", args, response) - if err != nil { - return response, err - } - return response, nil -} - -type ModifyInstanceSpecArgs struct { - InstanceId string - InstanceType string - InternetMaxBandwidthOut *int - InternetMaxBandwidthIn *int - ClientToken string -} - -type ModifyInstanceSpecResponse struct { - common.Response -} - -//ModifyInstanceSpec modify instance specification -// -// Notice: 1. An instance that was successfully modified once cannot be modified again within 5 minutes. -// 2. The API only can be used Pay-As-You-Go (PostPaid) instance -// -// You can read doc at https://www.alibabacloud.com/help/doc-detail/57633.htm -func (client *Client) ModifyInstanceSpec(args *ModifyInstanceSpecArgs) error { - response := ModifyInstanceSpecResponse{} - return client.Invoke("ModifyInstanceSpec", args, &response) -} - -type ModifyInstanceVpcAttributeArgs struct { - InstanceId string - VSwitchId string - PrivateIpAddress string -} - -type ModifyInstanceVpcAttributeResponse struct { - common.Response -} - -//ModifyInstanceVpcAttribute modify instance vswitchID and private ip address -// -// You can read doc at https://www.alibabacloud.com/help/doc-detail/25504.htm -func (client *Client) ModifyInstanceVpcAttribute(args *ModifyInstanceVpcAttributeArgs) error { - response := ModifyInstanceVpcAttributeResponse{} - return client.Invoke("ModifyInstanceVpcAttribute", args, &response) -} - -type ModifyInstanceChargeTypeArgs struct { - InstanceIds string - RegionId common.Region - Period int - PeriodUnit common.TimeType - IncludeDataDisks bool - DryRun bool - AutoPay bool - ClientToken string -} - -type ModifyInstanceChargeTypeResponse struct { - common.Response - Order string -} - -//ModifyInstanceChargeType modify instance charge type -// -// You can read doc at https://www.alibabacloud.com/help/doc-detail/25504.htm -func (client *Client) ModifyInstanceChargeType(args *ModifyInstanceChargeTypeArgs) (*ModifyInstanceChargeTypeResponse, error) { - response := &ModifyInstanceChargeTypeResponse{} - if err := client.Invoke("ModifyInstanceChargeType", args, response); err != nil { - return response, err - } - return response, nil -} - -type RenewalStatus string - -const ( - RenewAutoRenewal = RenewalStatus("AutoRenewal") - RenewNormal = RenewalStatus("Normal") - RenewNotRenewal = RenewalStatus("NotRenewal") -) - -type ModifyInstanceAutoRenewAttributeArgs struct { - InstanceId string - RegionId common.Region - Duration int - AutoRenew bool - RenewalStatus RenewalStatus -} - -// You can read doc at https://www.alibabacloud.com/help/doc-detail/52843.htm -func (client *Client) ModifyInstanceAutoRenewAttribute(args *ModifyInstanceAutoRenewAttributeArgs) error { - response := &common.Response{} - return client.Invoke("ModifyInstanceAutoRenewAttribute", args, response) -} - -type DescribeInstanceAutoRenewAttributeArgs struct { - InstanceId string - RegionId common.Region -} - -type InstanceRenewAttribute struct { - InstanceId string - Duration int - AutoRenewEnabled bool - PeriodUnit string - RenewalStatus RenewalStatus -} - -type DescribeInstanceAutoRenewAttributeResponse struct { - common.Response - InstanceRenewAttributes struct { - InstanceRenewAttribute []InstanceRenewAttribute - } -} - -// You can read doc at https://www.alibabacloud.com/help/doc-detail/52844.htm -func (client *Client) DescribeInstanceAutoRenewAttribute(args *DescribeInstanceAutoRenewAttributeArgs) (*DescribeInstanceAutoRenewAttributeResponse, error) { - response := &DescribeInstanceAutoRenewAttributeResponse{} - err := client.Invoke("DescribeInstanceAutoRenewAttribute", args, response) - return response, err -} diff --git a/vendor/github.com/denverdino/aliyungo/ecs/monitoring.go b/vendor/github.com/denverdino/aliyungo/ecs/monitoring.go deleted file mode 100644 index 6123d28b7..000000000 --- a/vendor/github.com/denverdino/aliyungo/ecs/monitoring.go +++ /dev/null @@ -1,136 +0,0 @@ -package ecs - -import ( - "github.com/denverdino/aliyungo/common" - "github.com/denverdino/aliyungo/util" -) - -type DescribeInstanceMonitorDataArgs struct { - InstanceId string - StartTime util.ISO6801Time - EndTime util.ISO6801Time - Period int //Default 60s -} - -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/datatype&instancemonitordatatype -type InstanceMonitorDataType struct { - InstanceId string - CPU int - IntranetRX int - IntranetTX int - IntranetBandwidth int - InternetRX int - InternetTX int - InternetBandwidth int - IOPSRead int - IOPSWrite int - BPSRead int - BPSWrite int - TimeStamp util.ISO6801Time -} - -type DescribeInstanceMonitorDataResponse struct { - common.Response - MonitorData struct { - InstanceMonitorData []InstanceMonitorDataType - } -} - -// DescribeInstanceMonitorData describes instance monitoring data -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/monitor&describeinstancemonitordata -func (client *Client) DescribeInstanceMonitorData(args *DescribeInstanceMonitorDataArgs) (monitorData []InstanceMonitorDataType, err error) { - if args.Period == 0 { - args.Period = 60 - } - response := DescribeInstanceMonitorDataResponse{} - err = client.Invoke("DescribeInstanceMonitorData", args, &response) - if err != nil { - return nil, err - } - return response.MonitorData.InstanceMonitorData, err -} - -type DescribeEipMonitorDataArgs struct { - AllocationId string - StartTime util.ISO6801Time - EndTime util.ISO6801Time - Period int //Default 60s -} - -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/datatype&eipmonitordatatype -type EipMonitorDataType struct { - EipRX int - EipTX int - EipFlow int - EipBandwidth int - EipPackets int - TimeStamp util.ISO6801Time -} - -type DescribeEipMonitorDataResponse struct { - common.Response - EipMonitorDatas struct { - EipMonitorData []EipMonitorDataType - } -} - -// DescribeEipMonitorData describes EIP monitoring data -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/monitor&describeeipmonitordata -func (client *Client) DescribeEipMonitorData(args *DescribeEipMonitorDataArgs) (monitorData []EipMonitorDataType, err error) { - if args.Period == 0 { - args.Period = 60 - } - response := DescribeEipMonitorDataResponse{} - err = client.Invoke("DescribeEipMonitorData", args, &response) - if err != nil { - return nil, err - } - return response.EipMonitorDatas.EipMonitorData, err -} - -type DescribeDiskMonitorDataArgs struct { - DiskId string - StartTime util.ISO6801Time - EndTime util.ISO6801Time - Period int //Default 60s -} - -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/datatype&diskmonitordatatype -type DiskMonitorDataType struct { - DiskId string - IOPSRead int - IOPSWrite int - IOPSTotal int - BPSRead int - BPSWrite int - BPSTotal int - TimeStamp util.ISO6801Time -} - -type DescribeDiskMonitorDataResponse struct { - common.Response - TotalCount int - MonitorData struct { - DiskMonitorData []DiskMonitorDataType - } -} - -// DescribeDiskMonitorData describes disk monitoring data -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/monitor&describediskmonitordata -func (client *Client) DescribeDiskMonitorData(args *DescribeDiskMonitorDataArgs) (monitorData []DiskMonitorDataType, totalCount int, err error) { - if args.Period == 0 { - args.Period = 60 - } - response := DescribeDiskMonitorDataResponse{} - err = client.Invoke("DescribeDiskMonitorData", args, &response) - if err != nil { - return nil, 0, err - } - return response.MonitorData.DiskMonitorData, response.TotalCount, err -} diff --git a/vendor/github.com/denverdino/aliyungo/ecs/nat_gateway.go b/vendor/github.com/denverdino/aliyungo/ecs/nat_gateway.go deleted file mode 100644 index d104cf885..000000000 --- a/vendor/github.com/denverdino/aliyungo/ecs/nat_gateway.go +++ /dev/null @@ -1,223 +0,0 @@ -package ecs - -import ( - "github.com/denverdino/aliyungo/common" -) - -type BandwidthPackageType struct { - IpCount int - Bandwidth int - Zone string -} - -type CreateNatGatewayArgs struct { - RegionId common.Region - VpcId string - Spec string - BandwidthPackage []BandwidthPackageType - Name string - Description string - ClientToken string -} - -type ForwardTableIdType struct { - ForwardTableId []string -} - -type SnatTableIdType struct { - SnatTableId []string -} - -type IpListsType struct { - IpList []IpListItem -} - -type IpListItem struct { - IpAddress string - AllocationId string - UsingStatus string -} - -type BandwidthPackageIdType struct { - BandwidthPackageId []string -} - -type CreateNatGatewayResponse struct { - common.Response - NatGatewayId string - ForwardTableIds ForwardTableIdType - BandwidthPackageIds BandwidthPackageIdType -} - -// CreateNatGateway creates Virtual Private Cloud -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/vpc&createvpc -func (client *Client) CreateNatGateway(args *CreateNatGatewayArgs) (resp *CreateNatGatewayResponse, err error) { - response := CreateNatGatewayResponse{} - err = client.Invoke("CreateNatGateway", args, &response) - if err != nil { - return nil, err - } - return &response, err -} - -type NatGatewaySetType struct { - BusinessStatus string - Description string - BandwidthPackageIds BandwidthPackageIdType - ForwardTableIds ForwardTableIdType - SnatTableIds SnatTableIdType - IpLists IpListsType - InstanceChargeType string - Name string - NatGatewayId string - RegionId common.Region - Spec string - Status string - VpcId string -} - -type DescribeNatGatewayResponse struct { - common.Response - common.PaginationResult - NatGateways struct { - NatGateway []NatGatewaySetType - } -} - -type DescribeNatGatewaysArgs struct { - RegionId common.Region - NatGatewayId string - VpcId string - common.Pagination -} - -func (client *Client) DescribeNatGateways(args *DescribeNatGatewaysArgs) (natGateways []NatGatewaySetType, - pagination *common.PaginationResult, err error) { - response, err := client.DescribeNatGatewaysWithRaw(args) - if err == nil { - return response.NatGateways.NatGateway, &response.PaginationResult, nil - } - - return nil, nil, err -} - -func (client *Client) DescribeNatGatewaysWithRaw(args *DescribeNatGatewaysArgs) (response *DescribeNatGatewayResponse, err error) { - args.Validate() - response = &DescribeNatGatewayResponse{} - - err = client.Invoke("DescribeNatGateways", args, response) - - if err == nil { - return response, nil - } - - return nil, err -} - -type ModifyNatGatewayAttributeArgs struct { - RegionId common.Region - NatGatewayId string - Name string - Description string -} - -type ModifyNatGatewayAttributeResponse struct { - common.Response -} - -func (client *Client) ModifyNatGatewayAttribute(args *ModifyNatGatewayAttributeArgs) error { - response := ModifyNatGatewayAttributeResponse{} - return client.Invoke("ModifyNatGatewayAttribute", args, &response) -} - -type ModifyNatGatewaySpecArgs struct { - RegionId common.Region - NatGatewayId string - Spec NatGatewaySpec -} - -func (client *Client) ModifyNatGatewaySpec(args *ModifyNatGatewaySpecArgs) error { - response := ModifyNatGatewayAttributeResponse{} - return client.Invoke("ModifyNatGatewaySpec", args, &response) -} - -type DeleteNatGatewayArgs struct { - RegionId common.Region - NatGatewayId string -} - -type DeleteNatGatewayResponse struct { - common.Response -} - -func (client *Client) DeleteNatGateway(args *DeleteNatGatewayArgs) error { - response := DeleteNatGatewayResponse{} - err := client.Invoke("DeleteNatGateway", args, &response) - return err -} - -type DescribeBandwidthPackagesArgs struct { - RegionId common.Region - common.Pagination - BandwidthPackageId string - NatGatewayId string -} - -type PublicIpAddresseType struct { - AllocationId string - IpAddress string -} - -type DescribeBandwidthPackageType struct { - Bandwidth string - BandwidthPackageId string - IpCount string - PublicIpAddresses struct { - PublicIpAddresse []PublicIpAddresseType - } - - ZoneId string -} - -type DescribeBandwidthPackagesResponse struct { - common.Response - common.PaginationResult - BandwidthPackages struct { - BandwidthPackage []DescribeBandwidthPackageType - } -} - -func (client *Client) DescribeBandwidthPackages(args *DescribeBandwidthPackagesArgs) (*DescribeBandwidthPackagesResponse, error) { - response := &DescribeBandwidthPackagesResponse{} - - err := client.Invoke("DescribeBandwidthPackages", args, response) - if err != nil { - return nil, err - } - - return response, err -} - -type DeleteBandwidthPackageArgs struct { - RegionId common.Region - BandwidthPackageId string -} - -type DeleteBandwidthPackageResponse struct { - common.Response -} - -func (client *Client) DeleteBandwidthPackage(args *DeleteBandwidthPackageArgs) error { - response := DeleteBandwidthPackageResponse{} - err := client.Invoke("DeleteBandwidthPackage", args, &response) - return err -} - -type NatGatewaySpec string - -const ( - NatGatewaySmallSpec = NatGatewaySpec("Small") - NatGatewayMiddleSpec = NatGatewaySpec("Middle") - NatGatewayLargeSpec = NatGatewaySpec("Large") -) diff --git a/vendor/github.com/denverdino/aliyungo/ecs/networks.go b/vendor/github.com/denverdino/aliyungo/ecs/networks.go deleted file mode 100644 index eb6b0edaf..000000000 --- a/vendor/github.com/denverdino/aliyungo/ecs/networks.go +++ /dev/null @@ -1,287 +0,0 @@ -// API on Network - -package ecs - -import ( - "time" - - "github.com/denverdino/aliyungo/common" - "github.com/denverdino/aliyungo/util" -) - -type AllocatePublicIpAddressArgs struct { - InstanceId string -} - -type AllocatePublicIpAddressResponse struct { - common.Response - - IpAddress string -} - -// AllocatePublicIpAddress allocates Public Ip Address -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/network&allocatepublicipaddress -func (client *Client) AllocatePublicIpAddress(instanceId string) (ipAddress string, err error) { - args := AllocatePublicIpAddressArgs{ - InstanceId: instanceId, - } - response := AllocatePublicIpAddressResponse{} - err = client.Invoke("AllocatePublicIpAddress", &args, &response) - if err != nil { - return "", err - } - return response.IpAddress, nil -} - -type ModifyInstanceNetworkSpec struct { - InstanceId string - InternetMaxBandwidthOut *int - InternetMaxBandwidthIn *int - NetworkChargeType common.InternetChargeType -} - -type ModifyInstanceNetworkSpecResponse struct { - common.Response -} - -// ModifyInstanceNetworkSpec modifies instance network spec -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/network&modifyinstancenetworkspec -func (client *Client) ModifyInstanceNetworkSpec(args *ModifyInstanceNetworkSpec) error { - - response := ModifyInstanceNetworkSpecResponse{} - return client.Invoke("ModifyInstanceNetworkSpec", args, &response) -} - -type AllocateEipAddressArgs struct { - RegionId common.Region - Bandwidth int - InternetChargeType common.InternetChargeType - ISP string - ClientToken string -} - -type AllocateEipAddressResponse struct { - common.Response - EipAddress string - AllocationId string -} - -// AllocateEipAddress allocates Eip Address -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/network&allocateeipaddress -func (client *Client) AllocateEipAddress(args *AllocateEipAddressArgs) (EipAddress string, AllocationId string, err error) { - if args.Bandwidth == 0 { - args.Bandwidth = 5 - } - response := AllocateEipAddressResponse{} - err = client.Invoke("AllocateEipAddress", args, &response) - if err != nil { - return "", "", err - } - return response.EipAddress, response.AllocationId, nil -} - -type EipInstanceType string - -const ( - EcsInstance = "EcsInstance" - SlbInstance = "SlbInstance" - Nat = "Nat" - HaVip = "HaVip" -) - -type AssociateEipAddressArgs struct { - AllocationId string - InstanceId string - InstanceType EipInstanceType -} - -type AssociateEipAddressResponse struct { - common.Response -} - -// AssociateEipAddress associates EIP address to VM instance -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/network&associateeipaddress -func (client *Client) AssociateEipAddress(allocationId string, instanceId string) error { - args := AssociateEipAddressArgs{ - AllocationId: allocationId, - InstanceId: instanceId, - } - response := ModifyInstanceNetworkSpecResponse{} - return client.Invoke("AssociateEipAddress", &args, &response) -} - -func (client *Client) NewAssociateEipAddress(args *AssociateEipAddressArgs) error { - response := ModifyInstanceNetworkSpecResponse{} - return client.Invoke("AssociateEipAddress", args, &response) -} - -// Status of disks -type EipStatus string - -const ( - EipStatusAssociating = EipStatus("Associating") - EipStatusUnassociating = EipStatus("Unassociating") - EipStatusInUse = EipStatus("InUse") - EipStatusAvailable = EipStatus("Available") -) - -type AssociatedInstanceType string - -const ( - AssociatedInstanceTypeEcsInstance = AssociatedInstanceType("EcsInstance") - AssociatedInstanceTypeSlbInstance = AssociatedInstanceType("SlbInstance") - AssociatedInstanceTypeNat = AssociatedInstanceType("Nat") - AssociatedInstanceTypeHaVip = AssociatedInstanceType("HaVip") -) - -type DescribeEipAddressesArgs struct { - RegionId common.Region - Status EipStatus //enum Associating | Unassociating | InUse | Available - EipAddress string - AllocationId string - AssociatedInstanceType AssociatedInstanceType //enum EcsInstance | SlbInstance | Nat | HaVip - AssociatedInstanceId string //绑定的资源的Id。 这是一个过滤器性质的参数,若不指定,则表示不适用该条件对结果进行过滤。 如果要使用该过滤器,必须同时使用AssociatedInstanceType。若InstanceType为EcsInstance,则此处填写ECS实例Id。若InstanceType为SlbInstance,则此处填写VPC类型的私网SLB 的实例ID。若InstanceType为Nat,则此处填写NAT 的实例ID。。若InstanceType为HaVip,则此处填写HaVipId。 - common.Pagination -} - -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/datatype&eipaddresssettype -type EipAddressSetType struct { - RegionId common.Region - IpAddress string - AllocationId string - Status EipStatus - InstanceId string - InstanceType string - Bandwidth string // Why string - InternetChargeType common.InternetChargeType - OperationLocks OperationLocksType - AllocationTime util.ISO6801Time -} - -type DescribeEipAddressesResponse struct { - common.Response - common.PaginationResult - EipAddresses struct { - EipAddress []EipAddressSetType - } -} - -// DescribeInstanceStatus describes instance status -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/network&describeeipaddresses -func (client *Client) DescribeEipAddresses(args *DescribeEipAddressesArgs) (eipAddresses []EipAddressSetType, pagination *common.PaginationResult, err error) { - response, err := client.DescribeEipAddressesWithRaw(args) - if err == nil { - return response.EipAddresses.EipAddress, &response.PaginationResult, nil - } - - return nil, nil, err -} - -func (client *Client) DescribeEipAddressesWithRaw(args *DescribeEipAddressesArgs) (response *DescribeEipAddressesResponse, err error) { - args.Validate() - response = &DescribeEipAddressesResponse{} - - err = client.Invoke("DescribeEipAddresses", args, response) - - if err == nil { - return response, nil - } - - return nil, err -} - -type ModifyEipAddressAttributeArgs struct { - AllocationId string - Bandwidth int -} - -type ModifyEipAddressAttributeResponse struct { - common.Response -} - -// ModifyEipAddressAttribute Modifies EIP attribute -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/network&modifyeipaddressattribute -func (client *Client) ModifyEipAddressAttribute(allocationId string, bandwidth int) error { - args := ModifyEipAddressAttributeArgs{ - AllocationId: allocationId, - Bandwidth: bandwidth, - } - response := ModifyEipAddressAttributeResponse{} - return client.Invoke("ModifyEipAddressAttribute", &args, &response) -} - -type UnallocateEipAddressArgs struct { - AllocationId string - InstanceId string -} - -type UnallocateEipAddressResponse struct { - common.Response -} - -// UnassociateEipAddress unallocates Eip Address from instance -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/network&unassociateeipaddress -func (client *Client) UnassociateEipAddress(allocationId string, instanceId string) error { - args := UnallocateEipAddressArgs{ - AllocationId: allocationId, - InstanceId: instanceId, - } - response := UnallocateEipAddressResponse{} - return client.Invoke("UnassociateEipAddress", &args, &response) -} - -type ReleaseEipAddressArgs struct { - AllocationId string -} - -type ReleaseEipAddressResponse struct { - common.Response -} - -// ReleaseEipAddress releases Eip address -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/network&releaseeipaddress -func (client *Client) ReleaseEipAddress(allocationId string) error { - args := ReleaseEipAddressArgs{ - AllocationId: allocationId, - } - response := ReleaseEipAddressResponse{} - return client.Invoke("ReleaseEipAddress", &args, &response) -} - -// WaitForVSwitchAvailable waits for VSwitch to given status -func (client *Client) WaitForEip(regionId common.Region, allocationId string, status EipStatus, timeout int) error { - if timeout <= 0 { - timeout = DefaultTimeout - } - args := DescribeEipAddressesArgs{ - RegionId: regionId, - AllocationId: allocationId, - } - for { - eips, _, err := client.DescribeEipAddresses(&args) - if err != nil { - return err - } - if len(eips) == 0 { - return common.GetClientErrorFromString("Not found") - } - if eips[0].Status == status { - break - } - timeout = timeout - DefaultWaitForInterval - if timeout <= 0 { - return common.GetClientErrorFromString("Timeout") - } - time.Sleep(DefaultWaitForInterval * time.Second) - } - return nil -} diff --git a/vendor/github.com/denverdino/aliyungo/ecs/regions.go b/vendor/github.com/denverdino/aliyungo/ecs/regions.go deleted file mode 100644 index d8ed72e8d..000000000 --- a/vendor/github.com/denverdino/aliyungo/ecs/regions.go +++ /dev/null @@ -1,34 +0,0 @@ -package ecs - -import "github.com/denverdino/aliyungo/common" - -type DescribeRegionsArgs struct { -} - -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/datatype®iontype -type RegionType struct { - RegionId common.Region - LocalName string -} - -type DescribeRegionsResponse struct { - common.Response - Regions struct { - Region []RegionType - } -} - -// DescribeRegions describes regions -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/region&describeregions -func (client *Client) DescribeRegions() (regions []RegionType, err error) { - response := DescribeRegionsResponse{} - - err = client.Invoke("DescribeRegions", &DescribeRegionsArgs{}, &response) - - if err != nil { - return []RegionType{}, err - } - return response.Regions.Region, nil -} diff --git a/vendor/github.com/denverdino/aliyungo/ecs/route_tables.go b/vendor/github.com/denverdino/aliyungo/ecs/route_tables.go deleted file mode 100644 index 15d7c7b7d..000000000 --- a/vendor/github.com/denverdino/aliyungo/ecs/route_tables.go +++ /dev/null @@ -1,186 +0,0 @@ -package ecs - -import ( - "time" - - "github.com/denverdino/aliyungo/common" - "github.com/denverdino/aliyungo/util" -) - -type DescribeRouteTablesArgs struct { - VRouterId string - RouteTableId string - common.Pagination -} - -type RouteTableType string - -const ( - RouteTableSystem = RouteTableType("System") - RouteTableCustom = RouteTableType("Custom") -) - -type RouteEntryStatus string - -const ( - RouteEntryStatusPending = RouteEntryStatus("Pending") - RouteEntryStatusAvailable = RouteEntryStatus("Available") - RouteEntryStatusModifying = RouteEntryStatus("Modifying") -) - -type NextHopListType struct { - NextHopList struct { - NextHopItem []NextHopItemType - } -} - -type NextHopItemType struct { - NextHopType string - NextHopId string -} - -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/datatype&routeentrysettype -type RouteEntrySetType struct { - RouteTableId string - DestinationCidrBlock string - Type RouteTableType - NextHopType string - NextHopId string - NextHopList NextHopListType - InstanceId string - Status RouteEntryStatus // enum Pending | Available | Modifying -} - -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/datatype&routetablesettype -type RouteTableSetType struct { - VRouterId string - RouteTableId string - RouteEntrys struct { - RouteEntry []RouteEntrySetType - } - RouteTableType RouteTableType - CreationTime util.ISO6801Time -} - -type DescribeRouteTablesResponse struct { - common.Response - common.PaginationResult - RouteTables struct { - RouteTable []RouteTableSetType - } -} - -// DescribeRouteTables describes Virtual Routers -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/routertable&describeroutetables -func (client *Client) DescribeRouteTables(args *DescribeRouteTablesArgs) (routeTables []RouteTableSetType, pagination *common.PaginationResult, err error) { - response, err := client.DescribeRouteTablesWithRaw(args) - if err == nil { - return response.RouteTables.RouteTable, &response.PaginationResult, nil - } - - return nil, nil, err -} - -func (client *Client) DescribeRouteTablesWithRaw(args *DescribeRouteTablesArgs) (response *DescribeRouteTablesResponse, err error) { - args.Validate() - response = &DescribeRouteTablesResponse{} - - err = client.Invoke("DescribeRouteTables", args, &response) - - if err == nil { - return response, nil - } - - return nil, err -} - -type NextHopType string - -const ( - NextHopIntance = NextHopType("Instance") //Default - NextHopTunnel = NextHopType("Tunnel") - NextHopTunnelRouterInterface = NextHopType("RouterInterface") -) - -type CreateRouteEntryArgs struct { - RouteTableId string - DestinationCidrBlock string - NextHopType NextHopType - NextHopId string - ClientToken string -} - -type CreateRouteEntryResponse struct { - common.Response -} - -// CreateRouteEntry creates route entry -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/routertable&createrouteentry -func (client *Client) CreateRouteEntry(args *CreateRouteEntryArgs) error { - response := CreateRouteEntryResponse{} - return client.Invoke("CreateRouteEntry", args, &response) -} - -type DeleteRouteEntryArgs struct { - RouteTableId string - DestinationCidrBlock string - NextHopId string -} - -type DeleteRouteEntryResponse struct { - common.Response -} - -// DeleteRouteEntry deletes route entry -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/routertable&deleterouteentry -func (client *Client) DeleteRouteEntry(args *DeleteRouteEntryArgs) error { - response := DeleteRouteEntryResponse{} - return client.Invoke("DeleteRouteEntry", args, &response) -} - -// WaitForAllRouteEntriesAvailable waits for all route entries to Available status -func (client *Client) WaitForAllRouteEntriesAvailable(vrouterId string, routeTableId string, timeout int) error { - if timeout <= 0 { - timeout = DefaultTimeout - } - args := DescribeRouteTablesArgs{ - VRouterId: vrouterId, - RouteTableId: routeTableId, - } - for { - - routeTables, _, err := client.DescribeRouteTables(&args) - - if err != nil { - return err - } - if len(routeTables) == 0 { - return common.GetClientErrorFromString("Not found") - } - success := true - - loop: - for _, routeTable := range routeTables { - for _, routeEntry := range routeTable.RouteEntrys.RouteEntry { - if routeEntry.Status != RouteEntryStatusAvailable { - success = false - break loop - } - } - } - if success { - break - } - timeout = timeout - DefaultWaitForInterval - if timeout <= 0 { - return common.GetClientErrorFromString("Timeout") - } - time.Sleep(DefaultWaitForInterval * time.Second) - } - return nil -} diff --git a/vendor/github.com/denverdino/aliyungo/ecs/router_interface.go b/vendor/github.com/denverdino/aliyungo/ecs/router_interface.go deleted file mode 100644 index 188bac89a..000000000 --- a/vendor/github.com/denverdino/aliyungo/ecs/router_interface.go +++ /dev/null @@ -1,257 +0,0 @@ -package ecs - -import ( - "time" - - "github.com/denverdino/aliyungo/common" -) - -type EcsCommonResponse struct { - common.Response -} -type RouterType string -type InterfaceStatus string -type Role string -type Spec string - -const ( - VRouter = RouterType("VRouter") - VBR = RouterType("VBR") - - Idl = InterfaceStatus("Idl") - Active = InterfaceStatus("Active") - Inactive = InterfaceStatus("Inactive") - // 'Idle' means the router interface is not connected. 'Idl' may be a incorrect status. - Idle = InterfaceStatus("Idle") - - InitiatingSide = Role("InitiatingSide") - AcceptingSide = Role("AcceptingSide") - - Small1 = Spec("Small.1") - Small2 = Spec("Small.2") - Small5 = Spec("Small.5") - Middle1 = Spec("Middle.1") - Middle2 = Spec("Middle.2") - Middle5 = Spec("Middle.5") - Large1 = Spec("Large.1") - Large2 = Spec("Large.2") -) - -type CreateRouterInterfaceArgs struct { - RegionId common.Region - OppositeRegionId common.Region - RouterType RouterType - OppositeRouterType RouterType - RouterId string - OppositeRouterId string - Role Role - Spec Spec - AccessPointId string - OppositeAccessPointId string - OppositeInterfaceId string - OppositeInterfaceOwnerId string - Name string - Description string - HealthCheckSourceIp string - HealthCheckTargetIp string -} - -type CreateRouterInterfaceResponse struct { - common.Response - RouterInterfaceId string -} - -// CreateRouterInterface create Router interface -// -// You can read doc at https://help.aliyun.com/document_detail/36032.html?spm=5176.product27706.6.664.EbBsxC -func (client *Client) CreateRouterInterface(args *CreateRouterInterfaceArgs) (response *CreateRouterInterfaceResponse, err error) { - response = &CreateRouterInterfaceResponse{} - err = client.Invoke("CreateRouterInterface", args, &response) - if err != nil { - return response, err - } - return response, nil -} - -type Filter struct { - Key string - Value []string -} - -type DescribeRouterInterfacesArgs struct { - RegionId common.Region - common.Pagination - Filter []Filter -} - -type RouterInterfaceItemType struct { - ChargeType string - RouterInterfaceId string - AccessPointId string - OppositeRegionId string - OppositeAccessPointId string - Role Role - Spec Spec - Name string - Description string - RouterId string - RouterType RouterType - CreationTime string - Status string - BusinessStatus string - ConnectedTime string - OppositeInterfaceId string - OppositeInterfaceSpec string - OppositeInterfaceStatus string - OppositeInterfaceBusinessStatus string - OppositeRouterId string - OppositeRouterType RouterType - OppositeInterfaceOwnerId string - HealthCheckSourceIp string - HealthCheckTargetIp string -} - -type DescribeRouterInterfacesResponse struct { - RouterInterfaceSet struct { - RouterInterfaceType []RouterInterfaceItemType - } - common.PaginationResult -} - -// DescribeRouterInterfaces describe Router interfaces -// -// You can read doc at https://help.aliyun.com/document_detail/36032.html?spm=5176.product27706.6.664.EbBsxC -func (client *Client) DescribeRouterInterfaces(args *DescribeRouterInterfacesArgs) (response *DescribeRouterInterfacesResponse, err error) { - response = &DescribeRouterInterfacesResponse{} - err = client.Invoke("DescribeRouterInterfaces", args, &response) - if err != nil { - return response, err - } - return response, nil -} - -type OperateRouterInterfaceArgs struct { - RegionId common.Region - RouterInterfaceId string -} - -// ConnectRouterInterface -// -// You can read doc at https://help.aliyun.com/document_detail/36031.html?spm=5176.doc36035.6.666.wkyljN -func (client *Client) ConnectRouterInterface(args *OperateRouterInterfaceArgs) (response *EcsCommonResponse, err error) { - response = &EcsCommonResponse{} - err = client.Invoke("ConnectRouterInterface", args, &response) - if err != nil { - return response, err - } - return response, nil -} - -// ActivateRouterInterface active Router Interface -// -// You can read doc at https://help.aliyun.com/document_detail/36030.html?spm=5176.doc36031.6.667.DAuZLD -func (client *Client) ActivateRouterInterface(args *OperateRouterInterfaceArgs) (response *EcsCommonResponse, err error) { - response = &EcsCommonResponse{} - err = client.Invoke("ActivateRouterInterface", args, &response) - if err != nil { - return response, err - } - return response, nil -} - -// DeactivateRouterInterface deactivate Router Interface -// -// You can read doc at https://help.aliyun.com/document_detail/36033.html?spm=5176.doc36030.6.668.JqCWUz -func (client *Client) DeactivateRouterInterface(args *OperateRouterInterfaceArgs) (response *EcsCommonResponse, err error) { - response = &EcsCommonResponse{} - err = client.Invoke("DeactivateRouterInterface", args, &response) - if err != nil { - return response, err - } - return response, nil -} - -type ModifyRouterInterfaceSpecArgs struct { - RegionId common.Region - RouterInterfaceId string - Spec Spec -} - -type ModifyRouterInterfaceSpecResponse struct { - common.Response - Spec Spec -} - -// ModifyRouterInterfaceSpec -// -// You can read doc at https://help.aliyun.com/document_detail/36037.html?spm=5176.doc36036.6.669.McKiye -func (client *Client) ModifyRouterInterfaceSpec(args *ModifyRouterInterfaceSpecArgs) (response *ModifyRouterInterfaceSpecResponse, err error) { - response = &ModifyRouterInterfaceSpecResponse{} - err = client.Invoke("ModifyRouterInterfaceSpec", args, &response) - if err != nil { - return response, err - } - return response, nil -} - -type ModifyRouterInterfaceAttributeArgs struct { - RegionId common.Region - RouterInterfaceId string - Name string - Description string - OppositeInterfaceId string - OppositeRouterId string - OppositeInterfaceOwnerId string - HealthCheckSourceIp string - HealthCheckTargetIp string -} - -// ModifyRouterInterfaceAttribute -// -// You can read doc at https://help.aliyun.com/document_detail/36036.html?spm=5176.doc36037.6.670.Dcz3xS -func (client *Client) ModifyRouterInterfaceAttribute(args *ModifyRouterInterfaceAttributeArgs) (response *EcsCommonResponse, err error) { - response = &EcsCommonResponse{} - err = client.Invoke("ModifyRouterInterfaceAttribute", args, &response) - if err != nil { - return response, err - } - return response, nil -} - -// DeleteRouterInterface delete Router Interface -// -// You can read doc at https://help.aliyun.com/document_detail/36034.html?spm=5176.doc36036.6.671.y2xpNt -func (client *Client) DeleteRouterInterface(args *OperateRouterInterfaceArgs) (response *EcsCommonResponse, err error) { - response = &EcsCommonResponse{} - err = client.Invoke("DeleteRouterInterface", args, &response) - if err != nil { - return response, err - } - return response, nil -} - -// WaitForRouterInterface waits for router interface to given status -func (client *Client) WaitForRouterInterfaceAsyn(regionId common.Region, interfaceId string, status InterfaceStatus, timeout int) error { - if timeout <= 0 { - timeout = InstanceDefaultTimeout - } - for { - interfaces, err := client.DescribeRouterInterfaces(&DescribeRouterInterfacesArgs{ - RegionId: regionId, - Filter: []Filter{Filter{Key: "RouterInterfaceId", Value: []string{interfaceId}}}, - }) - if err != nil { - return err - } else if interfaces != nil && InterfaceStatus(interfaces.RouterInterfaceSet.RouterInterfaceType[0].Status) == status { - //TODO - break - } - timeout = timeout - DefaultWaitForInterval - if timeout <= 0 { - return common.GetClientErrorFromString("Timeout") - } - time.Sleep(DefaultWaitForInterval * time.Second) - - } - return nil -} diff --git a/vendor/github.com/denverdino/aliyungo/ecs/security_groups.go b/vendor/github.com/denverdino/aliyungo/ecs/security_groups.go deleted file mode 100644 index dbe854349..000000000 --- a/vendor/github.com/denverdino/aliyungo/ecs/security_groups.go +++ /dev/null @@ -1,310 +0,0 @@ -package ecs - -import ( - "github.com/denverdino/aliyungo/common" - "github.com/denverdino/aliyungo/util" -) - -type NicType string -type Direction string - -const ( - NicTypeInternet = NicType("internet") - NicTypeIntranet = NicType("intranet") - - DirectionIngress = Direction("ingress") - DirectionEgress = Direction("egress") - DirectionAll = Direction("all") -) - -type IpProtocol string - -const ( - IpProtocolAll = IpProtocol("all") - IpProtocolTCP = IpProtocol("tcp") - IpProtocolUDP = IpProtocol("udp") - IpProtocolICMP = IpProtocol("icmp") - IpProtocolGRE = IpProtocol("gre") -) - -type PermissionPolicy string - -const ( - PermissionPolicyAccept = PermissionPolicy("accept") - PermissionPolicyDrop = PermissionPolicy("drop") -) - -type GroupInnerAccessPolicy string - -const ( - GroupInnerAccept = GroupInnerAccessPolicy("Accept") - GroupInnerDrop = GroupInnerAccessPolicy("Drop") -) - -type DescribeSecurityGroupAttributeArgs struct { - SecurityGroupId string - RegionId common.Region - NicType NicType //enum for internet (default) |intranet - Direction Direction // enum ingress egress -} - -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/datatype&permissiontype -type PermissionType struct { - IpProtocol IpProtocol - PortRange string - SourceCidrIp string - SourceGroupId string - SourceGroupOwnerAccount string - DestCidrIp string - DestGroupId string - DestGroupOwnerAccount string - Policy PermissionPolicy - NicType NicType - Priority int - Direction string - Description string -} - -type DescribeSecurityGroupAttributeResponse struct { - common.Response - - SecurityGroupId string - SecurityGroupName string - RegionId common.Region - Description string - Permissions struct { - Permission []PermissionType - } - VpcId string - InnerAccessPolicy GroupInnerAccessPolicy -} - -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/securitygroup&describesecuritygroupattribute -func (client *Client) DescribeSecurityGroupAttribute(args *DescribeSecurityGroupAttributeArgs) (response *DescribeSecurityGroupAttributeResponse, err error) { - response = &DescribeSecurityGroupAttributeResponse{} - err = client.Invoke("DescribeSecurityGroupAttribute", args, response) - if err != nil { - return nil, err - } - return response, nil -} - -type DescribeSecurityGroupsArgs struct { - RegionId common.Region - VpcId string - common.Pagination -} - -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/datatype&securitygroupitemtype -type SecurityGroupItemType struct { - SecurityGroupId string - SecurityGroupName string - Description string - VpcId string - CreationTime util.ISO6801Time -} - -type DescribeSecurityGroupsResponse struct { - common.Response - common.PaginationResult - - RegionId common.Region - SecurityGroups struct { - SecurityGroup []SecurityGroupItemType - } -} - -// DescribeSecurityGroups describes security groups -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/securitygroup&describesecuritygroups -func (client *Client) DescribeSecurityGroups(args *DescribeSecurityGroupsArgs) (securityGroupItems []SecurityGroupItemType, pagination *common.PaginationResult, err error) { - response, err := client.DescribeSecurityGroupsWithRaw(args) - if err != nil { - return nil, nil, err - } - - return response.SecurityGroups.SecurityGroup, &response.PaginationResult, nil -} - -func (client *Client) DescribeSecurityGroupsWithRaw(args *DescribeSecurityGroupsArgs) (response *DescribeSecurityGroupsResponse, err error) { - args.Validate() - response = &DescribeSecurityGroupsResponse{} - - err = client.Invoke("DescribeSecurityGroups", args, response) - - if err != nil { - return nil, err - } - - return response, nil -} - -type CreateSecurityGroupArgs struct { - RegionId common.Region - SecurityGroupName string - Description string - VpcId string - ClientToken string -} - -type CreateSecurityGroupResponse struct { - common.Response - - SecurityGroupId string -} - -// CreateSecurityGroup creates security group -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/securitygroup&createsecuritygroup -func (client *Client) CreateSecurityGroup(args *CreateSecurityGroupArgs) (securityGroupId string, err error) { - response := CreateSecurityGroupResponse{} - err = client.Invoke("CreateSecurityGroup", args, &response) - if err != nil { - return "", err - } - return response.SecurityGroupId, err -} - -type DeleteSecurityGroupArgs struct { - RegionId common.Region - SecurityGroupId string -} - -type DeleteSecurityGroupResponse struct { - common.Response -} - -// DeleteSecurityGroup deletes security group -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/securitygroup&deletesecuritygroup -func (client *Client) DeleteSecurityGroup(regionId common.Region, securityGroupId string) error { - args := DeleteSecurityGroupArgs{ - RegionId: regionId, - SecurityGroupId: securityGroupId, - } - response := DeleteSecurityGroupResponse{} - err := client.Invoke("DeleteSecurityGroup", &args, &response) - return err -} - -type ModifySecurityGroupAttributeArgs struct { - RegionId common.Region - SecurityGroupId string - SecurityGroupName string - Description string -} - -type ModifySecurityGroupAttributeResponse struct { - common.Response -} - -// ModifySecurityGroupAttribute modifies attribute of security group -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/securitygroup&modifysecuritygroupattribute -func (client *Client) ModifySecurityGroupAttribute(args *ModifySecurityGroupAttributeArgs) error { - response := ModifySecurityGroupAttributeResponse{} - err := client.Invoke("ModifySecurityGroupAttribute", args, &response) - return err -} - -type ModifySecurityGroupPolicyArgs struct { - RegionId common.Region - SecurityGroupId string - InnerAccessPolicy GroupInnerAccessPolicy -} - -// ModifySecurityGroupPolicy modifies inner access policy of security group -// -// You can read doc at https://www.alibabacloud.com/help/doc-detail/57315.htm -func (client *Client) ModifySecurityGroupPolicy(args *ModifySecurityGroupPolicyArgs) error { - response := common.Response{} - err := client.Invoke("ModifySecurityGroupPolicy", args, &response) - return err -} - -type AuthorizeSecurityGroupArgs struct { - SecurityGroupId string - RegionId common.Region - IpProtocol IpProtocol - PortRange string - SourceGroupId string - SourceGroupOwnerAccount string - SourceGroupOwnerID string - SourceCidrIp string // IPv4 only, default 0.0.0.0/0 - Policy PermissionPolicy // enum of accept (default) | drop - Priority int // 1 - 100, default 1 - NicType NicType // enum of internet | intranet (default) -} - -type AuthorizeSecurityGroupResponse struct { - common.Response -} - -// AuthorizeSecurityGroup authorize permissions to security group -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/securitygroup&authorizesecuritygroup -func (client *Client) AuthorizeSecurityGroup(args *AuthorizeSecurityGroupArgs) error { - response := AuthorizeSecurityGroupResponse{} - err := client.Invoke("AuthorizeSecurityGroup", args, &response) - return err -} - -type RevokeSecurityGroupArgs struct { - AuthorizeSecurityGroupArgs -} - -type RevokeSecurityGroupResponse struct { - common.Response -} - -// You can read doc at https://help.aliyun.com/document_detail/25557.html?spm=5176.doc25554.6.755.O6Tjz0 -func (client *Client) RevokeSecurityGroup(args *RevokeSecurityGroupArgs) error { - response := RevokeSecurityGroupResponse{} - err := client.Invoke("RevokeSecurityGroup", args, &response) - return err -} - -type AuthorizeSecurityGroupEgressArgs struct { - SecurityGroupId string - RegionId common.Region - IpProtocol IpProtocol - PortRange string - DestGroupId string - DestGroupOwnerAccount string - DestGroupOwnerId string - DestCidrIp string // IPv4 only, default 0.0.0.0/0 - Policy PermissionPolicy // enum of accept (default) | drop - Priority int // 1 - 100, default 1 - NicType NicType // enum of internet | intranet (default) -} - -type AuthorizeSecurityGroupEgressResponse struct { - common.Response -} - -// AuthorizeSecurityGroup authorize permissions to security group -// -// You can read doc at https://help.aliyun.com/document_detail/25560.html -func (client *Client) AuthorizeSecurityGroupEgress(args *AuthorizeSecurityGroupEgressArgs) error { - response := AuthorizeSecurityGroupEgressResponse{} - err := client.Invoke("AuthorizeSecurityGroupEgress", args, &response) - return err -} - -type RevokeSecurityGroupEgressArgs struct { - AuthorizeSecurityGroupEgressArgs -} - -type RevokeSecurityGroupEgressResponse struct { - common.Response -} - -// You can read doc at https://help.aliyun.com/document_detail/25561.html?spm=5176.doc25557.6.759.qcR4Az -func (client *Client) RevokeSecurityGroupEgress(args *RevokeSecurityGroupEgressArgs) error { - response := RevokeSecurityGroupEgressResponse{} - err := client.Invoke("RevokeSecurityGroupEgress", args, &response) - return err -} diff --git a/vendor/github.com/denverdino/aliyungo/ecs/snapshots.go b/vendor/github.com/denverdino/aliyungo/ecs/snapshots.go deleted file mode 100644 index 0b7cbe87b..000000000 --- a/vendor/github.com/denverdino/aliyungo/ecs/snapshots.go +++ /dev/null @@ -1,142 +0,0 @@ -package ecs - -import ( - "time" - - "github.com/denverdino/aliyungo/common" - "github.com/denverdino/aliyungo/util" -) - -type DescribeSnapshotsArgs struct { - RegionId common.Region - InstanceId string - DiskId string - SnapshotIds []string //["s-xxxxxxxxx", "s-yyyyyyyyy", ..."s-zzzzzzzzz"] - common.Pagination -} - -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/datatype&snapshottype -type SnapshotType struct { - SnapshotId string - SnapshotName string - Description string - Progress string - SourceDiskId string - SourceDiskSize int - SourceDiskType string //enum for System | Data - ProductCode string - Status string - Usage string - CreationTime util.ISO6801Time -} - -type DescribeSnapshotsResponse struct { - common.Response - common.PaginationResult - Snapshots struct { - Snapshot []SnapshotType - } -} - -// DescribeSnapshots describe snapshots -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/snapshot&describesnapshots -func (client *Client) DescribeSnapshots(args *DescribeSnapshotsArgs) (snapshots []SnapshotType, pagination *common.PaginationResult, err error) { - response, err := client.DescribeSnapshotsWithRaw(args) - if err != nil { - return nil, nil, err - } - return response.Snapshots.Snapshot, &response.PaginationResult, nil - -} - -func (client *Client) DescribeSnapshotsWithRaw(args *DescribeSnapshotsArgs) (response *DescribeSnapshotsResponse, err error) { - args.Validate() - response = &DescribeSnapshotsResponse{} - - err = client.Invoke("DescribeSnapshots", args, response) - - if err != nil { - return nil, err - } - return response, nil - -} - -type DeleteSnapshotArgs struct { - SnapshotId string -} - -type DeleteSnapshotResponse struct { - common.Response -} - -// DeleteSnapshot deletes snapshot -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/snapshot&deletesnapshot -func (client *Client) DeleteSnapshot(snapshotId string) error { - args := DeleteSnapshotArgs{SnapshotId: snapshotId} - response := DeleteSnapshotResponse{} - - return client.Invoke("DeleteSnapshot", &args, &response) -} - -type CreateSnapshotArgs struct { - DiskId string - SnapshotName string - Description string - ClientToken string -} - -type CreateSnapshotResponse struct { - common.Response - SnapshotId string -} - -// CreateSnapshot creates a new snapshot -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/snapshot&createsnapshot -func (client *Client) CreateSnapshot(args *CreateSnapshotArgs) (snapshotId string, err error) { - - response := CreateSnapshotResponse{} - - err = client.Invoke("CreateSnapshot", args, &response) - if err == nil { - snapshotId = response.SnapshotId - } - return snapshotId, err -} - -// Default timeout value for WaitForSnapShotReady method -const SnapshotDefaultTimeout = 120 - -// WaitForSnapShotReady waits for snapshot ready -func (client *Client) WaitForSnapShotReady(regionId common.Region, snapshotId string, timeout int) error { - if timeout <= 0 { - timeout = SnapshotDefaultTimeout - } - for { - args := DescribeSnapshotsArgs{ - RegionId: regionId, - SnapshotIds: []string{snapshotId}, - } - - snapshots, _, err := client.DescribeSnapshots(&args) - if err != nil { - return err - } - if snapshots == nil || len(snapshots) == 0 { - return common.GetClientErrorFromString("Not found") - } - if snapshots[0].Progress == "100%" { - break - } - timeout = timeout - DefaultWaitForInterval - if timeout <= 0 { - return common.GetClientErrorFromString("Timeout") - } - time.Sleep(DefaultWaitForInterval * time.Second) - } - return nil -} diff --git a/vendor/github.com/denverdino/aliyungo/ecs/snat_entry.go b/vendor/github.com/denverdino/aliyungo/ecs/snat_entry.go deleted file mode 100644 index c2e20df85..000000000 --- a/vendor/github.com/denverdino/aliyungo/ecs/snat_entry.go +++ /dev/null @@ -1,103 +0,0 @@ -package ecs - -import "github.com/denverdino/aliyungo/common" - -type CreateSnatEntryArgs struct { - RegionId common.Region - SnatTableId string - SourceVSwitchId string - SnatIp string -} - -type CreateSnatEntryResponse struct { - common.Response - SnatEntryId string -} - -type SnatEntrySetType struct { - RegionId common.Region - SnatEntryId string - SnatIp string - SnatTableId string - SourceCIDR string - SourceVSwitchId string - Status string -} - -type DescribeSnatTableEntriesArgs struct { - RegionId common.Region - SnatTableId string - common.Pagination -} - -type DescribeSnatTableEntriesResponse struct { - common.Response - common.PaginationResult - SnatTableEntries struct { - SnatTableEntry []SnatEntrySetType - } -} - -type ModifySnatEntryArgs struct { - RegionId common.Region - SnatTableId string - SnatEntryId string - SnatIp string -} - -type ModifySnatEntryResponse struct { - common.Response -} - -type DeleteSnatEntryArgs struct { - RegionId common.Region - SnatTableId string - SnatEntryId string -} - -type DeleteSnatEntryResponse struct { - common.Response -} - -func (client *Client) CreateSnatEntry(args *CreateSnatEntryArgs) (resp *CreateSnatEntryResponse, err error) { - response := CreateSnatEntryResponse{} - err = client.Invoke("CreateSnatEntry", args, &response) - if err != nil { - return nil, err - } - return &response, err -} - -func (client *Client) DescribeSnatTableEntries(args *DescribeSnatTableEntriesArgs) (snatTableEntries []SnatEntrySetType, - pagination *common.PaginationResult, err error) { - response, err := client.DescribeSnatTableEntriesWithRaw(args) - if err != nil { - return nil, nil, err - } - - return response.SnatTableEntries.SnatTableEntry, &response.PaginationResult, nil -} - -func (client *Client) DescribeSnatTableEntriesWithRaw(args *DescribeSnatTableEntriesArgs) (response *DescribeSnatTableEntriesResponse, err error) { - args.Validate() - response = &DescribeSnatTableEntriesResponse{} - - err = client.Invoke("DescribeSnatTableEntries", args, response) - - if err != nil { - return nil, err - } - - return response, nil -} - -func (client *Client) ModifySnatEntry(args *ModifySnatEntryArgs) error { - response := ModifySnatEntryResponse{} - return client.Invoke("ModifySnatEntry", args, &response) -} - -func (client *Client) DeleteSnatEntry(args *DeleteSnatEntryArgs) error { - response := DeleteSnatEntryResponse{} - err := client.Invoke("DeleteSnatEntry", args, &response) - return err -} diff --git a/vendor/github.com/denverdino/aliyungo/ecs/ssh_key_pair.go b/vendor/github.com/denverdino/aliyungo/ecs/ssh_key_pair.go deleted file mode 100644 index 9a0ad2e57..000000000 --- a/vendor/github.com/denverdino/aliyungo/ecs/ssh_key_pair.go +++ /dev/null @@ -1,151 +0,0 @@ -package ecs - -import ( - "github.com/denverdino/aliyungo/common" -) - -type CreateKeyPairArgs struct { - RegionId common.Region - KeyPairName string -} - -type CreateKeyPairResponse struct { - common.Response - KeyPairName string - KeyPairFingerPrint string - PrivateKeyBody string -} - -// CreateKeyPair creates keypair -// -// You can read doc at https://help.aliyun.com/document_detail/51771.html?spm=5176.doc51775.6.910.cedjfr -func (client *Client) CreateKeyPair(args *CreateKeyPairArgs) (resp *CreateKeyPairResponse, err error) { - response := CreateKeyPairResponse{} - err = client.Invoke("CreateKeyPair", args, &response) - if err != nil { - return nil, err - } - return &response, err -} - -type ImportKeyPairArgs struct { - RegionId common.Region - PublicKeyBody string - KeyPairName string -} - -type ImportKeyPairResponse struct { - common.Response - KeyPairName string - KeyPairFingerPrint string -} - -// ImportKeyPair import keypair -// -// You can read doc at https://help.aliyun.com/document_detail/51774.html?spm=5176.doc51771.6.911.BicQq2 -func (client *Client) ImportKeyPair(args *ImportKeyPairArgs) (resp *ImportKeyPairResponse, err error) { - response := ImportKeyPairResponse{} - err = client.Invoke("ImportKeyPair", args, &response) - if err != nil { - return nil, err - } - return &response, err -} - -type DescribeKeyPairsArgs struct { - RegionId common.Region - KeyPairFingerPrint string - KeyPairName string - common.Pagination -} - -type KeyPairItemType struct { - KeyPairName string - KeyPairFingerPrint string -} - -type DescribeKeyPairsResponse struct { - common.Response - common.PaginationResult - RegionId common.Region - KeyPairs struct { - KeyPair []KeyPairItemType - } -} - -// DescribeKeyPairs describe keypairs -// -// You can read doc at https://help.aliyun.com/document_detail/51773.html?spm=5176.doc51774.6.912.lyE0iX -func (client *Client) DescribeKeyPairs(args *DescribeKeyPairsArgs) (KeyPairs []KeyPairItemType, pagination *common.PaginationResult, err error) { - response, err := client.DescribeKeyPairsWithRaw(args) - if err != nil { - return nil, nil, err - } - - return response.KeyPairs.KeyPair, &response.PaginationResult, err -} - -func (client *Client) DescribeKeyPairsWithRaw(args *DescribeKeyPairsArgs) (response *DescribeKeyPairsResponse, err error) { - response = &DescribeKeyPairsResponse{} - - err = client.Invoke("DescribeKeyPairs", args, response) - - if err != nil { - return nil, err - } - - return response, err -} - -type AttachKeyPairArgs struct { - RegionId common.Region - KeyPairName string - InstanceIds string -} - -// AttachKeyPair keypars to instances -// -// You can read doc at https://help.aliyun.com/document_detail/51775.html?spm=5176.doc51773.6.913.igEem4 -func (client *Client) AttachKeyPair(args *AttachKeyPairArgs) (err error) { - response := common.Response{} - err = client.Invoke("AttachKeyPair", args, &response) - if err != nil { - return err - } - return nil -} - -type DetachKeyPairArgs struct { - RegionId common.Region - KeyPairName string - InstanceIds string -} - -// DetachKeyPair keyparis from instances -// -// You can read doc at https://help.aliyun.com/document_detail/51776.html?spm=5176.doc51775.6.914.DJ7Gmq -func (client *Client) DetachKeyPair(args *DetachKeyPairArgs) (err error) { - response := common.Response{} - err = client.Invoke("DetachKeyPair", args, &response) - if err != nil { - return err - } - return nil -} - -type DeleteKeyPairsArgs struct { - RegionId common.Region - KeyPairNames string -} - -// DeleteKeyPairs delete keypairs -// -// You can read doc at https://help.aliyun.com/document_detail/51772.html?spm=5176.doc51776.6.915.Qqcv2Q -func (client *Client) DeleteKeyPairs(args *DeleteKeyPairsArgs) (err error) { - response := common.Response{} - err = client.Invoke("DeleteKeyPairs", args, &response) - if err != nil { - return err - } - return nil -} diff --git a/vendor/github.com/denverdino/aliyungo/ecs/tags.go b/vendor/github.com/denverdino/aliyungo/ecs/tags.go deleted file mode 100644 index fb2519a1d..000000000 --- a/vendor/github.com/denverdino/aliyungo/ecs/tags.go +++ /dev/null @@ -1,128 +0,0 @@ -package ecs - -import "github.com/denverdino/aliyungo/common" - -type TagResourceType string - -const ( - TagResourceImage = TagResourceType("image") - TagResourceInstance = TagResourceType("instance") - TagResourceSnapshot = TagResourceType("snapshot") - TagResourceDisk = TagResourceType("disk") -) - -type AddTagsArgs struct { - ResourceId string - ResourceType TagResourceType //image, instance, snapshot or disk - RegionId common.Region - Tag map[string]string -} - -type AddTagsResponse struct { - common.Response -} - -// AddTags Add tags to resource -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/tags&addtags -func (client *Client) AddTags(args *AddTagsArgs) error { - response := AddTagsResponse{} - err := client.Invoke("AddTags", args, &response) - return err -} - -type RemoveTagsArgs struct { - ResourceId string - ResourceType TagResourceType //image, instance, snapshot or disk - RegionId common.Region - Tag map[string]string -} - -type RemoveTagsResponse struct { - common.Response -} - -// RemoveTags remove tags to resource -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/tags&removetags -func (client *Client) RemoveTags(args *RemoveTagsArgs) error { - response := RemoveTagsResponse{} - err := client.Invoke("RemoveTags", args, &response) - return err -} - -type ResourceItemType struct { - ResourceId string - ResourceType TagResourceType - RegionId common.Region -} - -type DescribeResourceByTagsArgs struct { - ResourceType TagResourceType //image, instance, snapshot or disk - RegionId common.Region - Tag map[string]string - common.Pagination -} - -type DescribeResourceByTagsResponse struct { - common.Response - common.PaginationResult - Resources struct { - Resource []ResourceItemType - } -} - -// DescribeResourceByTags describe resource by tags -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/tags&describeresourcebytags -func (client *Client) DescribeResourceByTags(args *DescribeResourceByTagsArgs) (resources []ResourceItemType, pagination *common.PaginationResult, err error) { - response, err := client.DescribeResourceByTagsWithRaw(args) - if err != nil { - return nil, nil, err - } - return response.Resources.Resource, &response.PaginationResult, nil -} - -func (client *Client) DescribeResourceByTagsWithRaw(args *DescribeResourceByTagsArgs) (response *DescribeResourceByTagsResponse, err error) { - args.Validate() - response = &DescribeResourceByTagsResponse{} - err = client.Invoke("DescribeResourceByTags", args, response) - if err != nil { - return nil, err - } - return response, nil -} - -type TagItemType struct { - TagKey string - TagValue string -} - -type DescribeTagsArgs struct { - RegionId common.Region - ResourceType TagResourceType //image, instance, snapshot or disk - ResourceId string - Tag map[string]string - common.Pagination -} - -type DescribeTagsResponse struct { - common.Response - common.PaginationResult - Tags struct { - Tag []TagItemType - } -} - -// DescribeResourceByTags describe resource by tags -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/tags&describeresourcebytags -func (client *Client) DescribeTags(args *DescribeTagsArgs) (tags []TagItemType, pagination *common.PaginationResult, err error) { - args.Validate() - response := DescribeTagsResponse{} - err = client.Invoke("DescribeTags", args, &response) - if err != nil { - return nil, nil, err - } - return response.Tags.Tag, &response.PaginationResult, nil -} diff --git a/vendor/github.com/denverdino/aliyungo/ecs/vpcs.go b/vendor/github.com/denverdino/aliyungo/ecs/vpcs.go deleted file mode 100644 index 2b4a2444b..000000000 --- a/vendor/github.com/denverdino/aliyungo/ecs/vpcs.go +++ /dev/null @@ -1,163 +0,0 @@ -package ecs - -import ( - "time" - - "github.com/denverdino/aliyungo/common" - "github.com/denverdino/aliyungo/util" -) - -type CreateVpcArgs struct { - RegionId common.Region - CidrBlock string //192.168.0.0/16 or 172.16.0.0/16 (default) - VpcName string - Description string - ClientToken string -} - -type CreateVpcResponse struct { - common.Response - VpcId string - VRouterId string - RouteTableId string -} - -// CreateVpc creates Virtual Private Cloud -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/vpc&createvpc -func (client *Client) CreateVpc(args *CreateVpcArgs) (resp *CreateVpcResponse, err error) { - response := CreateVpcResponse{} - err = client.Invoke("CreateVpc", args, &response) - if err != nil { - return nil, err - } - return &response, err -} - -type DeleteVpcArgs struct { - VpcId string -} - -type DeleteVpcResponse struct { - common.Response -} - -// DeleteVpc deletes Virtual Private Cloud -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/vpc&deletevpc -func (client *Client) DeleteVpc(vpcId string) error { - args := DeleteVpcArgs{ - VpcId: vpcId, - } - response := DeleteVpcResponse{} - return client.Invoke("DeleteVpc", &args, &response) -} - -type VpcStatus string - -const ( - VpcStatusPending = VpcStatus("Pending") - VpcStatusAvailable = VpcStatus("Available") -) - -type DescribeVpcsArgs struct { - VpcId string - RegionId common.Region - common.Pagination -} - -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/datatype&vpcsettype -type VpcSetType struct { - VpcId string - RegionId common.Region - Status VpcStatus // enum Pending | Available - VpcName string - VSwitchIds struct { - VSwitchId []string - } - CidrBlock string - VRouterId string - Description string - IsDefault bool - CreationTime util.ISO6801Time - RouterTableIds struct{ - RouterTableIds []string - } -} - -type DescribeVpcsResponse struct { - common.Response - common.PaginationResult - Vpcs struct { - Vpc []VpcSetType - } -} - -// DescribeInstanceStatus describes instance status -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/vpc&describevpcs -func (client *Client) DescribeVpcs(args *DescribeVpcsArgs) (vpcs []VpcSetType, pagination *common.PaginationResult, err error) { - response, err := client.DescribeVpcsWithRaw(args) - if err != nil { - return nil, nil, err - } - - return response.Vpcs.Vpc, &response.PaginationResult, nil -} - -func (client *Client) DescribeVpcsWithRaw(args *DescribeVpcsArgs) (response *DescribeVpcsResponse, err error) { - args.Validate() - response = &DescribeVpcsResponse{} - - err = client.Invoke("DescribeVpcs", args, response) - if err != nil { - return nil, err - } - - return response, err -} - -type ModifyVpcAttributeArgs struct { - VpcId string - VpcName string - Description string -} - -type ModifyVpcAttributeResponse struct { - common.Response -} - -// ModifyVpcAttribute modifies attribute of Virtual Private Cloud -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/vpc&modifyvpcattribute -func (client *Client) ModifyVpcAttribute(args *ModifyVpcAttributeArgs) error { - response := ModifyVpcAttributeResponse{} - return client.Invoke("ModifyVpcAttribute", args, &response) -} - -// WaitForInstance waits for instance to given status -func (client *Client) WaitForVpcAvailable(regionId common.Region, vpcId string, timeout int) error { - if timeout <= 0 { - timeout = DefaultTimeout - } - args := DescribeVpcsArgs{ - RegionId: regionId, - VpcId: vpcId, - } - for { - vpcs, _, err := client.DescribeVpcs(&args) - if err != nil { - return err - } - if len(vpcs) > 0 && vpcs[0].Status == VpcStatusAvailable { - break - } - timeout = timeout - DefaultWaitForInterval - if timeout <= 0 { - return common.GetClientErrorFromString("Timeout") - } - time.Sleep(DefaultWaitForInterval * time.Second) - } - return nil -} diff --git a/vendor/github.com/denverdino/aliyungo/ecs/vrouters.go b/vendor/github.com/denverdino/aliyungo/ecs/vrouters.go deleted file mode 100644 index 04d43daa8..000000000 --- a/vendor/github.com/denverdino/aliyungo/ecs/vrouters.go +++ /dev/null @@ -1,77 +0,0 @@ -package ecs - -import ( - "github.com/denverdino/aliyungo/common" - "github.com/denverdino/aliyungo/util" -) - -type DescribeVRoutersArgs struct { - VRouterId string - RegionId common.Region - common.Pagination -} - -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/datatype&vroutersettype -type VRouterSetType struct { - VRouterId string - RegionId common.Region - VpcId string - RouteTableIds struct { - RouteTableId []string - } - VRouterName string - Description string - CreationTime util.ISO6801Time -} - -type DescribeVRoutersResponse struct { - common.Response - common.PaginationResult - VRouters struct { - VRouter []VRouterSetType - } -} - -// DescribeVRouters describes Virtual Routers -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/vrouter&describevrouters -func (client *Client) DescribeVRouters(args *DescribeVRoutersArgs) (vrouters []VRouterSetType, pagination *common.PaginationResult, err error) { - response, err := client.DescribeVRoutersWithRaw(args) - if err == nil { - return response.VRouters.VRouter, &response.PaginationResult, nil - } - - return nil, nil, err -} - -func (client *Client) DescribeVRoutersWithRaw(args *DescribeVRoutersArgs) (response *DescribeVRoutersResponse, err error) { - args.Validate() - response = &DescribeVRoutersResponse{} - - err = client.Invoke("DescribeVRouters", args, response) - - if err == nil { - return response, nil - } - - return nil, err -} - -type ModifyVRouterAttributeArgs struct { - VRouterId string - VRouterName string - Description string -} - -type ModifyVRouterAttributeResponse struct { - common.Response -} - -// ModifyVRouterAttribute modifies attribute of Virtual Router -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/vrouter&modifyvrouterattribute -func (client *Client) ModifyVRouterAttribute(args *ModifyVRouterAttributeArgs) error { - response := ModifyVRouterAttributeResponse{} - return client.Invoke("ModifyVRouterAttribute", args, &response) -} diff --git a/vendor/github.com/denverdino/aliyungo/ecs/vswitches.go b/vendor/github.com/denverdino/aliyungo/ecs/vswitches.go deleted file mode 100644 index 22d5ec8ea..000000000 --- a/vendor/github.com/denverdino/aliyungo/ecs/vswitches.go +++ /dev/null @@ -1,164 +0,0 @@ -package ecs - -import ( - "time" - - "github.com/denverdino/aliyungo/common" - "github.com/denverdino/aliyungo/util" -) - -type CreateVSwitchArgs struct { - ZoneId string - CidrBlock string - VpcId string - VSwitchName string - Description string - ClientToken string -} - -type CreateVSwitchResponse struct { - common.Response - VSwitchId string -} - -// CreateVSwitch creates Virtual Switch -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/vswitch&createvswitch -func (client *Client) CreateVSwitch(args *CreateVSwitchArgs) (vswitchId string, err error) { - response := CreateVSwitchResponse{} - err = client.Invoke("CreateVSwitch", args, &response) - if err != nil { - return "", err - } - return response.VSwitchId, err -} - -type DeleteVSwitchArgs struct { - VSwitchId string -} - -type DeleteVSwitchResponse struct { - common.Response -} - -// DeleteVSwitch deletes Virtual Switch -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/vswitch&deletevswitch -func (client *Client) DeleteVSwitch(VSwitchId string) error { - args := DeleteVSwitchArgs{ - VSwitchId: VSwitchId, - } - response := DeleteVSwitchResponse{} - return client.Invoke("DeleteVSwitch", &args, &response) -} - -type DescribeVSwitchesArgs struct { - RegionId common.Region - VpcId string - VSwitchId string - ZoneId string - common.Pagination -} - -type VSwitchStatus string - -const ( - VSwitchStatusPending = VSwitchStatus("Pending") - VSwitchStatusAvailable = VSwitchStatus("Available") -) - -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/datatype&vswitchsettype -type VSwitchSetType struct { - VSwitchId string - VpcId string - Status VSwitchStatus // enum Pending | Available - CidrBlock string - ZoneId string - AvailableIpAddressCount int - Description string - VSwitchName string - IsDefault bool - CreationTime util.ISO6801Time -} - -type DescribeVSwitchesResponse struct { - common.Response - common.PaginationResult - VSwitches struct { - VSwitch []VSwitchSetType - } -} - -// DescribeVSwitches describes Virtual Switches -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/vswitch&describevswitches -func (client *Client) DescribeVSwitches(args *DescribeVSwitchesArgs) (vswitches []VSwitchSetType, pagination *common.PaginationResult, err error) { - args.Validate() - response, err := client.DescribeVSwitchesWithRaw(args) - if err == nil { - return response.VSwitches.VSwitch, &response.PaginationResult, nil - } - - return nil, nil, err -} - -func (client *Client) DescribeVSwitchesWithRaw(args *DescribeVSwitchesArgs) (response *DescribeVSwitchesResponse, err error) { - args.Validate() - response = &DescribeVSwitchesResponse{} - - err = client.Invoke("DescribeVSwitches", args, &response) - - if err == nil { - return response, nil - } - - return nil, err -} - -type ModifyVSwitchAttributeArgs struct { - VSwitchId string - VSwitchName string - Description string -} - -type ModifyVSwitchAttributeResponse struct { - common.Response -} - -// ModifyVSwitchAttribute modifies attribute of Virtual Private Cloud -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/vswitch&modifyvswitchattribute -func (client *Client) ModifyVSwitchAttribute(args *ModifyVSwitchAttributeArgs) error { - response := ModifyVSwitchAttributeResponse{} - return client.Invoke("ModifyVSwitchAttribute", args, &response) -} - -// WaitForVSwitchAvailable waits for VSwitch to given status -func (client *Client) WaitForVSwitchAvailable(vpcId string, vswitchId string, timeout int) error { - if timeout <= 0 { - timeout = DefaultTimeout - } - args := DescribeVSwitchesArgs{ - VpcId: vpcId, - VSwitchId: vswitchId, - } - for { - vswitches, _, err := client.DescribeVSwitches(&args) - if err != nil { - return err - } - if len(vswitches) == 0 { - return common.GetClientErrorFromString("Not found") - } - if vswitches[0].Status == VSwitchStatusAvailable { - break - } - timeout = timeout - DefaultWaitForInterval - if timeout <= 0 { - return common.GetClientErrorFromString("Timeout") - } - time.Sleep(DefaultWaitForInterval * time.Second) - } - return nil -} diff --git a/vendor/github.com/denverdino/aliyungo/ecs/zones.go b/vendor/github.com/denverdino/aliyungo/ecs/zones.go deleted file mode 100644 index 919e363a8..000000000 --- a/vendor/github.com/denverdino/aliyungo/ecs/zones.go +++ /dev/null @@ -1,158 +0,0 @@ -package ecs - -import ( - "github.com/denverdino/aliyungo/common" -) - -type ResourceType string - -const ( - ResourceTypeInstance = ResourceType("Instance") - ResourceTypeDisk = ResourceType("Disk") - ResourceTypeVSwitch = ResourceType("VSwitch") - ResourceTypeIOOptimizedInstance = ResourceType("IoOptimized") -) - -// The sub-item of the type AvailableResourcesType -type SupportedResourceType string - -const ( - SupportedInstanceType = SupportedResourceType("supportedInstanceType") - SupportedInstanceTypeFamily = SupportedResourceType("supportedInstanceTypeFamily") - SupportedInstanceGeneration = SupportedResourceType("supportedInstanceGeneration") - SupportedSystemDiskCategory = SupportedResourceType("supportedSystemDiskCategory") - SupportedDataDiskCategory = SupportedResourceType("supportedDataDiskCategory") - SupportedNetworkCategory = SupportedResourceType("supportedNetworkCategory") -) - -// -// You can read doc at https://help.aliyun.com/document_detail/25670.html?spm=5176.doc25640.2.1.J24zQt -type ResourcesInfoType struct { - ResourcesInfo []AvailableResourcesType -} - -// Because the sub-item of AvailableResourcesType starts with supported and golang struct cann't refer them, this uses map to parse ResourcesInfo -type AvailableResourcesType struct { - IoOptimized bool - NetworkTypes map[SupportedResourceType][]string - InstanceGenerations map[SupportedResourceType][]string - InstanceTypeFamilies map[SupportedResourceType][]string - InstanceTypes map[SupportedResourceType][]string - SystemDiskCategories map[SupportedResourceType][]DiskCategory - DataDiskCategories map[SupportedResourceType][]DiskCategory -} - -type DescribeZonesArgs struct { - RegionId common.Region -} - -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/datatype&availableresourcecreationtype -type AvailableResourceCreationType struct { - ResourceTypes []ResourceType //enum for Instance, Disk, VSwitch -} - -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/datatype&availablediskcategoriestype -type AvailableDiskCategoriesType struct { - DiskCategories []DiskCategory //enum for cloud, ephemeral, ephemeral_ssd -} - -type AvailableInstanceTypesType struct { - InstanceTypes []string -} - -// -// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/datatype&zonetype -type ZoneType struct { - ZoneId string - LocalName string - AvailableResources ResourcesInfoType - AvailableInstanceTypes AvailableInstanceTypesType - AvailableResourceCreation AvailableResourceCreationType - AvailableDiskCategories AvailableDiskCategoriesType -} - -type DescribeZonesResponse struct { - common.Response - Zones struct { - Zone []ZoneType - } -} - -// DescribeZones describes zones -func (client *Client) DescribeZones(regionId common.Region) (zones []ZoneType, err error) { - response, err := client.DescribeZonesWithRaw(regionId) - if err == nil { - return response.Zones.Zone, nil - } - - return []ZoneType{}, err -} - -func (client *Client) DescribeZonesWithRaw(regionId common.Region) (response *DescribeZonesResponse, err error) { - args := DescribeZonesArgs{ - RegionId: regionId, - } - response = &DescribeZonesResponse{} - - err = client.Invoke("DescribeZones", &args, response) - - if err == nil { - return response, nil - } - - return nil, err -} - -type DescribeAvailableResourceArgs struct { - RegionId string - DestinationResource string - ZoneId string - InstanceChargeType string - SpotStrategy string - IoOptimized string - InstanceType string - SystemDiskCategory string - DataDiskCategory string - NetworkCategory string -} - -type DescribeAvailableResourceResponse struct { - common.Response - AvailableZones struct { - AvailableZone []AvailableZoneType - } -} - -type AvailableZoneType struct { - RegionId string - ZoneId string - Status string - AvailableResources struct { - AvailableResource []NewAvailableResourcesType - } -} - -type NewAvailableResourcesType struct { - Type string - SupportedResources struct { - SupportedResource []SupportedResourcesType - } -} - -type SupportedResourcesType struct { - Value string - Status string - Min string - Max string - Unit string -} - -// https://www.alibabacloud.com/help/doc-detail/66186.htm -func (client *Client) DescribeAvailableResource(args *DescribeAvailableResourceArgs) (response *DescribeAvailableResourceResponse, err error) { - - response = &DescribeAvailableResourceResponse{} - err = client.Invoke("DescribeAvailableResource", args, response) - return response, err -} diff --git a/vendor/github.com/denverdino/aliyungo/ram/account.go b/vendor/github.com/denverdino/aliyungo/ram/account.go deleted file mode 100644 index 35ad58c4b..000000000 --- a/vendor/github.com/denverdino/aliyungo/ram/account.go +++ /dev/null @@ -1,78 +0,0 @@ -package ram - -type UserRequest struct { - User -} - -type UserResponse struct { - RamCommonResponse - User User -} - -type UpdateUserRequest struct { - UserName string - NewUserName string - NewDisplayName string - NewMobilePhone string - NewEmail string - NewComments string -} - -type ListUserRequest struct { - Marker string - MaxItems int8 -} - -type ListUserResponse struct { - RamCommonResponse - IsTruncated bool - Marker string - Users struct { - User []User - } -} - -func (client *RamClient) CreateUser(user UserRequest) (UserResponse, error) { - var userResponse UserResponse - err := client.Invoke("CreateUser", user, &userResponse) - if err != nil { - return UserResponse{}, err - } - return userResponse, nil -} - -func (client *RamClient) GetUser(userQuery UserQueryRequest) (UserResponse, error) { - var userResponse UserResponse - err := client.Invoke("GetUser", userQuery, &userResponse) - if err != nil { - return UserResponse{}, nil - } - return userResponse, nil -} - -func (client *RamClient) UpdateUser(newUser UpdateUserRequest) (UserResponse, error) { - var userResponse UserResponse - err := client.Invoke("UpdateUser", newUser, &userResponse) - if err != nil { - return UserResponse{}, err - } - return userResponse, nil -} - -func (client *RamClient) DeleteUser(userQuery UserQueryRequest) (RamCommonResponse, error) { - var commonResp RamCommonResponse - err := client.Invoke("DeleteUser", userQuery, &commonResp) - if err != nil { - return RamCommonResponse{}, err - } - return commonResp, nil -} - -func (client *RamClient) ListUsers(listParams ListUserRequest) (ListUserResponse, error) { - var userList ListUserResponse - err := client.Invoke("ListUsers", listParams, &userList) - if err != nil { - return ListUserResponse{}, err - } - return userList, nil -} diff --git a/vendor/github.com/denverdino/aliyungo/ram/ak.go b/vendor/github.com/denverdino/aliyungo/ram/ak.go deleted file mode 100644 index 649cb4f23..000000000 --- a/vendor/github.com/denverdino/aliyungo/ram/ak.go +++ /dev/null @@ -1,63 +0,0 @@ -package ram - -/* - CreateAccessKey() - UpdateAccessKey() - DeleteAccessKey() - ListAccessKeys() -*/ -type State string - -type AccessKeyResponse struct { - RamCommonResponse - AccessKey AccessKey -} - -type UpdateAccessKeyRequest struct { - UserAccessKeyId string - Status State - UserName string -} - -type AccessKeyListResponse struct { - RamCommonResponse - AccessKeys struct { - AccessKey []AccessKey - } -} - -func (client *RamClient) CreateAccessKey(userQuery UserQueryRequest) (AccessKeyResponse, error) { - var accesskeyResp AccessKeyResponse - err := client.Invoke("CreateAccessKey", userQuery, &accesskeyResp) - if err != nil { - return AccessKeyResponse{}, err - } - return accesskeyResp, nil -} - -func (client *RamClient) UpdateAccessKey(accessKeyRequest UpdateAccessKeyRequest) (RamCommonResponse, error) { - var commonResp RamCommonResponse - err := client.Invoke("UpdateAccessKey", accessKeyRequest, &commonResp) - if err != nil { - return RamCommonResponse{}, err - } - return commonResp, nil -} - -func (client *RamClient) DeleteAccessKey(accessKeyRequest UpdateAccessKeyRequest) (RamCommonResponse, error) { - var commonResp RamCommonResponse - err := client.Invoke("DeleteAccessKey", accessKeyRequest, &commonResp) - if err != nil { - return RamCommonResponse{}, err - } - return commonResp, nil -} - -func (client *RamClient) ListAccessKeys(userQuery UserQueryRequest) (AccessKeyListResponse, error) { - var accessKeyListResp AccessKeyListResponse - err := client.Invoke("ListAccessKeys", userQuery, &accessKeyListResp) - if err != nil { - return AccessKeyListResponse{}, err - } - return accessKeyListResp, nil -} diff --git a/vendor/github.com/denverdino/aliyungo/ram/api.go b/vendor/github.com/denverdino/aliyungo/ram/api.go deleted file mode 100644 index be9d40044..000000000 --- a/vendor/github.com/denverdino/aliyungo/ram/api.go +++ /dev/null @@ -1,87 +0,0 @@ -package ram - -/* - ringtail 2016/1/19 - All RAM apis provided -*/ - -type RamClientInterface interface { - //ram user - CreateUser(user UserRequest) (UserResponse, error) - GetUser(userQuery UserQueryRequest) (UserResponse, error) - UpdateUser(newUser UpdateUserRequest) (UserResponse, error) - DeleteUser(userQuery UserQueryRequest) (RamCommonResponse, error) - ListUsers(listParams ListUserRequest) (ListUserResponse, error) - - //ram login profile - CreateLoginProfile(req ProfileRequest) (ProfileResponse, error) - GetLoginProfile(req UserQueryRequest) (ProfileResponse, error) - DeleteLoginProfile(req UserQueryRequest) (RamCommonResponse, error) - UpdateLoginProfile(req ProfileRequest) (ProfileResponse, error) - - //ram ak - CreateAccessKey(userQuery UserQueryRequest) (AccessKeyResponse, error) - UpdateAccessKey(accessKeyRequest UpdateAccessKeyRequest) (RamCommonResponse, error) - DeleteAccessKey(accessKeyRequest UpdateAccessKeyRequest) (RamCommonResponse, error) - ListAccessKeys(userQuery UserQueryRequest) (AccessKeyListResponse, error) - - //ram mfa - CreateVirtualMFADevice(req MFARequest) (MFAResponse, error) - ListVirtualMFADevices() (MFAListResponse, error) - DeleteVirtualMFADevice(req MFADeleteRequest) (RamCommonResponse, error) - BindMFADevice(req MFABindRequest) (RamCommonResponse, error) - UnbindMFADevice(req UserQueryRequest) (MFAUserResponse, error) - GetUserMFAInfo(req UserQueryRequest) (MFAUserResponse, error) - - //ram group - CreateGroup(req GroupRequest) (GroupResponse, error) - GetGroup(req GroupQueryRequest) (GroupResponse, error) - UpdateGroup(req GroupUpdateRequest) (GroupResponse, error) - ListGroup(req GroupListRequest) (GroupListResponse, error) - DeleteGroup(req GroupQueryRequest) (RamCommonResponse, error) - AddUserToGroup(req UserRelateGroupRequest) (RamCommonResponse, error) - RemoveUserFromGroup(req UserRelateGroupRequest) (RamCommonResponse, error) - ListGroupsForUser(req UserQueryRequest) (GroupListResponse, error) - ListUsersForGroup(req GroupQueryRequest) (ListUserResponse, error) - - CreateRole(role RoleRequest) (RoleResponse, error) - GetRole(roleQuery RoleQueryRequest) (RoleResponse, error) - UpdateRole(newRole UpdateRoleRequest) (RoleResponse, error) - ListRoles() (ListRoleResponse, error) - DeleteRole(roleQuery RoleQueryRequest) (RamCommonResponse, error) - - //DONE policy - CreatePolicy(policyReq PolicyRequest) (PolicyResponse, error) - GetPolicy(policyReq PolicyRequest) (PolicyResponse, error) - DeletePolicy(policyReq PolicyRequest) (RamCommonResponse, error) - ListPolicies(policyQuery PolicyQueryRequest) (PolicyQueryResponse, error) - ListPoliciesForUser(userQuery UserQueryRequest) (PolicyListResponse, error) - - //ram policy version - CreatePolicyVersion(policyReq PolicyRequest) (PolicyVersionResponse, error) - GetPolicyVersion(policyReq PolicyRequest) (PolicyVersionResponse, error) - GetPolicyVersionNew(policyReq PolicyRequest) (PolicyVersionResponseNew, error) - DeletePolicyVersion(policyReq PolicyRequest) (RamCommonResponse, error) - ListPolicyVersions(policyReq PolicyRequest) (PolicyVersionResponse, error) - ListPolicyVersionsNew(policyReq PolicyRequest) (PolicyVersionsResponse, error) - AttachPolicyToUser(attachPolicyRequest AttachPolicyRequest) (RamCommonResponse, error) - DetachPolicyFromUser(attachPolicyRequest AttachPolicyRequest) (RamCommonResponse, error) - ListEntitiesForPolicy(policyReq PolicyRequest) (PolicyListEntitiesResponse, error) - SetDefaultPolicyVersion(policyReq PolicyRequest) (RamCommonResponse, error) - ListPoliciesForGroup(groupQuery GroupQueryRequest) (PolicyListResponse, error) - AttachPolicyToGroup(attachPolicyRequest AttachPolicyToGroupRequest) (RamCommonResponse, error) - DetachPolicyFromGroup(attachPolicyRequest AttachPolicyToGroupRequest) (RamCommonResponse, error) - AttachPolicyToRole(attachPolicyRequest AttachPolicyToRoleRequest) (RamCommonResponse, error) - DetachPolicyFromRole(attachPolicyRequest AttachPolicyToRoleRequest) (RamCommonResponse, error) - ListPoliciesForRole(roleQuery RoleQueryRequest) (PolicyListResponse, error) - - //ram security - SetAccountAlias(accountAlias AccountAliasRequest) (RamCommonResponse, error) - GetAccountAlias() (AccountAliasResponse, error) - ClearAccountAlias() (RamCommonResponse, error) - SetPasswordPolicy(passwordPolicy PasswordPolicyRequest) (PasswordPolicyResponse, error) - GetPasswordPolicy() (PasswordPolicyResponse, error) - - // Common Client Methods - SetUserAgent(userAgent string) -} diff --git a/vendor/github.com/denverdino/aliyungo/ram/client.go b/vendor/github.com/denverdino/aliyungo/ram/client.go deleted file mode 100644 index 2a29bd804..000000000 --- a/vendor/github.com/denverdino/aliyungo/ram/client.go +++ /dev/null @@ -1,45 +0,0 @@ -package ram - -import ( - "os" - - "github.com/denverdino/aliyungo/common" -) - -const ( - // RAMDefaultEndpoint is the default API endpoint of RAM services - RAMDefaultEndpoint = "https://ram.aliyuncs.com" - RAMAPIVersion = "2015-05-01" -) - -type RamClient struct { - common.Client -} - -func NewClient(accessKeyId string, accessKeySecret string) RamClientInterface { - return NewClientWithSecurityToken(accessKeyId, accessKeySecret, "") -} - -func NewClientWithSecurityToken(accessKeyId string, accessKeySecret string, securityToken string) RamClientInterface { - endpoint := os.Getenv("RAM_ENDPOINT") - if endpoint == "" { - endpoint = RAMDefaultEndpoint - } - - return NewClientWithEndpointAndSecurityToken(endpoint, accessKeyId, accessKeySecret, securityToken) -} - -func NewClientWithEndpoint(endpoint string, accessKeyId string, accessKeySecret string) RamClientInterface { - return NewClientWithEndpointAndSecurityToken(endpoint, accessKeyId, accessKeySecret, "") -} - -func NewClientWithEndpointAndSecurityToken(endpoint string, accessKeyId string, accessKeySecret string, securityToken string) RamClientInterface { - client := &RamClient{} - client.WithEndpoint(endpoint). - WithVersion(RAMAPIVersion). - WithAccessKeyId(accessKeyId). - WithAccessKeySecret(accessKeySecret). - WithSecurityToken(securityToken). - InitClient() - return client -} diff --git a/vendor/github.com/denverdino/aliyungo/ram/error.go b/vendor/github.com/denverdino/aliyungo/ram/error.go deleted file mode 100644 index 30d2f4eb0..000000000 --- a/vendor/github.com/denverdino/aliyungo/ram/error.go +++ /dev/null @@ -1,4 +0,0 @@ -package ram - -//common errors -var () diff --git a/vendor/github.com/denverdino/aliyungo/ram/group.go b/vendor/github.com/denverdino/aliyungo/ram/group.go deleted file mode 100644 index ba38e9193..000000000 --- a/vendor/github.com/denverdino/aliyungo/ram/group.go +++ /dev/null @@ -1,120 +0,0 @@ -package ram - -type GroupRequest struct { - Group -} - -type GroupQueryRequest struct { - GroupName string -} - -type GroupUpdateRequest struct { - GroupName string - NewGroupName string - NewComments string -} - -type GroupListRequest struct { - Marker string - MaxItems int8 -} - -type UserRelateGroupRequest struct { - UserName string - GroupName string -} - -type GroupResponse struct { - RamCommonResponse - Group Group -} - -type GroupListResponse struct { - RamCommonResponse - IsTruncated bool - Marker string - Groups struct { - Group []Group - } -} - -func (client *RamClient) CreateGroup(req GroupRequest) (GroupResponse, error) { - var resp GroupResponse - err := client.Invoke("CreateGroup", req, &resp) - if err != nil { - return GroupResponse{}, err - } - return resp, nil -} - -func (client *RamClient) GetGroup(req GroupQueryRequest) (GroupResponse, error) { - var resp GroupResponse - err := client.Invoke("GetGroup", req, &resp) - if err != nil { - return GroupResponse{}, err - } - return resp, nil -} - -func (client *RamClient) UpdateGroup(req GroupUpdateRequest) (GroupResponse, error) { - var resp GroupResponse - err := client.Invoke("UpdateGroup", req, &resp) - if err != nil { - return GroupResponse{}, err - } - return resp, nil -} - -func (client *RamClient) ListGroup(req GroupListRequest) (GroupListResponse, error) { - var resp GroupListResponse - err := client.Invoke("ListGroups", req, &resp) - if err != nil { - return GroupListResponse{}, err - } - return resp, nil -} - -func (client *RamClient) DeleteGroup(req GroupQueryRequest) (RamCommonResponse, error) { - var resp RamCommonResponse - err := client.Invoke("DeleteGroup", req, &resp) - if err != nil { - return RamCommonResponse{}, err - } - return resp, nil -} - -func (client *RamClient) AddUserToGroup(req UserRelateGroupRequest) (RamCommonResponse, error) { - var resp RamCommonResponse - err := client.Invoke("AddUserToGroup", req, &resp) - if err != nil { - return RamCommonResponse{}, err - } - return resp, nil -} - -func (client *RamClient) RemoveUserFromGroup(req UserRelateGroupRequest) (RamCommonResponse, error) { - var resp RamCommonResponse - err := client.Invoke("RemoveUserFromGroup", req, &resp) - if err != nil { - return RamCommonResponse{}, err - } - return resp, nil -} - -func (client *RamClient) ListGroupsForUser(req UserQueryRequest) (GroupListResponse, error) { - var resp GroupListResponse - err := client.Invoke("ListGroupsForUser", req, &resp) - if err != nil { - return GroupListResponse{}, err - } - return resp, nil -} - -func (client *RamClient) ListUsersForGroup(req GroupQueryRequest) (ListUserResponse, error) { - var resp ListUserResponse - err := client.Invoke("ListUsersForGroup", req, &resp) - if err != nil { - return ListUserResponse{}, err - } - return resp, nil -} diff --git a/vendor/github.com/denverdino/aliyungo/ram/mfa.go b/vendor/github.com/denverdino/aliyungo/ram/mfa.go deleted file mode 100644 index 708dfe262..000000000 --- a/vendor/github.com/denverdino/aliyungo/ram/mfa.go +++ /dev/null @@ -1,87 +0,0 @@ -package ram - -type MFARequest struct { - VirtualMFADeviceName string -} - -type MFADeleteRequest struct { - MFADevice -} - -type MFABindRequest struct { - SerialNumber string - UserName string - AuthenticationCode1 string - AuthenticationCode2 string -} - -type MFAResponse struct { - RamCommonResponse - VirtualMFADevice VirtualMFADevice -} - -type MFAListResponse struct { - RamCommonResponse - VirtualMFADevices struct { - VirtualMFADevice []VirtualMFADevice - } -} - -type MFAUserResponse struct { - RamCommonResponse - MFADevice MFADevice -} - -func (client *RamClient) CreateVirtualMFADevice(req MFARequest) (MFAResponse, error) { - var resp MFAResponse - err := client.Invoke("CreateVirtualMFADevice", req, &resp) - if err != nil { - return MFAResponse{}, err - } - return resp, nil -} - -func (client *RamClient) ListVirtualMFADevices() (MFAListResponse, error) { - var resp MFAListResponse - err := client.Invoke("ListVirtualMFADevices", struct{}{}, &resp) - if err != nil { - return MFAListResponse{}, err - } - return resp, nil -} - -func (client *RamClient) DeleteVirtualMFADevice(req MFADeleteRequest) (RamCommonResponse, error) { - var resp RamCommonResponse - err := client.Invoke("DeleteVirtualMFADevice", req, &resp) - if err != nil { - return RamCommonResponse{}, err - } - return resp, nil -} - -func (client *RamClient) BindMFADevice(req MFABindRequest) (RamCommonResponse, error) { - var resp RamCommonResponse - err := client.Invoke("BindMFADevice", req, &resp) - if err != nil { - return RamCommonResponse{}, err - } - return resp, nil -} - -func (client *RamClient) UnbindMFADevice(req UserQueryRequest) (MFAUserResponse, error) { - var resp MFAUserResponse - err := client.Invoke("UnbindMFADevice", req, &resp) - if err != nil { - return MFAUserResponse{}, err - } - return resp, nil -} - -func (client *RamClient) GetUserMFAInfo(req UserQueryRequest) (MFAUserResponse, error) { - var resp MFAUserResponse - err := client.Invoke("GetUserMFAInfo", req, &resp) - if err != nil { - return MFAUserResponse{}, err - } - return resp, nil -} diff --git a/vendor/github.com/denverdino/aliyungo/ram/policy.go b/vendor/github.com/denverdino/aliyungo/ram/policy.go deleted file mode 100644 index c1e6de173..000000000 --- a/vendor/github.com/denverdino/aliyungo/ram/policy.go +++ /dev/null @@ -1,291 +0,0 @@ -package ram - -type Type string - -const ( - Custom Type = "Custom" - System Type = "System" -) - -type PolicyRequest struct { - PolicyName string - PolicyType Type - Description string - PolicyDocument string - SetAsDefault string - VersionId string -} -type PolicyListResponse struct { - RamCommonResponse - Policies struct { - Policy []Policy - } -} - -type PolicyResponse struct { - RamCommonResponse - Policy Policy -} - -type PolicyQueryRequest struct { - PolicyType Type - Marker string - MaxItems int8 -} - -type PolicyQueryResponse struct { - RamCommonResponse - IsTruncated bool - Marker string - Policies struct { - Policy []Policy - } -} - -type PolicyVersionResponse struct { - RamCommonResponse - IsDefaultVersion bool - VersionId string - CreateDate string - PolicyDocument string -} - -type AttachPolicyRequest struct { - PolicyRequest - UserName string -} - -type AttachPolicyToRoleRequest struct { - PolicyRequest - RoleName string -} - -type PolicyVersionResponseNew struct { - RamCommonResponse - PolicyVersion struct { - IsDefaultVersion bool - VersionId string - CreateDate string - PolicyDocument string - } -} - -type AttachPolicyToGroupRequest struct { - PolicyRequest - GroupName string -} - -type PolicyVersionsResponse struct { - RamCommonResponse - PolicyVersions struct { - PolicyVersion []PolicyVersion - } -} - -type PolicyListEntitiesResponse struct { - RamCommonResponse - Groups struct { - Group []Group - } - Users struct { - User []User - } - Roles struct { - Role []Role - } -} - -func (client *RamClient) CreatePolicy(policyReq PolicyRequest) (PolicyResponse, error) { - var resp PolicyResponse - err := client.Invoke("CreatePolicy", policyReq, &resp) - if err != nil { - return PolicyResponse{}, err - } - return resp, nil -} - -func (client *RamClient) GetPolicy(policyReq PolicyRequest) (PolicyResponse, error) { - var resp PolicyResponse - err := client.Invoke("GetPolicy", policyReq, &resp) - if err != nil { - return PolicyResponse{}, err - } - return resp, nil -} - -func (client *RamClient) DeletePolicy(policyReq PolicyRequest) (RamCommonResponse, error) { - var resp RamCommonResponse - err := client.Invoke("DeletePolicy", policyReq, &resp) - if err != nil { - return RamCommonResponse{}, err - } - return resp, nil -} - -func (client *RamClient) ListPolicies(policyQuery PolicyQueryRequest) (PolicyQueryResponse, error) { - var resp PolicyQueryResponse - err := client.Invoke("ListPolicies", policyQuery, &resp) - if err != nil { - return PolicyQueryResponse{}, err - } - return resp, nil -} - -func (client *RamClient) CreatePolicyVersion(policyReq PolicyRequest) (PolicyVersionResponse, error) { - var resp PolicyVersionResponse - err := client.Invoke("CreatePolicyVersion", policyReq, &resp) - if err != nil { - return PolicyVersionResponse{}, err - } - return resp, nil -} - -func (client *RamClient) GetPolicyVersion(policyReq PolicyRequest) (PolicyVersionResponse, error) { - var resp PolicyVersionResponse - err := client.Invoke("GetPolicyVersion", policyReq, &resp) - if err != nil { - return PolicyVersionResponse{}, err - } - return resp, nil -} - -func (client *RamClient) GetPolicyVersionNew(policyReq PolicyRequest) (PolicyVersionResponseNew, error) { - var resp PolicyVersionResponseNew - err := client.Invoke("GetPolicyVersion", policyReq, &resp) - if err != nil { - return PolicyVersionResponseNew{}, err - } - return resp, nil -} - -func (client *RamClient) DeletePolicyVersion(policyReq PolicyRequest) (RamCommonResponse, error) { - var resp RamCommonResponse - err := client.Invoke("DeletePolicyVersion", policyReq, &resp) - if err != nil { - return RamCommonResponse{}, err - } - return resp, nil -} - -func (client *RamClient) ListPolicyVersions(policyReq PolicyRequest) (PolicyVersionResponse, error) { - var resp PolicyVersionResponse - err := client.Invoke("ListPolicyVersions", policyReq, &resp) - if err != nil { - return PolicyVersionResponse{}, err - } - return resp, nil -} - -func (client *RamClient) ListPolicyVersionsNew(policyReq PolicyRequest) (PolicyVersionsResponse, error) { - var resp PolicyVersionsResponse - err := client.Invoke("ListPolicyVersions", policyReq, &resp) - if err != nil { - return PolicyVersionsResponse{}, err - } - return resp, nil -} - -func (client *RamClient) SetDefaultPolicyVersion(policyReq PolicyRequest) (RamCommonResponse, error) { - var resp RamCommonResponse - err := client.Invoke("SetDefaultPolicyVersion", policyReq, &resp) - if err != nil { - return RamCommonResponse{}, err - } - return resp, nil -} - -func (client *RamClient) AttachPolicyToUser(attachPolicyRequest AttachPolicyRequest) (RamCommonResponse, error) { - var resp RamCommonResponse - err := client.Invoke("AttachPolicyToUser", attachPolicyRequest, &resp) - if err != nil { - return RamCommonResponse{}, err - } - return resp, nil -} - -func (client *RamClient) DetachPolicyFromUser(attachPolicyRequest AttachPolicyRequest) (RamCommonResponse, error) { - var resp RamCommonResponse - err := client.Invoke("DetachPolicyFromUser", attachPolicyRequest, &resp) - if err != nil { - return RamCommonResponse{}, err - } - return resp, nil -} - -func (client *RamClient) ListEntitiesForPolicy(policyReq PolicyRequest) (PolicyListEntitiesResponse, error) { - var resp PolicyListEntitiesResponse - err := client.Invoke("ListEntitiesForPolicy", policyReq, &resp) - if err != nil { - return PolicyListEntitiesResponse{}, err - } - return resp, nil -} - -func (client *RamClient) ListPoliciesForUser(userQuery UserQueryRequest) (PolicyListResponse, error) { - var resp PolicyListResponse - err := client.Invoke("ListPoliciesForUser", userQuery, &resp) - if err != nil { - return PolicyListResponse{}, err - } - return resp, nil -} - -// -//Role related -// -func (client *RamClient) AttachPolicyToRole(attachPolicyRequest AttachPolicyToRoleRequest) (RamCommonResponse, error) { - var resp RamCommonResponse - err := client.Invoke("AttachPolicyToRole", attachPolicyRequest, &resp) - if err != nil { - return RamCommonResponse{}, err - } - return resp, nil -} - -func (client *RamClient) DetachPolicyFromRole(attachPolicyRequest AttachPolicyToRoleRequest) (RamCommonResponse, error) { - var resp RamCommonResponse - err := client.Invoke("DetachPolicyFromRole", attachPolicyRequest, &resp) - if err != nil { - return RamCommonResponse{}, err - } - return resp, nil -} - -func (client *RamClient) ListPoliciesForRole(roleQuery RoleQueryRequest) (PolicyListResponse, error) { - var resp PolicyListResponse - err := client.Invoke("ListPoliciesForRole", roleQuery, &resp) - if err != nil { - return PolicyListResponse{}, err - } - return resp, nil -} - -// -//Group related -// -func (client *RamClient) AttachPolicyToGroup(attachPolicyRequest AttachPolicyToGroupRequest) (RamCommonResponse, error) { - var resp RamCommonResponse - err := client.Invoke("AttachPolicyToGroup", attachPolicyRequest, &resp) - if err != nil { - return RamCommonResponse{}, err - } - return resp, nil -} - -func (client *RamClient) DetachPolicyFromGroup(attachPolicyRequest AttachPolicyToGroupRequest) (RamCommonResponse, error) { - var resp RamCommonResponse - err := client.Invoke("DetachPolicyFromGroup", attachPolicyRequest, &resp) - if err != nil { - return RamCommonResponse{}, err - } - return resp, nil -} - -func (client *RamClient) ListPoliciesForGroup(groupQuery GroupQueryRequest) (PolicyListResponse, error) { - var resp PolicyListResponse - err := client.Invoke("ListPoliciesForGroup", groupQuery, &resp) - if err != nil { - return PolicyListResponse{}, err - } - return resp, nil -} diff --git a/vendor/github.com/denverdino/aliyungo/ram/profile.go b/vendor/github.com/denverdino/aliyungo/ram/profile.go deleted file mode 100644 index fb8276193..000000000 --- a/vendor/github.com/denverdino/aliyungo/ram/profile.go +++ /dev/null @@ -1,56 +0,0 @@ -package ram - -/* - CreateLoginProfile() - GetLoginProfile() - DeleteLoginProfile() - UpdateLoginProfile() -*/ - -type ProfileRequest struct { - UserName string - Password string - PasswordResetRequired bool - MFABindRequired bool -} - -type ProfileResponse struct { - RamCommonResponse - LoginProfile LoginProfile -} - -func (client *RamClient) CreateLoginProfile(req ProfileRequest) (ProfileResponse, error) { - var resp ProfileResponse - err := client.Invoke("CreateLoginProfile", req, &resp) - if err != nil { - return ProfileResponse{}, err - } - return resp, nil -} - -func (client *RamClient) GetLoginProfile(req UserQueryRequest) (ProfileResponse, error) { - var resp ProfileResponse - err := client.Invoke("GetLoginProfile", req, &resp) - if err != nil { - return ProfileResponse{}, err - } - return resp, nil -} - -func (client *RamClient) DeleteLoginProfile(req UserQueryRequest) (RamCommonResponse, error) { - var resp RamCommonResponse - err := client.Invoke("DeleteLoginProfile", req, &resp) - if err != nil { - return RamCommonResponse{}, err - } - return resp, nil -} - -func (client *RamClient) UpdateLoginProfile(req ProfileRequest) (ProfileResponse, error) { - var resp ProfileResponse - err := client.Invoke("UpdateLoginProfile", req, &resp) - if err != nil { - return ProfileResponse{}, err - } - return resp, nil -} diff --git a/vendor/github.com/denverdino/aliyungo/ram/role.go b/vendor/github.com/denverdino/aliyungo/ram/role.go deleted file mode 100644 index 08ded08fb..000000000 --- a/vendor/github.com/denverdino/aliyungo/ram/role.go +++ /dev/null @@ -1,73 +0,0 @@ -package ram - -type RoleRequest struct { - RoleName string - AssumeRolePolicyDocument string - Description string -} - -type RoleResponse struct { - RamCommonResponse - Role Role -} - -type RoleQueryRequest struct { - RoleName string -} - -type UpdateRoleRequest struct { - RoleName string - NewAssumeRolePolicyDocument string -} - -type ListRoleResponse struct { - RamCommonResponse - Roles struct { - Role []Role - } -} - -func (client *RamClient) CreateRole(role RoleRequest) (RoleResponse, error) { - var roleResponse RoleResponse - err := client.Invoke("CreateRole", role, &roleResponse) - if err != nil { - return RoleResponse{}, err - } - return roleResponse, nil -} - -func (client *RamClient) GetRole(roleQuery RoleQueryRequest) (RoleResponse, error) { - var roleResponse RoleResponse - err := client.Invoke("GetRole", roleQuery, &roleResponse) - if err != nil { - return RoleResponse{}, nil - } - return roleResponse, nil -} - -func (client *RamClient) UpdateRole(newRole UpdateRoleRequest) (RoleResponse, error) { - var roleResponse RoleResponse - err := client.Invoke("UpdateRole", newRole, &roleResponse) - if err != nil { - return RoleResponse{}, err - } - return roleResponse, nil -} - -func (client *RamClient) ListRoles() (ListRoleResponse, error) { - var roleList ListRoleResponse - err := client.Invoke("ListRoles", struct{}{}, &roleList) - if err != nil { - return ListRoleResponse{}, err - } - return roleList, nil -} - -func (client *RamClient) DeleteRole(roleQuery RoleQueryRequest) (RamCommonResponse, error) { - var commonResp RamCommonResponse - err := client.Invoke("DeleteRole", roleQuery, &commonResp) - if err != nil { - return RamCommonResponse{}, err - } - return commonResp, nil -} diff --git a/vendor/github.com/denverdino/aliyungo/ram/security.go b/vendor/github.com/denverdino/aliyungo/ram/security.go deleted file mode 100644 index 5421ba0b9..000000000 --- a/vendor/github.com/denverdino/aliyungo/ram/security.go +++ /dev/null @@ -1,72 +0,0 @@ -package ram - -//TODO implement ram api about security -/* - SetAccountAlias() - GetAccountAlias() - ClearAccountAlias() - SetPasswordPolicy() - GetPasswordPolicy() -*/ -type AccountAliasResponse struct { - RamCommonResponse - AccountAlias string -} - -type PasswordPolicyResponse struct { - RamCommonResponse - PasswordPolicy -} - -type PasswordPolicyRequest struct { - PasswordPolicy -} - -type AccountAliasRequest struct { - AccountAlias string -} - -func (client *RamClient) SetAccountAlias(accountalias AccountAliasRequest) (RamCommonResponse, error) { - var resp RamCommonResponse - err := client.Invoke("SetAccountAlias", accountalias, &resp) - if err != nil { - return RamCommonResponse{}, err - } - return resp, nil -} - -func (client *RamClient) GetAccountAlias() (AccountAliasResponse, error) { - var resp AccountAliasResponse - err := client.Invoke("GetAccountAlias", struct{}{}, &resp) - if err != nil { - return AccountAliasResponse{}, err - } - return resp, nil -} - -func (client *RamClient) ClearAccountAlias() (RamCommonResponse, error) { - var resp RamCommonResponse - err := client.Invoke("ClearAccountAlias", struct{}{}, &resp) - if err != nil { - return RamCommonResponse{}, err - } - return resp, nil -} - -func (client *RamClient) SetPasswordPolicy(passwordPolicy PasswordPolicyRequest) (PasswordPolicyResponse, error) { - var resp PasswordPolicyResponse - err := client.Invoke("SetPasswordPolicy", passwordPolicy, &resp) - if err != nil { - return PasswordPolicyResponse{}, err - } - return resp, nil -} - -func (client *RamClient) GetPasswordPolicy() (PasswordPolicyResponse, error) { - var resp PasswordPolicyResponse - err := client.Invoke("GetPasswordPolicy", struct{}{}, &resp) - if err != nil { - return PasswordPolicyResponse{}, err - } - return resp, nil -} diff --git a/vendor/github.com/denverdino/aliyungo/ram/types.go b/vendor/github.com/denverdino/aliyungo/ram/types.go deleted file mode 100644 index c7bb91879..000000000 --- a/vendor/github.com/denverdino/aliyungo/ram/types.go +++ /dev/null @@ -1,144 +0,0 @@ -package ram - -import ( - "github.com/denverdino/aliyungo/common" -) - -/* - All common struct -*/ - -const ( - Active State = "Active" - Inactive State = "Inactive" -) - -/* - AccountAlias - 类型:String - 必须:是 - 描述:指定云账号的别名, 长度限制为3-63个字符 - 限制:^[a-z0-9](([a-z0-9]|-(?!-))*[a-z0-9])?$ -*/ -type AccountAlias string - -type UserQueryRequest struct { - UserName string -} - -type User struct { - UserId string - UserName string - DisplayName string - MobilePhone string - Email string - Comments string - CreateDate string - UpdateDate string - LastLoginDate string -} - -type LoginProfile struct { - UserName string - PasswordResetRequired bool - MFABindRequired bool -} - -type MFADevice struct { - SerialNumber string -} - -type VirtualMFADevice struct { - SerialNumber string - Base32StringSeed string - QRCodePNG string - ActivateDate string - User User -} - -type AccessKey struct { - AccessKeyId string - AccessKeySecret string - Status State - CreateDate string -} - -type Group struct { - GroupName string - Comments string -} - -type Role struct { - RoleId string - RoleName string - Arn string - Description string - AssumeRolePolicyDocument string - CreateDate string - UpdateDate string -} - -type Policy struct { - PolicyName string - PolicyType string - Description string - DefaultVersion string - CreateDate string - UpdateDate string - AttachmentCount int64 -} - -type PolicyVersion struct { - VersionId string - IsDefaultVersion bool - CreateDate string - PolicyDocument string -} - -type PolicyDocument struct { - Statement []PolicyItem - Version string -} - -type PolicyItem struct { - Action string - Effect string - Resource string -} - -type AssumeRolePolicyDocument struct { - Statement []AssumeRolePolicyItem - Version string -} - -type AssumeRolePolicyItem struct { - Action string - Effect string - Principal AssumeRolePolicyPrincpal -} - -type AssumeRolePolicyPrincpal struct { - RAM []string -} - -/* - "PasswordPolicy": { - "MinimumPasswordLength": 12, - "RequireLowercaseCharacters": true, - "RequireUppercaseCharacters": true, - "RequireNumbers": true, - "RequireSymbols": true - } -*/ - -type PasswordPolicy struct { - MinimumPasswordLength int8 - RequireLowercaseCharacters bool - RequireUppercaseCharacters bool - RequireNumbers bool - RequireSymbols bool -} - -type RamCommonResponse struct { - common.Response -} diff --git a/vendor/github.com/denverdino/aliyungo/util/attempt.go b/vendor/github.com/denverdino/aliyungo/util/attempt.go deleted file mode 100644 index 2d07f03a8..000000000 --- a/vendor/github.com/denverdino/aliyungo/util/attempt.go +++ /dev/null @@ -1,76 +0,0 @@ -package util - -import ( - "time" -) - -// AttemptStrategy is reused from the goamz package - -// AttemptStrategy represents a strategy for waiting for an action -// to complete successfully. This is an internal type used by the -// implementation of other packages. -type AttemptStrategy struct { - Total time.Duration // total duration of attempt. - Delay time.Duration // interval between each try in the burst. - Min int // minimum number of retries; overrides Total -} - -type Attempt struct { - strategy AttemptStrategy - last time.Time - end time.Time - force bool - count int -} - -// Start begins a new sequence of attempts for the given strategy. -func (s AttemptStrategy) Start() *Attempt { - now := time.Now() - return &Attempt{ - strategy: s, - last: now, - end: now.Add(s.Total), - force: true, - } -} - -// Next waits until it is time to perform the next attempt or returns -// false if it is time to stop trying. -func (a *Attempt) Next() bool { - now := time.Now() - sleep := a.nextSleep(now) - if !a.force && !now.Add(sleep).Before(a.end) && a.strategy.Min <= a.count { - return false - } - a.force = false - if sleep > 0 && a.count > 0 { - time.Sleep(sleep) - now = time.Now() - } - a.count++ - a.last = now - return true -} - -func (a *Attempt) nextSleep(now time.Time) time.Duration { - sleep := a.strategy.Delay - now.Sub(a.last) - if sleep < 0 { - return 0 - } - return sleep -} - -// HasNext returns whether another attempt will be made if the current -// one fails. If it returns true, the following call to Next is -// guaranteed to return true. -func (a *Attempt) HasNext() bool { - if a.force || a.strategy.Min > a.count { - return true - } - now := time.Now() - if now.Add(a.nextSleep(now)).Before(a.end) { - a.force = true - return true - } - return false -} diff --git a/vendor/github.com/denverdino/aliyungo/util/encoding.go b/vendor/github.com/denverdino/aliyungo/util/encoding.go deleted file mode 100644 index ec1a5b137..000000000 --- a/vendor/github.com/denverdino/aliyungo/util/encoding.go +++ /dev/null @@ -1,331 +0,0 @@ -package util - -import ( - "encoding/json" - "fmt" - "log" - "net/url" - "reflect" - "strconv" - "strings" - "time" -) - -// change instance=["a", "b"] -// to instance.1="a" instance.2="b" -func FlattenFn(fieldName string, field reflect.Value, values *url.Values) { - l := field.Len() - if l > 0 { - for i := 0; i < l; i++ { - str := field.Index(i).String() - values.Set(fieldName+"."+strconv.Itoa(i+1), str) - } - } -} - -func Underline2Dot(name string) string { - return strings.Replace(name, "_", ".", -1) -} - -//ConvertToQueryValues converts the struct to url.Values -func ConvertToQueryValues(ifc interface{}) url.Values { - values := url.Values{} - SetQueryValues(ifc, &values) - return values -} - -//SetQueryValues sets the struct to existing url.Values following ECS encoding rules -func SetQueryValues(ifc interface{}, values *url.Values) { - setQueryValues(ifc, values, "") -} - -func SetQueryValueByFlattenMethod(ifc interface{}, values *url.Values) { - setQueryValuesByFlattenMethod(ifc, values, "") -} - -func setQueryValues(i interface{}, values *url.Values, prefix string) { - // add to support url.Values - mapValues, ok := i.(url.Values) - if ok { - for k, _ := range mapValues { - values.Set(k, mapValues.Get(k)) - } - return - } - - elem := reflect.ValueOf(i) - if elem.Kind() == reflect.Ptr { - elem = elem.Elem() - } - elemType := elem.Type() - for i := 0; i < elem.NumField(); i++ { - - fieldName := elemType.Field(i).Name - anonymous := elemType.Field(i).Anonymous - tag := elemType.Field(i).Tag.Get("query") - argName := elemType.Field(i).Tag.Get("ArgName") - field := elem.Field(i) - // TODO Use Tag for validation - // tag := typ.Field(i).Tag.Get("tagname") - kind := field.Kind() - isPtr := false - if (kind == reflect.Ptr || kind == reflect.Array || kind == reflect.Slice || kind == reflect.Map || kind == reflect.Chan) && field.IsNil() { - continue - } - if kind == reflect.Ptr { - field = field.Elem() - kind = field.Kind() - isPtr = true - } - var value string - //switch field.Interface().(type) { - switch kind { - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - i := field.Int() - if i != 0 || isPtr { - value = strconv.FormatInt(i, 10) - } - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: - i := field.Uint() - if i != 0 || isPtr { - value = strconv.FormatUint(i, 10) - } - case reflect.Float32: - value = strconv.FormatFloat(field.Float(), 'f', 4, 32) - case reflect.Float64: - value = strconv.FormatFloat(field.Float(), 'f', 4, 64) - case reflect.Bool: - value = strconv.FormatBool(field.Bool()) - case reflect.String: - value = field.String() - case reflect.Map: - ifc := field.Interface() - m := ifc.(map[string]string) - if m != nil { - j := 0 - for k, v := range m { - j++ - keyName := fmt.Sprintf("%s.%d.Key", fieldName, j) - values.Set(keyName, k) - valueName := fmt.Sprintf("%s.%d.Value", fieldName, j) - values.Set(valueName, v) - } - } - case reflect.Slice: - switch field.Type().Elem().Kind() { - case reflect.Uint8: - value = string(field.Bytes()) - case reflect.String: - l := field.Len() - if l > 0 { - if tag == "list" { - name := argName - if argName == "" { - name = fieldName - } - for i := 0; i < l; i++ { - valueName := fmt.Sprintf("%s.%d", name, (i + 1)) - values.Set(valueName, field.Index(i).String()) - } - } else { - strArray := make([]string, l) - for i := 0; i < l; i++ { - strArray[i] = field.Index(i).String() - } - bytes, err := json.Marshal(strArray) - if err == nil { - value = string(bytes) - } else { - log.Printf("Failed to convert JSON: %v", err) - } - } - } - default: - l := field.Len() - for j := 0; j < l; j++ { - prefixName := fmt.Sprintf("%s.%d.", fieldName, (j + 1)) - ifc := field.Index(j).Interface() - //log.Printf("%s : %v", prefixName, ifc) - if ifc != nil { - setQueryValues(ifc, values, prefixName) - } - } - continue - } - - default: - switch field.Interface().(type) { - case ISO6801Time: - t := field.Interface().(ISO6801Time) - value = t.String() - case time.Time: - t := field.Interface().(time.Time) - value = GetISO8601TimeStamp(t) - default: - ifc := field.Interface() - if ifc != nil { - if anonymous { - SetQueryValues(ifc, values) - } else { - prefixName := fieldName + "." - setQueryValues(ifc, values, prefixName) - } - continue - } - } - } - if value != "" { - name := argName - if argName == "" { - name = fieldName - } - if prefix != "" { - name = prefix + name - } - values.Set(name, value) - } - } -} - -func setQueryValuesByFlattenMethod(i interface{}, values *url.Values, prefix string) { - // add to support url.Values - mapValues, ok := i.(url.Values) - if ok { - for k, _ := range mapValues { - values.Set(k, mapValues.Get(k)) - } - return - } - - elem := reflect.ValueOf(i) - if elem.Kind() == reflect.Ptr { - elem = elem.Elem() - } - elemType := elem.Type() - for i := 0; i < elem.NumField(); i++ { - - fieldName := elemType.Field(i).Name - anonymous := elemType.Field(i).Anonymous - field := elem.Field(i) - - // TODO Use Tag for validation - // tag := typ.Field(i).Tag.Get("tagname") - kind := field.Kind() - - isPtr := false - if (kind == reflect.Ptr || kind == reflect.Array || kind == reflect.Slice || kind == reflect.Map || kind == reflect.Chan) && field.IsNil() { - continue - } - if kind == reflect.Ptr { - field = field.Elem() - kind = field.Kind() - isPtr = true - } - - var value string - //switch field.Interface().(type) { - switch kind { - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - i := field.Int() - if i != 0 || isPtr { - value = strconv.FormatInt(i, 10) - } - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: - i := field.Uint() - if i != 0 || isPtr { - value = strconv.FormatUint(i, 10) - } - case reflect.Float32: - value = strconv.FormatFloat(field.Float(), 'f', 4, 32) - case reflect.Float64: - value = strconv.FormatFloat(field.Float(), 'f', 4, 64) - case reflect.Bool: - value = strconv.FormatBool(field.Bool()) - case reflect.String: - value = field.String() - case reflect.Map: - ifc := field.Interface() - m := ifc.(map[string]string) - if m != nil { - j := 0 - for k, v := range m { - j++ - keyName := fmt.Sprintf("%s.%d.Key", fieldName, j) - values.Set(keyName, k) - valueName := fmt.Sprintf("%s.%d.Value", fieldName, j) - values.Set(valueName, v) - } - } - case reflect.Slice: - if field.Type().Name() == "FlattenArray" { - FlattenFn(fieldName, field, values) - } else { - switch field.Type().Elem().Kind() { - case reflect.Uint8: - value = string(field.Bytes()) - case reflect.String: - l := field.Len() - if l > 0 { - strArray := make([]string, l) - for i := 0; i < l; i++ { - strArray[i] = field.Index(i).String() - } - bytes, err := json.Marshal(strArray) - if err == nil { - value = string(bytes) - } else { - log.Printf("Failed to convert JSON: %v", err) - } - } - default: - l := field.Len() - for j := 0; j < l; j++ { - prefixName := fmt.Sprintf("%s.%d.", fieldName, (j + 1)) - ifc := field.Index(j).Interface() - //log.Printf("%s : %v", prefixName, ifc) - if ifc != nil { - setQueryValuesByFlattenMethod(ifc, values, prefixName) - } - } - continue - } - } - - default: - switch field.Interface().(type) { - case ISO6801Time: - t := field.Interface().(ISO6801Time) - value = t.String() - case time.Time: - t := field.Interface().(time.Time) - value = GetISO8601TimeStamp(t) - default: - - ifc := field.Interface() - if ifc != nil { - if anonymous { - SetQueryValues(ifc, values) - } else { - prefixName := fieldName + "." - setQueryValuesByFlattenMethod(ifc, values, prefixName) - } - continue - } - } - } - if value != "" { - name := elemType.Field(i).Tag.Get("ArgName") - if name == "" { - name = fieldName - } - if prefix != "" { - name = prefix + name - } - // NOTE: here we will change name to underline style when the type is UnderlineString - if field.Type().Name() == "UnderlineString" { - name = Underline2Dot(name) - } - values.Set(name, value) - } - } -} diff --git a/vendor/github.com/denverdino/aliyungo/util/iso6801.go b/vendor/github.com/denverdino/aliyungo/util/iso6801.go deleted file mode 100644 index 9c25e8f68..000000000 --- a/vendor/github.com/denverdino/aliyungo/util/iso6801.go +++ /dev/null @@ -1,80 +0,0 @@ -package util - -import ( - "fmt" - "strconv" - "time" -) - -// GetISO8601TimeStamp gets timestamp string in ISO8601 format -func GetISO8601TimeStamp(ts time.Time) string { - t := ts.UTC() - return fmt.Sprintf("%04d-%02d-%02dT%02d:%02d:%02dZ", t.Year(), t.Month(), t.Day(), t.Hour(), t.Minute(), t.Second()) -} - -const formatISO8601 = "2006-01-02T15:04:05Z" -const jsonFormatISO8601 = `"` + formatISO8601 + `"` -const formatISO8601withoutSeconds = "2006-01-02T15:04Z" -const jsonFormatISO8601withoutSeconds = `"` + formatISO8601withoutSeconds + `"` - -// A ISO6801Time represents a time in ISO8601 format -type ISO6801Time time.Time - -// New constructs a new iso8601.Time instance from an existing -// time.Time instance. This causes the nanosecond field to be set to -// 0, and its time zone set to a fixed zone with no offset from UTC -// (but it is *not* UTC itself). -func NewISO6801Time(t time.Time) ISO6801Time { - return ISO6801Time(time.Date( - t.Year(), - t.Month(), - t.Day(), - t.Hour(), - t.Minute(), - t.Second(), - 0, - time.UTC, - )) -} - -// IsDefault checks if the time is default -func (it *ISO6801Time) IsDefault() bool { - return *it == ISO6801Time{} -} - -// MarshalJSON serializes the ISO6801Time into JSON string -func (it ISO6801Time) MarshalJSON() ([]byte, error) { - return []byte(time.Time(it).Format(jsonFormatISO8601)), nil -} - -// UnmarshalJSON deserializes the ISO6801Time from JSON string -func (it *ISO6801Time) UnmarshalJSON(data []byte) error { - str := string(data) - - if str == "\"\"" || len(data) == 0 { - return nil - } - var t time.Time - var err error - if str[0] == '"' { - t, err = time.ParseInLocation(jsonFormatISO8601, str, time.UTC) - if err != nil { - t, err = time.ParseInLocation(jsonFormatISO8601withoutSeconds, str, time.UTC) - } - } else { - var i int64 - i, err = strconv.ParseInt(str, 10, 64) - if err == nil { - t = time.Unix(i/1000, i%1000) - } - } - if err == nil { - *it = ISO6801Time(t) - } - return err -} - -// String returns the time in ISO6801Time format -func (it ISO6801Time) String() string { - return time.Time(it).Format(formatISO8601) -} diff --git a/vendor/github.com/denverdino/aliyungo/util/signature.go b/vendor/github.com/denverdino/aliyungo/util/signature.go deleted file mode 100644 index 1be6d39c7..000000000 --- a/vendor/github.com/denverdino/aliyungo/util/signature.go +++ /dev/null @@ -1,39 +0,0 @@ -package util - -import ( - "crypto/hmac" - "crypto/sha1" - "encoding/base64" - "net/url" - "strings" -) - -//CreateSignature creates signature for string following Aliyun rules -func CreateSignature(stringToSignature, accessKeySecret string) string { - // Crypto by HMAC-SHA1 - hmacSha1 := hmac.New(sha1.New, []byte(accessKeySecret)) - hmacSha1.Write([]byte(stringToSignature)) - sign := hmacSha1.Sum(nil) - - // Encode to Base64 - base64Sign := base64.StdEncoding.EncodeToString(sign) - - return base64Sign -} - -func percentReplace(str string) string { - str = strings.Replace(str, "+", "%20", -1) - str = strings.Replace(str, "*", "%2A", -1) - str = strings.Replace(str, "%7E", "~", -1) - - return str -} - -// CreateSignatureForRequest creates signature for query string values -func CreateSignatureForRequest(method string, values *url.Values, accessKeySecret string) string { - - canonicalizedQueryString := percentReplace(values.Encode()) - - stringToSign := method + "&%2F&" + url.QueryEscape(canonicalizedQueryString) - return CreateSignature(stringToSign, accessKeySecret) -} diff --git a/vendor/github.com/denverdino/aliyungo/util/util.go b/vendor/github.com/denverdino/aliyungo/util/util.go deleted file mode 100644 index 15a990da1..000000000 --- a/vendor/github.com/denverdino/aliyungo/util/util.go +++ /dev/null @@ -1,185 +0,0 @@ -package util - -import ( - "bytes" - srand "crypto/rand" - "encoding/binary" - "encoding/json" - "fmt" - "math/rand" - "net/http" - "net/url" - "sort" - "time" -) - -const dictionary = "_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" - -//CreateRandomString create random string -func CreateRandomString() string { - b := make([]byte, 32) - l := len(dictionary) - - _, err := srand.Read(b) - - if err != nil { - // fail back to insecure rand - rand.Seed(time.Now().UnixNano()) - for i := range b { - b[i] = dictionary[rand.Int()%l] - } - } else { - for i, v := range b { - b[i] = dictionary[v%byte(l)] - } - } - - return string(b) -} - -// Encode encodes the values into ``URL encoded'' form -// ("acl&bar=baz&foo=quux") sorted by key. -func Encode(v url.Values) string { - if v == nil { - return "" - } - var buf bytes.Buffer - keys := make([]string, 0, len(v)) - for k := range v { - keys = append(keys, k) - } - sort.Strings(keys) - for _, k := range keys { - vs := v[k] - prefix := url.QueryEscape(k) - for _, v := range vs { - if buf.Len() > 0 { - buf.WriteByte('&') - } - buf.WriteString(prefix) - if v != "" { - buf.WriteString("=") - buf.WriteString(url.QueryEscape(v)) - } - } - } - return buf.String() -} - -// Like Encode, but key and value are not escaped -func EncodeWithoutEscape(v url.Values) string { - if v == nil { - return "" - } - var buf bytes.Buffer - keys := make([]string, 0, len(v)) - for k := range v { - keys = append(keys, k) - } - sort.Strings(keys) - for _, k := range keys { - vs := v[k] - prefix := k - for _, v := range vs { - if buf.Len() > 0 { - buf.WriteByte('&') - } - buf.WriteString(prefix) - if v != "" { - buf.WriteString("=") - buf.WriteString(v) - } - } - } - return buf.String() -} - -func GetGMTime() string { - return time.Now().UTC().Format(http.TimeFormat) -} - -// - -func randUint32() uint32 { - return randUint32Slice(1)[0] -} - -func randUint32Slice(c int) []uint32 { - b := make([]byte, c*4) - - _, err := srand.Read(b) - - if err != nil { - // fail back to insecure rand - rand.Seed(time.Now().UnixNano()) - for i := range b { - b[i] = byte(rand.Int()) - } - } - - n := make([]uint32, c) - - for i := range n { - n[i] = binary.BigEndian.Uint32(b[i*4 : i*4+4]) - } - - return n -} - -func toByte(n uint32, st, ed byte) byte { - return byte(n%uint32(ed-st+1) + uint32(st)) -} - -func toDigit(n uint32) byte { - return toByte(n, '0', '9') -} - -func toLowerLetter(n uint32) byte { - return toByte(n, 'a', 'z') -} - -func toUpperLetter(n uint32) byte { - return toByte(n, 'A', 'Z') -} - -type convFunc func(uint32) byte - -var convFuncs = []convFunc{toDigit, toLowerLetter, toUpperLetter} - -// tools for generating a random ECS instance password -// from 8 to 30 char MUST contain digit upper, case letter and upper case letter -// http://docs.aliyun.com/#/pub/ecs/open-api/instance&createinstance -func GenerateRandomECSPassword() string { - - // [8, 30] - l := int(randUint32()%23 + 8) - - n := randUint32Slice(l) - - b := make([]byte, l) - - b[0] = toDigit(n[0]) - b[1] = toLowerLetter(n[1]) - b[2] = toUpperLetter(n[2]) - - for i := 3; i < l; i++ { - b[i] = convFuncs[n[i]%3](n[i]) - } - - s := make([]byte, l) - perm := rand.Perm(l) - for i, v := range perm { - s[v] = b[i] - } - - return string(s) - -} - -func PrettyJson(object interface{}) string { - b, err := json.MarshalIndent(object, "", " ") - if err != nil { - fmt.Printf("ERROR: PrettyJson, %v\n %s\n", err, b) - } - return string(b) -} diff --git a/vendor/github.com/json-iterator/go/.codecov.yml b/vendor/github.com/json-iterator/go/.codecov.yml new file mode 100644 index 000000000..955dc0be5 --- /dev/null +++ b/vendor/github.com/json-iterator/go/.codecov.yml @@ -0,0 +1,3 @@ +ignore: + - "output_tests/.*" + diff --git a/vendor/github.com/json-iterator/go/.gitignore b/vendor/github.com/json-iterator/go/.gitignore new file mode 100644 index 000000000..15556530a --- /dev/null +++ b/vendor/github.com/json-iterator/go/.gitignore @@ -0,0 +1,4 @@ +/vendor +/bug_test.go +/coverage.txt +/.idea diff --git a/vendor/github.com/json-iterator/go/.travis.yml b/vendor/github.com/json-iterator/go/.travis.yml new file mode 100644 index 000000000..449e67cd0 --- /dev/null +++ b/vendor/github.com/json-iterator/go/.travis.yml @@ -0,0 +1,14 @@ +language: go + +go: + - 1.8.x + - 1.x + +before_install: + - go get -t -v ./... + +script: + - ./test.sh + +after_success: + - bash <(curl -s https://codecov.io/bash) diff --git a/vendor/github.com/json-iterator/go/Gopkg.lock b/vendor/github.com/json-iterator/go/Gopkg.lock new file mode 100644 index 000000000..c8a9fbb38 --- /dev/null +++ b/vendor/github.com/json-iterator/go/Gopkg.lock @@ -0,0 +1,21 @@ +# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. + + +[[projects]] + name = "github.com/modern-go/concurrent" + packages = ["."] + revision = "e0a39a4cb4216ea8db28e22a69f4ec25610d513a" + version = "1.0.0" + +[[projects]] + name = "github.com/modern-go/reflect2" + packages = ["."] + revision = "4b7aa43c6742a2c18fdef89dd197aaae7dac7ccd" + version = "1.0.1" + +[solve-meta] + analyzer-name = "dep" + analyzer-version = 1 + inputs-digest = "ea54a775e5a354cb015502d2e7aa4b74230fc77e894f34a838b268c25ec8eeb8" + solver-name = "gps-cdcl" + solver-version = 1 diff --git a/vendor/github.com/json-iterator/go/Gopkg.toml b/vendor/github.com/json-iterator/go/Gopkg.toml new file mode 100644 index 000000000..313a0f887 --- /dev/null +++ b/vendor/github.com/json-iterator/go/Gopkg.toml @@ -0,0 +1,26 @@ +# Gopkg.toml example +# +# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md +# for detailed Gopkg.toml documentation. +# +# required = ["github.com/user/thing/cmd/thing"] +# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] +# +# [[constraint]] +# name = "github.com/user/project" +# version = "1.0.0" +# +# [[constraint]] +# name = "github.com/user/project2" +# branch = "dev" +# source = "github.com/myfork/project2" +# +# [[override]] +# name = "github.com/x/y" +# version = "2.4.0" + +ignored = ["github.com/davecgh/go-spew*","github.com/google/gofuzz*","github.com/stretchr/testify*"] + +[[constraint]] + name = "github.com/modern-go/reflect2" + version = "1.0.1" diff --git a/vendor/github.com/json-iterator/go/LICENSE b/vendor/github.com/json-iterator/go/LICENSE new file mode 100644 index 000000000..2cf4f5ab2 --- /dev/null +++ b/vendor/github.com/json-iterator/go/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2016 json-iterator + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/vendor/github.com/json-iterator/go/README.md b/vendor/github.com/json-iterator/go/README.md new file mode 100644 index 000000000..50d56ffbf --- /dev/null +++ b/vendor/github.com/json-iterator/go/README.md @@ -0,0 +1,87 @@ +[![Sourcegraph](https://sourcegraph.com/github.com/json-iterator/go/-/badge.svg)](https://sourcegraph.com/github.com/json-iterator/go?badge) +[![GoDoc](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](http://godoc.org/github.com/json-iterator/go) +[![Build Status](https://travis-ci.org/json-iterator/go.svg?branch=master)](https://travis-ci.org/json-iterator/go) +[![codecov](https://codecov.io/gh/json-iterator/go/branch/master/graph/badge.svg)](https://codecov.io/gh/json-iterator/go) +[![rcard](https://goreportcard.com/badge/github.com/json-iterator/go)](https://goreportcard.com/report/github.com/json-iterator/go) +[![License](http://img.shields.io/badge/license-mit-blue.svg?style=flat-square)](https://raw.githubusercontent.com/json-iterator/go/master/LICENSE) +[![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/json-iterator/Lobby) + +A high-performance 100% compatible drop-in replacement of "encoding/json" + +You can also use thrift like JSON using [thrift-iterator](https://github.com/thrift-iterator/go) + +# Benchmark + +![benchmark](http://jsoniter.com/benchmarks/go-benchmark.png) + +Source code: https://github.com/json-iterator/go-benchmark/blob/master/src/github.com/json-iterator/go-benchmark/benchmark_medium_payload_test.go + +Raw Result (easyjson requires static code generation) + +| | ns/op | allocation bytes | allocation times | +| --- | --- | --- | --- | +| std decode | 35510 ns/op | 1960 B/op | 99 allocs/op | +| easyjson decode | 8499 ns/op | 160 B/op | 4 allocs/op | +| jsoniter decode | 5623 ns/op | 160 B/op | 3 allocs/op | +| std encode | 2213 ns/op | 712 B/op | 5 allocs/op | +| easyjson encode | 883 ns/op | 576 B/op | 3 allocs/op | +| jsoniter encode | 837 ns/op | 384 B/op | 4 allocs/op | + +Always benchmark with your own workload. +The result depends heavily on the data input. + +# Usage + +100% compatibility with standard lib + +Replace + +```go +import "encoding/json" +json.Marshal(&data) +``` + +with + +```go +import "github.com/json-iterator/go" + +var json = jsoniter.ConfigCompatibleWithStandardLibrary +json.Marshal(&data) +``` + +Replace + +```go +import "encoding/json" +json.Unmarshal(input, &data) +``` + +with + +```go +import "github.com/json-iterator/go" + +var json = jsoniter.ConfigCompatibleWithStandardLibrary +json.Unmarshal(input, &data) +``` + +[More documentation](http://jsoniter.com/migrate-from-go-std.html) + +# How to get + +``` +go get github.com/json-iterator/go +``` + +# Contribution Welcomed ! + +Contributors + +* [thockin](https://github.com/thockin) +* [mattn](https://github.com/mattn) +* [cch123](https://github.com/cch123) +* [Oleg Shaldybin](https://github.com/olegshaldybin) +* [Jason Toffaletti](https://github.com/toffaletti) + +Report issue or pull request, or email taowen@gmail.com, or [![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/json-iterator/Lobby) diff --git a/vendor/github.com/json-iterator/go/adapter.go b/vendor/github.com/json-iterator/go/adapter.go new file mode 100644 index 000000000..e674d0f39 --- /dev/null +++ b/vendor/github.com/json-iterator/go/adapter.go @@ -0,0 +1,150 @@ +package jsoniter + +import ( + "bytes" + "io" +) + +// RawMessage to make replace json with jsoniter +type RawMessage []byte + +// Unmarshal adapts to json/encoding Unmarshal API +// +// Unmarshal parses the JSON-encoded data and stores the result in the value pointed to by v. +// Refer to https://godoc.org/encoding/json#Unmarshal for more information +func Unmarshal(data []byte, v interface{}) error { + return ConfigDefault.Unmarshal(data, v) +} + +// UnmarshalFromString convenient method to read from string instead of []byte +func UnmarshalFromString(str string, v interface{}) error { + return ConfigDefault.UnmarshalFromString(str, v) +} + +// Get quick method to get value from deeply nested JSON structure +func Get(data []byte, path ...interface{}) Any { + return ConfigDefault.Get(data, path...) +} + +// Marshal adapts to json/encoding Marshal API +// +// Marshal returns the JSON encoding of v, adapts to json/encoding Marshal API +// Refer to https://godoc.org/encoding/json#Marshal for more information +func Marshal(v interface{}) ([]byte, error) { + return ConfigDefault.Marshal(v) +} + +// MarshalIndent same as json.MarshalIndent. Prefix is not supported. +func MarshalIndent(v interface{}, prefix, indent string) ([]byte, error) { + return ConfigDefault.MarshalIndent(v, prefix, indent) +} + +// MarshalToString convenient method to write as string instead of []byte +func MarshalToString(v interface{}) (string, error) { + return ConfigDefault.MarshalToString(v) +} + +// NewDecoder adapts to json/stream NewDecoder API. +// +// NewDecoder returns a new decoder that reads from r. +// +// Instead of a json/encoding Decoder, an Decoder is returned +// Refer to https://godoc.org/encoding/json#NewDecoder for more information +func NewDecoder(reader io.Reader) *Decoder { + return ConfigDefault.NewDecoder(reader) +} + +// Decoder reads and decodes JSON values from an input stream. +// Decoder provides identical APIs with json/stream Decoder (Token() and UseNumber() are in progress) +type Decoder struct { + iter *Iterator +} + +// Decode decode JSON into interface{} +func (adapter *Decoder) Decode(obj interface{}) error { + if adapter.iter.head == adapter.iter.tail && adapter.iter.reader != nil { + if !adapter.iter.loadMore() { + return io.EOF + } + } + adapter.iter.ReadVal(obj) + err := adapter.iter.Error + if err == io.EOF { + return nil + } + return adapter.iter.Error +} + +// More is there more? +func (adapter *Decoder) More() bool { + iter := adapter.iter + if iter.Error != nil { + return false + } + c := iter.nextToken() + if c == 0 { + return false + } + iter.unreadByte() + return c != ']' && c != '}' +} + +// Buffered remaining buffer +func (adapter *Decoder) Buffered() io.Reader { + remaining := adapter.iter.buf[adapter.iter.head:adapter.iter.tail] + return bytes.NewReader(remaining) +} + +// UseNumber causes the Decoder to unmarshal a number into an interface{} as a +// Number instead of as a float64. +func (adapter *Decoder) UseNumber() { + cfg := adapter.iter.cfg.configBeforeFrozen + cfg.UseNumber = true + adapter.iter.cfg = cfg.frozeWithCacheReuse(adapter.iter.cfg.extraExtensions) +} + +// DisallowUnknownFields causes the Decoder to return an error when the destination +// is a struct and the input contains object keys which do not match any +// non-ignored, exported fields in the destination. +func (adapter *Decoder) DisallowUnknownFields() { + cfg := adapter.iter.cfg.configBeforeFrozen + cfg.DisallowUnknownFields = true + adapter.iter.cfg = cfg.frozeWithCacheReuse(adapter.iter.cfg.extraExtensions) +} + +// NewEncoder same as json.NewEncoder +func NewEncoder(writer io.Writer) *Encoder { + return ConfigDefault.NewEncoder(writer) +} + +// Encoder same as json.Encoder +type Encoder struct { + stream *Stream +} + +// Encode encode interface{} as JSON to io.Writer +func (adapter *Encoder) Encode(val interface{}) error { + adapter.stream.WriteVal(val) + adapter.stream.WriteRaw("\n") + adapter.stream.Flush() + return adapter.stream.Error +} + +// SetIndent set the indention. Prefix is not supported +func (adapter *Encoder) SetIndent(prefix, indent string) { + config := adapter.stream.cfg.configBeforeFrozen + config.IndentionStep = len(indent) + adapter.stream.cfg = config.frozeWithCacheReuse(adapter.stream.cfg.extraExtensions) +} + +// SetEscapeHTML escape html by default, set to false to disable +func (adapter *Encoder) SetEscapeHTML(escapeHTML bool) { + config := adapter.stream.cfg.configBeforeFrozen + config.EscapeHTML = escapeHTML + adapter.stream.cfg = config.frozeWithCacheReuse(adapter.stream.cfg.extraExtensions) +} + +// Valid reports whether data is a valid JSON encoding. +func Valid(data []byte) bool { + return ConfigDefault.Valid(data) +} diff --git a/vendor/github.com/json-iterator/go/any.go b/vendor/github.com/json-iterator/go/any.go new file mode 100644 index 000000000..f6b8aeab0 --- /dev/null +++ b/vendor/github.com/json-iterator/go/any.go @@ -0,0 +1,325 @@ +package jsoniter + +import ( + "errors" + "fmt" + "github.com/modern-go/reflect2" + "io" + "reflect" + "strconv" + "unsafe" +) + +// Any generic object representation. +// The lazy json implementation holds []byte and parse lazily. +type Any interface { + LastError() error + ValueType() ValueType + MustBeValid() Any + ToBool() bool + ToInt() int + ToInt32() int32 + ToInt64() int64 + ToUint() uint + ToUint32() uint32 + ToUint64() uint64 + ToFloat32() float32 + ToFloat64() float64 + ToString() string + ToVal(val interface{}) + Get(path ...interface{}) Any + Size() int + Keys() []string + GetInterface() interface{} + WriteTo(stream *Stream) +} + +type baseAny struct{} + +func (any *baseAny) Get(path ...interface{}) Any { + return &invalidAny{baseAny{}, fmt.Errorf("GetIndex %v from simple value", path)} +} + +func (any *baseAny) Size() int { + return 0 +} + +func (any *baseAny) Keys() []string { + return []string{} +} + +func (any *baseAny) ToVal(obj interface{}) { + panic("not implemented") +} + +// WrapInt32 turn int32 into Any interface +func WrapInt32(val int32) Any { + return &int32Any{baseAny{}, val} +} + +// WrapInt64 turn int64 into Any interface +func WrapInt64(val int64) Any { + return &int64Any{baseAny{}, val} +} + +// WrapUint32 turn uint32 into Any interface +func WrapUint32(val uint32) Any { + return &uint32Any{baseAny{}, val} +} + +// WrapUint64 turn uint64 into Any interface +func WrapUint64(val uint64) Any { + return &uint64Any{baseAny{}, val} +} + +// WrapFloat64 turn float64 into Any interface +func WrapFloat64(val float64) Any { + return &floatAny{baseAny{}, val} +} + +// WrapString turn string into Any interface +func WrapString(val string) Any { + return &stringAny{baseAny{}, val} +} + +// Wrap turn a go object into Any interface +func Wrap(val interface{}) Any { + if val == nil { + return &nilAny{} + } + asAny, isAny := val.(Any) + if isAny { + return asAny + } + typ := reflect2.TypeOf(val) + switch typ.Kind() { + case reflect.Slice: + return wrapArray(val) + case reflect.Struct: + return wrapStruct(val) + case reflect.Map: + return wrapMap(val) + case reflect.String: + return WrapString(val.(string)) + case reflect.Int: + if strconv.IntSize == 32 { + return WrapInt32(int32(val.(int))) + } + return WrapInt64(int64(val.(int))) + case reflect.Int8: + return WrapInt32(int32(val.(int8))) + case reflect.Int16: + return WrapInt32(int32(val.(int16))) + case reflect.Int32: + return WrapInt32(val.(int32)) + case reflect.Int64: + return WrapInt64(val.(int64)) + case reflect.Uint: + if strconv.IntSize == 32 { + return WrapUint32(uint32(val.(uint))) + } + return WrapUint64(uint64(val.(uint))) + case reflect.Uintptr: + if ptrSize == 32 { + return WrapUint32(uint32(val.(uintptr))) + } + return WrapUint64(uint64(val.(uintptr))) + case reflect.Uint8: + return WrapUint32(uint32(val.(uint8))) + case reflect.Uint16: + return WrapUint32(uint32(val.(uint16))) + case reflect.Uint32: + return WrapUint32(uint32(val.(uint32))) + case reflect.Uint64: + return WrapUint64(val.(uint64)) + case reflect.Float32: + return WrapFloat64(float64(val.(float32))) + case reflect.Float64: + return WrapFloat64(val.(float64)) + case reflect.Bool: + if val.(bool) == true { + return &trueAny{} + } + return &falseAny{} + } + return &invalidAny{baseAny{}, fmt.Errorf("unsupported type: %v", typ)} +} + +// ReadAny read next JSON element as an Any object. It is a better json.RawMessage. +func (iter *Iterator) ReadAny() Any { + return iter.readAny() +} + +func (iter *Iterator) readAny() Any { + c := iter.nextToken() + switch c { + case '"': + iter.unreadByte() + return &stringAny{baseAny{}, iter.ReadString()} + case 'n': + iter.skipThreeBytes('u', 'l', 'l') // null + return &nilAny{} + case 't': + iter.skipThreeBytes('r', 'u', 'e') // true + return &trueAny{} + case 'f': + iter.skipFourBytes('a', 'l', 's', 'e') // false + return &falseAny{} + case '{': + return iter.readObjectAny() + case '[': + return iter.readArrayAny() + case '-': + return iter.readNumberAny(false) + case 0: + return &invalidAny{baseAny{}, errors.New("input is empty")} + default: + return iter.readNumberAny(true) + } +} + +func (iter *Iterator) readNumberAny(positive bool) Any { + iter.startCapture(iter.head - 1) + iter.skipNumber() + lazyBuf := iter.stopCapture() + return &numberLazyAny{baseAny{}, iter.cfg, lazyBuf, nil} +} + +func (iter *Iterator) readObjectAny() Any { + iter.startCapture(iter.head - 1) + iter.skipObject() + lazyBuf := iter.stopCapture() + return &objectLazyAny{baseAny{}, iter.cfg, lazyBuf, nil} +} + +func (iter *Iterator) readArrayAny() Any { + iter.startCapture(iter.head - 1) + iter.skipArray() + lazyBuf := iter.stopCapture() + return &arrayLazyAny{baseAny{}, iter.cfg, lazyBuf, nil} +} + +func locateObjectField(iter *Iterator, target string) []byte { + var found []byte + iter.ReadObjectCB(func(iter *Iterator, field string) bool { + if field == target { + found = iter.SkipAndReturnBytes() + return false + } + iter.Skip() + return true + }) + return found +} + +func locateArrayElement(iter *Iterator, target int) []byte { + var found []byte + n := 0 + iter.ReadArrayCB(func(iter *Iterator) bool { + if n == target { + found = iter.SkipAndReturnBytes() + return false + } + iter.Skip() + n++ + return true + }) + return found +} + +func locatePath(iter *Iterator, path []interface{}) Any { + for i, pathKeyObj := range path { + switch pathKey := pathKeyObj.(type) { + case string: + valueBytes := locateObjectField(iter, pathKey) + if valueBytes == nil { + return newInvalidAny(path[i:]) + } + iter.ResetBytes(valueBytes) + case int: + valueBytes := locateArrayElement(iter, pathKey) + if valueBytes == nil { + return newInvalidAny(path[i:]) + } + iter.ResetBytes(valueBytes) + case int32: + if '*' == pathKey { + return iter.readAny().Get(path[i:]...) + } + return newInvalidAny(path[i:]) + default: + return newInvalidAny(path[i:]) + } + } + if iter.Error != nil && iter.Error != io.EOF { + return &invalidAny{baseAny{}, iter.Error} + } + return iter.readAny() +} + +var anyType = reflect2.TypeOfPtr((*Any)(nil)).Elem() + +func createDecoderOfAny(ctx *ctx, typ reflect2.Type) ValDecoder { + if typ == anyType { + return &directAnyCodec{} + } + if typ.Implements(anyType) { + return &anyCodec{ + valType: typ, + } + } + return nil +} + +func createEncoderOfAny(ctx *ctx, typ reflect2.Type) ValEncoder { + if typ == anyType { + return &directAnyCodec{} + } + if typ.Implements(anyType) { + return &anyCodec{ + valType: typ, + } + } + return nil +} + +type anyCodec struct { + valType reflect2.Type +} + +func (codec *anyCodec) Decode(ptr unsafe.Pointer, iter *Iterator) { + panic("not implemented") +} + +func (codec *anyCodec) Encode(ptr unsafe.Pointer, stream *Stream) { + obj := codec.valType.UnsafeIndirect(ptr) + any := obj.(Any) + any.WriteTo(stream) +} + +func (codec *anyCodec) IsEmpty(ptr unsafe.Pointer) bool { + obj := codec.valType.UnsafeIndirect(ptr) + any := obj.(Any) + return any.Size() == 0 +} + +type directAnyCodec struct { +} + +func (codec *directAnyCodec) Decode(ptr unsafe.Pointer, iter *Iterator) { + *(*Any)(ptr) = iter.readAny() +} + +func (codec *directAnyCodec) Encode(ptr unsafe.Pointer, stream *Stream) { + any := *(*Any)(ptr) + if any == nil { + stream.WriteNil() + return + } + any.WriteTo(stream) +} + +func (codec *directAnyCodec) IsEmpty(ptr unsafe.Pointer) bool { + any := *(*Any)(ptr) + return any.Size() == 0 +} diff --git a/vendor/github.com/json-iterator/go/any_array.go b/vendor/github.com/json-iterator/go/any_array.go new file mode 100644 index 000000000..0449e9aa4 --- /dev/null +++ b/vendor/github.com/json-iterator/go/any_array.go @@ -0,0 +1,278 @@ +package jsoniter + +import ( + "reflect" + "unsafe" +) + +type arrayLazyAny struct { + baseAny + cfg *frozenConfig + buf []byte + err error +} + +func (any *arrayLazyAny) ValueType() ValueType { + return ArrayValue +} + +func (any *arrayLazyAny) MustBeValid() Any { + return any +} + +func (any *arrayLazyAny) LastError() error { + return any.err +} + +func (any *arrayLazyAny) ToBool() bool { + iter := any.cfg.BorrowIterator(any.buf) + defer any.cfg.ReturnIterator(iter) + return iter.ReadArray() +} + +func (any *arrayLazyAny) ToInt() int { + if any.ToBool() { + return 1 + } + return 0 +} + +func (any *arrayLazyAny) ToInt32() int32 { + if any.ToBool() { + return 1 + } + return 0 +} + +func (any *arrayLazyAny) ToInt64() int64 { + if any.ToBool() { + return 1 + } + return 0 +} + +func (any *arrayLazyAny) ToUint() uint { + if any.ToBool() { + return 1 + } + return 0 +} + +func (any *arrayLazyAny) ToUint32() uint32 { + if any.ToBool() { + return 1 + } + return 0 +} + +func (any *arrayLazyAny) ToUint64() uint64 { + if any.ToBool() { + return 1 + } + return 0 +} + +func (any *arrayLazyAny) ToFloat32() float32 { + if any.ToBool() { + return 1 + } + return 0 +} + +func (any *arrayLazyAny) ToFloat64() float64 { + if any.ToBool() { + return 1 + } + return 0 +} + +func (any *arrayLazyAny) ToString() string { + return *(*string)(unsafe.Pointer(&any.buf)) +} + +func (any *arrayLazyAny) ToVal(val interface{}) { + iter := any.cfg.BorrowIterator(any.buf) + defer any.cfg.ReturnIterator(iter) + iter.ReadVal(val) +} + +func (any *arrayLazyAny) Get(path ...interface{}) Any { + if len(path) == 0 { + return any + } + switch firstPath := path[0].(type) { + case int: + iter := any.cfg.BorrowIterator(any.buf) + defer any.cfg.ReturnIterator(iter) + valueBytes := locateArrayElement(iter, firstPath) + if valueBytes == nil { + return newInvalidAny(path) + } + iter.ResetBytes(valueBytes) + return locatePath(iter, path[1:]) + case int32: + if '*' == firstPath { + iter := any.cfg.BorrowIterator(any.buf) + defer any.cfg.ReturnIterator(iter) + arr := make([]Any, 0) + iter.ReadArrayCB(func(iter *Iterator) bool { + found := iter.readAny().Get(path[1:]...) + if found.ValueType() != InvalidValue { + arr = append(arr, found) + } + return true + }) + return wrapArray(arr) + } + return newInvalidAny(path) + default: + return newInvalidAny(path) + } +} + +func (any *arrayLazyAny) Size() int { + size := 0 + iter := any.cfg.BorrowIterator(any.buf) + defer any.cfg.ReturnIterator(iter) + iter.ReadArrayCB(func(iter *Iterator) bool { + size++ + iter.Skip() + return true + }) + return size +} + +func (any *arrayLazyAny) WriteTo(stream *Stream) { + stream.Write(any.buf) +} + +func (any *arrayLazyAny) GetInterface() interface{} { + iter := any.cfg.BorrowIterator(any.buf) + defer any.cfg.ReturnIterator(iter) + return iter.Read() +} + +type arrayAny struct { + baseAny + val reflect.Value +} + +func wrapArray(val interface{}) *arrayAny { + return &arrayAny{baseAny{}, reflect.ValueOf(val)} +} + +func (any *arrayAny) ValueType() ValueType { + return ArrayValue +} + +func (any *arrayAny) MustBeValid() Any { + return any +} + +func (any *arrayAny) LastError() error { + return nil +} + +func (any *arrayAny) ToBool() bool { + return any.val.Len() != 0 +} + +func (any *arrayAny) ToInt() int { + if any.val.Len() == 0 { + return 0 + } + return 1 +} + +func (any *arrayAny) ToInt32() int32 { + if any.val.Len() == 0 { + return 0 + } + return 1 +} + +func (any *arrayAny) ToInt64() int64 { + if any.val.Len() == 0 { + return 0 + } + return 1 +} + +func (any *arrayAny) ToUint() uint { + if any.val.Len() == 0 { + return 0 + } + return 1 +} + +func (any *arrayAny) ToUint32() uint32 { + if any.val.Len() == 0 { + return 0 + } + return 1 +} + +func (any *arrayAny) ToUint64() uint64 { + if any.val.Len() == 0 { + return 0 + } + return 1 +} + +func (any *arrayAny) ToFloat32() float32 { + if any.val.Len() == 0 { + return 0 + } + return 1 +} + +func (any *arrayAny) ToFloat64() float64 { + if any.val.Len() == 0 { + return 0 + } + return 1 +} + +func (any *arrayAny) ToString() string { + str, _ := MarshalToString(any.val.Interface()) + return str +} + +func (any *arrayAny) Get(path ...interface{}) Any { + if len(path) == 0 { + return any + } + switch firstPath := path[0].(type) { + case int: + if firstPath < 0 || firstPath >= any.val.Len() { + return newInvalidAny(path) + } + return Wrap(any.val.Index(firstPath).Interface()) + case int32: + if '*' == firstPath { + mappedAll := make([]Any, 0) + for i := 0; i < any.val.Len(); i++ { + mapped := Wrap(any.val.Index(i).Interface()).Get(path[1:]...) + if mapped.ValueType() != InvalidValue { + mappedAll = append(mappedAll, mapped) + } + } + return wrapArray(mappedAll) + } + return newInvalidAny(path) + default: + return newInvalidAny(path) + } +} + +func (any *arrayAny) Size() int { + return any.val.Len() +} + +func (any *arrayAny) WriteTo(stream *Stream) { + stream.WriteVal(any.val) +} + +func (any *arrayAny) GetInterface() interface{} { + return any.val.Interface() +} diff --git a/vendor/github.com/json-iterator/go/any_bool.go b/vendor/github.com/json-iterator/go/any_bool.go new file mode 100644 index 000000000..9452324af --- /dev/null +++ b/vendor/github.com/json-iterator/go/any_bool.go @@ -0,0 +1,137 @@ +package jsoniter + +type trueAny struct { + baseAny +} + +func (any *trueAny) LastError() error { + return nil +} + +func (any *trueAny) ToBool() bool { + return true +} + +func (any *trueAny) ToInt() int { + return 1 +} + +func (any *trueAny) ToInt32() int32 { + return 1 +} + +func (any *trueAny) ToInt64() int64 { + return 1 +} + +func (any *trueAny) ToUint() uint { + return 1 +} + +func (any *trueAny) ToUint32() uint32 { + return 1 +} + +func (any *trueAny) ToUint64() uint64 { + return 1 +} + +func (any *trueAny) ToFloat32() float32 { + return 1 +} + +func (any *trueAny) ToFloat64() float64 { + return 1 +} + +func (any *trueAny) ToString() string { + return "true" +} + +func (any *trueAny) WriteTo(stream *Stream) { + stream.WriteTrue() +} + +func (any *trueAny) Parse() *Iterator { + return nil +} + +func (any *trueAny) GetInterface() interface{} { + return true +} + +func (any *trueAny) ValueType() ValueType { + return BoolValue +} + +func (any *trueAny) MustBeValid() Any { + return any +} + +type falseAny struct { + baseAny +} + +func (any *falseAny) LastError() error { + return nil +} + +func (any *falseAny) ToBool() bool { + return false +} + +func (any *falseAny) ToInt() int { + return 0 +} + +func (any *falseAny) ToInt32() int32 { + return 0 +} + +func (any *falseAny) ToInt64() int64 { + return 0 +} + +func (any *falseAny) ToUint() uint { + return 0 +} + +func (any *falseAny) ToUint32() uint32 { + return 0 +} + +func (any *falseAny) ToUint64() uint64 { + return 0 +} + +func (any *falseAny) ToFloat32() float32 { + return 0 +} + +func (any *falseAny) ToFloat64() float64 { + return 0 +} + +func (any *falseAny) ToString() string { + return "false" +} + +func (any *falseAny) WriteTo(stream *Stream) { + stream.WriteFalse() +} + +func (any *falseAny) Parse() *Iterator { + return nil +} + +func (any *falseAny) GetInterface() interface{} { + return false +} + +func (any *falseAny) ValueType() ValueType { + return BoolValue +} + +func (any *falseAny) MustBeValid() Any { + return any +} diff --git a/vendor/github.com/json-iterator/go/any_float.go b/vendor/github.com/json-iterator/go/any_float.go new file mode 100644 index 000000000..35fdb0949 --- /dev/null +++ b/vendor/github.com/json-iterator/go/any_float.go @@ -0,0 +1,83 @@ +package jsoniter + +import ( + "strconv" +) + +type floatAny struct { + baseAny + val float64 +} + +func (any *floatAny) Parse() *Iterator { + return nil +} + +func (any *floatAny) ValueType() ValueType { + return NumberValue +} + +func (any *floatAny) MustBeValid() Any { + return any +} + +func (any *floatAny) LastError() error { + return nil +} + +func (any *floatAny) ToBool() bool { + return any.ToFloat64() != 0 +} + +func (any *floatAny) ToInt() int { + return int(any.val) +} + +func (any *floatAny) ToInt32() int32 { + return int32(any.val) +} + +func (any *floatAny) ToInt64() int64 { + return int64(any.val) +} + +func (any *floatAny) ToUint() uint { + if any.val > 0 { + return uint(any.val) + } + return 0 +} + +func (any *floatAny) ToUint32() uint32 { + if any.val > 0 { + return uint32(any.val) + } + return 0 +} + +func (any *floatAny) ToUint64() uint64 { + if any.val > 0 { + return uint64(any.val) + } + return 0 +} + +func (any *floatAny) ToFloat32() float32 { + return float32(any.val) +} + +func (any *floatAny) ToFloat64() float64 { + return any.val +} + +func (any *floatAny) ToString() string { + return strconv.FormatFloat(any.val, 'E', -1, 64) +} + +func (any *floatAny) WriteTo(stream *Stream) { + stream.WriteFloat64(any.val) +} + +func (any *floatAny) GetInterface() interface{} { + return any.val +} diff --git a/vendor/github.com/json-iterator/go/any_int32.go b/vendor/github.com/json-iterator/go/any_int32.go new file mode 100644 index 000000000..1b56f3991 --- /dev/null +++ b/vendor/github.com/json-iterator/go/any_int32.go @@ -0,0 +1,74 @@ +package jsoniter + +import ( + "strconv" +) + +type int32Any struct { + baseAny + val int32 +} + +func (any *int32Any) LastError() error { + return nil +} + +func (any *int32Any) ValueType() ValueType { + return NumberValue +} + +func (any *int32Any) MustBeValid() Any { + return any +} + +func (any *int32Any) ToBool() bool { + return any.val != 0 +} + +func (any *int32Any) ToInt() int { + return int(any.val) +} + +func (any *int32Any) ToInt32() int32 { + return any.val +} + +func (any *int32Any) ToInt64() int64 { + return int64(any.val) +} + +func (any *int32Any) ToUint() uint { + return uint(any.val) +} + +func (any *int32Any) ToUint32() uint32 { + return uint32(any.val) +} + +func (any *int32Any) ToUint64() uint64 { + return uint64(any.val) +} + +func (any *int32Any) ToFloat32() float32 { + return float32(any.val) +} + +func (any *int32Any) ToFloat64() float64 { + return float64(any.val) +} + +func (any *int32Any) ToString() string { + return strconv.FormatInt(int64(any.val), 10) +} + +func (any *int32Any) WriteTo(stream *Stream) { + stream.WriteInt32(any.val) +} + +func (any *int32Any) Parse() *Iterator { + return nil +} + +func (any *int32Any) GetInterface() interface{} { + return any.val +} diff --git a/vendor/github.com/json-iterator/go/any_int64.go b/vendor/github.com/json-iterator/go/any_int64.go new file mode 100644 index 000000000..c440d72b6 --- /dev/null +++ b/vendor/github.com/json-iterator/go/any_int64.go @@ -0,0 +1,74 @@ +package jsoniter + +import ( + "strconv" +) + +type int64Any struct { + baseAny + val int64 +} + +func (any *int64Any) LastError() error { + return nil +} + +func (any *int64Any) ValueType() ValueType { + return NumberValue +} + +func (any *int64Any) MustBeValid() Any { + return any +} + +func (any *int64Any) ToBool() bool { + return any.val != 0 +} + +func (any *int64Any) ToInt() int { + return int(any.val) +} + +func (any *int64Any) ToInt32() int32 { + return int32(any.val) +} + +func (any *int64Any) ToInt64() int64 { + return any.val +} + +func (any *int64Any) ToUint() uint { + return uint(any.val) +} + +func (any *int64Any) ToUint32() uint32 { + return uint32(any.val) +} + +func (any *int64Any) ToUint64() uint64 { + return uint64(any.val) +} + +func (any *int64Any) ToFloat32() float32 { + return float32(any.val) +} + +func (any *int64Any) ToFloat64() float64 { + return float64(any.val) +} + +func (any *int64Any) ToString() string { + return strconv.FormatInt(any.val, 10) +} + +func (any *int64Any) WriteTo(stream *Stream) { + stream.WriteInt64(any.val) +} + +func (any *int64Any) Parse() *Iterator { + return nil +} + +func (any *int64Any) GetInterface() interface{} { + return any.val +} diff --git a/vendor/github.com/json-iterator/go/any_invalid.go b/vendor/github.com/json-iterator/go/any_invalid.go new file mode 100644 index 000000000..1d859eac3 --- /dev/null +++ b/vendor/github.com/json-iterator/go/any_invalid.go @@ -0,0 +1,82 @@ +package jsoniter + +import "fmt" + +type invalidAny struct { + baseAny + err error +} + +func newInvalidAny(path []interface{}) *invalidAny { + return &invalidAny{baseAny{}, fmt.Errorf("%v not found", path)} +} + +func (any *invalidAny) LastError() error { + return any.err +} + +func (any *invalidAny) ValueType() ValueType { + return InvalidValue +} + +func (any *invalidAny) MustBeValid() Any { + panic(any.err) +} + +func (any *invalidAny) ToBool() bool { + return false +} + +func (any *invalidAny) ToInt() int { + return 0 +} + +func (any *invalidAny) ToInt32() int32 { + return 0 +} + +func (any *invalidAny) ToInt64() int64 { + return 0 +} + +func (any *invalidAny) ToUint() uint { + return 0 +} + +func (any *invalidAny) ToUint32() uint32 { + return 0 +} + +func (any *invalidAny) ToUint64() uint64 { + return 0 +} + +func (any *invalidAny) ToFloat32() float32 { + return 0 +} + +func (any *invalidAny) ToFloat64() float64 { + return 0 +} + +func (any *invalidAny) ToString() string { + return "" +} + +func (any *invalidAny) WriteTo(stream *Stream) { +} + +func (any *invalidAny) Get(path ...interface{}) Any { + if any.err == nil { + return &invalidAny{baseAny{}, fmt.Errorf("get %v from invalid", path)} + } + return &invalidAny{baseAny{}, fmt.Errorf("%v, get %v from invalid", any.err, path)} +} + +func (any *invalidAny) Parse() *Iterator { + return nil +} + +func (any *invalidAny) GetInterface() interface{} { + return nil +} diff --git a/vendor/github.com/json-iterator/go/any_nil.go b/vendor/github.com/json-iterator/go/any_nil.go new file mode 100644 index 000000000..d04cb54c1 --- /dev/null +++ b/vendor/github.com/json-iterator/go/any_nil.go @@ -0,0 +1,69 @@ +package jsoniter + +type nilAny struct { + baseAny +} + +func (any *nilAny) LastError() error { + return nil +} + +func (any *nilAny) ValueType() ValueType { + return NilValue +} + +func (any *nilAny) MustBeValid() Any { + return any +} + +func (any *nilAny) ToBool() bool { + return false +} + +func (any *nilAny) ToInt() int { + return 0 +} + +func (any *nilAny) ToInt32() int32 { + return 0 +} + +func (any *nilAny) ToInt64() int64 { + return 0 +} + +func (any *nilAny) ToUint() uint { + return 0 +} + +func (any *nilAny) ToUint32() uint32 { + return 0 +} + +func (any *nilAny) ToUint64() uint64 { + return 0 +} + +func (any *nilAny) ToFloat32() float32 { + return 0 +} + +func (any *nilAny) ToFloat64() float64 { + return 0 +} + +func (any *nilAny) ToString() string { + return "" +} + +func (any *nilAny) WriteTo(stream *Stream) { + stream.WriteNil() +} + +func (any *nilAny) Parse() *Iterator { + return nil +} + +func (any *nilAny) GetInterface() interface{} { + return nil +} diff --git a/vendor/github.com/json-iterator/go/any_number.go b/vendor/github.com/json-iterator/go/any_number.go new file mode 100644 index 000000000..9d1e901a6 --- /dev/null +++ b/vendor/github.com/json-iterator/go/any_number.go @@ -0,0 +1,123 @@ +package jsoniter + +import ( + "io" + "unsafe" +) + +type numberLazyAny struct { + baseAny + cfg *frozenConfig + buf []byte + err error +} + +func (any *numberLazyAny) ValueType() ValueType { + return NumberValue +} + +func (any *numberLazyAny) MustBeValid() Any { + return any +} + +func (any *numberLazyAny) LastError() error { + return any.err +} + +func (any *numberLazyAny) ToBool() bool { + return any.ToFloat64() != 0 +} + +func (any *numberLazyAny) ToInt() int { + iter := any.cfg.BorrowIterator(any.buf) + defer any.cfg.ReturnIterator(iter) + val := iter.ReadInt() + if iter.Error != nil && iter.Error != io.EOF { + any.err = iter.Error + } + return val +} + +func (any *numberLazyAny) ToInt32() int32 { + iter := any.cfg.BorrowIterator(any.buf) + defer any.cfg.ReturnIterator(iter) + val := iter.ReadInt32() + if iter.Error != nil && iter.Error != io.EOF { + any.err = iter.Error + } + return val +} + +func (any *numberLazyAny) ToInt64() int64 { + iter := any.cfg.BorrowIterator(any.buf) + defer any.cfg.ReturnIterator(iter) + val := iter.ReadInt64() + if iter.Error != nil && iter.Error != io.EOF { + any.err = iter.Error + } + return val +} + +func (any *numberLazyAny) ToUint() uint { + iter := any.cfg.BorrowIterator(any.buf) + defer any.cfg.ReturnIterator(iter) + val := iter.ReadUint() + if iter.Error != nil && iter.Error != io.EOF { + any.err = iter.Error + } + return val +} + +func (any *numberLazyAny) ToUint32() uint32 { + iter := any.cfg.BorrowIterator(any.buf) + defer any.cfg.ReturnIterator(iter) + val := iter.ReadUint32() + if iter.Error != nil && iter.Error != io.EOF { + any.err = iter.Error + } + return val +} + +func (any *numberLazyAny) ToUint64() uint64 { + iter := any.cfg.BorrowIterator(any.buf) + defer any.cfg.ReturnIterator(iter) + val := iter.ReadUint64() + if iter.Error != nil && iter.Error != io.EOF { + any.err = iter.Error + } + return val +} + +func (any *numberLazyAny) ToFloat32() float32 { + iter := any.cfg.BorrowIterator(any.buf) + defer any.cfg.ReturnIterator(iter) + val := iter.ReadFloat32() + if iter.Error != nil && iter.Error != io.EOF { + any.err = iter.Error + } + return val +} + +func (any *numberLazyAny) ToFloat64() float64 { + iter := any.cfg.BorrowIterator(any.buf) + defer any.cfg.ReturnIterator(iter) + val := iter.ReadFloat64() + if iter.Error != nil && iter.Error != io.EOF { + any.err = iter.Error + } + return val +} + +func (any *numberLazyAny) ToString() string { + return *(*string)(unsafe.Pointer(&any.buf)) +} + +func (any *numberLazyAny) WriteTo(stream *Stream) { + stream.Write(any.buf) +} + +func (any *numberLazyAny) GetInterface() interface{} { + iter := any.cfg.BorrowIterator(any.buf) + defer any.cfg.ReturnIterator(iter) + return iter.Read() +} diff --git a/vendor/github.com/json-iterator/go/any_object.go b/vendor/github.com/json-iterator/go/any_object.go new file mode 100644 index 000000000..c44ef5c98 --- /dev/null +++ b/vendor/github.com/json-iterator/go/any_object.go @@ -0,0 +1,374 @@ +package jsoniter + +import ( + "reflect" + "unsafe" +) + +type objectLazyAny struct { + baseAny + cfg *frozenConfig + buf []byte + err error +} + +func (any *objectLazyAny) ValueType() ValueType { + return ObjectValue +} + +func (any *objectLazyAny) MustBeValid() Any { + return any +} + +func (any *objectLazyAny) LastError() error { + return any.err +} + +func (any *objectLazyAny) ToBool() bool { + return true +} + +func (any *objectLazyAny) ToInt() int { + return 0 +} + +func (any *objectLazyAny) ToInt32() int32 { + return 0 +} + +func (any *objectLazyAny) ToInt64() int64 { + return 0 +} + +func (any *objectLazyAny) ToUint() uint { + return 0 +} + +func (any *objectLazyAny) ToUint32() uint32 { + return 0 +} + +func (any *objectLazyAny) ToUint64() uint64 { + return 0 +} + +func (any *objectLazyAny) ToFloat32() float32 { + return 0 +} + +func (any *objectLazyAny) ToFloat64() float64 { + return 0 +} + +func (any *objectLazyAny) ToString() string { + return *(*string)(unsafe.Pointer(&any.buf)) +} + +func (any *objectLazyAny) ToVal(obj interface{}) { + iter := any.cfg.BorrowIterator(any.buf) + defer any.cfg.ReturnIterator(iter) + iter.ReadVal(obj) +} + +func (any *objectLazyAny) Get(path ...interface{}) Any { + if len(path) == 0 { + return any + } + switch firstPath := path[0].(type) { + case string: + iter := any.cfg.BorrowIterator(any.buf) + defer any.cfg.ReturnIterator(iter) + valueBytes := locateObjectField(iter, firstPath) + if valueBytes == nil { + return newInvalidAny(path) + } + iter.ResetBytes(valueBytes) + return locatePath(iter, path[1:]) + case int32: + if '*' == firstPath { + mappedAll := map[string]Any{} + iter := any.cfg.BorrowIterator(any.buf) + defer any.cfg.ReturnIterator(iter) + iter.ReadMapCB(func(iter *Iterator, field string) bool { + mapped := locatePath(iter, path[1:]) + if mapped.ValueType() != InvalidValue { + mappedAll[field] = mapped + } + return true + }) + return wrapMap(mappedAll) + } + return newInvalidAny(path) + default: + return newInvalidAny(path) + } +} + +func (any *objectLazyAny) Keys() []string { + keys := []string{} + iter := any.cfg.BorrowIterator(any.buf) + defer any.cfg.ReturnIterator(iter) + iter.ReadMapCB(func(iter *Iterator, field string) bool { + iter.Skip() + keys = append(keys, field) + return true + }) + return keys +} + +func (any *objectLazyAny) Size() int { + size := 0 + iter := any.cfg.BorrowIterator(any.buf) + defer any.cfg.ReturnIterator(iter) + iter.ReadObjectCB(func(iter *Iterator, field string) bool { + iter.Skip() + size++ + return true + }) + return size +} + +func (any *objectLazyAny) WriteTo(stream *Stream) { + stream.Write(any.buf) +} + +func (any *objectLazyAny) GetInterface() interface{} { + iter := any.cfg.BorrowIterator(any.buf) + defer any.cfg.ReturnIterator(iter) + return iter.Read() +} + +type objectAny struct { + baseAny + err error + val reflect.Value +} + +func wrapStruct(val interface{}) *objectAny { + return &objectAny{baseAny{}, nil, reflect.ValueOf(val)} +} + +func (any *objectAny) ValueType() ValueType { + return ObjectValue +} + +func (any *objectAny) MustBeValid() Any { + return any +} + +func (any *objectAny) Parse() *Iterator { + return nil +} + +func (any *objectAny) LastError() error { + return any.err +} + +func (any *objectAny) ToBool() bool { + return any.val.NumField() != 0 +} + +func (any *objectAny) ToInt() int { + return 0 +} + +func (any *objectAny) ToInt32() int32 { + return 0 +} + +func (any *objectAny) ToInt64() int64 { + return 0 +} + +func (any *objectAny) ToUint() uint { + return 0 +} + +func (any *objectAny) ToUint32() uint32 { + return 0 +} + +func (any *objectAny) ToUint64() uint64 { + return 0 +} + +func (any *objectAny) ToFloat32() float32 { + return 0 +} + +func (any *objectAny) ToFloat64() float64 { + return 0 +} + +func (any *objectAny) ToString() string { + str, err := MarshalToString(any.val.Interface()) + any.err = err + return str +} + +func (any *objectAny) Get(path ...interface{}) Any { + if len(path) == 0 { + return any + } + switch firstPath := path[0].(type) { + case string: + field := any.val.FieldByName(firstPath) + if !field.IsValid() { + return newInvalidAny(path) + } + return Wrap(field.Interface()) + case int32: + if '*' == firstPath { + mappedAll := map[string]Any{} + for i := 0; i < any.val.NumField(); i++ { + field := any.val.Field(i) + if field.CanInterface() { + mapped := Wrap(field.Interface()).Get(path[1:]...) + if mapped.ValueType() != InvalidValue { + mappedAll[any.val.Type().Field(i).Name] = mapped + } + } + } + return wrapMap(mappedAll) + } + return newInvalidAny(path) + default: + return newInvalidAny(path) + } +} + +func (any *objectAny) Keys() []string { + keys := make([]string, 0, any.val.NumField()) + for i := 0; i < any.val.NumField(); i++ { + keys = append(keys, any.val.Type().Field(i).Name) + } + return keys +} + +func (any *objectAny) Size() int { + return any.val.NumField() +} + +func (any *objectAny) WriteTo(stream *Stream) { + stream.WriteVal(any.val) +} + +func (any *objectAny) GetInterface() interface{} { + return any.val.Interface() +} + +type mapAny struct { + baseAny + err error + val reflect.Value +} + +func wrapMap(val interface{}) *mapAny { + return &mapAny{baseAny{}, nil, reflect.ValueOf(val)} +} + +func (any *mapAny) ValueType() ValueType { + return ObjectValue +} + +func (any *mapAny) MustBeValid() Any { + return any +} + +func (any *mapAny) Parse() *Iterator { + return nil +} + +func (any *mapAny) LastError() error { + return any.err +} + +func (any *mapAny) ToBool() bool { + return true +} + +func (any *mapAny) ToInt() int { + return 0 +} + +func (any *mapAny) ToInt32() int32 { + return 0 +} + +func (any *mapAny) ToInt64() int64 { + return 0 +} + +func (any *mapAny) ToUint() uint { + return 0 +} + +func (any *mapAny) ToUint32() uint32 { + return 0 +} + +func (any *mapAny) ToUint64() uint64 { + return 0 +} + +func (any *mapAny) ToFloat32() float32 { + return 0 +} + +func (any *mapAny) ToFloat64() float64 { + return 0 +} + +func (any *mapAny) ToString() string { + str, err := MarshalToString(any.val.Interface()) + any.err = err + return str +} + +func (any *mapAny) Get(path ...interface{}) Any { + if len(path) == 0 { + return any + } + switch firstPath := path[0].(type) { + case int32: + if '*' == firstPath { + mappedAll := map[string]Any{} + for _, key := range any.val.MapKeys() { + keyAsStr := key.String() + element := Wrap(any.val.MapIndex(key).Interface()) + mapped := element.Get(path[1:]...) + if mapped.ValueType() != InvalidValue { + mappedAll[keyAsStr] = mapped + } + } + return wrapMap(mappedAll) + } + return newInvalidAny(path) + default: + value := any.val.MapIndex(reflect.ValueOf(firstPath)) + if !value.IsValid() { + return newInvalidAny(path) + } + return Wrap(value.Interface()) + } +} + +func (any *mapAny) Keys() []string { + keys := make([]string, 0, any.val.Len()) + for _, key := range any.val.MapKeys() { + keys = append(keys, key.String()) + } + return keys +} + +func (any *mapAny) Size() int { + return any.val.Len() +} + +func (any *mapAny) WriteTo(stream *Stream) { + stream.WriteVal(any.val) +} + +func (any *mapAny) GetInterface() interface{} { + return any.val.Interface() +} diff --git a/vendor/github.com/json-iterator/go/any_str.go b/vendor/github.com/json-iterator/go/any_str.go new file mode 100644 index 000000000..a4b93c78c --- /dev/null +++ b/vendor/github.com/json-iterator/go/any_str.go @@ -0,0 +1,166 @@ +package jsoniter + +import ( + "fmt" + "strconv" +) + +type stringAny struct { + baseAny + val string +} + +func (any *stringAny) Get(path ...interface{}) Any { + if len(path) == 0 { + return any + } + return &invalidAny{baseAny{}, fmt.Errorf("GetIndex %v from simple value", path)} +} + +func (any *stringAny) Parse() *Iterator { + return nil +} + +func (any *stringAny) ValueType() ValueType { + return StringValue +} + +func (any *stringAny) MustBeValid() Any { + return any +} + +func (any *stringAny) LastError() error { + return nil +} + +func (any *stringAny) ToBool() bool { + str := any.ToString() + if str == "0" { + return false + } + for _, c := range str { + switch c { + case ' ', '\n', '\r', '\t': + default: + return true + } + } + return false +} + +func (any *stringAny) ToInt() int { + return int(any.ToInt64()) + +} + +func (any *stringAny) ToInt32() int32 { + return int32(any.ToInt64()) +} + +func (any *stringAny) ToInt64() int64 { + if any.val == "" { + return 0 + } + + flag := 1 + startPos := 0 + endPos := 0 + if any.val[0] == '+' || any.val[0] == '-' { + startPos = 1 + } + + if any.val[0] == '-' { + flag = -1 + } + + for i := startPos; i < len(any.val); i++ { + if any.val[i] >= '0' && any.val[i] <= '9' { + endPos = i + 1 + } else { + break + } + } + parsed, _ := strconv.ParseInt(any.val[startPos:endPos], 10, 64) + return int64(flag) * parsed +} + +func (any *stringAny) ToUint() uint { + return uint(any.ToUint64()) +} + +func (any *stringAny) ToUint32() uint32 { + return uint32(any.ToUint64()) +} + +func (any *stringAny) ToUint64() uint64 { + if any.val == "" { + return 0 + } + + startPos := 0 + endPos := 0 + + if any.val[0] == '-' { + return 0 + } + if any.val[0] == '+' { + startPos = 1 + } + + for i := startPos; i < len(any.val); i++ { + if any.val[i] >= '0' && any.val[i] <= '9' { + endPos = i + 1 + } else { + break + } + } + parsed, _ := strconv.ParseUint(any.val[startPos:endPos], 10, 64) + return parsed +} + +func (any *stringAny) ToFloat32() float32 { + return float32(any.ToFloat64()) +} + +func (any *stringAny) ToFloat64() float64 { + if len(any.val) == 0 { + return 0 + } + + // first char invalid + if any.val[0] != '+' && any.val[0] != '-' && (any.val[0] > '9' || any.val[0] < '0') { + return 0 + } + + // extract valid num expression from string + // eg 123true => 123, -12.12xxa => -12.12 + endPos := 1 + for i := 1; i < len(any.val); i++ { + if any.val[i] == '.' || any.val[i] == 'e' || any.val[i] == 'E' || any.val[i] == '+' || any.val[i] == '-' { + endPos = i + 1 + continue + } + + // end position is the first char which is not digit + if any.val[i] >= '0' && any.val[i] <= '9' { + endPos = i + 1 + } else { + endPos = i + break + } + } + parsed, _ := strconv.ParseFloat(any.val[:endPos], 64) + return parsed +} + +func (any *stringAny) ToString() string { + return any.val +} + +func (any *stringAny) WriteTo(stream *Stream) { + stream.WriteString(any.val) +} + +func (any *stringAny) GetInterface() interface{} { + return any.val +} diff --git a/vendor/github.com/json-iterator/go/any_uint32.go b/vendor/github.com/json-iterator/go/any_uint32.go new file mode 100644 index 000000000..656bbd33d --- /dev/null +++ b/vendor/github.com/json-iterator/go/any_uint32.go @@ -0,0 +1,74 @@ +package jsoniter + +import ( + "strconv" +) + +type uint32Any struct { + baseAny + val uint32 +} + +func (any *uint32Any) LastError() error { + return nil +} + +func (any *uint32Any) ValueType() ValueType { + return NumberValue +} + +func (any *uint32Any) MustBeValid() Any { + return any +} + +func (any *uint32Any) ToBool() bool { + return any.val != 0 +} + +func (any *uint32Any) ToInt() int { + return int(any.val) +} + +func (any *uint32Any) ToInt32() int32 { + return int32(any.val) +} + +func (any *uint32Any) ToInt64() int64 { + return int64(any.val) +} + +func (any *uint32Any) ToUint() uint { + return uint(any.val) +} + +func (any *uint32Any) ToUint32() uint32 { + return any.val +} + +func (any *uint32Any) ToUint64() uint64 { + return uint64(any.val) +} + +func (any *uint32Any) ToFloat32() float32 { + return float32(any.val) +} + +func (any *uint32Any) ToFloat64() float64 { + return float64(any.val) +} + +func (any *uint32Any) ToString() string { + return strconv.FormatInt(int64(any.val), 10) +} + +func (any *uint32Any) WriteTo(stream *Stream) { + stream.WriteUint32(any.val) +} + +func (any *uint32Any) Parse() *Iterator { + return nil +} + +func (any *uint32Any) GetInterface() interface{} { + return any.val +} diff --git a/vendor/github.com/json-iterator/go/any_uint64.go b/vendor/github.com/json-iterator/go/any_uint64.go new file mode 100644 index 000000000..7df2fce33 --- /dev/null +++ b/vendor/github.com/json-iterator/go/any_uint64.go @@ -0,0 +1,74 @@ +package jsoniter + +import ( + "strconv" +) + +type uint64Any struct { + baseAny + val uint64 +} + +func (any *uint64Any) LastError() error { + return nil +} + +func (any *uint64Any) ValueType() ValueType { + return NumberValue +} + +func (any *uint64Any) MustBeValid() Any { + return any +} + +func (any *uint64Any) ToBool() bool { + return any.val != 0 +} + +func (any *uint64Any) ToInt() int { + return int(any.val) +} + +func (any *uint64Any) ToInt32() int32 { + return int32(any.val) +} + +func (any *uint64Any) ToInt64() int64 { + return int64(any.val) +} + +func (any *uint64Any) ToUint() uint { + return uint(any.val) +} + +func (any *uint64Any) ToUint32() uint32 { + return uint32(any.val) +} + +func (any *uint64Any) ToUint64() uint64 { + return any.val +} + +func (any *uint64Any) ToFloat32() float32 { + return float32(any.val) +} + +func (any *uint64Any) ToFloat64() float64 { + return float64(any.val) +} + +func (any *uint64Any) ToString() string { + return strconv.FormatUint(any.val, 10) +} + +func (any *uint64Any) WriteTo(stream *Stream) { + stream.WriteUint64(any.val) +} + +func (any *uint64Any) Parse() *Iterator { + return nil +} + +func (any *uint64Any) GetInterface() interface{} { + return any.val +} diff --git a/vendor/github.com/json-iterator/go/build.sh b/vendor/github.com/json-iterator/go/build.sh new file mode 100644 index 000000000..b45ef6883 --- /dev/null +++ b/vendor/github.com/json-iterator/go/build.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -e +set -x + +if [ ! -d /tmp/build-golang/src/github.com/json-iterator ]; then + mkdir -p /tmp/build-golang/src/github.com/json-iterator + ln -s $PWD /tmp/build-golang/src/github.com/json-iterator/go +fi +export GOPATH=/tmp/build-golang +go get -u github.com/golang/dep/cmd/dep +cd /tmp/build-golang/src/github.com/json-iterator/go +exec $GOPATH/bin/dep ensure -update diff --git a/vendor/github.com/json-iterator/go/config.go b/vendor/github.com/json-iterator/go/config.go new file mode 100644 index 000000000..8c58fcba5 --- /dev/null +++ b/vendor/github.com/json-iterator/go/config.go @@ -0,0 +1,375 @@ +package jsoniter + +import ( + "encoding/json" + "io" + "reflect" + "sync" + "unsafe" + + "github.com/modern-go/concurrent" + "github.com/modern-go/reflect2" +) + +// Config customize how the API should behave. +// The API is created from Config by Froze. +type Config struct { + IndentionStep int + MarshalFloatWith6Digits bool + EscapeHTML bool + SortMapKeys bool + UseNumber bool + DisallowUnknownFields bool + TagKey string + OnlyTaggedField bool + ValidateJsonRawMessage bool + ObjectFieldMustBeSimpleString bool + CaseSensitive bool +} + +// API the public interface of this package. +// Primary Marshal and Unmarshal. +type API interface { + IteratorPool + StreamPool + MarshalToString(v interface{}) (string, error) + Marshal(v interface{}) ([]byte, error) + MarshalIndent(v interface{}, prefix, indent string) ([]byte, error) + UnmarshalFromString(str string, v interface{}) error + Unmarshal(data []byte, v interface{}) error + Get(data []byte, path ...interface{}) Any + NewEncoder(writer io.Writer) *Encoder + NewDecoder(reader io.Reader) *Decoder + Valid(data []byte) bool + RegisterExtension(extension Extension) + DecoderOf(typ reflect2.Type) ValDecoder + EncoderOf(typ reflect2.Type) ValEncoder +} + +// ConfigDefault the default API +var ConfigDefault = Config{ + EscapeHTML: true, +}.Froze() + +// ConfigCompatibleWithStandardLibrary tries to be 100% compatible with standard library behavior +var ConfigCompatibleWithStandardLibrary = Config{ + EscapeHTML: true, + SortMapKeys: true, + ValidateJsonRawMessage: true, +}.Froze() + +// ConfigFastest marshals float with only 6 digits precision +var ConfigFastest = Config{ + EscapeHTML: false, + MarshalFloatWith6Digits: true, // will lose precession + ObjectFieldMustBeSimpleString: true, // do not unescape object field +}.Froze() + +type frozenConfig struct { + configBeforeFrozen Config + sortMapKeys bool + indentionStep int + objectFieldMustBeSimpleString bool + onlyTaggedField bool + disallowUnknownFields bool + decoderCache *concurrent.Map + encoderCache *concurrent.Map + encoderExtension Extension + decoderExtension Extension + extraExtensions []Extension + streamPool *sync.Pool + iteratorPool *sync.Pool + caseSensitive bool +} + +func (cfg *frozenConfig) initCache() { + cfg.decoderCache = concurrent.NewMap() + cfg.encoderCache = concurrent.NewMap() +} + +func (cfg *frozenConfig) addDecoderToCache(cacheKey uintptr, decoder ValDecoder) { + cfg.decoderCache.Store(cacheKey, decoder) +} + +func (cfg *frozenConfig) addEncoderToCache(cacheKey uintptr, encoder ValEncoder) { + cfg.encoderCache.Store(cacheKey, encoder) +} + +func (cfg *frozenConfig) getDecoderFromCache(cacheKey uintptr) ValDecoder { + decoder, found := cfg.decoderCache.Load(cacheKey) + if found { + return decoder.(ValDecoder) + } + return nil +} + +func (cfg *frozenConfig) getEncoderFromCache(cacheKey uintptr) ValEncoder { + encoder, found := cfg.encoderCache.Load(cacheKey) + if found { + return encoder.(ValEncoder) + } + return nil +} + +var cfgCache = concurrent.NewMap() + +func getFrozenConfigFromCache(cfg Config) *frozenConfig { + obj, found := cfgCache.Load(cfg) + if found { + return obj.(*frozenConfig) + } + return nil +} + +func addFrozenConfigToCache(cfg Config, frozenConfig *frozenConfig) { + cfgCache.Store(cfg, frozenConfig) +} + +// Froze forge API from config +func (cfg Config) Froze() API { + api := &frozenConfig{ + sortMapKeys: cfg.SortMapKeys, + indentionStep: cfg.IndentionStep, + objectFieldMustBeSimpleString: cfg.ObjectFieldMustBeSimpleString, + onlyTaggedField: cfg.OnlyTaggedField, + disallowUnknownFields: cfg.DisallowUnknownFields, + caseSensitive: cfg.CaseSensitive, + } + api.streamPool = &sync.Pool{ + New: func() interface{} { + return NewStream(api, nil, 512) + }, + } + api.iteratorPool = &sync.Pool{ + New: func() interface{} { + return NewIterator(api) + }, + } + api.initCache() + encoderExtension := EncoderExtension{} + decoderExtension := DecoderExtension{} + if cfg.MarshalFloatWith6Digits { + api.marshalFloatWith6Digits(encoderExtension) + } + if cfg.EscapeHTML { + api.escapeHTML(encoderExtension) + } + if cfg.UseNumber { + api.useNumber(decoderExtension) + } + if cfg.ValidateJsonRawMessage { + api.validateJsonRawMessage(encoderExtension) + } + api.encoderExtension = encoderExtension + api.decoderExtension = decoderExtension + api.configBeforeFrozen = cfg + return api +} + +func (cfg Config) frozeWithCacheReuse(extraExtensions []Extension) *frozenConfig { + api := getFrozenConfigFromCache(cfg) + if api != nil { + return api + } + api = cfg.Froze().(*frozenConfig) + for _, extension := range extraExtensions { + api.RegisterExtension(extension) + } + addFrozenConfigToCache(cfg, api) + return api +} + +func (cfg *frozenConfig) validateJsonRawMessage(extension EncoderExtension) { + encoder := &funcEncoder{func(ptr unsafe.Pointer, stream *Stream) { + rawMessage := *(*json.RawMessage)(ptr) + iter := cfg.BorrowIterator([]byte(rawMessage)) + iter.Read() + if iter.Error != nil { + stream.WriteRaw("null") + } else { + cfg.ReturnIterator(iter) + stream.WriteRaw(string(rawMessage)) + } + }, func(ptr unsafe.Pointer) bool { + return len(*((*json.RawMessage)(ptr))) == 0 + }} + extension[reflect2.TypeOfPtr((*json.RawMessage)(nil)).Elem()] = encoder + extension[reflect2.TypeOfPtr((*RawMessage)(nil)).Elem()] = encoder +} + +func (cfg *frozenConfig) useNumber(extension DecoderExtension) { + extension[reflect2.TypeOfPtr((*interface{})(nil)).Elem()] = &funcDecoder{func(ptr unsafe.Pointer, iter *Iterator) { + exitingValue := *((*interface{})(ptr)) + if exitingValue != nil && reflect.TypeOf(exitingValue).Kind() == reflect.Ptr { + iter.ReadVal(exitingValue) + return + } + if iter.WhatIsNext() == NumberValue { + *((*interface{})(ptr)) = json.Number(iter.readNumberAsString()) + } else { + *((*interface{})(ptr)) = iter.Read() + } + }} +} +func (cfg *frozenConfig) getTagKey() string { + tagKey := cfg.configBeforeFrozen.TagKey + if tagKey == "" { + return "json" + } + return tagKey +} + +func (cfg *frozenConfig) RegisterExtension(extension Extension) { + cfg.extraExtensions = append(cfg.extraExtensions, extension) + copied := cfg.configBeforeFrozen + cfg.configBeforeFrozen = copied +} + +type lossyFloat32Encoder struct { +} + +func (encoder *lossyFloat32Encoder) Encode(ptr unsafe.Pointer, stream *Stream) { + stream.WriteFloat32Lossy(*((*float32)(ptr))) +} + +func (encoder *lossyFloat32Encoder) IsEmpty(ptr unsafe.Pointer) bool { + return *((*float32)(ptr)) == 0 +} + +type lossyFloat64Encoder struct { +} + +func (encoder *lossyFloat64Encoder) Encode(ptr unsafe.Pointer, stream *Stream) { + stream.WriteFloat64Lossy(*((*float64)(ptr))) +} + +func (encoder *lossyFloat64Encoder) IsEmpty(ptr unsafe.Pointer) bool { + return *((*float64)(ptr)) == 0 +} + +// EnableLossyFloatMarshalling keeps 10**(-6) precision +// for float variables for better performance. +func (cfg *frozenConfig) marshalFloatWith6Digits(extension EncoderExtension) { + // for better performance + extension[reflect2.TypeOfPtr((*float32)(nil)).Elem()] = &lossyFloat32Encoder{} + extension[reflect2.TypeOfPtr((*float64)(nil)).Elem()] = &lossyFloat64Encoder{} +} + +type htmlEscapedStringEncoder struct { +} + +func (encoder *htmlEscapedStringEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { + str := *((*string)(ptr)) + stream.WriteStringWithHTMLEscaped(str) +} + +func (encoder *htmlEscapedStringEncoder) IsEmpty(ptr unsafe.Pointer) bool { + return *((*string)(ptr)) == "" +} + +func (cfg *frozenConfig) escapeHTML(encoderExtension EncoderExtension) { + encoderExtension[reflect2.TypeOfPtr((*string)(nil)).Elem()] = &htmlEscapedStringEncoder{} +} + +func (cfg *frozenConfig) cleanDecoders() { + typeDecoders = map[string]ValDecoder{} + fieldDecoders = map[string]ValDecoder{} + *cfg = *(cfg.configBeforeFrozen.Froze().(*frozenConfig)) +} + +func (cfg *frozenConfig) cleanEncoders() { + typeEncoders = map[string]ValEncoder{} + fieldEncoders = map[string]ValEncoder{} + *cfg = *(cfg.configBeforeFrozen.Froze().(*frozenConfig)) +} + +func (cfg *frozenConfig) MarshalToString(v interface{}) (string, error) { + stream := cfg.BorrowStream(nil) + defer cfg.ReturnStream(stream) + stream.WriteVal(v) + if stream.Error != nil { + return "", stream.Error + } + return string(stream.Buffer()), nil +} + +func (cfg *frozenConfig) Marshal(v interface{}) ([]byte, error) { + stream := cfg.BorrowStream(nil) + defer cfg.ReturnStream(stream) + stream.WriteVal(v) + if stream.Error != nil { + return nil, stream.Error + } + result := stream.Buffer() + copied := make([]byte, len(result)) + copy(copied, result) + return copied, nil +} + +func (cfg *frozenConfig) MarshalIndent(v interface{}, prefix, indent string) ([]byte, error) { + if prefix != "" { + panic("prefix is not supported") + } + for _, r := range indent { + if r != ' ' { + panic("indent can only be space") + } + } + newCfg := cfg.configBeforeFrozen + newCfg.IndentionStep = len(indent) + return newCfg.frozeWithCacheReuse(cfg.extraExtensions).Marshal(v) +} + +func (cfg *frozenConfig) UnmarshalFromString(str string, v interface{}) error { + data := []byte(str) + iter := cfg.BorrowIterator(data) + defer cfg.ReturnIterator(iter) + iter.ReadVal(v) + c := iter.nextToken() + if c == 0 { + if iter.Error == io.EOF { + return nil + } + return iter.Error + } + iter.ReportError("Unmarshal", "there are bytes left after unmarshal") + return iter.Error +} + +func (cfg *frozenConfig) Get(data []byte, path ...interface{}) Any { + iter := cfg.BorrowIterator(data) + defer cfg.ReturnIterator(iter) + return locatePath(iter, path) +} + +func (cfg *frozenConfig) Unmarshal(data []byte, v interface{}) error { + iter := cfg.BorrowIterator(data) + defer cfg.ReturnIterator(iter) + iter.ReadVal(v) + c := iter.nextToken() + if c == 0 { + if iter.Error == io.EOF { + return nil + } + return iter.Error + } + iter.ReportError("Unmarshal", "there are bytes left after unmarshal") + return iter.Error +} + +func (cfg *frozenConfig) NewEncoder(writer io.Writer) *Encoder { + stream := NewStream(cfg, writer, 512) + return &Encoder{stream} +} + +func (cfg *frozenConfig) NewDecoder(reader io.Reader) *Decoder { + iter := Parse(cfg, reader, 512) + return &Decoder{iter} +} + +func (cfg *frozenConfig) Valid(data []byte) bool { + iter := cfg.BorrowIterator(data) + defer cfg.ReturnIterator(iter) + iter.Skip() + return iter.Error == nil +} diff --git a/vendor/github.com/json-iterator/go/fuzzy_mode_convert_table.md b/vendor/github.com/json-iterator/go/fuzzy_mode_convert_table.md new file mode 100644 index 000000000..3095662b0 --- /dev/null +++ b/vendor/github.com/json-iterator/go/fuzzy_mode_convert_table.md @@ -0,0 +1,7 @@ +| json type \ dest type | bool | int | uint | float |string| +| --- | --- | --- | --- |--|--| +| number | positive => true
negative => true
zero => false| 23.2 => 23
-32.1 => -32| 12.1 => 12
-12.1 => 0|as normal|same as origin| +| string | empty string => false
string "0" => false
other strings => true | "123.32" => 123
"-123.4" => -123
"123.23xxxw" => 123
"abcde12" => 0
"-32.1" => -32| 13.2 => 13
-1.1 => 0 |12.1 => 12.1
-12.3 => -12.3
12.4xxa => 12.4
+1.1e2 =>110 |same as origin| +| bool | true => true
false => false| true => 1
false => 0 | true => 1
false => 0 |true => 1
false => 0|true => "true"
false => "false"| +| object | true | 0 | 0 |0|originnal json| +| array | empty array => false
nonempty array => true| [] => 0
[1,2] => 1 | [] => 0
[1,2] => 1 |[] => 0
[1,2] => 1|original json| \ No newline at end of file diff --git a/vendor/github.com/json-iterator/go/iter.go b/vendor/github.com/json-iterator/go/iter.go new file mode 100644 index 000000000..95ae54fbf --- /dev/null +++ b/vendor/github.com/json-iterator/go/iter.go @@ -0,0 +1,322 @@ +package jsoniter + +import ( + "encoding/json" + "fmt" + "io" +) + +// ValueType the type for JSON element +type ValueType int + +const ( + // InvalidValue invalid JSON element + InvalidValue ValueType = iota + // StringValue JSON element "string" + StringValue + // NumberValue JSON element 100 or 0.10 + NumberValue + // NilValue JSON element null + NilValue + // BoolValue JSON element true or false + BoolValue + // ArrayValue JSON element [] + ArrayValue + // ObjectValue JSON element {} + ObjectValue +) + +var hexDigits []byte +var valueTypes []ValueType + +func init() { + hexDigits = make([]byte, 256) + for i := 0; i < len(hexDigits); i++ { + hexDigits[i] = 255 + } + for i := '0'; i <= '9'; i++ { + hexDigits[i] = byte(i - '0') + } + for i := 'a'; i <= 'f'; i++ { + hexDigits[i] = byte((i - 'a') + 10) + } + for i := 'A'; i <= 'F'; i++ { + hexDigits[i] = byte((i - 'A') + 10) + } + valueTypes = make([]ValueType, 256) + for i := 0; i < len(valueTypes); i++ { + valueTypes[i] = InvalidValue + } + valueTypes['"'] = StringValue + valueTypes['-'] = NumberValue + valueTypes['0'] = NumberValue + valueTypes['1'] = NumberValue + valueTypes['2'] = NumberValue + valueTypes['3'] = NumberValue + valueTypes['4'] = NumberValue + valueTypes['5'] = NumberValue + valueTypes['6'] = NumberValue + valueTypes['7'] = NumberValue + valueTypes['8'] = NumberValue + valueTypes['9'] = NumberValue + valueTypes['t'] = BoolValue + valueTypes['f'] = BoolValue + valueTypes['n'] = NilValue + valueTypes['['] = ArrayValue + valueTypes['{'] = ObjectValue +} + +// Iterator is a io.Reader like object, with JSON specific read functions. +// Error is not returned as return value, but stored as Error member on this iterator instance. +type Iterator struct { + cfg *frozenConfig + reader io.Reader + buf []byte + head int + tail int + captureStartedAt int + captured []byte + Error error + Attachment interface{} // open for customized decoder +} + +// NewIterator creates an empty Iterator instance +func NewIterator(cfg API) *Iterator { + return &Iterator{ + cfg: cfg.(*frozenConfig), + reader: nil, + buf: nil, + head: 0, + tail: 0, + } +} + +// Parse creates an Iterator instance from io.Reader +func Parse(cfg API, reader io.Reader, bufSize int) *Iterator { + return &Iterator{ + cfg: cfg.(*frozenConfig), + reader: reader, + buf: make([]byte, bufSize), + head: 0, + tail: 0, + } +} + +// ParseBytes creates an Iterator instance from byte array +func ParseBytes(cfg API, input []byte) *Iterator { + return &Iterator{ + cfg: cfg.(*frozenConfig), + reader: nil, + buf: input, + head: 0, + tail: len(input), + } +} + +// ParseString creates an Iterator instance from string +func ParseString(cfg API, input string) *Iterator { + return ParseBytes(cfg, []byte(input)) +} + +// Pool returns a pool can provide more iterator with same configuration +func (iter *Iterator) Pool() IteratorPool { + return iter.cfg +} + +// Reset reuse iterator instance by specifying another reader +func (iter *Iterator) Reset(reader io.Reader) *Iterator { + iter.reader = reader + iter.head = 0 + iter.tail = 0 + return iter +} + +// ResetBytes reuse iterator instance by specifying another byte array as input +func (iter *Iterator) ResetBytes(input []byte) *Iterator { + iter.reader = nil + iter.buf = input + iter.head = 0 + iter.tail = len(input) + return iter +} + +// WhatIsNext gets ValueType of relatively next json element +func (iter *Iterator) WhatIsNext() ValueType { + valueType := valueTypes[iter.nextToken()] + iter.unreadByte() + return valueType +} + +func (iter *Iterator) skipWhitespacesWithoutLoadMore() bool { + for i := iter.head; i < iter.tail; i++ { + c := iter.buf[i] + switch c { + case ' ', '\n', '\t', '\r': + continue + } + iter.head = i + return false + } + return true +} + +func (iter *Iterator) isObjectEnd() bool { + c := iter.nextToken() + if c == ',' { + return false + } + if c == '}' { + return true + } + iter.ReportError("isObjectEnd", "object ended prematurely, unexpected char "+string([]byte{c})) + return true +} + +func (iter *Iterator) nextToken() byte { + // a variation of skip whitespaces, returning the next non-whitespace token + for { + for i := iter.head; i < iter.tail; i++ { + c := iter.buf[i] + switch c { + case ' ', '\n', '\t', '\r': + continue + } + iter.head = i + 1 + return c + } + if !iter.loadMore() { + return 0 + } + } +} + +// ReportError record a error in iterator instance with current position. +func (iter *Iterator) ReportError(operation string, msg string) { + if iter.Error != nil { + if iter.Error != io.EOF { + return + } + } + peekStart := iter.head - 10 + if peekStart < 0 { + peekStart = 0 + } + peekEnd := iter.head + 10 + if peekEnd > iter.tail { + peekEnd = iter.tail + } + parsing := string(iter.buf[peekStart:peekEnd]) + contextStart := iter.head - 50 + if contextStart < 0 { + contextStart = 0 + } + contextEnd := iter.head + 50 + if contextEnd > iter.tail { + contextEnd = iter.tail + } + context := string(iter.buf[contextStart:contextEnd]) + iter.Error = fmt.Errorf("%s: %s, error found in #%v byte of ...|%s|..., bigger context ...|%s|...", + operation, msg, iter.head-peekStart, parsing, context) +} + +// CurrentBuffer gets current buffer as string for debugging purpose +func (iter *Iterator) CurrentBuffer() string { + peekStart := iter.head - 10 + if peekStart < 0 { + peekStart = 0 + } + return fmt.Sprintf("parsing #%v byte, around ...|%s|..., whole buffer ...|%s|...", iter.head, + string(iter.buf[peekStart:iter.head]), string(iter.buf[0:iter.tail])) +} + +func (iter *Iterator) readByte() (ret byte) { + if iter.head == iter.tail { + if iter.loadMore() { + ret = iter.buf[iter.head] + iter.head++ + return ret + } + return 0 + } + ret = iter.buf[iter.head] + iter.head++ + return ret +} + +func (iter *Iterator) loadMore() bool { + if iter.reader == nil { + if iter.Error == nil { + iter.head = iter.tail + iter.Error = io.EOF + } + return false + } + if iter.captured != nil { + iter.captured = append(iter.captured, + iter.buf[iter.captureStartedAt:iter.tail]...) + iter.captureStartedAt = 0 + } + for { + n, err := iter.reader.Read(iter.buf) + if n == 0 { + if err != nil { + if iter.Error == nil { + iter.Error = err + } + return false + } + } else { + iter.head = 0 + iter.tail = n + return true + } + } +} + +func (iter *Iterator) unreadByte() { + if iter.Error != nil { + return + } + iter.head-- + return +} + +// Read read the next JSON element as generic interface{}. +func (iter *Iterator) Read() interface{} { + valueType := iter.WhatIsNext() + switch valueType { + case StringValue: + return iter.ReadString() + case NumberValue: + if iter.cfg.configBeforeFrozen.UseNumber { + return json.Number(iter.readNumberAsString()) + } + return iter.ReadFloat64() + case NilValue: + iter.skipFourBytes('n', 'u', 'l', 'l') + return nil + case BoolValue: + return iter.ReadBool() + case ArrayValue: + arr := []interface{}{} + iter.ReadArrayCB(func(iter *Iterator) bool { + var elem interface{} + iter.ReadVal(&elem) + arr = append(arr, elem) + return true + }) + return arr + case ObjectValue: + obj := map[string]interface{}{} + iter.ReadMapCB(func(Iter *Iterator, field string) bool { + var elem interface{} + iter.ReadVal(&elem) + obj[field] = elem + return true + }) + return obj + default: + iter.ReportError("Read", fmt.Sprintf("unexpected value type: %v", valueType)) + return nil + } +} diff --git a/vendor/github.com/json-iterator/go/iter_array.go b/vendor/github.com/json-iterator/go/iter_array.go new file mode 100644 index 000000000..6188cb457 --- /dev/null +++ b/vendor/github.com/json-iterator/go/iter_array.go @@ -0,0 +1,58 @@ +package jsoniter + +// ReadArray read array element, tells if the array has more element to read. +func (iter *Iterator) ReadArray() (ret bool) { + c := iter.nextToken() + switch c { + case 'n': + iter.skipThreeBytes('u', 'l', 'l') + return false // null + case '[': + c = iter.nextToken() + if c != ']' { + iter.unreadByte() + return true + } + return false + case ']': + return false + case ',': + return true + default: + iter.ReportError("ReadArray", "expect [ or , or ] or n, but found "+string([]byte{c})) + return + } +} + +// ReadArrayCB read array with callback +func (iter *Iterator) ReadArrayCB(callback func(*Iterator) bool) (ret bool) { + c := iter.nextToken() + if c == '[' { + c = iter.nextToken() + if c != ']' { + iter.unreadByte() + if !callback(iter) { + return false + } + c = iter.nextToken() + for c == ',' { + if !callback(iter) { + return false + } + c = iter.nextToken() + } + if c != ']' { + iter.ReportError("ReadArrayCB", "expect ] in the end, but found "+string([]byte{c})) + return false + } + return true + } + return true + } + if c == 'n' { + iter.skipThreeBytes('u', 'l', 'l') + return true // null + } + iter.ReportError("ReadArrayCB", "expect [ or n, but found "+string([]byte{c})) + return false +} diff --git a/vendor/github.com/json-iterator/go/iter_float.go b/vendor/github.com/json-iterator/go/iter_float.go new file mode 100644 index 000000000..b9754638e --- /dev/null +++ b/vendor/github.com/json-iterator/go/iter_float.go @@ -0,0 +1,339 @@ +package jsoniter + +import ( + "encoding/json" + "io" + "math/big" + "strconv" + "strings" + "unsafe" +) + +var floatDigits []int8 + +const invalidCharForNumber = int8(-1) +const endOfNumber = int8(-2) +const dotInNumber = int8(-3) + +func init() { + floatDigits = make([]int8, 256) + for i := 0; i < len(floatDigits); i++ { + floatDigits[i] = invalidCharForNumber + } + for i := int8('0'); i <= int8('9'); i++ { + floatDigits[i] = i - int8('0') + } + floatDigits[','] = endOfNumber + floatDigits[']'] = endOfNumber + floatDigits['}'] = endOfNumber + floatDigits[' '] = endOfNumber + floatDigits['\t'] = endOfNumber + floatDigits['\n'] = endOfNumber + floatDigits['.'] = dotInNumber +} + +// ReadBigFloat read big.Float +func (iter *Iterator) ReadBigFloat() (ret *big.Float) { + str := iter.readNumberAsString() + if iter.Error != nil && iter.Error != io.EOF { + return nil + } + prec := 64 + if len(str) > prec { + prec = len(str) + } + val, _, err := big.ParseFloat(str, 10, uint(prec), big.ToZero) + if err != nil { + iter.Error = err + return nil + } + return val +} + +// ReadBigInt read big.Int +func (iter *Iterator) ReadBigInt() (ret *big.Int) { + str := iter.readNumberAsString() + if iter.Error != nil && iter.Error != io.EOF { + return nil + } + ret = big.NewInt(0) + var success bool + ret, success = ret.SetString(str, 10) + if !success { + iter.ReportError("ReadBigInt", "invalid big int") + return nil + } + return ret +} + +//ReadFloat32 read float32 +func (iter *Iterator) ReadFloat32() (ret float32) { + c := iter.nextToken() + if c == '-' { + return -iter.readPositiveFloat32() + } + iter.unreadByte() + return iter.readPositiveFloat32() +} + +func (iter *Iterator) readPositiveFloat32() (ret float32) { + i := iter.head + // first char + if i == iter.tail { + return iter.readFloat32SlowPath() + } + c := iter.buf[i] + i++ + ind := floatDigits[c] + switch ind { + case invalidCharForNumber: + return iter.readFloat32SlowPath() + case endOfNumber: + iter.ReportError("readFloat32", "empty number") + return + case dotInNumber: + iter.ReportError("readFloat32", "leading dot is invalid") + return + case 0: + if i == iter.tail { + return iter.readFloat32SlowPath() + } + c = iter.buf[i] + switch c { + case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': + iter.ReportError("readFloat32", "leading zero is invalid") + return + } + } + value := uint64(ind) + // chars before dot +non_decimal_loop: + for ; i < iter.tail; i++ { + c = iter.buf[i] + ind := floatDigits[c] + switch ind { + case invalidCharForNumber: + return iter.readFloat32SlowPath() + case endOfNumber: + iter.head = i + return float32(value) + case dotInNumber: + break non_decimal_loop + } + if value > uint64SafeToMultiple10 { + return iter.readFloat32SlowPath() + } + value = (value << 3) + (value << 1) + uint64(ind) // value = value * 10 + ind; + } + // chars after dot + if c == '.' { + i++ + decimalPlaces := 0 + if i == iter.tail { + return iter.readFloat32SlowPath() + } + for ; i < iter.tail; i++ { + c = iter.buf[i] + ind := floatDigits[c] + switch ind { + case endOfNumber: + if decimalPlaces > 0 && decimalPlaces < len(pow10) { + iter.head = i + return float32(float64(value) / float64(pow10[decimalPlaces])) + } + // too many decimal places + return iter.readFloat32SlowPath() + case invalidCharForNumber, dotInNumber: + return iter.readFloat32SlowPath() + } + decimalPlaces++ + if value > uint64SafeToMultiple10 { + return iter.readFloat32SlowPath() + } + value = (value << 3) + (value << 1) + uint64(ind) + } + } + return iter.readFloat32SlowPath() +} + +func (iter *Iterator) readNumberAsString() (ret string) { + strBuf := [16]byte{} + str := strBuf[0:0] +load_loop: + for { + for i := iter.head; i < iter.tail; i++ { + c := iter.buf[i] + switch c { + case '+', '-', '.', 'e', 'E', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': + str = append(str, c) + continue + default: + iter.head = i + break load_loop + } + } + if !iter.loadMore() { + break + } + } + if iter.Error != nil && iter.Error != io.EOF { + return + } + if len(str) == 0 { + iter.ReportError("readNumberAsString", "invalid number") + } + return *(*string)(unsafe.Pointer(&str)) +} + +func (iter *Iterator) readFloat32SlowPath() (ret float32) { + str := iter.readNumberAsString() + if iter.Error != nil && iter.Error != io.EOF { + return + } + errMsg := validateFloat(str) + if errMsg != "" { + iter.ReportError("readFloat32SlowPath", errMsg) + return + } + val, err := strconv.ParseFloat(str, 32) + if err != nil { + iter.Error = err + return + } + return float32(val) +} + +// ReadFloat64 read float64 +func (iter *Iterator) ReadFloat64() (ret float64) { + c := iter.nextToken() + if c == '-' { + return -iter.readPositiveFloat64() + } + iter.unreadByte() + return iter.readPositiveFloat64() +} + +func (iter *Iterator) readPositiveFloat64() (ret float64) { + i := iter.head + // first char + if i == iter.tail { + return iter.readFloat64SlowPath() + } + c := iter.buf[i] + i++ + ind := floatDigits[c] + switch ind { + case invalidCharForNumber: + return iter.readFloat64SlowPath() + case endOfNumber: + iter.ReportError("readFloat64", "empty number") + return + case dotInNumber: + iter.ReportError("readFloat64", "leading dot is invalid") + return + case 0: + if i == iter.tail { + return iter.readFloat64SlowPath() + } + c = iter.buf[i] + switch c { + case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': + iter.ReportError("readFloat64", "leading zero is invalid") + return + } + } + value := uint64(ind) + // chars before dot +non_decimal_loop: + for ; i < iter.tail; i++ { + c = iter.buf[i] + ind := floatDigits[c] + switch ind { + case invalidCharForNumber: + return iter.readFloat64SlowPath() + case endOfNumber: + iter.head = i + return float64(value) + case dotInNumber: + break non_decimal_loop + } + if value > uint64SafeToMultiple10 { + return iter.readFloat64SlowPath() + } + value = (value << 3) + (value << 1) + uint64(ind) // value = value * 10 + ind; + } + // chars after dot + if c == '.' { + i++ + decimalPlaces := 0 + if i == iter.tail { + return iter.readFloat64SlowPath() + } + for ; i < iter.tail; i++ { + c = iter.buf[i] + ind := floatDigits[c] + switch ind { + case endOfNumber: + if decimalPlaces > 0 && decimalPlaces < len(pow10) { + iter.head = i + return float64(value) / float64(pow10[decimalPlaces]) + } + // too many decimal places + return iter.readFloat64SlowPath() + case invalidCharForNumber, dotInNumber: + return iter.readFloat64SlowPath() + } + decimalPlaces++ + if value > uint64SafeToMultiple10 { + return iter.readFloat64SlowPath() + } + value = (value << 3) + (value << 1) + uint64(ind) + } + } + return iter.readFloat64SlowPath() +} + +func (iter *Iterator) readFloat64SlowPath() (ret float64) { + str := iter.readNumberAsString() + if iter.Error != nil && iter.Error != io.EOF { + return + } + errMsg := validateFloat(str) + if errMsg != "" { + iter.ReportError("readFloat64SlowPath", errMsg) + return + } + val, err := strconv.ParseFloat(str, 64) + if err != nil { + iter.Error = err + return + } + return val +} + +func validateFloat(str string) string { + // strconv.ParseFloat is not validating `1.` or `1.e1` + if len(str) == 0 { + return "empty number" + } + if str[0] == '-' { + return "-- is not valid" + } + dotPos := strings.IndexByte(str, '.') + if dotPos != -1 { + if dotPos == len(str)-1 { + return "dot can not be last character" + } + switch str[dotPos+1] { + case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': + default: + return "missing digit after dot" + } + } + return "" +} + +// ReadNumber read json.Number +func (iter *Iterator) ReadNumber() (ret json.Number) { + return json.Number(iter.readNumberAsString()) +} diff --git a/vendor/github.com/json-iterator/go/iter_int.go b/vendor/github.com/json-iterator/go/iter_int.go new file mode 100644 index 000000000..214232035 --- /dev/null +++ b/vendor/github.com/json-iterator/go/iter_int.go @@ -0,0 +1,345 @@ +package jsoniter + +import ( + "math" + "strconv" +) + +var intDigits []int8 + +const uint32SafeToMultiply10 = uint32(0xffffffff)/10 - 1 +const uint64SafeToMultiple10 = uint64(0xffffffffffffffff)/10 - 1 + +func init() { + intDigits = make([]int8, 256) + for i := 0; i < len(intDigits); i++ { + intDigits[i] = invalidCharForNumber + } + for i := int8('0'); i <= int8('9'); i++ { + intDigits[i] = i - int8('0') + } +} + +// ReadUint read uint +func (iter *Iterator) ReadUint() uint { + if strconv.IntSize == 32 { + return uint(iter.ReadUint32()) + } + return uint(iter.ReadUint64()) +} + +// ReadInt read int +func (iter *Iterator) ReadInt() int { + if strconv.IntSize == 32 { + return int(iter.ReadInt32()) + } + return int(iter.ReadInt64()) +} + +// ReadInt8 read int8 +func (iter *Iterator) ReadInt8() (ret int8) { + c := iter.nextToken() + if c == '-' { + val := iter.readUint32(iter.readByte()) + if val > math.MaxInt8+1 { + iter.ReportError("ReadInt8", "overflow: "+strconv.FormatInt(int64(val), 10)) + return + } + return -int8(val) + } + val := iter.readUint32(c) + if val > math.MaxInt8 { + iter.ReportError("ReadInt8", "overflow: "+strconv.FormatInt(int64(val), 10)) + return + } + return int8(val) +} + +// ReadUint8 read uint8 +func (iter *Iterator) ReadUint8() (ret uint8) { + val := iter.readUint32(iter.nextToken()) + if val > math.MaxUint8 { + iter.ReportError("ReadUint8", "overflow: "+strconv.FormatInt(int64(val), 10)) + return + } + return uint8(val) +} + +// ReadInt16 read int16 +func (iter *Iterator) ReadInt16() (ret int16) { + c := iter.nextToken() + if c == '-' { + val := iter.readUint32(iter.readByte()) + if val > math.MaxInt16+1 { + iter.ReportError("ReadInt16", "overflow: "+strconv.FormatInt(int64(val), 10)) + return + } + return -int16(val) + } + val := iter.readUint32(c) + if val > math.MaxInt16 { + iter.ReportError("ReadInt16", "overflow: "+strconv.FormatInt(int64(val), 10)) + return + } + return int16(val) +} + +// ReadUint16 read uint16 +func (iter *Iterator) ReadUint16() (ret uint16) { + val := iter.readUint32(iter.nextToken()) + if val > math.MaxUint16 { + iter.ReportError("ReadUint16", "overflow: "+strconv.FormatInt(int64(val), 10)) + return + } + return uint16(val) +} + +// ReadInt32 read int32 +func (iter *Iterator) ReadInt32() (ret int32) { + c := iter.nextToken() + if c == '-' { + val := iter.readUint32(iter.readByte()) + if val > math.MaxInt32+1 { + iter.ReportError("ReadInt32", "overflow: "+strconv.FormatInt(int64(val), 10)) + return + } + return -int32(val) + } + val := iter.readUint32(c) + if val > math.MaxInt32 { + iter.ReportError("ReadInt32", "overflow: "+strconv.FormatInt(int64(val), 10)) + return + } + return int32(val) +} + +// ReadUint32 read uint32 +func (iter *Iterator) ReadUint32() (ret uint32) { + return iter.readUint32(iter.nextToken()) +} + +func (iter *Iterator) readUint32(c byte) (ret uint32) { + ind := intDigits[c] + if ind == 0 { + iter.assertInteger() + return 0 // single zero + } + if ind == invalidCharForNumber { + iter.ReportError("readUint32", "unexpected character: "+string([]byte{byte(ind)})) + return + } + value := uint32(ind) + if iter.tail-iter.head > 10 { + i := iter.head + ind2 := intDigits[iter.buf[i]] + if ind2 == invalidCharForNumber { + iter.head = i + iter.assertInteger() + return value + } + i++ + ind3 := intDigits[iter.buf[i]] + if ind3 == invalidCharForNumber { + iter.head = i + iter.assertInteger() + return value*10 + uint32(ind2) + } + //iter.head = i + 1 + //value = value * 100 + uint32(ind2) * 10 + uint32(ind3) + i++ + ind4 := intDigits[iter.buf[i]] + if ind4 == invalidCharForNumber { + iter.head = i + iter.assertInteger() + return value*100 + uint32(ind2)*10 + uint32(ind3) + } + i++ + ind5 := intDigits[iter.buf[i]] + if ind5 == invalidCharForNumber { + iter.head = i + iter.assertInteger() + return value*1000 + uint32(ind2)*100 + uint32(ind3)*10 + uint32(ind4) + } + i++ + ind6 := intDigits[iter.buf[i]] + if ind6 == invalidCharForNumber { + iter.head = i + iter.assertInteger() + return value*10000 + uint32(ind2)*1000 + uint32(ind3)*100 + uint32(ind4)*10 + uint32(ind5) + } + i++ + ind7 := intDigits[iter.buf[i]] + if ind7 == invalidCharForNumber { + iter.head = i + iter.assertInteger() + return value*100000 + uint32(ind2)*10000 + uint32(ind3)*1000 + uint32(ind4)*100 + uint32(ind5)*10 + uint32(ind6) + } + i++ + ind8 := intDigits[iter.buf[i]] + if ind8 == invalidCharForNumber { + iter.head = i + iter.assertInteger() + return value*1000000 + uint32(ind2)*100000 + uint32(ind3)*10000 + uint32(ind4)*1000 + uint32(ind5)*100 + uint32(ind6)*10 + uint32(ind7) + } + i++ + ind9 := intDigits[iter.buf[i]] + value = value*10000000 + uint32(ind2)*1000000 + uint32(ind3)*100000 + uint32(ind4)*10000 + uint32(ind5)*1000 + uint32(ind6)*100 + uint32(ind7)*10 + uint32(ind8) + iter.head = i + if ind9 == invalidCharForNumber { + iter.assertInteger() + return value + } + } + for { + for i := iter.head; i < iter.tail; i++ { + ind = intDigits[iter.buf[i]] + if ind == invalidCharForNumber { + iter.head = i + iter.assertInteger() + return value + } + if value > uint32SafeToMultiply10 { + value2 := (value << 3) + (value << 1) + uint32(ind) + if value2 < value { + iter.ReportError("readUint32", "overflow") + return + } + value = value2 + continue + } + value = (value << 3) + (value << 1) + uint32(ind) + } + if !iter.loadMore() { + iter.assertInteger() + return value + } + } +} + +// ReadInt64 read int64 +func (iter *Iterator) ReadInt64() (ret int64) { + c := iter.nextToken() + if c == '-' { + val := iter.readUint64(iter.readByte()) + if val > math.MaxInt64+1 { + iter.ReportError("ReadInt64", "overflow: "+strconv.FormatUint(uint64(val), 10)) + return + } + return -int64(val) + } + val := iter.readUint64(c) + if val > math.MaxInt64 { + iter.ReportError("ReadInt64", "overflow: "+strconv.FormatUint(uint64(val), 10)) + return + } + return int64(val) +} + +// ReadUint64 read uint64 +func (iter *Iterator) ReadUint64() uint64 { + return iter.readUint64(iter.nextToken()) +} + +func (iter *Iterator) readUint64(c byte) (ret uint64) { + ind := intDigits[c] + if ind == 0 { + iter.assertInteger() + return 0 // single zero + } + if ind == invalidCharForNumber { + iter.ReportError("readUint64", "unexpected character: "+string([]byte{byte(ind)})) + return + } + value := uint64(ind) + if iter.tail-iter.head > 10 { + i := iter.head + ind2 := intDigits[iter.buf[i]] + if ind2 == invalidCharForNumber { + iter.head = i + iter.assertInteger() + return value + } + i++ + ind3 := intDigits[iter.buf[i]] + if ind3 == invalidCharForNumber { + iter.head = i + iter.assertInteger() + return value*10 + uint64(ind2) + } + //iter.head = i + 1 + //value = value * 100 + uint32(ind2) * 10 + uint32(ind3) + i++ + ind4 := intDigits[iter.buf[i]] + if ind4 == invalidCharForNumber { + iter.head = i + iter.assertInteger() + return value*100 + uint64(ind2)*10 + uint64(ind3) + } + i++ + ind5 := intDigits[iter.buf[i]] + if ind5 == invalidCharForNumber { + iter.head = i + iter.assertInteger() + return value*1000 + uint64(ind2)*100 + uint64(ind3)*10 + uint64(ind4) + } + i++ + ind6 := intDigits[iter.buf[i]] + if ind6 == invalidCharForNumber { + iter.head = i + iter.assertInteger() + return value*10000 + uint64(ind2)*1000 + uint64(ind3)*100 + uint64(ind4)*10 + uint64(ind5) + } + i++ + ind7 := intDigits[iter.buf[i]] + if ind7 == invalidCharForNumber { + iter.head = i + iter.assertInteger() + return value*100000 + uint64(ind2)*10000 + uint64(ind3)*1000 + uint64(ind4)*100 + uint64(ind5)*10 + uint64(ind6) + } + i++ + ind8 := intDigits[iter.buf[i]] + if ind8 == invalidCharForNumber { + iter.head = i + iter.assertInteger() + return value*1000000 + uint64(ind2)*100000 + uint64(ind3)*10000 + uint64(ind4)*1000 + uint64(ind5)*100 + uint64(ind6)*10 + uint64(ind7) + } + i++ + ind9 := intDigits[iter.buf[i]] + value = value*10000000 + uint64(ind2)*1000000 + uint64(ind3)*100000 + uint64(ind4)*10000 + uint64(ind5)*1000 + uint64(ind6)*100 + uint64(ind7)*10 + uint64(ind8) + iter.head = i + if ind9 == invalidCharForNumber { + iter.assertInteger() + return value + } + } + for { + for i := iter.head; i < iter.tail; i++ { + ind = intDigits[iter.buf[i]] + if ind == invalidCharForNumber { + iter.head = i + iter.assertInteger() + return value + } + if value > uint64SafeToMultiple10 { + value2 := (value << 3) + (value << 1) + uint64(ind) + if value2 < value { + iter.ReportError("readUint64", "overflow") + return + } + value = value2 + continue + } + value = (value << 3) + (value << 1) + uint64(ind) + } + if !iter.loadMore() { + iter.assertInteger() + return value + } + } +} + +func (iter *Iterator) assertInteger() { + if iter.head < len(iter.buf) && iter.buf[iter.head] == '.' { + iter.ReportError("assertInteger", "can not decode float as int") + } +} diff --git a/vendor/github.com/json-iterator/go/iter_object.go b/vendor/github.com/json-iterator/go/iter_object.go new file mode 100644 index 000000000..1c5757671 --- /dev/null +++ b/vendor/github.com/json-iterator/go/iter_object.go @@ -0,0 +1,251 @@ +package jsoniter + +import ( + "fmt" + "strings" +) + +// ReadObject read one field from object. +// If object ended, returns empty string. +// Otherwise, returns the field name. +func (iter *Iterator) ReadObject() (ret string) { + c := iter.nextToken() + switch c { + case 'n': + iter.skipThreeBytes('u', 'l', 'l') + return "" // null + case '{': + c = iter.nextToken() + if c == '"' { + iter.unreadByte() + field := iter.ReadString() + c = iter.nextToken() + if c != ':' { + iter.ReportError("ReadObject", "expect : after object field, but found "+string([]byte{c})) + } + return field + } + if c == '}' { + return "" // end of object + } + iter.ReportError("ReadObject", `expect " after {, but found `+string([]byte{c})) + return + case ',': + field := iter.ReadString() + c = iter.nextToken() + if c != ':' { + iter.ReportError("ReadObject", "expect : after object field, but found "+string([]byte{c})) + } + return field + case '}': + return "" // end of object + default: + iter.ReportError("ReadObject", fmt.Sprintf(`expect { or , or } or n, but found %s`, string([]byte{c}))) + return + } +} + +// CaseInsensitive +func (iter *Iterator) readFieldHash() int64 { + hash := int64(0x811c9dc5) + c := iter.nextToken() + if c != '"' { + iter.ReportError("readFieldHash", `expect ", but found `+string([]byte{c})) + return 0 + } + for { + for i := iter.head; i < iter.tail; i++ { + // require ascii string and no escape + b := iter.buf[i] + if b == '\\' { + iter.head = i + for _, b := range iter.readStringSlowPath() { + if 'A' <= b && b <= 'Z' && !iter.cfg.caseSensitive { + b += 'a' - 'A' + } + hash ^= int64(b) + hash *= 0x1000193 + } + c = iter.nextToken() + if c != ':' { + iter.ReportError("readFieldHash", `expect :, but found `+string([]byte{c})) + return 0 + } + return hash + } + if b == '"' { + iter.head = i + 1 + c = iter.nextToken() + if c != ':' { + iter.ReportError("readFieldHash", `expect :, but found `+string([]byte{c})) + return 0 + } + return hash + } + if 'A' <= b && b <= 'Z' && !iter.cfg.caseSensitive { + b += 'a' - 'A' + } + hash ^= int64(b) + hash *= 0x1000193 + } + if !iter.loadMore() { + iter.ReportError("readFieldHash", `incomplete field name`) + return 0 + } + } +} + +func calcHash(str string, caseSensitive bool) int64 { + if !caseSensitive { + str = strings.ToLower(str) + } + hash := int64(0x811c9dc5) + for _, b := range []byte(str) { + hash ^= int64(b) + hash *= 0x1000193 + } + return int64(hash) +} + +// ReadObjectCB read object with callback, the key is ascii only and field name not copied +func (iter *Iterator) ReadObjectCB(callback func(*Iterator, string) bool) bool { + c := iter.nextToken() + var field string + if c == '{' { + c = iter.nextToken() + if c == '"' { + iter.unreadByte() + field = iter.ReadString() + c = iter.nextToken() + if c != ':' { + iter.ReportError("ReadObject", "expect : after object field, but found "+string([]byte{c})) + } + if !callback(iter, field) { + return false + } + c = iter.nextToken() + for c == ',' { + field = iter.ReadString() + c = iter.nextToken() + if c != ':' { + iter.ReportError("ReadObject", "expect : after object field, but found "+string([]byte{c})) + } + if !callback(iter, field) { + return false + } + c = iter.nextToken() + } + if c != '}' { + iter.ReportError("ReadObjectCB", `object not ended with }`) + return false + } + return true + } + if c == '}' { + return true + } + iter.ReportError("ReadObjectCB", `expect " after }, but found `+string([]byte{c})) + return false + } + if c == 'n' { + iter.skipThreeBytes('u', 'l', 'l') + return true // null + } + iter.ReportError("ReadObjectCB", `expect { or n, but found `+string([]byte{c})) + return false +} + +// ReadMapCB read map with callback, the key can be any string +func (iter *Iterator) ReadMapCB(callback func(*Iterator, string) bool) bool { + c := iter.nextToken() + if c == '{' { + c = iter.nextToken() + if c == '"' { + iter.unreadByte() + field := iter.ReadString() + if iter.nextToken() != ':' { + iter.ReportError("ReadMapCB", "expect : after object field, but found "+string([]byte{c})) + return false + } + if !callback(iter, field) { + return false + } + c = iter.nextToken() + for c == ',' { + field = iter.ReadString() + if iter.nextToken() != ':' { + iter.ReportError("ReadMapCB", "expect : after object field, but found "+string([]byte{c})) + return false + } + if !callback(iter, field) { + return false + } + c = iter.nextToken() + } + if c != '}' { + iter.ReportError("ReadMapCB", `object not ended with }`) + return false + } + return true + } + if c == '}' { + return true + } + iter.ReportError("ReadMapCB", `expect " after }, but found `+string([]byte{c})) + return false + } + if c == 'n' { + iter.skipThreeBytes('u', 'l', 'l') + return true // null + } + iter.ReportError("ReadMapCB", `expect { or n, but found `+string([]byte{c})) + return false +} + +func (iter *Iterator) readObjectStart() bool { + c := iter.nextToken() + if c == '{' { + c = iter.nextToken() + if c == '}' { + return false + } + iter.unreadByte() + return true + } else if c == 'n' { + iter.skipThreeBytes('u', 'l', 'l') + return false + } + iter.ReportError("readObjectStart", "expect { or n, but found "+string([]byte{c})) + return false +} + +func (iter *Iterator) readObjectFieldAsBytes() (ret []byte) { + str := iter.ReadStringAsSlice() + if iter.skipWhitespacesWithoutLoadMore() { + if ret == nil { + ret = make([]byte, len(str)) + copy(ret, str) + } + if !iter.loadMore() { + return + } + } + if iter.buf[iter.head] != ':' { + iter.ReportError("readObjectFieldAsBytes", "expect : after object field, but found "+string([]byte{iter.buf[iter.head]})) + return + } + iter.head++ + if iter.skipWhitespacesWithoutLoadMore() { + if ret == nil { + ret = make([]byte, len(str)) + copy(ret, str) + } + if !iter.loadMore() { + return + } + } + if ret == nil { + return str + } + return ret +} diff --git a/vendor/github.com/json-iterator/go/iter_skip.go b/vendor/github.com/json-iterator/go/iter_skip.go new file mode 100644 index 000000000..f58beb913 --- /dev/null +++ b/vendor/github.com/json-iterator/go/iter_skip.go @@ -0,0 +1,129 @@ +package jsoniter + +import "fmt" + +// ReadNil reads a json object as nil and +// returns whether it's a nil or not +func (iter *Iterator) ReadNil() (ret bool) { + c := iter.nextToken() + if c == 'n' { + iter.skipThreeBytes('u', 'l', 'l') // null + return true + } + iter.unreadByte() + return false +} + +// ReadBool reads a json object as BoolValue +func (iter *Iterator) ReadBool() (ret bool) { + c := iter.nextToken() + if c == 't' { + iter.skipThreeBytes('r', 'u', 'e') + return true + } + if c == 'f' { + iter.skipFourBytes('a', 'l', 's', 'e') + return false + } + iter.ReportError("ReadBool", "expect t or f, but found "+string([]byte{c})) + return +} + +// SkipAndReturnBytes skip next JSON element, and return its content as []byte. +// The []byte can be kept, it is a copy of data. +func (iter *Iterator) SkipAndReturnBytes() []byte { + iter.startCapture(iter.head) + iter.Skip() + return iter.stopCapture() +} + +type captureBuffer struct { + startedAt int + captured []byte +} + +func (iter *Iterator) startCapture(captureStartedAt int) { + if iter.captured != nil { + panic("already in capture mode") + } + iter.captureStartedAt = captureStartedAt + iter.captured = make([]byte, 0, 32) +} + +func (iter *Iterator) stopCapture() []byte { + if iter.captured == nil { + panic("not in capture mode") + } + captured := iter.captured + remaining := iter.buf[iter.captureStartedAt:iter.head] + iter.captureStartedAt = -1 + iter.captured = nil + if len(captured) == 0 { + copied := make([]byte, len(remaining)) + copy(copied, remaining) + return copied + } + captured = append(captured, remaining...) + return captured +} + +// Skip skips a json object and positions to relatively the next json object +func (iter *Iterator) Skip() { + c := iter.nextToken() + switch c { + case '"': + iter.skipString() + case 'n': + iter.skipThreeBytes('u', 'l', 'l') // null + case 't': + iter.skipThreeBytes('r', 'u', 'e') // true + case 'f': + iter.skipFourBytes('a', 'l', 's', 'e') // false + case '0': + iter.unreadByte() + iter.ReadFloat32() + case '-', '1', '2', '3', '4', '5', '6', '7', '8', '9': + iter.skipNumber() + case '[': + iter.skipArray() + case '{': + iter.skipObject() + default: + iter.ReportError("Skip", fmt.Sprintf("do not know how to skip: %v", c)) + return + } +} + +func (iter *Iterator) skipFourBytes(b1, b2, b3, b4 byte) { + if iter.readByte() != b1 { + iter.ReportError("skipFourBytes", fmt.Sprintf("expect %s", string([]byte{b1, b2, b3, b4}))) + return + } + if iter.readByte() != b2 { + iter.ReportError("skipFourBytes", fmt.Sprintf("expect %s", string([]byte{b1, b2, b3, b4}))) + return + } + if iter.readByte() != b3 { + iter.ReportError("skipFourBytes", fmt.Sprintf("expect %s", string([]byte{b1, b2, b3, b4}))) + return + } + if iter.readByte() != b4 { + iter.ReportError("skipFourBytes", fmt.Sprintf("expect %s", string([]byte{b1, b2, b3, b4}))) + return + } +} + +func (iter *Iterator) skipThreeBytes(b1, b2, b3 byte) { + if iter.readByte() != b1 { + iter.ReportError("skipThreeBytes", fmt.Sprintf("expect %s", string([]byte{b1, b2, b3}))) + return + } + if iter.readByte() != b2 { + iter.ReportError("skipThreeBytes", fmt.Sprintf("expect %s", string([]byte{b1, b2, b3}))) + return + } + if iter.readByte() != b3 { + iter.ReportError("skipThreeBytes", fmt.Sprintf("expect %s", string([]byte{b1, b2, b3}))) + return + } +} diff --git a/vendor/github.com/json-iterator/go/iter_skip_sloppy.go b/vendor/github.com/json-iterator/go/iter_skip_sloppy.go new file mode 100644 index 000000000..8fcdc3b69 --- /dev/null +++ b/vendor/github.com/json-iterator/go/iter_skip_sloppy.go @@ -0,0 +1,144 @@ +//+build jsoniter_sloppy + +package jsoniter + +// sloppy but faster implementation, do not validate the input json + +func (iter *Iterator) skipNumber() { + for { + for i := iter.head; i < iter.tail; i++ { + c := iter.buf[i] + switch c { + case ' ', '\n', '\r', '\t', ',', '}', ']': + iter.head = i + return + } + } + if !iter.loadMore() { + return + } + } +} + +func (iter *Iterator) skipArray() { + level := 1 + for { + for i := iter.head; i < iter.tail; i++ { + switch iter.buf[i] { + case '"': // If inside string, skip it + iter.head = i + 1 + iter.skipString() + i = iter.head - 1 // it will be i++ soon + case '[': // If open symbol, increase level + level++ + case ']': // If close symbol, increase level + level-- + + // If we have returned to the original level, we're done + if level == 0 { + iter.head = i + 1 + return + } + } + } + if !iter.loadMore() { + iter.ReportError("skipObject", "incomplete array") + return + } + } +} + +func (iter *Iterator) skipObject() { + level := 1 + for { + for i := iter.head; i < iter.tail; i++ { + switch iter.buf[i] { + case '"': // If inside string, skip it + iter.head = i + 1 + iter.skipString() + i = iter.head - 1 // it will be i++ soon + case '{': // If open symbol, increase level + level++ + case '}': // If close symbol, increase level + level-- + + // If we have returned to the original level, we're done + if level == 0 { + iter.head = i + 1 + return + } + } + } + if !iter.loadMore() { + iter.ReportError("skipObject", "incomplete object") + return + } + } +} + +func (iter *Iterator) skipString() { + for { + end, escaped := iter.findStringEnd() + if end == -1 { + if !iter.loadMore() { + iter.ReportError("skipString", "incomplete string") + return + } + if escaped { + iter.head = 1 // skip the first char as last char read is \ + } + } else { + iter.head = end + return + } + } +} + +// adapted from: https://github.com/buger/jsonparser/blob/master/parser.go +// Tries to find the end of string +// Support if string contains escaped quote symbols. +func (iter *Iterator) findStringEnd() (int, bool) { + escaped := false + for i := iter.head; i < iter.tail; i++ { + c := iter.buf[i] + if c == '"' { + if !escaped { + return i + 1, false + } + j := i - 1 + for { + if j < iter.head || iter.buf[j] != '\\' { + // even number of backslashes + // either end of buffer, or " found + return i + 1, true + } + j-- + if j < iter.head || iter.buf[j] != '\\' { + // odd number of backslashes + // it is \" or \\\" + break + } + j-- + } + } else if c == '\\' { + escaped = true + } + } + j := iter.tail - 1 + for { + if j < iter.head || iter.buf[j] != '\\' { + // even number of backslashes + // either end of buffer, or " found + return -1, false // do not end with \ + } + j-- + if j < iter.head || iter.buf[j] != '\\' { + // odd number of backslashes + // it is \" or \\\" + break + } + j-- + + } + return -1, true // end with \ +} diff --git a/vendor/github.com/json-iterator/go/iter_skip_strict.go b/vendor/github.com/json-iterator/go/iter_skip_strict.go new file mode 100644 index 000000000..6cf66d043 --- /dev/null +++ b/vendor/github.com/json-iterator/go/iter_skip_strict.go @@ -0,0 +1,99 @@ +//+build !jsoniter_sloppy + +package jsoniter + +import ( + "fmt" + "io" +) + +func (iter *Iterator) skipNumber() { + if !iter.trySkipNumber() { + iter.unreadByte() + if iter.Error != nil && iter.Error != io.EOF { + return + } + iter.ReadFloat64() + if iter.Error != nil && iter.Error != io.EOF { + iter.Error = nil + iter.ReadBigFloat() + } + } +} + +func (iter *Iterator) trySkipNumber() bool { + dotFound := false + for i := iter.head; i < iter.tail; i++ { + c := iter.buf[i] + switch c { + case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': + case '.': + if dotFound { + iter.ReportError("validateNumber", `more than one dot found in number`) + return true // already failed + } + if i+1 == iter.tail { + return false + } + c = iter.buf[i+1] + switch c { + case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': + default: + iter.ReportError("validateNumber", `missing digit after dot`) + return true // already failed + } + dotFound = true + default: + switch c { + case ',', ']', '}', ' ', '\t', '\n', '\r': + if iter.head == i { + return false // if - without following digits + } + iter.head = i + return true // must be valid + } + return false // may be invalid + } + } + return false +} + +func (iter *Iterator) skipString() { + if !iter.trySkipString() { + iter.unreadByte() + iter.ReadString() + } +} + +func (iter *Iterator) trySkipString() bool { + for i := iter.head; i < iter.tail; i++ { + c := iter.buf[i] + if c == '"' { + iter.head = i + 1 + return true // valid + } else if c == '\\' { + return false + } else if c < ' ' { + iter.ReportError("trySkipString", + fmt.Sprintf(`invalid control character found: %d`, c)) + return true // already failed + } + } + return false +} + +func (iter *Iterator) skipObject() { + iter.unreadByte() + iter.ReadObjectCB(func(iter *Iterator, field string) bool { + iter.Skip() + return true + }) +} + +func (iter *Iterator) skipArray() { + iter.unreadByte() + iter.ReadArrayCB(func(iter *Iterator) bool { + iter.Skip() + return true + }) +} diff --git a/vendor/github.com/json-iterator/go/iter_str.go b/vendor/github.com/json-iterator/go/iter_str.go new file mode 100644 index 000000000..adc487ea8 --- /dev/null +++ b/vendor/github.com/json-iterator/go/iter_str.go @@ -0,0 +1,215 @@ +package jsoniter + +import ( + "fmt" + "unicode/utf16" +) + +// ReadString read string from iterator +func (iter *Iterator) ReadString() (ret string) { + c := iter.nextToken() + if c == '"' { + for i := iter.head; i < iter.tail; i++ { + c := iter.buf[i] + if c == '"' { + ret = string(iter.buf[iter.head:i]) + iter.head = i + 1 + return ret + } else if c == '\\' { + break + } else if c < ' ' { + iter.ReportError("ReadString", + fmt.Sprintf(`invalid control character found: %d`, c)) + return + } + } + return iter.readStringSlowPath() + } else if c == 'n' { + iter.skipThreeBytes('u', 'l', 'l') + return "" + } + iter.ReportError("ReadString", `expects " or n, but found `+string([]byte{c})) + return +} + +func (iter *Iterator) readStringSlowPath() (ret string) { + var str []byte + var c byte + for iter.Error == nil { + c = iter.readByte() + if c == '"' { + return string(str) + } + if c == '\\' { + c = iter.readByte() + str = iter.readEscapedChar(c, str) + } else { + str = append(str, c) + } + } + iter.ReportError("readStringSlowPath", "unexpected end of input") + return +} + +func (iter *Iterator) readEscapedChar(c byte, str []byte) []byte { + switch c { + case 'u': + r := iter.readU4() + if utf16.IsSurrogate(r) { + c = iter.readByte() + if iter.Error != nil { + return nil + } + if c != '\\' { + iter.unreadByte() + str = appendRune(str, r) + return str + } + c = iter.readByte() + if iter.Error != nil { + return nil + } + if c != 'u' { + str = appendRune(str, r) + return iter.readEscapedChar(c, str) + } + r2 := iter.readU4() + if iter.Error != nil { + return nil + } + combined := utf16.DecodeRune(r, r2) + if combined == '\uFFFD' { + str = appendRune(str, r) + str = appendRune(str, r2) + } else { + str = appendRune(str, combined) + } + } else { + str = appendRune(str, r) + } + case '"': + str = append(str, '"') + case '\\': + str = append(str, '\\') + case '/': + str = append(str, '/') + case 'b': + str = append(str, '\b') + case 'f': + str = append(str, '\f') + case 'n': + str = append(str, '\n') + case 'r': + str = append(str, '\r') + case 't': + str = append(str, '\t') + default: + iter.ReportError("readEscapedChar", + `invalid escape char after \`) + return nil + } + return str +} + +// ReadStringAsSlice read string from iterator without copying into string form. +// The []byte can not be kept, as it will change after next iterator call. +func (iter *Iterator) ReadStringAsSlice() (ret []byte) { + c := iter.nextToken() + if c == '"' { + for i := iter.head; i < iter.tail; i++ { + // require ascii string and no escape + // for: field name, base64, number + if iter.buf[i] == '"' { + // fast path: reuse the underlying buffer + ret = iter.buf[iter.head:i] + iter.head = i + 1 + return ret + } + } + readLen := iter.tail - iter.head + copied := make([]byte, readLen, readLen*2) + copy(copied, iter.buf[iter.head:iter.tail]) + iter.head = iter.tail + for iter.Error == nil { + c := iter.readByte() + if c == '"' { + return copied + } + copied = append(copied, c) + } + return copied + } + iter.ReportError("ReadStringAsSlice", `expects " or n, but found `+string([]byte{c})) + return +} + +func (iter *Iterator) readU4() (ret rune) { + for i := 0; i < 4; i++ { + c := iter.readByte() + if iter.Error != nil { + return + } + if c >= '0' && c <= '9' { + ret = ret*16 + rune(c-'0') + } else if c >= 'a' && c <= 'f' { + ret = ret*16 + rune(c-'a'+10) + } else if c >= 'A' && c <= 'F' { + ret = ret*16 + rune(c-'A'+10) + } else { + iter.ReportError("readU4", "expects 0~9 or a~f, but found "+string([]byte{c})) + return + } + } + return ret +} + +const ( + t1 = 0x00 // 0000 0000 + tx = 0x80 // 1000 0000 + t2 = 0xC0 // 1100 0000 + t3 = 0xE0 // 1110 0000 + t4 = 0xF0 // 1111 0000 + t5 = 0xF8 // 1111 1000 + + maskx = 0x3F // 0011 1111 + mask2 = 0x1F // 0001 1111 + mask3 = 0x0F // 0000 1111 + mask4 = 0x07 // 0000 0111 + + rune1Max = 1<<7 - 1 + rune2Max = 1<<11 - 1 + rune3Max = 1<<16 - 1 + + surrogateMin = 0xD800 + surrogateMax = 0xDFFF + + maxRune = '\U0010FFFF' // Maximum valid Unicode code point. + runeError = '\uFFFD' // the "error" Rune or "Unicode replacement character" +) + +func appendRune(p []byte, r rune) []byte { + // Negative values are erroneous. Making it unsigned addresses the problem. + switch i := uint32(r); { + case i <= rune1Max: + p = append(p, byte(r)) + return p + case i <= rune2Max: + p = append(p, t2|byte(r>>6)) + p = append(p, tx|byte(r)&maskx) + return p + case i > maxRune, surrogateMin <= i && i <= surrogateMax: + r = runeError + fallthrough + case i <= rune3Max: + p = append(p, t3|byte(r>>12)) + p = append(p, tx|byte(r>>6)&maskx) + p = append(p, tx|byte(r)&maskx) + return p + default: + p = append(p, t4|byte(r>>18)) + p = append(p, tx|byte(r>>12)&maskx) + p = append(p, tx|byte(r>>6)&maskx) + p = append(p, tx|byte(r)&maskx) + return p + } +} diff --git a/vendor/github.com/json-iterator/go/jsoniter.go b/vendor/github.com/json-iterator/go/jsoniter.go new file mode 100644 index 000000000..c2934f916 --- /dev/null +++ b/vendor/github.com/json-iterator/go/jsoniter.go @@ -0,0 +1,18 @@ +// Package jsoniter implements encoding and decoding of JSON as defined in +// RFC 4627 and provides interfaces with identical syntax of standard lib encoding/json. +// Converting from encoding/json to jsoniter is no more than replacing the package with jsoniter +// and variable type declarations (if any). +// jsoniter interfaces gives 100% compatibility with code using standard lib. +// +// "JSON and Go" +// (https://golang.org/doc/articles/json_and_go.html) +// gives a description of how Marshal/Unmarshal operate +// between arbitrary or predefined json objects and bytes, +// and it applies to jsoniter.Marshal/Unmarshal as well. +// +// Besides, jsoniter.Iterator provides a different set of interfaces +// iterating given bytes/string/reader +// and yielding parsed elements one by one. +// This set of interfaces reads input as required and gives +// better performance. +package jsoniter diff --git a/vendor/github.com/json-iterator/go/pool.go b/vendor/github.com/json-iterator/go/pool.go new file mode 100644 index 000000000..e2389b56c --- /dev/null +++ b/vendor/github.com/json-iterator/go/pool.go @@ -0,0 +1,42 @@ +package jsoniter + +import ( + "io" +) + +// IteratorPool a thread safe pool of iterators with same configuration +type IteratorPool interface { + BorrowIterator(data []byte) *Iterator + ReturnIterator(iter *Iterator) +} + +// StreamPool a thread safe pool of streams with same configuration +type StreamPool interface { + BorrowStream(writer io.Writer) *Stream + ReturnStream(stream *Stream) +} + +func (cfg *frozenConfig) BorrowStream(writer io.Writer) *Stream { + stream := cfg.streamPool.Get().(*Stream) + stream.Reset(writer) + return stream +} + +func (cfg *frozenConfig) ReturnStream(stream *Stream) { + stream.out = nil + stream.Error = nil + stream.Attachment = nil + cfg.streamPool.Put(stream) +} + +func (cfg *frozenConfig) BorrowIterator(data []byte) *Iterator { + iter := cfg.iteratorPool.Get().(*Iterator) + iter.ResetBytes(data) + return iter +} + +func (cfg *frozenConfig) ReturnIterator(iter *Iterator) { + iter.Error = nil + iter.Attachment = nil + cfg.iteratorPool.Put(iter) +} diff --git a/vendor/github.com/json-iterator/go/reflect.go b/vendor/github.com/json-iterator/go/reflect.go new file mode 100644 index 000000000..4459e203f --- /dev/null +++ b/vendor/github.com/json-iterator/go/reflect.go @@ -0,0 +1,332 @@ +package jsoniter + +import ( + "fmt" + "reflect" + "unsafe" + + "github.com/modern-go/reflect2" +) + +// ValDecoder is an internal type registered to cache as needed. +// Don't confuse jsoniter.ValDecoder with json.Decoder. +// For json.Decoder's adapter, refer to jsoniter.AdapterDecoder(todo link). +// +// Reflection on type to create decoders, which is then cached +// Reflection on value is avoided as we can, as the reflect.Value itself will allocate, with following exceptions +// 1. create instance of new value, for example *int will need a int to be allocated +// 2. append to slice, if the existing cap is not enough, allocate will be done using Reflect.New +// 3. assignment to map, both key and value will be reflect.Value +// For a simple struct binding, it will be reflect.Value free and allocation free +type ValDecoder interface { + Decode(ptr unsafe.Pointer, iter *Iterator) +} + +// ValEncoder is an internal type registered to cache as needed. +// Don't confuse jsoniter.ValEncoder with json.Encoder. +// For json.Encoder's adapter, refer to jsoniter.AdapterEncoder(todo godoc link). +type ValEncoder interface { + IsEmpty(ptr unsafe.Pointer) bool + Encode(ptr unsafe.Pointer, stream *Stream) +} + +type checkIsEmpty interface { + IsEmpty(ptr unsafe.Pointer) bool +} + +type ctx struct { + *frozenConfig + prefix string + encoders map[reflect2.Type]ValEncoder + decoders map[reflect2.Type]ValDecoder +} + +func (b *ctx) caseSensitive() bool { + if b.frozenConfig == nil { + // default is case-insensitive + return false + } + return b.frozenConfig.caseSensitive +} + +func (b *ctx) append(prefix string) *ctx { + return &ctx{ + frozenConfig: b.frozenConfig, + prefix: b.prefix + " " + prefix, + encoders: b.encoders, + decoders: b.decoders, + } +} + +// ReadVal copy the underlying JSON into go interface, same as json.Unmarshal +func (iter *Iterator) ReadVal(obj interface{}) { + cacheKey := reflect2.RTypeOf(obj) + decoder := iter.cfg.getDecoderFromCache(cacheKey) + if decoder == nil { + typ := reflect2.TypeOf(obj) + if typ.Kind() != reflect.Ptr { + iter.ReportError("ReadVal", "can only unmarshal into pointer") + return + } + decoder = iter.cfg.DecoderOf(typ) + } + ptr := reflect2.PtrOf(obj) + if ptr == nil { + iter.ReportError("ReadVal", "can not read into nil pointer") + return + } + decoder.Decode(ptr, iter) +} + +// WriteVal copy the go interface into underlying JSON, same as json.Marshal +func (stream *Stream) WriteVal(val interface{}) { + if nil == val { + stream.WriteNil() + return + } + cacheKey := reflect2.RTypeOf(val) + encoder := stream.cfg.getEncoderFromCache(cacheKey) + if encoder == nil { + typ := reflect2.TypeOf(val) + encoder = stream.cfg.EncoderOf(typ) + } + encoder.Encode(reflect2.PtrOf(val), stream) +} + +func (cfg *frozenConfig) DecoderOf(typ reflect2.Type) ValDecoder { + cacheKey := typ.RType() + decoder := cfg.getDecoderFromCache(cacheKey) + if decoder != nil { + return decoder + } + ctx := &ctx{ + frozenConfig: cfg, + prefix: "", + decoders: map[reflect2.Type]ValDecoder{}, + encoders: map[reflect2.Type]ValEncoder{}, + } + ptrType := typ.(*reflect2.UnsafePtrType) + decoder = decoderOfType(ctx, ptrType.Elem()) + cfg.addDecoderToCache(cacheKey, decoder) + return decoder +} + +func decoderOfType(ctx *ctx, typ reflect2.Type) ValDecoder { + decoder := getTypeDecoderFromExtension(ctx, typ) + if decoder != nil { + return decoder + } + decoder = createDecoderOfType(ctx, typ) + for _, extension := range extensions { + decoder = extension.DecorateDecoder(typ, decoder) + } + decoder = ctx.decoderExtension.DecorateDecoder(typ, decoder) + for _, extension := range ctx.extraExtensions { + decoder = extension.DecorateDecoder(typ, decoder) + } + return decoder +} + +func createDecoderOfType(ctx *ctx, typ reflect2.Type) ValDecoder { + decoder := ctx.decoders[typ] + if decoder != nil { + return decoder + } + placeholder := &placeholderDecoder{} + ctx.decoders[typ] = placeholder + decoder = _createDecoderOfType(ctx, typ) + placeholder.decoder = decoder + return decoder +} + +func _createDecoderOfType(ctx *ctx, typ reflect2.Type) ValDecoder { + decoder := createDecoderOfJsonRawMessage(ctx, typ) + if decoder != nil { + return decoder + } + decoder = createDecoderOfJsonNumber(ctx, typ) + if decoder != nil { + return decoder + } + decoder = createDecoderOfMarshaler(ctx, typ) + if decoder != nil { + return decoder + } + decoder = createDecoderOfAny(ctx, typ) + if decoder != nil { + return decoder + } + decoder = createDecoderOfNative(ctx, typ) + if decoder != nil { + return decoder + } + switch typ.Kind() { + case reflect.Interface: + ifaceType, isIFace := typ.(*reflect2.UnsafeIFaceType) + if isIFace { + return &ifaceDecoder{valType: ifaceType} + } + return &efaceDecoder{} + case reflect.Struct: + return decoderOfStruct(ctx, typ) + case reflect.Array: + return decoderOfArray(ctx, typ) + case reflect.Slice: + return decoderOfSlice(ctx, typ) + case reflect.Map: + return decoderOfMap(ctx, typ) + case reflect.Ptr: + return decoderOfOptional(ctx, typ) + default: + return &lazyErrorDecoder{err: fmt.Errorf("%s%s is unsupported type", ctx.prefix, typ.String())} + } +} + +func (cfg *frozenConfig) EncoderOf(typ reflect2.Type) ValEncoder { + cacheKey := typ.RType() + encoder := cfg.getEncoderFromCache(cacheKey) + if encoder != nil { + return encoder + } + ctx := &ctx{ + frozenConfig: cfg, + prefix: "", + decoders: map[reflect2.Type]ValDecoder{}, + encoders: map[reflect2.Type]ValEncoder{}, + } + encoder = encoderOfType(ctx, typ) + if typ.LikePtr() { + encoder = &onePtrEncoder{encoder} + } + cfg.addEncoderToCache(cacheKey, encoder) + return encoder +} + +type onePtrEncoder struct { + encoder ValEncoder +} + +func (encoder *onePtrEncoder) IsEmpty(ptr unsafe.Pointer) bool { + return encoder.encoder.IsEmpty(unsafe.Pointer(&ptr)) +} + +func (encoder *onePtrEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { + encoder.encoder.Encode(unsafe.Pointer(&ptr), stream) +} + +func encoderOfType(ctx *ctx, typ reflect2.Type) ValEncoder { + encoder := getTypeEncoderFromExtension(ctx, typ) + if encoder != nil { + return encoder + } + encoder = createEncoderOfType(ctx, typ) + for _, extension := range extensions { + encoder = extension.DecorateEncoder(typ, encoder) + } + encoder = ctx.encoderExtension.DecorateEncoder(typ, encoder) + for _, extension := range ctx.extraExtensions { + encoder = extension.DecorateEncoder(typ, encoder) + } + return encoder +} + +func createEncoderOfType(ctx *ctx, typ reflect2.Type) ValEncoder { + encoder := ctx.encoders[typ] + if encoder != nil { + return encoder + } + placeholder := &placeholderEncoder{} + ctx.encoders[typ] = placeholder + encoder = _createEncoderOfType(ctx, typ) + placeholder.encoder = encoder + return encoder +} +func _createEncoderOfType(ctx *ctx, typ reflect2.Type) ValEncoder { + encoder := createEncoderOfJsonRawMessage(ctx, typ) + if encoder != nil { + return encoder + } + encoder = createEncoderOfJsonNumber(ctx, typ) + if encoder != nil { + return encoder + } + encoder = createEncoderOfMarshaler(ctx, typ) + if encoder != nil { + return encoder + } + encoder = createEncoderOfAny(ctx, typ) + if encoder != nil { + return encoder + } + encoder = createEncoderOfNative(ctx, typ) + if encoder != nil { + return encoder + } + kind := typ.Kind() + switch kind { + case reflect.Interface: + return &dynamicEncoder{typ} + case reflect.Struct: + return encoderOfStruct(ctx, typ) + case reflect.Array: + return encoderOfArray(ctx, typ) + case reflect.Slice: + return encoderOfSlice(ctx, typ) + case reflect.Map: + return encoderOfMap(ctx, typ) + case reflect.Ptr: + return encoderOfOptional(ctx, typ) + default: + return &lazyErrorEncoder{err: fmt.Errorf("%s%s is unsupported type", ctx.prefix, typ.String())} + } +} + +type lazyErrorDecoder struct { + err error +} + +func (decoder *lazyErrorDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { + if iter.WhatIsNext() != NilValue { + if iter.Error == nil { + iter.Error = decoder.err + } + } else { + iter.Skip() + } +} + +type lazyErrorEncoder struct { + err error +} + +func (encoder *lazyErrorEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { + if ptr == nil { + stream.WriteNil() + } else if stream.Error == nil { + stream.Error = encoder.err + } +} + +func (encoder *lazyErrorEncoder) IsEmpty(ptr unsafe.Pointer) bool { + return false +} + +type placeholderDecoder struct { + decoder ValDecoder +} + +func (decoder *placeholderDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { + decoder.decoder.Decode(ptr, iter) +} + +type placeholderEncoder struct { + encoder ValEncoder +} + +func (encoder *placeholderEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { + encoder.encoder.Encode(ptr, stream) +} + +func (encoder *placeholderEncoder) IsEmpty(ptr unsafe.Pointer) bool { + return encoder.encoder.IsEmpty(ptr) +} diff --git a/vendor/github.com/json-iterator/go/reflect_array.go b/vendor/github.com/json-iterator/go/reflect_array.go new file mode 100644 index 000000000..13a0b7b08 --- /dev/null +++ b/vendor/github.com/json-iterator/go/reflect_array.go @@ -0,0 +1,104 @@ +package jsoniter + +import ( + "fmt" + "github.com/modern-go/reflect2" + "io" + "unsafe" +) + +func decoderOfArray(ctx *ctx, typ reflect2.Type) ValDecoder { + arrayType := typ.(*reflect2.UnsafeArrayType) + decoder := decoderOfType(ctx.append("[arrayElem]"), arrayType.Elem()) + return &arrayDecoder{arrayType, decoder} +} + +func encoderOfArray(ctx *ctx, typ reflect2.Type) ValEncoder { + arrayType := typ.(*reflect2.UnsafeArrayType) + if arrayType.Len() == 0 { + return emptyArrayEncoder{} + } + encoder := encoderOfType(ctx.append("[arrayElem]"), arrayType.Elem()) + return &arrayEncoder{arrayType, encoder} +} + +type emptyArrayEncoder struct{} + +func (encoder emptyArrayEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { + stream.WriteEmptyArray() +} + +func (encoder emptyArrayEncoder) IsEmpty(ptr unsafe.Pointer) bool { + return true +} + +type arrayEncoder struct { + arrayType *reflect2.UnsafeArrayType + elemEncoder ValEncoder +} + +func (encoder *arrayEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { + stream.WriteArrayStart() + elemPtr := unsafe.Pointer(ptr) + encoder.elemEncoder.Encode(elemPtr, stream) + for i := 1; i < encoder.arrayType.Len(); i++ { + stream.WriteMore() + elemPtr = encoder.arrayType.UnsafeGetIndex(ptr, i) + encoder.elemEncoder.Encode(elemPtr, stream) + } + stream.WriteArrayEnd() + if stream.Error != nil && stream.Error != io.EOF { + stream.Error = fmt.Errorf("%v: %s", encoder.arrayType, stream.Error.Error()) + } +} + +func (encoder *arrayEncoder) IsEmpty(ptr unsafe.Pointer) bool { + return false +} + +type arrayDecoder struct { + arrayType *reflect2.UnsafeArrayType + elemDecoder ValDecoder +} + +func (decoder *arrayDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { + decoder.doDecode(ptr, iter) + if iter.Error != nil && iter.Error != io.EOF { + iter.Error = fmt.Errorf("%v: %s", decoder.arrayType, iter.Error.Error()) + } +} + +func (decoder *arrayDecoder) doDecode(ptr unsafe.Pointer, iter *Iterator) { + c := iter.nextToken() + arrayType := decoder.arrayType + if c == 'n' { + iter.skipThreeBytes('u', 'l', 'l') + return + } + if c != '[' { + iter.ReportError("decode array", "expect [ or n, but found "+string([]byte{c})) + return + } + c = iter.nextToken() + if c == ']' { + return + } + iter.unreadByte() + elemPtr := arrayType.UnsafeGetIndex(ptr, 0) + decoder.elemDecoder.Decode(elemPtr, iter) + length := 1 + for c = iter.nextToken(); c == ','; c = iter.nextToken() { + if length >= arrayType.Len() { + iter.Skip() + continue + } + idx := length + length += 1 + elemPtr = arrayType.UnsafeGetIndex(ptr, idx) + decoder.elemDecoder.Decode(elemPtr, iter) + } + if c != ']' { + iter.ReportError("decode array", "expect ], but found "+string([]byte{c})) + return + } +} diff --git a/vendor/github.com/json-iterator/go/reflect_dynamic.go b/vendor/github.com/json-iterator/go/reflect_dynamic.go new file mode 100644 index 000000000..8b6bc8b43 --- /dev/null +++ b/vendor/github.com/json-iterator/go/reflect_dynamic.go @@ -0,0 +1,70 @@ +package jsoniter + +import ( + "github.com/modern-go/reflect2" + "reflect" + "unsafe" +) + +type dynamicEncoder struct { + valType reflect2.Type +} + +func (encoder *dynamicEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { + obj := encoder.valType.UnsafeIndirect(ptr) + stream.WriteVal(obj) +} + +func (encoder *dynamicEncoder) IsEmpty(ptr unsafe.Pointer) bool { + return encoder.valType.UnsafeIndirect(ptr) == nil +} + +type efaceDecoder struct { +} + +func (decoder *efaceDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { + pObj := (*interface{})(ptr) + obj := *pObj + if obj == nil { + *pObj = iter.Read() + return + } + typ := reflect2.TypeOf(obj) + if typ.Kind() != reflect.Ptr { + *pObj = iter.Read() + return + } + ptrType := typ.(*reflect2.UnsafePtrType) + ptrElemType := ptrType.Elem() + if iter.WhatIsNext() == NilValue { + if ptrElemType.Kind() != reflect.Ptr { + iter.skipFourBytes('n', 'u', 'l', 'l') + *pObj = nil + return + } + } + if reflect2.IsNil(obj) { + obj := ptrElemType.New() + iter.ReadVal(obj) + *pObj = obj + return + } + iter.ReadVal(obj) +} + +type ifaceDecoder struct { + valType *reflect2.UnsafeIFaceType +} + +func (decoder *ifaceDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { + if iter.ReadNil() { + decoder.valType.UnsafeSet(ptr, decoder.valType.UnsafeNew()) + return + } + obj := decoder.valType.UnsafeIndirect(ptr) + if reflect2.IsNil(obj) { + iter.ReportError("decode non empty interface", "can not unmarshal into nil") + return + } + iter.ReadVal(obj) +} diff --git a/vendor/github.com/json-iterator/go/reflect_extension.go b/vendor/github.com/json-iterator/go/reflect_extension.go new file mode 100644 index 000000000..05e8fbf1f --- /dev/null +++ b/vendor/github.com/json-iterator/go/reflect_extension.go @@ -0,0 +1,483 @@ +package jsoniter + +import ( + "fmt" + "github.com/modern-go/reflect2" + "reflect" + "sort" + "strings" + "unicode" + "unsafe" +) + +var typeDecoders = map[string]ValDecoder{} +var fieldDecoders = map[string]ValDecoder{} +var typeEncoders = map[string]ValEncoder{} +var fieldEncoders = map[string]ValEncoder{} +var extensions = []Extension{} + +// StructDescriptor describe how should we encode/decode the struct +type StructDescriptor struct { + Type reflect2.Type + Fields []*Binding +} + +// GetField get one field from the descriptor by its name. +// Can not use map here to keep field orders. +func (structDescriptor *StructDescriptor) GetField(fieldName string) *Binding { + for _, binding := range structDescriptor.Fields { + if binding.Field.Name() == fieldName { + return binding + } + } + return nil +} + +// Binding describe how should we encode/decode the struct field +type Binding struct { + levels []int + Field reflect2.StructField + FromNames []string + ToNames []string + Encoder ValEncoder + Decoder ValDecoder +} + +// Extension the one for all SPI. Customize encoding/decoding by specifying alternate encoder/decoder. +// Can also rename fields by UpdateStructDescriptor. +type Extension interface { + UpdateStructDescriptor(structDescriptor *StructDescriptor) + CreateMapKeyDecoder(typ reflect2.Type) ValDecoder + CreateMapKeyEncoder(typ reflect2.Type) ValEncoder + CreateDecoder(typ reflect2.Type) ValDecoder + CreateEncoder(typ reflect2.Type) ValEncoder + DecorateDecoder(typ reflect2.Type, decoder ValDecoder) ValDecoder + DecorateEncoder(typ reflect2.Type, encoder ValEncoder) ValEncoder +} + +// DummyExtension embed this type get dummy implementation for all methods of Extension +type DummyExtension struct { +} + +// UpdateStructDescriptor No-op +func (extension *DummyExtension) UpdateStructDescriptor(structDescriptor *StructDescriptor) { +} + +// CreateMapKeyDecoder No-op +func (extension *DummyExtension) CreateMapKeyDecoder(typ reflect2.Type) ValDecoder { + return nil +} + +// CreateMapKeyEncoder No-op +func (extension *DummyExtension) CreateMapKeyEncoder(typ reflect2.Type) ValEncoder { + return nil +} + +// CreateDecoder No-op +func (extension *DummyExtension) CreateDecoder(typ reflect2.Type) ValDecoder { + return nil +} + +// CreateEncoder No-op +func (extension *DummyExtension) CreateEncoder(typ reflect2.Type) ValEncoder { + return nil +} + +// DecorateDecoder No-op +func (extension *DummyExtension) DecorateDecoder(typ reflect2.Type, decoder ValDecoder) ValDecoder { + return decoder +} + +// DecorateEncoder No-op +func (extension *DummyExtension) DecorateEncoder(typ reflect2.Type, encoder ValEncoder) ValEncoder { + return encoder +} + +type EncoderExtension map[reflect2.Type]ValEncoder + +// UpdateStructDescriptor No-op +func (extension EncoderExtension) UpdateStructDescriptor(structDescriptor *StructDescriptor) { +} + +// CreateDecoder No-op +func (extension EncoderExtension) CreateDecoder(typ reflect2.Type) ValDecoder { + return nil +} + +// CreateEncoder get encoder from map +func (extension EncoderExtension) CreateEncoder(typ reflect2.Type) ValEncoder { + return extension[typ] +} + +// CreateMapKeyDecoder No-op +func (extension EncoderExtension) CreateMapKeyDecoder(typ reflect2.Type) ValDecoder { + return nil +} + +// CreateMapKeyEncoder No-op +func (extension EncoderExtension) CreateMapKeyEncoder(typ reflect2.Type) ValEncoder { + return nil +} + +// DecorateDecoder No-op +func (extension EncoderExtension) DecorateDecoder(typ reflect2.Type, decoder ValDecoder) ValDecoder { + return decoder +} + +// DecorateEncoder No-op +func (extension EncoderExtension) DecorateEncoder(typ reflect2.Type, encoder ValEncoder) ValEncoder { + return encoder +} + +type DecoderExtension map[reflect2.Type]ValDecoder + +// UpdateStructDescriptor No-op +func (extension DecoderExtension) UpdateStructDescriptor(structDescriptor *StructDescriptor) { +} + +// CreateMapKeyDecoder No-op +func (extension DecoderExtension) CreateMapKeyDecoder(typ reflect2.Type) ValDecoder { + return nil +} + +// CreateMapKeyEncoder No-op +func (extension DecoderExtension) CreateMapKeyEncoder(typ reflect2.Type) ValEncoder { + return nil +} + +// CreateDecoder get decoder from map +func (extension DecoderExtension) CreateDecoder(typ reflect2.Type) ValDecoder { + return extension[typ] +} + +// CreateEncoder No-op +func (extension DecoderExtension) CreateEncoder(typ reflect2.Type) ValEncoder { + return nil +} + +// DecorateDecoder No-op +func (extension DecoderExtension) DecorateDecoder(typ reflect2.Type, decoder ValDecoder) ValDecoder { + return decoder +} + +// DecorateEncoder No-op +func (extension DecoderExtension) DecorateEncoder(typ reflect2.Type, encoder ValEncoder) ValEncoder { + return encoder +} + +type funcDecoder struct { + fun DecoderFunc +} + +func (decoder *funcDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { + decoder.fun(ptr, iter) +} + +type funcEncoder struct { + fun EncoderFunc + isEmptyFunc func(ptr unsafe.Pointer) bool +} + +func (encoder *funcEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { + encoder.fun(ptr, stream) +} + +func (encoder *funcEncoder) IsEmpty(ptr unsafe.Pointer) bool { + if encoder.isEmptyFunc == nil { + return false + } + return encoder.isEmptyFunc(ptr) +} + +// DecoderFunc the function form of TypeDecoder +type DecoderFunc func(ptr unsafe.Pointer, iter *Iterator) + +// EncoderFunc the function form of TypeEncoder +type EncoderFunc func(ptr unsafe.Pointer, stream *Stream) + +// RegisterTypeDecoderFunc register TypeDecoder for a type with function +func RegisterTypeDecoderFunc(typ string, fun DecoderFunc) { + typeDecoders[typ] = &funcDecoder{fun} +} + +// RegisterTypeDecoder register TypeDecoder for a typ +func RegisterTypeDecoder(typ string, decoder ValDecoder) { + typeDecoders[typ] = decoder +} + +// RegisterFieldDecoderFunc register TypeDecoder for a struct field with function +func RegisterFieldDecoderFunc(typ string, field string, fun DecoderFunc) { + RegisterFieldDecoder(typ, field, &funcDecoder{fun}) +} + +// RegisterFieldDecoder register TypeDecoder for a struct field +func RegisterFieldDecoder(typ string, field string, decoder ValDecoder) { + fieldDecoders[fmt.Sprintf("%s/%s", typ, field)] = decoder +} + +// RegisterTypeEncoderFunc register TypeEncoder for a type with encode/isEmpty function +func RegisterTypeEncoderFunc(typ string, fun EncoderFunc, isEmptyFunc func(unsafe.Pointer) bool) { + typeEncoders[typ] = &funcEncoder{fun, isEmptyFunc} +} + +// RegisterTypeEncoder register TypeEncoder for a type +func RegisterTypeEncoder(typ string, encoder ValEncoder) { + typeEncoders[typ] = encoder +} + +// RegisterFieldEncoderFunc register TypeEncoder for a struct field with encode/isEmpty function +func RegisterFieldEncoderFunc(typ string, field string, fun EncoderFunc, isEmptyFunc func(unsafe.Pointer) bool) { + RegisterFieldEncoder(typ, field, &funcEncoder{fun, isEmptyFunc}) +} + +// RegisterFieldEncoder register TypeEncoder for a struct field +func RegisterFieldEncoder(typ string, field string, encoder ValEncoder) { + fieldEncoders[fmt.Sprintf("%s/%s", typ, field)] = encoder +} + +// RegisterExtension register extension +func RegisterExtension(extension Extension) { + extensions = append(extensions, extension) +} + +func getTypeDecoderFromExtension(ctx *ctx, typ reflect2.Type) ValDecoder { + decoder := _getTypeDecoderFromExtension(ctx, typ) + if decoder != nil { + for _, extension := range extensions { + decoder = extension.DecorateDecoder(typ, decoder) + } + decoder = ctx.decoderExtension.DecorateDecoder(typ, decoder) + for _, extension := range ctx.extraExtensions { + decoder = extension.DecorateDecoder(typ, decoder) + } + } + return decoder +} +func _getTypeDecoderFromExtension(ctx *ctx, typ reflect2.Type) ValDecoder { + for _, extension := range extensions { + decoder := extension.CreateDecoder(typ) + if decoder != nil { + return decoder + } + } + decoder := ctx.decoderExtension.CreateDecoder(typ) + if decoder != nil { + return decoder + } + for _, extension := range ctx.extraExtensions { + decoder := extension.CreateDecoder(typ) + if decoder != nil { + return decoder + } + } + typeName := typ.String() + decoder = typeDecoders[typeName] + if decoder != nil { + return decoder + } + if typ.Kind() == reflect.Ptr { + ptrType := typ.(*reflect2.UnsafePtrType) + decoder := typeDecoders[ptrType.Elem().String()] + if decoder != nil { + return &OptionalDecoder{ptrType.Elem(), decoder} + } + } + return nil +} + +func getTypeEncoderFromExtension(ctx *ctx, typ reflect2.Type) ValEncoder { + encoder := _getTypeEncoderFromExtension(ctx, typ) + if encoder != nil { + for _, extension := range extensions { + encoder = extension.DecorateEncoder(typ, encoder) + } + encoder = ctx.encoderExtension.DecorateEncoder(typ, encoder) + for _, extension := range ctx.extraExtensions { + encoder = extension.DecorateEncoder(typ, encoder) + } + } + return encoder +} + +func _getTypeEncoderFromExtension(ctx *ctx, typ reflect2.Type) ValEncoder { + for _, extension := range extensions { + encoder := extension.CreateEncoder(typ) + if encoder != nil { + return encoder + } + } + encoder := ctx.encoderExtension.CreateEncoder(typ) + if encoder != nil { + return encoder + } + for _, extension := range ctx.extraExtensions { + encoder := extension.CreateEncoder(typ) + if encoder != nil { + return encoder + } + } + typeName := typ.String() + encoder = typeEncoders[typeName] + if encoder != nil { + return encoder + } + if typ.Kind() == reflect.Ptr { + typePtr := typ.(*reflect2.UnsafePtrType) + encoder := typeEncoders[typePtr.Elem().String()] + if encoder != nil { + return &OptionalEncoder{encoder} + } + } + return nil +} + +func describeStruct(ctx *ctx, typ reflect2.Type) *StructDescriptor { + structType := typ.(*reflect2.UnsafeStructType) + embeddedBindings := []*Binding{} + bindings := []*Binding{} + for i := 0; i < structType.NumField(); i++ { + field := structType.Field(i) + tag, hastag := field.Tag().Lookup(ctx.getTagKey()) + if ctx.onlyTaggedField && !hastag && !field.Anonymous() { + continue + } + tagParts := strings.Split(tag, ",") + if tag == "-" { + continue + } + if field.Anonymous() && (tag == "" || tagParts[0] == "") { + if field.Type().Kind() == reflect.Struct { + structDescriptor := describeStruct(ctx, field.Type()) + for _, binding := range structDescriptor.Fields { + binding.levels = append([]int{i}, binding.levels...) + omitempty := binding.Encoder.(*structFieldEncoder).omitempty + binding.Encoder = &structFieldEncoder{field, binding.Encoder, omitempty} + binding.Decoder = &structFieldDecoder{field, binding.Decoder} + embeddedBindings = append(embeddedBindings, binding) + } + continue + } else if field.Type().Kind() == reflect.Ptr { + ptrType := field.Type().(*reflect2.UnsafePtrType) + if ptrType.Elem().Kind() == reflect.Struct { + structDescriptor := describeStruct(ctx, ptrType.Elem()) + for _, binding := range structDescriptor.Fields { + binding.levels = append([]int{i}, binding.levels...) + omitempty := binding.Encoder.(*structFieldEncoder).omitempty + binding.Encoder = &dereferenceEncoder{binding.Encoder} + binding.Encoder = &structFieldEncoder{field, binding.Encoder, omitempty} + binding.Decoder = &dereferenceDecoder{ptrType.Elem(), binding.Decoder} + binding.Decoder = &structFieldDecoder{field, binding.Decoder} + embeddedBindings = append(embeddedBindings, binding) + } + continue + } + } + } + fieldNames := calcFieldNames(field.Name(), tagParts[0], tag) + fieldCacheKey := fmt.Sprintf("%s/%s", typ.String(), field.Name()) + decoder := fieldDecoders[fieldCacheKey] + if decoder == nil { + decoder = decoderOfType(ctx.append(field.Name()), field.Type()) + } + encoder := fieldEncoders[fieldCacheKey] + if encoder == nil { + encoder = encoderOfType(ctx.append(field.Name()), field.Type()) + } + binding := &Binding{ + Field: field, + FromNames: fieldNames, + ToNames: fieldNames, + Decoder: decoder, + Encoder: encoder, + } + binding.levels = []int{i} + bindings = append(bindings, binding) + } + return createStructDescriptor(ctx, typ, bindings, embeddedBindings) +} +func createStructDescriptor(ctx *ctx, typ reflect2.Type, bindings []*Binding, embeddedBindings []*Binding) *StructDescriptor { + structDescriptor := &StructDescriptor{ + Type: typ, + Fields: bindings, + } + for _, extension := range extensions { + extension.UpdateStructDescriptor(structDescriptor) + } + ctx.encoderExtension.UpdateStructDescriptor(structDescriptor) + ctx.decoderExtension.UpdateStructDescriptor(structDescriptor) + for _, extension := range ctx.extraExtensions { + extension.UpdateStructDescriptor(structDescriptor) + } + processTags(structDescriptor, ctx.frozenConfig) + // merge normal & embedded bindings & sort with original order + allBindings := sortableBindings(append(embeddedBindings, structDescriptor.Fields...)) + sort.Sort(allBindings) + structDescriptor.Fields = allBindings + return structDescriptor +} + +type sortableBindings []*Binding + +func (bindings sortableBindings) Len() int { + return len(bindings) +} + +func (bindings sortableBindings) Less(i, j int) bool { + left := bindings[i].levels + right := bindings[j].levels + k := 0 + for { + if left[k] < right[k] { + return true + } else if left[k] > right[k] { + return false + } + k++ + } +} + +func (bindings sortableBindings) Swap(i, j int) { + bindings[i], bindings[j] = bindings[j], bindings[i] +} + +func processTags(structDescriptor *StructDescriptor, cfg *frozenConfig) { + for _, binding := range structDescriptor.Fields { + shouldOmitEmpty := false + tagParts := strings.Split(binding.Field.Tag().Get(cfg.getTagKey()), ",") + for _, tagPart := range tagParts[1:] { + if tagPart == "omitempty" { + shouldOmitEmpty = true + } else if tagPart == "string" { + if binding.Field.Type().Kind() == reflect.String { + binding.Decoder = &stringModeStringDecoder{binding.Decoder, cfg} + binding.Encoder = &stringModeStringEncoder{binding.Encoder, cfg} + } else { + binding.Decoder = &stringModeNumberDecoder{binding.Decoder} + binding.Encoder = &stringModeNumberEncoder{binding.Encoder} + } + } + } + binding.Decoder = &structFieldDecoder{binding.Field, binding.Decoder} + binding.Encoder = &structFieldEncoder{binding.Field, binding.Encoder, shouldOmitEmpty} + } +} + +func calcFieldNames(originalFieldName string, tagProvidedFieldName string, wholeTag string) []string { + // ignore? + if wholeTag == "-" { + return []string{} + } + // rename? + var fieldNames []string + if tagProvidedFieldName == "" { + fieldNames = []string{originalFieldName} + } else { + fieldNames = []string{tagProvidedFieldName} + } + // private? + isNotExported := unicode.IsLower(rune(originalFieldName[0])) + if isNotExported { + fieldNames = []string{} + } + return fieldNames +} diff --git a/vendor/github.com/json-iterator/go/reflect_json_number.go b/vendor/github.com/json-iterator/go/reflect_json_number.go new file mode 100644 index 000000000..98d45c1ec --- /dev/null +++ b/vendor/github.com/json-iterator/go/reflect_json_number.go @@ -0,0 +1,112 @@ +package jsoniter + +import ( + "encoding/json" + "github.com/modern-go/reflect2" + "strconv" + "unsafe" +) + +type Number string + +// String returns the literal text of the number. +func (n Number) String() string { return string(n) } + +// Float64 returns the number as a float64. +func (n Number) Float64() (float64, error) { + return strconv.ParseFloat(string(n), 64) +} + +// Int64 returns the number as an int64. +func (n Number) Int64() (int64, error) { + return strconv.ParseInt(string(n), 10, 64) +} + +func CastJsonNumber(val interface{}) (string, bool) { + switch typedVal := val.(type) { + case json.Number: + return string(typedVal), true + case Number: + return string(typedVal), true + } + return "", false +} + +var jsonNumberType = reflect2.TypeOfPtr((*json.Number)(nil)).Elem() +var jsoniterNumberType = reflect2.TypeOfPtr((*Number)(nil)).Elem() + +func createDecoderOfJsonNumber(ctx *ctx, typ reflect2.Type) ValDecoder { + if typ.AssignableTo(jsonNumberType) { + return &jsonNumberCodec{} + } + if typ.AssignableTo(jsoniterNumberType) { + return &jsoniterNumberCodec{} + } + return nil +} + +func createEncoderOfJsonNumber(ctx *ctx, typ reflect2.Type) ValEncoder { + if typ.AssignableTo(jsonNumberType) { + return &jsonNumberCodec{} + } + if typ.AssignableTo(jsoniterNumberType) { + return &jsoniterNumberCodec{} + } + return nil +} + +type jsonNumberCodec struct { +} + +func (codec *jsonNumberCodec) Decode(ptr unsafe.Pointer, iter *Iterator) { + switch iter.WhatIsNext() { + case StringValue: + *((*json.Number)(ptr)) = json.Number(iter.ReadString()) + case NilValue: + iter.skipFourBytes('n', 'u', 'l', 'l') + *((*json.Number)(ptr)) = "" + default: + *((*json.Number)(ptr)) = json.Number([]byte(iter.readNumberAsString())) + } +} + +func (codec *jsonNumberCodec) Encode(ptr unsafe.Pointer, stream *Stream) { + number := *((*json.Number)(ptr)) + if len(number) == 0 { + stream.writeByte('0') + } else { + stream.WriteRaw(string(number)) + } +} + +func (codec *jsonNumberCodec) IsEmpty(ptr unsafe.Pointer) bool { + return len(*((*json.Number)(ptr))) == 0 +} + +type jsoniterNumberCodec struct { +} + +func (codec *jsoniterNumberCodec) Decode(ptr unsafe.Pointer, iter *Iterator) { + switch iter.WhatIsNext() { + case StringValue: + *((*Number)(ptr)) = Number(iter.ReadString()) + case NilValue: + iter.skipFourBytes('n', 'u', 'l', 'l') + *((*Number)(ptr)) = "" + default: + *((*Number)(ptr)) = Number([]byte(iter.readNumberAsString())) + } +} + +func (codec *jsoniterNumberCodec) Encode(ptr unsafe.Pointer, stream *Stream) { + number := *((*Number)(ptr)) + if len(number) == 0 { + stream.writeByte('0') + } else { + stream.WriteRaw(string(number)) + } +} + +func (codec *jsoniterNumberCodec) IsEmpty(ptr unsafe.Pointer) bool { + return len(*((*Number)(ptr))) == 0 +} diff --git a/vendor/github.com/json-iterator/go/reflect_json_raw_message.go b/vendor/github.com/json-iterator/go/reflect_json_raw_message.go new file mode 100644 index 000000000..f2619936c --- /dev/null +++ b/vendor/github.com/json-iterator/go/reflect_json_raw_message.go @@ -0,0 +1,60 @@ +package jsoniter + +import ( + "encoding/json" + "github.com/modern-go/reflect2" + "unsafe" +) + +var jsonRawMessageType = reflect2.TypeOfPtr((*json.RawMessage)(nil)).Elem() +var jsoniterRawMessageType = reflect2.TypeOfPtr((*RawMessage)(nil)).Elem() + +func createEncoderOfJsonRawMessage(ctx *ctx, typ reflect2.Type) ValEncoder { + if typ == jsonRawMessageType { + return &jsonRawMessageCodec{} + } + if typ == jsoniterRawMessageType { + return &jsoniterRawMessageCodec{} + } + return nil +} + +func createDecoderOfJsonRawMessage(ctx *ctx, typ reflect2.Type) ValDecoder { + if typ == jsonRawMessageType { + return &jsonRawMessageCodec{} + } + if typ == jsoniterRawMessageType { + return &jsoniterRawMessageCodec{} + } + return nil +} + +type jsonRawMessageCodec struct { +} + +func (codec *jsonRawMessageCodec) Decode(ptr unsafe.Pointer, iter *Iterator) { + *((*json.RawMessage)(ptr)) = json.RawMessage(iter.SkipAndReturnBytes()) +} + +func (codec *jsonRawMessageCodec) Encode(ptr unsafe.Pointer, stream *Stream) { + stream.WriteRaw(string(*((*json.RawMessage)(ptr)))) +} + +func (codec *jsonRawMessageCodec) IsEmpty(ptr unsafe.Pointer) bool { + return len(*((*json.RawMessage)(ptr))) == 0 +} + +type jsoniterRawMessageCodec struct { +} + +func (codec *jsoniterRawMessageCodec) Decode(ptr unsafe.Pointer, iter *Iterator) { + *((*RawMessage)(ptr)) = RawMessage(iter.SkipAndReturnBytes()) +} + +func (codec *jsoniterRawMessageCodec) Encode(ptr unsafe.Pointer, stream *Stream) { + stream.WriteRaw(string(*((*RawMessage)(ptr)))) +} + +func (codec *jsoniterRawMessageCodec) IsEmpty(ptr unsafe.Pointer) bool { + return len(*((*RawMessage)(ptr))) == 0 +} diff --git a/vendor/github.com/json-iterator/go/reflect_map.go b/vendor/github.com/json-iterator/go/reflect_map.go new file mode 100644 index 000000000..547b4421e --- /dev/null +++ b/vendor/github.com/json-iterator/go/reflect_map.go @@ -0,0 +1,338 @@ +package jsoniter + +import ( + "fmt" + "github.com/modern-go/reflect2" + "io" + "reflect" + "sort" + "unsafe" +) + +func decoderOfMap(ctx *ctx, typ reflect2.Type) ValDecoder { + mapType := typ.(*reflect2.UnsafeMapType) + keyDecoder := decoderOfMapKey(ctx.append("[mapKey]"), mapType.Key()) + elemDecoder := decoderOfType(ctx.append("[mapElem]"), mapType.Elem()) + return &mapDecoder{ + mapType: mapType, + keyType: mapType.Key(), + elemType: mapType.Elem(), + keyDecoder: keyDecoder, + elemDecoder: elemDecoder, + } +} + +func encoderOfMap(ctx *ctx, typ reflect2.Type) ValEncoder { + mapType := typ.(*reflect2.UnsafeMapType) + if ctx.sortMapKeys { + return &sortKeysMapEncoder{ + mapType: mapType, + keyEncoder: encoderOfMapKey(ctx.append("[mapKey]"), mapType.Key()), + elemEncoder: encoderOfType(ctx.append("[mapElem]"), mapType.Elem()), + } + } + return &mapEncoder{ + mapType: mapType, + keyEncoder: encoderOfMapKey(ctx.append("[mapKey]"), mapType.Key()), + elemEncoder: encoderOfType(ctx.append("[mapElem]"), mapType.Elem()), + } +} + +func decoderOfMapKey(ctx *ctx, typ reflect2.Type) ValDecoder { + decoder := ctx.decoderExtension.CreateMapKeyDecoder(typ) + if decoder != nil { + return decoder + } + for _, extension := range ctx.extraExtensions { + decoder := extension.CreateMapKeyDecoder(typ) + if decoder != nil { + return decoder + } + } + switch typ.Kind() { + case reflect.String: + return decoderOfType(ctx, reflect2.DefaultTypeOfKind(reflect.String)) + case reflect.Bool, + reflect.Uint8, reflect.Int8, + reflect.Uint16, reflect.Int16, + reflect.Uint32, reflect.Int32, + reflect.Uint64, reflect.Int64, + reflect.Uint, reflect.Int, + reflect.Float32, reflect.Float64, + reflect.Uintptr: + typ = reflect2.DefaultTypeOfKind(typ.Kind()) + return &numericMapKeyDecoder{decoderOfType(ctx, typ)} + default: + ptrType := reflect2.PtrTo(typ) + if ptrType.Implements(unmarshalerType) { + return &referenceDecoder{ + &unmarshalerDecoder{ + valType: ptrType, + }, + } + } + if typ.Implements(unmarshalerType) { + return &unmarshalerDecoder{ + valType: typ, + } + } + if ptrType.Implements(textUnmarshalerType) { + return &referenceDecoder{ + &textUnmarshalerDecoder{ + valType: ptrType, + }, + } + } + if typ.Implements(textUnmarshalerType) { + return &textUnmarshalerDecoder{ + valType: typ, + } + } + return &lazyErrorDecoder{err: fmt.Errorf("unsupported map key type: %v", typ)} + } +} + +func encoderOfMapKey(ctx *ctx, typ reflect2.Type) ValEncoder { + encoder := ctx.encoderExtension.CreateMapKeyEncoder(typ) + if encoder != nil { + return encoder + } + for _, extension := range ctx.extraExtensions { + encoder := extension.CreateMapKeyEncoder(typ) + if encoder != nil { + return encoder + } + } + switch typ.Kind() { + case reflect.String: + return encoderOfType(ctx, reflect2.DefaultTypeOfKind(reflect.String)) + case reflect.Bool, + reflect.Uint8, reflect.Int8, + reflect.Uint16, reflect.Int16, + reflect.Uint32, reflect.Int32, + reflect.Uint64, reflect.Int64, + reflect.Uint, reflect.Int, + reflect.Float32, reflect.Float64, + reflect.Uintptr: + typ = reflect2.DefaultTypeOfKind(typ.Kind()) + return &numericMapKeyEncoder{encoderOfType(ctx, typ)} + default: + if typ == textMarshalerType { + return &directTextMarshalerEncoder{ + stringEncoder: ctx.EncoderOf(reflect2.TypeOf("")), + } + } + if typ.Implements(textMarshalerType) { + return &textMarshalerEncoder{ + valType: typ, + stringEncoder: ctx.EncoderOf(reflect2.TypeOf("")), + } + } + if typ.Kind() == reflect.Interface { + return &dynamicMapKeyEncoder{ctx, typ} + } + return &lazyErrorEncoder{err: fmt.Errorf("unsupported map key type: %v", typ)} + } +} + +type mapDecoder struct { + mapType *reflect2.UnsafeMapType + keyType reflect2.Type + elemType reflect2.Type + keyDecoder ValDecoder + elemDecoder ValDecoder +} + +func (decoder *mapDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { + mapType := decoder.mapType + c := iter.nextToken() + if c == 'n' { + iter.skipThreeBytes('u', 'l', 'l') + *(*unsafe.Pointer)(ptr) = nil + mapType.UnsafeSet(ptr, mapType.UnsafeNew()) + return + } + if mapType.UnsafeIsNil(ptr) { + mapType.UnsafeSet(ptr, mapType.UnsafeMakeMap(0)) + } + if c != '{' { + iter.ReportError("ReadMapCB", `expect { or n, but found `+string([]byte{c})) + return + } + c = iter.nextToken() + if c == '}' { + return + } + if c != '"' { + iter.ReportError("ReadMapCB", `expect " after }, but found `+string([]byte{c})) + return + } + iter.unreadByte() + key := decoder.keyType.UnsafeNew() + decoder.keyDecoder.Decode(key, iter) + c = iter.nextToken() + if c != ':' { + iter.ReportError("ReadMapCB", "expect : after object field, but found "+string([]byte{c})) + return + } + elem := decoder.elemType.UnsafeNew() + decoder.elemDecoder.Decode(elem, iter) + decoder.mapType.UnsafeSetIndex(ptr, key, elem) + for c = iter.nextToken(); c == ','; c = iter.nextToken() { + key := decoder.keyType.UnsafeNew() + decoder.keyDecoder.Decode(key, iter) + c = iter.nextToken() + if c != ':' { + iter.ReportError("ReadMapCB", "expect : after object field, but found "+string([]byte{c})) + return + } + elem := decoder.elemType.UnsafeNew() + decoder.elemDecoder.Decode(elem, iter) + decoder.mapType.UnsafeSetIndex(ptr, key, elem) + } + if c != '}' { + iter.ReportError("ReadMapCB", `expect }, but found `+string([]byte{c})) + } +} + +type numericMapKeyDecoder struct { + decoder ValDecoder +} + +func (decoder *numericMapKeyDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { + c := iter.nextToken() + if c != '"' { + iter.ReportError("ReadMapCB", `expect ", but found `+string([]byte{c})) + return + } + decoder.decoder.Decode(ptr, iter) + c = iter.nextToken() + if c != '"' { + iter.ReportError("ReadMapCB", `expect ", but found `+string([]byte{c})) + return + } +} + +type numericMapKeyEncoder struct { + encoder ValEncoder +} + +func (encoder *numericMapKeyEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { + stream.writeByte('"') + encoder.encoder.Encode(ptr, stream) + stream.writeByte('"') +} + +func (encoder *numericMapKeyEncoder) IsEmpty(ptr unsafe.Pointer) bool { + return false +} + +type dynamicMapKeyEncoder struct { + ctx *ctx + valType reflect2.Type +} + +func (encoder *dynamicMapKeyEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { + obj := encoder.valType.UnsafeIndirect(ptr) + encoderOfMapKey(encoder.ctx, reflect2.TypeOf(obj)).Encode(reflect2.PtrOf(obj), stream) +} + +func (encoder *dynamicMapKeyEncoder) IsEmpty(ptr unsafe.Pointer) bool { + obj := encoder.valType.UnsafeIndirect(ptr) + return encoderOfMapKey(encoder.ctx, reflect2.TypeOf(obj)).IsEmpty(reflect2.PtrOf(obj)) +} + +type mapEncoder struct { + mapType *reflect2.UnsafeMapType + keyEncoder ValEncoder + elemEncoder ValEncoder +} + +func (encoder *mapEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { + stream.WriteObjectStart() + iter := encoder.mapType.UnsafeIterate(ptr) + for i := 0; iter.HasNext(); i++ { + if i != 0 { + stream.WriteMore() + } + key, elem := iter.UnsafeNext() + encoder.keyEncoder.Encode(key, stream) + if stream.indention > 0 { + stream.writeTwoBytes(byte(':'), byte(' ')) + } else { + stream.writeByte(':') + } + encoder.elemEncoder.Encode(elem, stream) + } + stream.WriteObjectEnd() +} + +func (encoder *mapEncoder) IsEmpty(ptr unsafe.Pointer) bool { + iter := encoder.mapType.UnsafeIterate(ptr) + return !iter.HasNext() +} + +type sortKeysMapEncoder struct { + mapType *reflect2.UnsafeMapType + keyEncoder ValEncoder + elemEncoder ValEncoder +} + +func (encoder *sortKeysMapEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { + if *(*unsafe.Pointer)(ptr) == nil { + stream.WriteNil() + return + } + stream.WriteObjectStart() + mapIter := encoder.mapType.UnsafeIterate(ptr) + subStream := stream.cfg.BorrowStream(nil) + subIter := stream.cfg.BorrowIterator(nil) + keyValues := encodedKeyValues{} + for mapIter.HasNext() { + subStream.buf = make([]byte, 0, 64) + key, elem := mapIter.UnsafeNext() + encoder.keyEncoder.Encode(key, subStream) + if subStream.Error != nil && subStream.Error != io.EOF && stream.Error == nil { + stream.Error = subStream.Error + } + encodedKey := subStream.Buffer() + subIter.ResetBytes(encodedKey) + decodedKey := subIter.ReadString() + if stream.indention > 0 { + subStream.writeTwoBytes(byte(':'), byte(' ')) + } else { + subStream.writeByte(':') + } + encoder.elemEncoder.Encode(elem, subStream) + keyValues = append(keyValues, encodedKV{ + key: decodedKey, + keyValue: subStream.Buffer(), + }) + } + sort.Sort(keyValues) + for i, keyValue := range keyValues { + if i != 0 { + stream.WriteMore() + } + stream.Write(keyValue.keyValue) + } + stream.WriteObjectEnd() + stream.cfg.ReturnStream(subStream) + stream.cfg.ReturnIterator(subIter) +} + +func (encoder *sortKeysMapEncoder) IsEmpty(ptr unsafe.Pointer) bool { + iter := encoder.mapType.UnsafeIterate(ptr) + return !iter.HasNext() +} + +type encodedKeyValues []encodedKV + +type encodedKV struct { + key string + keyValue []byte +} + +func (sv encodedKeyValues) Len() int { return len(sv) } +func (sv encodedKeyValues) Swap(i, j int) { sv[i], sv[j] = sv[j], sv[i] } +func (sv encodedKeyValues) Less(i, j int) bool { return sv[i].key < sv[j].key } diff --git a/vendor/github.com/json-iterator/go/reflect_marshaler.go b/vendor/github.com/json-iterator/go/reflect_marshaler.go new file mode 100644 index 000000000..fea50719d --- /dev/null +++ b/vendor/github.com/json-iterator/go/reflect_marshaler.go @@ -0,0 +1,217 @@ +package jsoniter + +import ( + "encoding" + "encoding/json" + "github.com/modern-go/reflect2" + "unsafe" +) + +var marshalerType = reflect2.TypeOfPtr((*json.Marshaler)(nil)).Elem() +var unmarshalerType = reflect2.TypeOfPtr((*json.Unmarshaler)(nil)).Elem() +var textMarshalerType = reflect2.TypeOfPtr((*encoding.TextMarshaler)(nil)).Elem() +var textUnmarshalerType = reflect2.TypeOfPtr((*encoding.TextUnmarshaler)(nil)).Elem() + +func createDecoderOfMarshaler(ctx *ctx, typ reflect2.Type) ValDecoder { + ptrType := reflect2.PtrTo(typ) + if ptrType.Implements(unmarshalerType) { + return &referenceDecoder{ + &unmarshalerDecoder{ptrType}, + } + } + if ptrType.Implements(textUnmarshalerType) { + return &referenceDecoder{ + &textUnmarshalerDecoder{ptrType}, + } + } + return nil +} + +func createEncoderOfMarshaler(ctx *ctx, typ reflect2.Type) ValEncoder { + if typ == marshalerType { + checkIsEmpty := createCheckIsEmpty(ctx, typ) + var encoder ValEncoder = &directMarshalerEncoder{ + checkIsEmpty: checkIsEmpty, + } + return encoder + } + if typ.Implements(marshalerType) { + checkIsEmpty := createCheckIsEmpty(ctx, typ) + var encoder ValEncoder = &marshalerEncoder{ + valType: typ, + checkIsEmpty: checkIsEmpty, + } + return encoder + } + ptrType := reflect2.PtrTo(typ) + if ctx.prefix != "" && ptrType.Implements(marshalerType) { + checkIsEmpty := createCheckIsEmpty(ctx, ptrType) + var encoder ValEncoder = &marshalerEncoder{ + valType: ptrType, + checkIsEmpty: checkIsEmpty, + } + return &referenceEncoder{encoder} + } + if typ == textMarshalerType { + checkIsEmpty := createCheckIsEmpty(ctx, typ) + var encoder ValEncoder = &directTextMarshalerEncoder{ + checkIsEmpty: checkIsEmpty, + stringEncoder: ctx.EncoderOf(reflect2.TypeOf("")), + } + return encoder + } + if typ.Implements(textMarshalerType) { + checkIsEmpty := createCheckIsEmpty(ctx, typ) + var encoder ValEncoder = &textMarshalerEncoder{ + valType: typ, + stringEncoder: ctx.EncoderOf(reflect2.TypeOf("")), + checkIsEmpty: checkIsEmpty, + } + return encoder + } + // if prefix is empty, the type is the root type + if ctx.prefix != "" && ptrType.Implements(textMarshalerType) { + checkIsEmpty := createCheckIsEmpty(ctx, ptrType) + var encoder ValEncoder = &textMarshalerEncoder{ + valType: ptrType, + stringEncoder: ctx.EncoderOf(reflect2.TypeOf("")), + checkIsEmpty: checkIsEmpty, + } + return &referenceEncoder{encoder} + } + return nil +} + +type marshalerEncoder struct { + checkIsEmpty checkIsEmpty + valType reflect2.Type +} + +func (encoder *marshalerEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { + obj := encoder.valType.UnsafeIndirect(ptr) + if encoder.valType.IsNullable() && reflect2.IsNil(obj) { + stream.WriteNil() + return + } + bytes, err := json.Marshal(obj) + if err != nil { + stream.Error = err + } else { + stream.Write(bytes) + } +} + +func (encoder *marshalerEncoder) IsEmpty(ptr unsafe.Pointer) bool { + return encoder.checkIsEmpty.IsEmpty(ptr) +} + +type directMarshalerEncoder struct { + checkIsEmpty checkIsEmpty +} + +func (encoder *directMarshalerEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { + marshaler := *(*json.Marshaler)(ptr) + if marshaler == nil { + stream.WriteNil() + return + } + bytes, err := marshaler.MarshalJSON() + if err != nil { + stream.Error = err + } else { + stream.Write(bytes) + } +} + +func (encoder *directMarshalerEncoder) IsEmpty(ptr unsafe.Pointer) bool { + return encoder.checkIsEmpty.IsEmpty(ptr) +} + +type textMarshalerEncoder struct { + valType reflect2.Type + stringEncoder ValEncoder + checkIsEmpty checkIsEmpty +} + +func (encoder *textMarshalerEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { + obj := encoder.valType.UnsafeIndirect(ptr) + if encoder.valType.IsNullable() && reflect2.IsNil(obj) { + stream.WriteNil() + return + } + marshaler := (obj).(encoding.TextMarshaler) + bytes, err := marshaler.MarshalText() + if err != nil { + stream.Error = err + } else { + str := string(bytes) + encoder.stringEncoder.Encode(unsafe.Pointer(&str), stream) + } +} + +func (encoder *textMarshalerEncoder) IsEmpty(ptr unsafe.Pointer) bool { + return encoder.checkIsEmpty.IsEmpty(ptr) +} + +type directTextMarshalerEncoder struct { + stringEncoder ValEncoder + checkIsEmpty checkIsEmpty +} + +func (encoder *directTextMarshalerEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { + marshaler := *(*encoding.TextMarshaler)(ptr) + if marshaler == nil { + stream.WriteNil() + return + } + bytes, err := marshaler.MarshalText() + if err != nil { + stream.Error = err + } else { + str := string(bytes) + encoder.stringEncoder.Encode(unsafe.Pointer(&str), stream) + } +} + +func (encoder *directTextMarshalerEncoder) IsEmpty(ptr unsafe.Pointer) bool { + return encoder.checkIsEmpty.IsEmpty(ptr) +} + +type unmarshalerDecoder struct { + valType reflect2.Type +} + +func (decoder *unmarshalerDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { + valType := decoder.valType + obj := valType.UnsafeIndirect(ptr) + unmarshaler := obj.(json.Unmarshaler) + iter.nextToken() + iter.unreadByte() // skip spaces + bytes := iter.SkipAndReturnBytes() + err := unmarshaler.UnmarshalJSON(bytes) + if err != nil { + iter.ReportError("unmarshalerDecoder", err.Error()) + } +} + +type textUnmarshalerDecoder struct { + valType reflect2.Type +} + +func (decoder *textUnmarshalerDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { + valType := decoder.valType + obj := valType.UnsafeIndirect(ptr) + if reflect2.IsNil(obj) { + ptrType := valType.(*reflect2.UnsafePtrType) + elemType := ptrType.Elem() + elem := elemType.UnsafeNew() + ptrType.UnsafeSet(ptr, unsafe.Pointer(&elem)) + obj = valType.UnsafeIndirect(ptr) + } + unmarshaler := (obj).(encoding.TextUnmarshaler) + str := iter.ReadString() + err := unmarshaler.UnmarshalText([]byte(str)) + if err != nil { + iter.ReportError("textUnmarshalerDecoder", err.Error()) + } +} diff --git a/vendor/github.com/json-iterator/go/reflect_native.go b/vendor/github.com/json-iterator/go/reflect_native.go new file mode 100644 index 000000000..9042eb0cb --- /dev/null +++ b/vendor/github.com/json-iterator/go/reflect_native.go @@ -0,0 +1,451 @@ +package jsoniter + +import ( + "encoding/base64" + "reflect" + "strconv" + "unsafe" + + "github.com/modern-go/reflect2" +) + +const ptrSize = 32 << uintptr(^uintptr(0)>>63) + +func createEncoderOfNative(ctx *ctx, typ reflect2.Type) ValEncoder { + if typ.Kind() == reflect.Slice && typ.(reflect2.SliceType).Elem().Kind() == reflect.Uint8 { + sliceDecoder := decoderOfSlice(ctx, typ) + return &base64Codec{sliceDecoder: sliceDecoder} + } + typeName := typ.String() + kind := typ.Kind() + switch kind { + case reflect.String: + if typeName != "string" { + return encoderOfType(ctx, reflect2.TypeOfPtr((*string)(nil)).Elem()) + } + return &stringCodec{} + case reflect.Int: + if typeName != "int" { + return encoderOfType(ctx, reflect2.TypeOfPtr((*int)(nil)).Elem()) + } + if strconv.IntSize == 32 { + return &int32Codec{} + } + return &int64Codec{} + case reflect.Int8: + if typeName != "int8" { + return encoderOfType(ctx, reflect2.TypeOfPtr((*int8)(nil)).Elem()) + } + return &int8Codec{} + case reflect.Int16: + if typeName != "int16" { + return encoderOfType(ctx, reflect2.TypeOfPtr((*int16)(nil)).Elem()) + } + return &int16Codec{} + case reflect.Int32: + if typeName != "int32" { + return encoderOfType(ctx, reflect2.TypeOfPtr((*int32)(nil)).Elem()) + } + return &int32Codec{} + case reflect.Int64: + if typeName != "int64" { + return encoderOfType(ctx, reflect2.TypeOfPtr((*int64)(nil)).Elem()) + } + return &int64Codec{} + case reflect.Uint: + if typeName != "uint" { + return encoderOfType(ctx, reflect2.TypeOfPtr((*uint)(nil)).Elem()) + } + if strconv.IntSize == 32 { + return &uint32Codec{} + } + return &uint64Codec{} + case reflect.Uint8: + if typeName != "uint8" { + return encoderOfType(ctx, reflect2.TypeOfPtr((*uint8)(nil)).Elem()) + } + return &uint8Codec{} + case reflect.Uint16: + if typeName != "uint16" { + return encoderOfType(ctx, reflect2.TypeOfPtr((*uint16)(nil)).Elem()) + } + return &uint16Codec{} + case reflect.Uint32: + if typeName != "uint32" { + return encoderOfType(ctx, reflect2.TypeOfPtr((*uint32)(nil)).Elem()) + } + return &uint32Codec{} + case reflect.Uintptr: + if typeName != "uintptr" { + return encoderOfType(ctx, reflect2.TypeOfPtr((*uintptr)(nil)).Elem()) + } + if ptrSize == 32 { + return &uint32Codec{} + } + return &uint64Codec{} + case reflect.Uint64: + if typeName != "uint64" { + return encoderOfType(ctx, reflect2.TypeOfPtr((*uint64)(nil)).Elem()) + } + return &uint64Codec{} + case reflect.Float32: + if typeName != "float32" { + return encoderOfType(ctx, reflect2.TypeOfPtr((*float32)(nil)).Elem()) + } + return &float32Codec{} + case reflect.Float64: + if typeName != "float64" { + return encoderOfType(ctx, reflect2.TypeOfPtr((*float64)(nil)).Elem()) + } + return &float64Codec{} + case reflect.Bool: + if typeName != "bool" { + return encoderOfType(ctx, reflect2.TypeOfPtr((*bool)(nil)).Elem()) + } + return &boolCodec{} + } + return nil +} + +func createDecoderOfNative(ctx *ctx, typ reflect2.Type) ValDecoder { + if typ.Kind() == reflect.Slice && typ.(reflect2.SliceType).Elem().Kind() == reflect.Uint8 { + sliceDecoder := decoderOfSlice(ctx, typ) + return &base64Codec{sliceDecoder: sliceDecoder} + } + typeName := typ.String() + switch typ.Kind() { + case reflect.String: + if typeName != "string" { + return decoderOfType(ctx, reflect2.TypeOfPtr((*string)(nil)).Elem()) + } + return &stringCodec{} + case reflect.Int: + if typeName != "int" { + return decoderOfType(ctx, reflect2.TypeOfPtr((*int)(nil)).Elem()) + } + if strconv.IntSize == 32 { + return &int32Codec{} + } + return &int64Codec{} + case reflect.Int8: + if typeName != "int8" { + return decoderOfType(ctx, reflect2.TypeOfPtr((*int8)(nil)).Elem()) + } + return &int8Codec{} + case reflect.Int16: + if typeName != "int16" { + return decoderOfType(ctx, reflect2.TypeOfPtr((*int16)(nil)).Elem()) + } + return &int16Codec{} + case reflect.Int32: + if typeName != "int32" { + return decoderOfType(ctx, reflect2.TypeOfPtr((*int32)(nil)).Elem()) + } + return &int32Codec{} + case reflect.Int64: + if typeName != "int64" { + return decoderOfType(ctx, reflect2.TypeOfPtr((*int64)(nil)).Elem()) + } + return &int64Codec{} + case reflect.Uint: + if typeName != "uint" { + return decoderOfType(ctx, reflect2.TypeOfPtr((*uint)(nil)).Elem()) + } + if strconv.IntSize == 32 { + return &uint32Codec{} + } + return &uint64Codec{} + case reflect.Uint8: + if typeName != "uint8" { + return decoderOfType(ctx, reflect2.TypeOfPtr((*uint8)(nil)).Elem()) + } + return &uint8Codec{} + case reflect.Uint16: + if typeName != "uint16" { + return decoderOfType(ctx, reflect2.TypeOfPtr((*uint16)(nil)).Elem()) + } + return &uint16Codec{} + case reflect.Uint32: + if typeName != "uint32" { + return decoderOfType(ctx, reflect2.TypeOfPtr((*uint32)(nil)).Elem()) + } + return &uint32Codec{} + case reflect.Uintptr: + if typeName != "uintptr" { + return decoderOfType(ctx, reflect2.TypeOfPtr((*uintptr)(nil)).Elem()) + } + if ptrSize == 32 { + return &uint32Codec{} + } + return &uint64Codec{} + case reflect.Uint64: + if typeName != "uint64" { + return decoderOfType(ctx, reflect2.TypeOfPtr((*uint64)(nil)).Elem()) + } + return &uint64Codec{} + case reflect.Float32: + if typeName != "float32" { + return decoderOfType(ctx, reflect2.TypeOfPtr((*float32)(nil)).Elem()) + } + return &float32Codec{} + case reflect.Float64: + if typeName != "float64" { + return decoderOfType(ctx, reflect2.TypeOfPtr((*float64)(nil)).Elem()) + } + return &float64Codec{} + case reflect.Bool: + if typeName != "bool" { + return decoderOfType(ctx, reflect2.TypeOfPtr((*bool)(nil)).Elem()) + } + return &boolCodec{} + } + return nil +} + +type stringCodec struct { +} + +func (codec *stringCodec) Decode(ptr unsafe.Pointer, iter *Iterator) { + *((*string)(ptr)) = iter.ReadString() +} + +func (codec *stringCodec) Encode(ptr unsafe.Pointer, stream *Stream) { + str := *((*string)(ptr)) + stream.WriteString(str) +} + +func (codec *stringCodec) IsEmpty(ptr unsafe.Pointer) bool { + return *((*string)(ptr)) == "" +} + +type int8Codec struct { +} + +func (codec *int8Codec) Decode(ptr unsafe.Pointer, iter *Iterator) { + if !iter.ReadNil() { + *((*int8)(ptr)) = iter.ReadInt8() + } +} + +func (codec *int8Codec) Encode(ptr unsafe.Pointer, stream *Stream) { + stream.WriteInt8(*((*int8)(ptr))) +} + +func (codec *int8Codec) IsEmpty(ptr unsafe.Pointer) bool { + return *((*int8)(ptr)) == 0 +} + +type int16Codec struct { +} + +func (codec *int16Codec) Decode(ptr unsafe.Pointer, iter *Iterator) { + if !iter.ReadNil() { + *((*int16)(ptr)) = iter.ReadInt16() + } +} + +func (codec *int16Codec) Encode(ptr unsafe.Pointer, stream *Stream) { + stream.WriteInt16(*((*int16)(ptr))) +} + +func (codec *int16Codec) IsEmpty(ptr unsafe.Pointer) bool { + return *((*int16)(ptr)) == 0 +} + +type int32Codec struct { +} + +func (codec *int32Codec) Decode(ptr unsafe.Pointer, iter *Iterator) { + if !iter.ReadNil() { + *((*int32)(ptr)) = iter.ReadInt32() + } +} + +func (codec *int32Codec) Encode(ptr unsafe.Pointer, stream *Stream) { + stream.WriteInt32(*((*int32)(ptr))) +} + +func (codec *int32Codec) IsEmpty(ptr unsafe.Pointer) bool { + return *((*int32)(ptr)) == 0 +} + +type int64Codec struct { +} + +func (codec *int64Codec) Decode(ptr unsafe.Pointer, iter *Iterator) { + if !iter.ReadNil() { + *((*int64)(ptr)) = iter.ReadInt64() + } +} + +func (codec *int64Codec) Encode(ptr unsafe.Pointer, stream *Stream) { + stream.WriteInt64(*((*int64)(ptr))) +} + +func (codec *int64Codec) IsEmpty(ptr unsafe.Pointer) bool { + return *((*int64)(ptr)) == 0 +} + +type uint8Codec struct { +} + +func (codec *uint8Codec) Decode(ptr unsafe.Pointer, iter *Iterator) { + if !iter.ReadNil() { + *((*uint8)(ptr)) = iter.ReadUint8() + } +} + +func (codec *uint8Codec) Encode(ptr unsafe.Pointer, stream *Stream) { + stream.WriteUint8(*((*uint8)(ptr))) +} + +func (codec *uint8Codec) IsEmpty(ptr unsafe.Pointer) bool { + return *((*uint8)(ptr)) == 0 +} + +type uint16Codec struct { +} + +func (codec *uint16Codec) Decode(ptr unsafe.Pointer, iter *Iterator) { + if !iter.ReadNil() { + *((*uint16)(ptr)) = iter.ReadUint16() + } +} + +func (codec *uint16Codec) Encode(ptr unsafe.Pointer, stream *Stream) { + stream.WriteUint16(*((*uint16)(ptr))) +} + +func (codec *uint16Codec) IsEmpty(ptr unsafe.Pointer) bool { + return *((*uint16)(ptr)) == 0 +} + +type uint32Codec struct { +} + +func (codec *uint32Codec) Decode(ptr unsafe.Pointer, iter *Iterator) { + if !iter.ReadNil() { + *((*uint32)(ptr)) = iter.ReadUint32() + } +} + +func (codec *uint32Codec) Encode(ptr unsafe.Pointer, stream *Stream) { + stream.WriteUint32(*((*uint32)(ptr))) +} + +func (codec *uint32Codec) IsEmpty(ptr unsafe.Pointer) bool { + return *((*uint32)(ptr)) == 0 +} + +type uint64Codec struct { +} + +func (codec *uint64Codec) Decode(ptr unsafe.Pointer, iter *Iterator) { + if !iter.ReadNil() { + *((*uint64)(ptr)) = iter.ReadUint64() + } +} + +func (codec *uint64Codec) Encode(ptr unsafe.Pointer, stream *Stream) { + stream.WriteUint64(*((*uint64)(ptr))) +} + +func (codec *uint64Codec) IsEmpty(ptr unsafe.Pointer) bool { + return *((*uint64)(ptr)) == 0 +} + +type float32Codec struct { +} + +func (codec *float32Codec) Decode(ptr unsafe.Pointer, iter *Iterator) { + if !iter.ReadNil() { + *((*float32)(ptr)) = iter.ReadFloat32() + } +} + +func (codec *float32Codec) Encode(ptr unsafe.Pointer, stream *Stream) { + stream.WriteFloat32(*((*float32)(ptr))) +} + +func (codec *float32Codec) IsEmpty(ptr unsafe.Pointer) bool { + return *((*float32)(ptr)) == 0 +} + +type float64Codec struct { +} + +func (codec *float64Codec) Decode(ptr unsafe.Pointer, iter *Iterator) { + if !iter.ReadNil() { + *((*float64)(ptr)) = iter.ReadFloat64() + } +} + +func (codec *float64Codec) Encode(ptr unsafe.Pointer, stream *Stream) { + stream.WriteFloat64(*((*float64)(ptr))) +} + +func (codec *float64Codec) IsEmpty(ptr unsafe.Pointer) bool { + return *((*float64)(ptr)) == 0 +} + +type boolCodec struct { +} + +func (codec *boolCodec) Decode(ptr unsafe.Pointer, iter *Iterator) { + if !iter.ReadNil() { + *((*bool)(ptr)) = iter.ReadBool() + } +} + +func (codec *boolCodec) Encode(ptr unsafe.Pointer, stream *Stream) { + stream.WriteBool(*((*bool)(ptr))) +} + +func (codec *boolCodec) IsEmpty(ptr unsafe.Pointer) bool { + return !(*((*bool)(ptr))) +} + +type base64Codec struct { + sliceType *reflect2.UnsafeSliceType + sliceDecoder ValDecoder +} + +func (codec *base64Codec) Decode(ptr unsafe.Pointer, iter *Iterator) { + if iter.ReadNil() { + codec.sliceType.UnsafeSetNil(ptr) + return + } + switch iter.WhatIsNext() { + case StringValue: + src := iter.ReadString() + dst, err := base64.StdEncoding.DecodeString(src) + if err != nil { + iter.ReportError("decode base64", err.Error()) + } else { + codec.sliceType.UnsafeSet(ptr, unsafe.Pointer(&dst)) + } + case ArrayValue: + codec.sliceDecoder.Decode(ptr, iter) + default: + iter.ReportError("base64Codec", "invalid input") + } +} + +func (codec *base64Codec) Encode(ptr unsafe.Pointer, stream *Stream) { + src := *((*[]byte)(ptr)) + if len(src) == 0 { + stream.WriteNil() + return + } + encoding := base64.StdEncoding + stream.writeByte('"') + size := encoding.EncodedLen(len(src)) + buf := make([]byte, size) + encoding.Encode(buf, src) + stream.buf = append(stream.buf, buf...) + stream.writeByte('"') +} + +func (codec *base64Codec) IsEmpty(ptr unsafe.Pointer) bool { + return len(*((*[]byte)(ptr))) == 0 +} diff --git a/vendor/github.com/json-iterator/go/reflect_optional.go b/vendor/github.com/json-iterator/go/reflect_optional.go new file mode 100644 index 000000000..43ec71d6d --- /dev/null +++ b/vendor/github.com/json-iterator/go/reflect_optional.go @@ -0,0 +1,133 @@ +package jsoniter + +import ( + "github.com/modern-go/reflect2" + "reflect" + "unsafe" +) + +func decoderOfOptional(ctx *ctx, typ reflect2.Type) ValDecoder { + ptrType := typ.(*reflect2.UnsafePtrType) + elemType := ptrType.Elem() + decoder := decoderOfType(ctx, elemType) + if ctx.prefix == "" && elemType.Kind() == reflect.Ptr { + return &dereferenceDecoder{elemType, decoder} + } + return &OptionalDecoder{elemType, decoder} +} + +func encoderOfOptional(ctx *ctx, typ reflect2.Type) ValEncoder { + ptrType := typ.(*reflect2.UnsafePtrType) + elemType := ptrType.Elem() + elemEncoder := encoderOfType(ctx, elemType) + encoder := &OptionalEncoder{elemEncoder} + return encoder +} + +type OptionalDecoder struct { + ValueType reflect2.Type + ValueDecoder ValDecoder +} + +func (decoder *OptionalDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { + if iter.ReadNil() { + *((*unsafe.Pointer)(ptr)) = nil + } else { + if *((*unsafe.Pointer)(ptr)) == nil { + //pointer to null, we have to allocate memory to hold the value + newPtr := decoder.ValueType.UnsafeNew() + decoder.ValueDecoder.Decode(newPtr, iter) + *((*unsafe.Pointer)(ptr)) = newPtr + } else { + //reuse existing instance + decoder.ValueDecoder.Decode(*((*unsafe.Pointer)(ptr)), iter) + } + } +} + +type dereferenceDecoder struct { + // only to deference a pointer + valueType reflect2.Type + valueDecoder ValDecoder +} + +func (decoder *dereferenceDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { + if *((*unsafe.Pointer)(ptr)) == nil { + //pointer to null, we have to allocate memory to hold the value + newPtr := decoder.valueType.UnsafeNew() + decoder.valueDecoder.Decode(newPtr, iter) + *((*unsafe.Pointer)(ptr)) = newPtr + } else { + //reuse existing instance + decoder.valueDecoder.Decode(*((*unsafe.Pointer)(ptr)), iter) + } +} + +type OptionalEncoder struct { + ValueEncoder ValEncoder +} + +func (encoder *OptionalEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { + if *((*unsafe.Pointer)(ptr)) == nil { + stream.WriteNil() + } else { + encoder.ValueEncoder.Encode(*((*unsafe.Pointer)(ptr)), stream) + } +} + +func (encoder *OptionalEncoder) IsEmpty(ptr unsafe.Pointer) bool { + return *((*unsafe.Pointer)(ptr)) == nil +} + +type dereferenceEncoder struct { + ValueEncoder ValEncoder +} + +func (encoder *dereferenceEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { + if *((*unsafe.Pointer)(ptr)) == nil { + stream.WriteNil() + } else { + encoder.ValueEncoder.Encode(*((*unsafe.Pointer)(ptr)), stream) + } +} + +func (encoder *dereferenceEncoder) IsEmpty(ptr unsafe.Pointer) bool { + dePtr := *((*unsafe.Pointer)(ptr)) + if dePtr == nil { + return true + } + return encoder.ValueEncoder.IsEmpty(dePtr) +} + +func (encoder *dereferenceEncoder) IsEmbeddedPtrNil(ptr unsafe.Pointer) bool { + deReferenced := *((*unsafe.Pointer)(ptr)) + if deReferenced == nil { + return true + } + isEmbeddedPtrNil, converted := encoder.ValueEncoder.(IsEmbeddedPtrNil) + if !converted { + return false + } + fieldPtr := unsafe.Pointer(deReferenced) + return isEmbeddedPtrNil.IsEmbeddedPtrNil(fieldPtr) +} + +type referenceEncoder struct { + encoder ValEncoder +} + +func (encoder *referenceEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { + encoder.encoder.Encode(unsafe.Pointer(&ptr), stream) +} + +func (encoder *referenceEncoder) IsEmpty(ptr unsafe.Pointer) bool { + return encoder.encoder.IsEmpty(unsafe.Pointer(&ptr)) +} + +type referenceDecoder struct { + decoder ValDecoder +} + +func (decoder *referenceDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { + decoder.decoder.Decode(unsafe.Pointer(&ptr), iter) +} diff --git a/vendor/github.com/json-iterator/go/reflect_slice.go b/vendor/github.com/json-iterator/go/reflect_slice.go new file mode 100644 index 000000000..9441d79df --- /dev/null +++ b/vendor/github.com/json-iterator/go/reflect_slice.go @@ -0,0 +1,99 @@ +package jsoniter + +import ( + "fmt" + "github.com/modern-go/reflect2" + "io" + "unsafe" +) + +func decoderOfSlice(ctx *ctx, typ reflect2.Type) ValDecoder { + sliceType := typ.(*reflect2.UnsafeSliceType) + decoder := decoderOfType(ctx.append("[sliceElem]"), sliceType.Elem()) + return &sliceDecoder{sliceType, decoder} +} + +func encoderOfSlice(ctx *ctx, typ reflect2.Type) ValEncoder { + sliceType := typ.(*reflect2.UnsafeSliceType) + encoder := encoderOfType(ctx.append("[sliceElem]"), sliceType.Elem()) + return &sliceEncoder{sliceType, encoder} +} + +type sliceEncoder struct { + sliceType *reflect2.UnsafeSliceType + elemEncoder ValEncoder +} + +func (encoder *sliceEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { + if encoder.sliceType.UnsafeIsNil(ptr) { + stream.WriteNil() + return + } + length := encoder.sliceType.UnsafeLengthOf(ptr) + if length == 0 { + stream.WriteEmptyArray() + return + } + stream.WriteArrayStart() + encoder.elemEncoder.Encode(encoder.sliceType.UnsafeGetIndex(ptr, 0), stream) + for i := 1; i < length; i++ { + stream.WriteMore() + elemPtr := encoder.sliceType.UnsafeGetIndex(ptr, i) + encoder.elemEncoder.Encode(elemPtr, stream) + } + stream.WriteArrayEnd() + if stream.Error != nil && stream.Error != io.EOF { + stream.Error = fmt.Errorf("%v: %s", encoder.sliceType, stream.Error.Error()) + } +} + +func (encoder *sliceEncoder) IsEmpty(ptr unsafe.Pointer) bool { + return encoder.sliceType.UnsafeLengthOf(ptr) == 0 +} + +type sliceDecoder struct { + sliceType *reflect2.UnsafeSliceType + elemDecoder ValDecoder +} + +func (decoder *sliceDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { + decoder.doDecode(ptr, iter) + if iter.Error != nil && iter.Error != io.EOF { + iter.Error = fmt.Errorf("%v: %s", decoder.sliceType, iter.Error.Error()) + } +} + +func (decoder *sliceDecoder) doDecode(ptr unsafe.Pointer, iter *Iterator) { + c := iter.nextToken() + sliceType := decoder.sliceType + if c == 'n' { + iter.skipThreeBytes('u', 'l', 'l') + sliceType.UnsafeSetNil(ptr) + return + } + if c != '[' { + iter.ReportError("decode slice", "expect [ or n, but found "+string([]byte{c})) + return + } + c = iter.nextToken() + if c == ']' { + sliceType.UnsafeSet(ptr, sliceType.UnsafeMakeSlice(0, 0)) + return + } + iter.unreadByte() + sliceType.UnsafeGrow(ptr, 1) + elemPtr := sliceType.UnsafeGetIndex(ptr, 0) + decoder.elemDecoder.Decode(elemPtr, iter) + length := 1 + for c = iter.nextToken(); c == ','; c = iter.nextToken() { + idx := length + length += 1 + sliceType.UnsafeGrow(ptr, length) + elemPtr = sliceType.UnsafeGetIndex(ptr, idx) + decoder.elemDecoder.Decode(elemPtr, iter) + } + if c != ']' { + iter.ReportError("decode slice", "expect ], but found "+string([]byte{c})) + return + } +} diff --git a/vendor/github.com/json-iterator/go/reflect_struct_decoder.go b/vendor/github.com/json-iterator/go/reflect_struct_decoder.go new file mode 100644 index 000000000..355d2d116 --- /dev/null +++ b/vendor/github.com/json-iterator/go/reflect_struct_decoder.go @@ -0,0 +1,1048 @@ +package jsoniter + +import ( + "fmt" + "io" + "strings" + "unsafe" + + "github.com/modern-go/reflect2" +) + +func decoderOfStruct(ctx *ctx, typ reflect2.Type) ValDecoder { + bindings := map[string]*Binding{} + structDescriptor := describeStruct(ctx, typ) + for _, binding := range structDescriptor.Fields { + for _, fromName := range binding.FromNames { + old := bindings[fromName] + if old == nil { + bindings[fromName] = binding + continue + } + ignoreOld, ignoreNew := resolveConflictBinding(ctx.frozenConfig, old, binding) + if ignoreOld { + delete(bindings, fromName) + } + if !ignoreNew { + bindings[fromName] = binding + } + } + } + fields := map[string]*structFieldDecoder{} + for k, binding := range bindings { + fields[k] = binding.Decoder.(*structFieldDecoder) + } + + if !ctx.caseSensitive() { + for k, binding := range bindings { + if _, found := fields[strings.ToLower(k)]; !found { + fields[strings.ToLower(k)] = binding.Decoder.(*structFieldDecoder) + } + } + } + + return createStructDecoder(ctx, typ, fields) +} + +func createStructDecoder(ctx *ctx, typ reflect2.Type, fields map[string]*structFieldDecoder) ValDecoder { + if ctx.disallowUnknownFields { + return &generalStructDecoder{typ: typ, fields: fields, disallowUnknownFields: true} + } + knownHash := map[int64]struct{}{ + 0: {}, + } + + switch len(fields) { + case 0: + return &skipObjectDecoder{typ} + case 1: + for fieldName, fieldDecoder := range fields { + fieldHash := calcHash(fieldName, ctx.caseSensitive()) + _, known := knownHash[fieldHash] + if known { + return &generalStructDecoder{typ, fields, false} + } + knownHash[fieldHash] = struct{}{} + return &oneFieldStructDecoder{typ, fieldHash, fieldDecoder} + } + case 2: + var fieldHash1 int64 + var fieldHash2 int64 + var fieldDecoder1 *structFieldDecoder + var fieldDecoder2 *structFieldDecoder + for fieldName, fieldDecoder := range fields { + fieldHash := calcHash(fieldName, ctx.caseSensitive()) + _, known := knownHash[fieldHash] + if known { + return &generalStructDecoder{typ, fields, false} + } + knownHash[fieldHash] = struct{}{} + if fieldHash1 == 0 { + fieldHash1 = fieldHash + fieldDecoder1 = fieldDecoder + } else { + fieldHash2 = fieldHash + fieldDecoder2 = fieldDecoder + } + } + return &twoFieldsStructDecoder{typ, fieldHash1, fieldDecoder1, fieldHash2, fieldDecoder2} + case 3: + var fieldName1 int64 + var fieldName2 int64 + var fieldName3 int64 + var fieldDecoder1 *structFieldDecoder + var fieldDecoder2 *structFieldDecoder + var fieldDecoder3 *structFieldDecoder + for fieldName, fieldDecoder := range fields { + fieldHash := calcHash(fieldName, ctx.caseSensitive()) + _, known := knownHash[fieldHash] + if known { + return &generalStructDecoder{typ, fields, false} + } + knownHash[fieldHash] = struct{}{} + if fieldName1 == 0 { + fieldName1 = fieldHash + fieldDecoder1 = fieldDecoder + } else if fieldName2 == 0 { + fieldName2 = fieldHash + fieldDecoder2 = fieldDecoder + } else { + fieldName3 = fieldHash + fieldDecoder3 = fieldDecoder + } + } + return &threeFieldsStructDecoder{typ, + fieldName1, fieldDecoder1, + fieldName2, fieldDecoder2, + fieldName3, fieldDecoder3} + case 4: + var fieldName1 int64 + var fieldName2 int64 + var fieldName3 int64 + var fieldName4 int64 + var fieldDecoder1 *structFieldDecoder + var fieldDecoder2 *structFieldDecoder + var fieldDecoder3 *structFieldDecoder + var fieldDecoder4 *structFieldDecoder + for fieldName, fieldDecoder := range fields { + fieldHash := calcHash(fieldName, ctx.caseSensitive()) + _, known := knownHash[fieldHash] + if known { + return &generalStructDecoder{typ, fields, false} + } + knownHash[fieldHash] = struct{}{} + if fieldName1 == 0 { + fieldName1 = fieldHash + fieldDecoder1 = fieldDecoder + } else if fieldName2 == 0 { + fieldName2 = fieldHash + fieldDecoder2 = fieldDecoder + } else if fieldName3 == 0 { + fieldName3 = fieldHash + fieldDecoder3 = fieldDecoder + } else { + fieldName4 = fieldHash + fieldDecoder4 = fieldDecoder + } + } + return &fourFieldsStructDecoder{typ, + fieldName1, fieldDecoder1, + fieldName2, fieldDecoder2, + fieldName3, fieldDecoder3, + fieldName4, fieldDecoder4} + case 5: + var fieldName1 int64 + var fieldName2 int64 + var fieldName3 int64 + var fieldName4 int64 + var fieldName5 int64 + var fieldDecoder1 *structFieldDecoder + var fieldDecoder2 *structFieldDecoder + var fieldDecoder3 *structFieldDecoder + var fieldDecoder4 *structFieldDecoder + var fieldDecoder5 *structFieldDecoder + for fieldName, fieldDecoder := range fields { + fieldHash := calcHash(fieldName, ctx.caseSensitive()) + _, known := knownHash[fieldHash] + if known { + return &generalStructDecoder{typ, fields, false} + } + knownHash[fieldHash] = struct{}{} + if fieldName1 == 0 { + fieldName1 = fieldHash + fieldDecoder1 = fieldDecoder + } else if fieldName2 == 0 { + fieldName2 = fieldHash + fieldDecoder2 = fieldDecoder + } else if fieldName3 == 0 { + fieldName3 = fieldHash + fieldDecoder3 = fieldDecoder + } else if fieldName4 == 0 { + fieldName4 = fieldHash + fieldDecoder4 = fieldDecoder + } else { + fieldName5 = fieldHash + fieldDecoder5 = fieldDecoder + } + } + return &fiveFieldsStructDecoder{typ, + fieldName1, fieldDecoder1, + fieldName2, fieldDecoder2, + fieldName3, fieldDecoder3, + fieldName4, fieldDecoder4, + fieldName5, fieldDecoder5} + case 6: + var fieldName1 int64 + var fieldName2 int64 + var fieldName3 int64 + var fieldName4 int64 + var fieldName5 int64 + var fieldName6 int64 + var fieldDecoder1 *structFieldDecoder + var fieldDecoder2 *structFieldDecoder + var fieldDecoder3 *structFieldDecoder + var fieldDecoder4 *structFieldDecoder + var fieldDecoder5 *structFieldDecoder + var fieldDecoder6 *structFieldDecoder + for fieldName, fieldDecoder := range fields { + fieldHash := calcHash(fieldName, ctx.caseSensitive()) + _, known := knownHash[fieldHash] + if known { + return &generalStructDecoder{typ, fields, false} + } + knownHash[fieldHash] = struct{}{} + if fieldName1 == 0 { + fieldName1 = fieldHash + fieldDecoder1 = fieldDecoder + } else if fieldName2 == 0 { + fieldName2 = fieldHash + fieldDecoder2 = fieldDecoder + } else if fieldName3 == 0 { + fieldName3 = fieldHash + fieldDecoder3 = fieldDecoder + } else if fieldName4 == 0 { + fieldName4 = fieldHash + fieldDecoder4 = fieldDecoder + } else if fieldName5 == 0 { + fieldName5 = fieldHash + fieldDecoder5 = fieldDecoder + } else { + fieldName6 = fieldHash + fieldDecoder6 = fieldDecoder + } + } + return &sixFieldsStructDecoder{typ, + fieldName1, fieldDecoder1, + fieldName2, fieldDecoder2, + fieldName3, fieldDecoder3, + fieldName4, fieldDecoder4, + fieldName5, fieldDecoder5, + fieldName6, fieldDecoder6} + case 7: + var fieldName1 int64 + var fieldName2 int64 + var fieldName3 int64 + var fieldName4 int64 + var fieldName5 int64 + var fieldName6 int64 + var fieldName7 int64 + var fieldDecoder1 *structFieldDecoder + var fieldDecoder2 *structFieldDecoder + var fieldDecoder3 *structFieldDecoder + var fieldDecoder4 *structFieldDecoder + var fieldDecoder5 *structFieldDecoder + var fieldDecoder6 *structFieldDecoder + var fieldDecoder7 *structFieldDecoder + for fieldName, fieldDecoder := range fields { + fieldHash := calcHash(fieldName, ctx.caseSensitive()) + _, known := knownHash[fieldHash] + if known { + return &generalStructDecoder{typ, fields, false} + } + knownHash[fieldHash] = struct{}{} + if fieldName1 == 0 { + fieldName1 = fieldHash + fieldDecoder1 = fieldDecoder + } else if fieldName2 == 0 { + fieldName2 = fieldHash + fieldDecoder2 = fieldDecoder + } else if fieldName3 == 0 { + fieldName3 = fieldHash + fieldDecoder3 = fieldDecoder + } else if fieldName4 == 0 { + fieldName4 = fieldHash + fieldDecoder4 = fieldDecoder + } else if fieldName5 == 0 { + fieldName5 = fieldHash + fieldDecoder5 = fieldDecoder + } else if fieldName6 == 0 { + fieldName6 = fieldHash + fieldDecoder6 = fieldDecoder + } else { + fieldName7 = fieldHash + fieldDecoder7 = fieldDecoder + } + } + return &sevenFieldsStructDecoder{typ, + fieldName1, fieldDecoder1, + fieldName2, fieldDecoder2, + fieldName3, fieldDecoder3, + fieldName4, fieldDecoder4, + fieldName5, fieldDecoder5, + fieldName6, fieldDecoder6, + fieldName7, fieldDecoder7} + case 8: + var fieldName1 int64 + var fieldName2 int64 + var fieldName3 int64 + var fieldName4 int64 + var fieldName5 int64 + var fieldName6 int64 + var fieldName7 int64 + var fieldName8 int64 + var fieldDecoder1 *structFieldDecoder + var fieldDecoder2 *structFieldDecoder + var fieldDecoder3 *structFieldDecoder + var fieldDecoder4 *structFieldDecoder + var fieldDecoder5 *structFieldDecoder + var fieldDecoder6 *structFieldDecoder + var fieldDecoder7 *structFieldDecoder + var fieldDecoder8 *structFieldDecoder + for fieldName, fieldDecoder := range fields { + fieldHash := calcHash(fieldName, ctx.caseSensitive()) + _, known := knownHash[fieldHash] + if known { + return &generalStructDecoder{typ, fields, false} + } + knownHash[fieldHash] = struct{}{} + if fieldName1 == 0 { + fieldName1 = fieldHash + fieldDecoder1 = fieldDecoder + } else if fieldName2 == 0 { + fieldName2 = fieldHash + fieldDecoder2 = fieldDecoder + } else if fieldName3 == 0 { + fieldName3 = fieldHash + fieldDecoder3 = fieldDecoder + } else if fieldName4 == 0 { + fieldName4 = fieldHash + fieldDecoder4 = fieldDecoder + } else if fieldName5 == 0 { + fieldName5 = fieldHash + fieldDecoder5 = fieldDecoder + } else if fieldName6 == 0 { + fieldName6 = fieldHash + fieldDecoder6 = fieldDecoder + } else if fieldName7 == 0 { + fieldName7 = fieldHash + fieldDecoder7 = fieldDecoder + } else { + fieldName8 = fieldHash + fieldDecoder8 = fieldDecoder + } + } + return &eightFieldsStructDecoder{typ, + fieldName1, fieldDecoder1, + fieldName2, fieldDecoder2, + fieldName3, fieldDecoder3, + fieldName4, fieldDecoder4, + fieldName5, fieldDecoder5, + fieldName6, fieldDecoder6, + fieldName7, fieldDecoder7, + fieldName8, fieldDecoder8} + case 9: + var fieldName1 int64 + var fieldName2 int64 + var fieldName3 int64 + var fieldName4 int64 + var fieldName5 int64 + var fieldName6 int64 + var fieldName7 int64 + var fieldName8 int64 + var fieldName9 int64 + var fieldDecoder1 *structFieldDecoder + var fieldDecoder2 *structFieldDecoder + var fieldDecoder3 *structFieldDecoder + var fieldDecoder4 *structFieldDecoder + var fieldDecoder5 *structFieldDecoder + var fieldDecoder6 *structFieldDecoder + var fieldDecoder7 *structFieldDecoder + var fieldDecoder8 *structFieldDecoder + var fieldDecoder9 *structFieldDecoder + for fieldName, fieldDecoder := range fields { + fieldHash := calcHash(fieldName, ctx.caseSensitive()) + _, known := knownHash[fieldHash] + if known { + return &generalStructDecoder{typ, fields, false} + } + knownHash[fieldHash] = struct{}{} + if fieldName1 == 0 { + fieldName1 = fieldHash + fieldDecoder1 = fieldDecoder + } else if fieldName2 == 0 { + fieldName2 = fieldHash + fieldDecoder2 = fieldDecoder + } else if fieldName3 == 0 { + fieldName3 = fieldHash + fieldDecoder3 = fieldDecoder + } else if fieldName4 == 0 { + fieldName4 = fieldHash + fieldDecoder4 = fieldDecoder + } else if fieldName5 == 0 { + fieldName5 = fieldHash + fieldDecoder5 = fieldDecoder + } else if fieldName6 == 0 { + fieldName6 = fieldHash + fieldDecoder6 = fieldDecoder + } else if fieldName7 == 0 { + fieldName7 = fieldHash + fieldDecoder7 = fieldDecoder + } else if fieldName8 == 0 { + fieldName8 = fieldHash + fieldDecoder8 = fieldDecoder + } else { + fieldName9 = fieldHash + fieldDecoder9 = fieldDecoder + } + } + return &nineFieldsStructDecoder{typ, + fieldName1, fieldDecoder1, + fieldName2, fieldDecoder2, + fieldName3, fieldDecoder3, + fieldName4, fieldDecoder4, + fieldName5, fieldDecoder5, + fieldName6, fieldDecoder6, + fieldName7, fieldDecoder7, + fieldName8, fieldDecoder8, + fieldName9, fieldDecoder9} + case 10: + var fieldName1 int64 + var fieldName2 int64 + var fieldName3 int64 + var fieldName4 int64 + var fieldName5 int64 + var fieldName6 int64 + var fieldName7 int64 + var fieldName8 int64 + var fieldName9 int64 + var fieldName10 int64 + var fieldDecoder1 *structFieldDecoder + var fieldDecoder2 *structFieldDecoder + var fieldDecoder3 *structFieldDecoder + var fieldDecoder4 *structFieldDecoder + var fieldDecoder5 *structFieldDecoder + var fieldDecoder6 *structFieldDecoder + var fieldDecoder7 *structFieldDecoder + var fieldDecoder8 *structFieldDecoder + var fieldDecoder9 *structFieldDecoder + var fieldDecoder10 *structFieldDecoder + for fieldName, fieldDecoder := range fields { + fieldHash := calcHash(fieldName, ctx.caseSensitive()) + _, known := knownHash[fieldHash] + if known { + return &generalStructDecoder{typ, fields, false} + } + knownHash[fieldHash] = struct{}{} + if fieldName1 == 0 { + fieldName1 = fieldHash + fieldDecoder1 = fieldDecoder + } else if fieldName2 == 0 { + fieldName2 = fieldHash + fieldDecoder2 = fieldDecoder + } else if fieldName3 == 0 { + fieldName3 = fieldHash + fieldDecoder3 = fieldDecoder + } else if fieldName4 == 0 { + fieldName4 = fieldHash + fieldDecoder4 = fieldDecoder + } else if fieldName5 == 0 { + fieldName5 = fieldHash + fieldDecoder5 = fieldDecoder + } else if fieldName6 == 0 { + fieldName6 = fieldHash + fieldDecoder6 = fieldDecoder + } else if fieldName7 == 0 { + fieldName7 = fieldHash + fieldDecoder7 = fieldDecoder + } else if fieldName8 == 0 { + fieldName8 = fieldHash + fieldDecoder8 = fieldDecoder + } else if fieldName9 == 0 { + fieldName9 = fieldHash + fieldDecoder9 = fieldDecoder + } else { + fieldName10 = fieldHash + fieldDecoder10 = fieldDecoder + } + } + return &tenFieldsStructDecoder{typ, + fieldName1, fieldDecoder1, + fieldName2, fieldDecoder2, + fieldName3, fieldDecoder3, + fieldName4, fieldDecoder4, + fieldName5, fieldDecoder5, + fieldName6, fieldDecoder6, + fieldName7, fieldDecoder7, + fieldName8, fieldDecoder8, + fieldName9, fieldDecoder9, + fieldName10, fieldDecoder10} + } + return &generalStructDecoder{typ, fields, false} +} + +type generalStructDecoder struct { + typ reflect2.Type + fields map[string]*structFieldDecoder + disallowUnknownFields bool +} + +func (decoder *generalStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { + if !iter.readObjectStart() { + return + } + var c byte + for c = ','; c == ','; c = iter.nextToken() { + decoder.decodeOneField(ptr, iter) + } + if iter.Error != nil && iter.Error != io.EOF { + iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error()) + } + if c != '}' { + iter.ReportError("struct Decode", `expect }, but found `+string([]byte{c})) + } +} + +func (decoder *generalStructDecoder) decodeOneField(ptr unsafe.Pointer, iter *Iterator) { + var field string + var fieldDecoder *structFieldDecoder + if iter.cfg.objectFieldMustBeSimpleString { + fieldBytes := iter.ReadStringAsSlice() + field = *(*string)(unsafe.Pointer(&fieldBytes)) + fieldDecoder = decoder.fields[field] + if fieldDecoder == nil && !iter.cfg.caseSensitive { + fieldDecoder = decoder.fields[strings.ToLower(field)] + } + } else { + field = iter.ReadString() + fieldDecoder = decoder.fields[field] + if fieldDecoder == nil && !iter.cfg.caseSensitive { + fieldDecoder = decoder.fields[strings.ToLower(field)] + } + } + if fieldDecoder == nil { + msg := "found unknown field: " + field + if decoder.disallowUnknownFields { + iter.ReportError("ReadObject", msg) + } + c := iter.nextToken() + if c != ':' { + iter.ReportError("ReadObject", "expect : after object field, but found "+string([]byte{c})) + } + iter.Skip() + return + } + c := iter.nextToken() + if c != ':' { + iter.ReportError("ReadObject", "expect : after object field, but found "+string([]byte{c})) + } + fieldDecoder.Decode(ptr, iter) +} + +type skipObjectDecoder struct { + typ reflect2.Type +} + +func (decoder *skipObjectDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { + valueType := iter.WhatIsNext() + if valueType != ObjectValue && valueType != NilValue { + iter.ReportError("skipObjectDecoder", "expect object or null") + return + } + iter.Skip() +} + +type oneFieldStructDecoder struct { + typ reflect2.Type + fieldHash int64 + fieldDecoder *structFieldDecoder +} + +func (decoder *oneFieldStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { + if !iter.readObjectStart() { + return + } + for { + if iter.readFieldHash() == decoder.fieldHash { + decoder.fieldDecoder.Decode(ptr, iter) + } else { + iter.Skip() + } + if iter.isObjectEnd() { + break + } + } + if iter.Error != nil && iter.Error != io.EOF { + iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error()) + } +} + +type twoFieldsStructDecoder struct { + typ reflect2.Type + fieldHash1 int64 + fieldDecoder1 *structFieldDecoder + fieldHash2 int64 + fieldDecoder2 *structFieldDecoder +} + +func (decoder *twoFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { + if !iter.readObjectStart() { + return + } + for { + switch iter.readFieldHash() { + case decoder.fieldHash1: + decoder.fieldDecoder1.Decode(ptr, iter) + case decoder.fieldHash2: + decoder.fieldDecoder2.Decode(ptr, iter) + default: + iter.Skip() + } + if iter.isObjectEnd() { + break + } + } + if iter.Error != nil && iter.Error != io.EOF { + iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error()) + } +} + +type threeFieldsStructDecoder struct { + typ reflect2.Type + fieldHash1 int64 + fieldDecoder1 *structFieldDecoder + fieldHash2 int64 + fieldDecoder2 *structFieldDecoder + fieldHash3 int64 + fieldDecoder3 *structFieldDecoder +} + +func (decoder *threeFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { + if !iter.readObjectStart() { + return + } + for { + switch iter.readFieldHash() { + case decoder.fieldHash1: + decoder.fieldDecoder1.Decode(ptr, iter) + case decoder.fieldHash2: + decoder.fieldDecoder2.Decode(ptr, iter) + case decoder.fieldHash3: + decoder.fieldDecoder3.Decode(ptr, iter) + default: + iter.Skip() + } + if iter.isObjectEnd() { + break + } + } + if iter.Error != nil && iter.Error != io.EOF { + iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error()) + } +} + +type fourFieldsStructDecoder struct { + typ reflect2.Type + fieldHash1 int64 + fieldDecoder1 *structFieldDecoder + fieldHash2 int64 + fieldDecoder2 *structFieldDecoder + fieldHash3 int64 + fieldDecoder3 *structFieldDecoder + fieldHash4 int64 + fieldDecoder4 *structFieldDecoder +} + +func (decoder *fourFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { + if !iter.readObjectStart() { + return + } + for { + switch iter.readFieldHash() { + case decoder.fieldHash1: + decoder.fieldDecoder1.Decode(ptr, iter) + case decoder.fieldHash2: + decoder.fieldDecoder2.Decode(ptr, iter) + case decoder.fieldHash3: + decoder.fieldDecoder3.Decode(ptr, iter) + case decoder.fieldHash4: + decoder.fieldDecoder4.Decode(ptr, iter) + default: + iter.Skip() + } + if iter.isObjectEnd() { + break + } + } + if iter.Error != nil && iter.Error != io.EOF { + iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error()) + } +} + +type fiveFieldsStructDecoder struct { + typ reflect2.Type + fieldHash1 int64 + fieldDecoder1 *structFieldDecoder + fieldHash2 int64 + fieldDecoder2 *structFieldDecoder + fieldHash3 int64 + fieldDecoder3 *structFieldDecoder + fieldHash4 int64 + fieldDecoder4 *structFieldDecoder + fieldHash5 int64 + fieldDecoder5 *structFieldDecoder +} + +func (decoder *fiveFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { + if !iter.readObjectStart() { + return + } + for { + switch iter.readFieldHash() { + case decoder.fieldHash1: + decoder.fieldDecoder1.Decode(ptr, iter) + case decoder.fieldHash2: + decoder.fieldDecoder2.Decode(ptr, iter) + case decoder.fieldHash3: + decoder.fieldDecoder3.Decode(ptr, iter) + case decoder.fieldHash4: + decoder.fieldDecoder4.Decode(ptr, iter) + case decoder.fieldHash5: + decoder.fieldDecoder5.Decode(ptr, iter) + default: + iter.Skip() + } + if iter.isObjectEnd() { + break + } + } + if iter.Error != nil && iter.Error != io.EOF { + iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error()) + } +} + +type sixFieldsStructDecoder struct { + typ reflect2.Type + fieldHash1 int64 + fieldDecoder1 *structFieldDecoder + fieldHash2 int64 + fieldDecoder2 *structFieldDecoder + fieldHash3 int64 + fieldDecoder3 *structFieldDecoder + fieldHash4 int64 + fieldDecoder4 *structFieldDecoder + fieldHash5 int64 + fieldDecoder5 *structFieldDecoder + fieldHash6 int64 + fieldDecoder6 *structFieldDecoder +} + +func (decoder *sixFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { + if !iter.readObjectStart() { + return + } + for { + switch iter.readFieldHash() { + case decoder.fieldHash1: + decoder.fieldDecoder1.Decode(ptr, iter) + case decoder.fieldHash2: + decoder.fieldDecoder2.Decode(ptr, iter) + case decoder.fieldHash3: + decoder.fieldDecoder3.Decode(ptr, iter) + case decoder.fieldHash4: + decoder.fieldDecoder4.Decode(ptr, iter) + case decoder.fieldHash5: + decoder.fieldDecoder5.Decode(ptr, iter) + case decoder.fieldHash6: + decoder.fieldDecoder6.Decode(ptr, iter) + default: + iter.Skip() + } + if iter.isObjectEnd() { + break + } + } + if iter.Error != nil && iter.Error != io.EOF { + iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error()) + } +} + +type sevenFieldsStructDecoder struct { + typ reflect2.Type + fieldHash1 int64 + fieldDecoder1 *structFieldDecoder + fieldHash2 int64 + fieldDecoder2 *structFieldDecoder + fieldHash3 int64 + fieldDecoder3 *structFieldDecoder + fieldHash4 int64 + fieldDecoder4 *structFieldDecoder + fieldHash5 int64 + fieldDecoder5 *structFieldDecoder + fieldHash6 int64 + fieldDecoder6 *structFieldDecoder + fieldHash7 int64 + fieldDecoder7 *structFieldDecoder +} + +func (decoder *sevenFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { + if !iter.readObjectStart() { + return + } + for { + switch iter.readFieldHash() { + case decoder.fieldHash1: + decoder.fieldDecoder1.Decode(ptr, iter) + case decoder.fieldHash2: + decoder.fieldDecoder2.Decode(ptr, iter) + case decoder.fieldHash3: + decoder.fieldDecoder3.Decode(ptr, iter) + case decoder.fieldHash4: + decoder.fieldDecoder4.Decode(ptr, iter) + case decoder.fieldHash5: + decoder.fieldDecoder5.Decode(ptr, iter) + case decoder.fieldHash6: + decoder.fieldDecoder6.Decode(ptr, iter) + case decoder.fieldHash7: + decoder.fieldDecoder7.Decode(ptr, iter) + default: + iter.Skip() + } + if iter.isObjectEnd() { + break + } + } + if iter.Error != nil && iter.Error != io.EOF { + iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error()) + } +} + +type eightFieldsStructDecoder struct { + typ reflect2.Type + fieldHash1 int64 + fieldDecoder1 *structFieldDecoder + fieldHash2 int64 + fieldDecoder2 *structFieldDecoder + fieldHash3 int64 + fieldDecoder3 *structFieldDecoder + fieldHash4 int64 + fieldDecoder4 *structFieldDecoder + fieldHash5 int64 + fieldDecoder5 *structFieldDecoder + fieldHash6 int64 + fieldDecoder6 *structFieldDecoder + fieldHash7 int64 + fieldDecoder7 *structFieldDecoder + fieldHash8 int64 + fieldDecoder8 *structFieldDecoder +} + +func (decoder *eightFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { + if !iter.readObjectStart() { + return + } + for { + switch iter.readFieldHash() { + case decoder.fieldHash1: + decoder.fieldDecoder1.Decode(ptr, iter) + case decoder.fieldHash2: + decoder.fieldDecoder2.Decode(ptr, iter) + case decoder.fieldHash3: + decoder.fieldDecoder3.Decode(ptr, iter) + case decoder.fieldHash4: + decoder.fieldDecoder4.Decode(ptr, iter) + case decoder.fieldHash5: + decoder.fieldDecoder5.Decode(ptr, iter) + case decoder.fieldHash6: + decoder.fieldDecoder6.Decode(ptr, iter) + case decoder.fieldHash7: + decoder.fieldDecoder7.Decode(ptr, iter) + case decoder.fieldHash8: + decoder.fieldDecoder8.Decode(ptr, iter) + default: + iter.Skip() + } + if iter.isObjectEnd() { + break + } + } + if iter.Error != nil && iter.Error != io.EOF { + iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error()) + } +} + +type nineFieldsStructDecoder struct { + typ reflect2.Type + fieldHash1 int64 + fieldDecoder1 *structFieldDecoder + fieldHash2 int64 + fieldDecoder2 *structFieldDecoder + fieldHash3 int64 + fieldDecoder3 *structFieldDecoder + fieldHash4 int64 + fieldDecoder4 *structFieldDecoder + fieldHash5 int64 + fieldDecoder5 *structFieldDecoder + fieldHash6 int64 + fieldDecoder6 *structFieldDecoder + fieldHash7 int64 + fieldDecoder7 *structFieldDecoder + fieldHash8 int64 + fieldDecoder8 *structFieldDecoder + fieldHash9 int64 + fieldDecoder9 *structFieldDecoder +} + +func (decoder *nineFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { + if !iter.readObjectStart() { + return + } + for { + switch iter.readFieldHash() { + case decoder.fieldHash1: + decoder.fieldDecoder1.Decode(ptr, iter) + case decoder.fieldHash2: + decoder.fieldDecoder2.Decode(ptr, iter) + case decoder.fieldHash3: + decoder.fieldDecoder3.Decode(ptr, iter) + case decoder.fieldHash4: + decoder.fieldDecoder4.Decode(ptr, iter) + case decoder.fieldHash5: + decoder.fieldDecoder5.Decode(ptr, iter) + case decoder.fieldHash6: + decoder.fieldDecoder6.Decode(ptr, iter) + case decoder.fieldHash7: + decoder.fieldDecoder7.Decode(ptr, iter) + case decoder.fieldHash8: + decoder.fieldDecoder8.Decode(ptr, iter) + case decoder.fieldHash9: + decoder.fieldDecoder9.Decode(ptr, iter) + default: + iter.Skip() + } + if iter.isObjectEnd() { + break + } + } + if iter.Error != nil && iter.Error != io.EOF { + iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error()) + } +} + +type tenFieldsStructDecoder struct { + typ reflect2.Type + fieldHash1 int64 + fieldDecoder1 *structFieldDecoder + fieldHash2 int64 + fieldDecoder2 *structFieldDecoder + fieldHash3 int64 + fieldDecoder3 *structFieldDecoder + fieldHash4 int64 + fieldDecoder4 *structFieldDecoder + fieldHash5 int64 + fieldDecoder5 *structFieldDecoder + fieldHash6 int64 + fieldDecoder6 *structFieldDecoder + fieldHash7 int64 + fieldDecoder7 *structFieldDecoder + fieldHash8 int64 + fieldDecoder8 *structFieldDecoder + fieldHash9 int64 + fieldDecoder9 *structFieldDecoder + fieldHash10 int64 + fieldDecoder10 *structFieldDecoder +} + +func (decoder *tenFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { + if !iter.readObjectStart() { + return + } + for { + switch iter.readFieldHash() { + case decoder.fieldHash1: + decoder.fieldDecoder1.Decode(ptr, iter) + case decoder.fieldHash2: + decoder.fieldDecoder2.Decode(ptr, iter) + case decoder.fieldHash3: + decoder.fieldDecoder3.Decode(ptr, iter) + case decoder.fieldHash4: + decoder.fieldDecoder4.Decode(ptr, iter) + case decoder.fieldHash5: + decoder.fieldDecoder5.Decode(ptr, iter) + case decoder.fieldHash6: + decoder.fieldDecoder6.Decode(ptr, iter) + case decoder.fieldHash7: + decoder.fieldDecoder7.Decode(ptr, iter) + case decoder.fieldHash8: + decoder.fieldDecoder8.Decode(ptr, iter) + case decoder.fieldHash9: + decoder.fieldDecoder9.Decode(ptr, iter) + case decoder.fieldHash10: + decoder.fieldDecoder10.Decode(ptr, iter) + default: + iter.Skip() + } + if iter.isObjectEnd() { + break + } + } + if iter.Error != nil && iter.Error != io.EOF { + iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error()) + } +} + +type structFieldDecoder struct { + field reflect2.StructField + fieldDecoder ValDecoder +} + +func (decoder *structFieldDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { + fieldPtr := decoder.field.UnsafeGet(ptr) + decoder.fieldDecoder.Decode(fieldPtr, iter) + if iter.Error != nil && iter.Error != io.EOF { + iter.Error = fmt.Errorf("%s: %s", decoder.field.Name(), iter.Error.Error()) + } +} + +type stringModeStringDecoder struct { + elemDecoder ValDecoder + cfg *frozenConfig +} + +func (decoder *stringModeStringDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { + decoder.elemDecoder.Decode(ptr, iter) + str := *((*string)(ptr)) + tempIter := decoder.cfg.BorrowIterator([]byte(str)) + defer decoder.cfg.ReturnIterator(tempIter) + *((*string)(ptr)) = tempIter.ReadString() +} + +type stringModeNumberDecoder struct { + elemDecoder ValDecoder +} + +func (decoder *stringModeNumberDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { + c := iter.nextToken() + if c != '"' { + iter.ReportError("stringModeNumberDecoder", `expect ", but found `+string([]byte{c})) + return + } + decoder.elemDecoder.Decode(ptr, iter) + if iter.Error != nil { + return + } + c = iter.readByte() + if c != '"' { + iter.ReportError("stringModeNumberDecoder", `expect ", but found `+string([]byte{c})) + return + } +} diff --git a/vendor/github.com/json-iterator/go/reflect_struct_encoder.go b/vendor/github.com/json-iterator/go/reflect_struct_encoder.go new file mode 100644 index 000000000..d0759cf64 --- /dev/null +++ b/vendor/github.com/json-iterator/go/reflect_struct_encoder.go @@ -0,0 +1,210 @@ +package jsoniter + +import ( + "fmt" + "github.com/modern-go/reflect2" + "io" + "reflect" + "unsafe" +) + +func encoderOfStruct(ctx *ctx, typ reflect2.Type) ValEncoder { + type bindingTo struct { + binding *Binding + toName string + ignored bool + } + orderedBindings := []*bindingTo{} + structDescriptor := describeStruct(ctx, typ) + for _, binding := range structDescriptor.Fields { + for _, toName := range binding.ToNames { + new := &bindingTo{ + binding: binding, + toName: toName, + } + for _, old := range orderedBindings { + if old.toName != toName { + continue + } + old.ignored, new.ignored = resolveConflictBinding(ctx.frozenConfig, old.binding, new.binding) + } + orderedBindings = append(orderedBindings, new) + } + } + if len(orderedBindings) == 0 { + return &emptyStructEncoder{} + } + finalOrderedFields := []structFieldTo{} + for _, bindingTo := range orderedBindings { + if !bindingTo.ignored { + finalOrderedFields = append(finalOrderedFields, structFieldTo{ + encoder: bindingTo.binding.Encoder.(*structFieldEncoder), + toName: bindingTo.toName, + }) + } + } + return &structEncoder{typ, finalOrderedFields} +} + +func createCheckIsEmpty(ctx *ctx, typ reflect2.Type) checkIsEmpty { + encoder := createEncoderOfNative(ctx, typ) + if encoder != nil { + return encoder + } + kind := typ.Kind() + switch kind { + case reflect.Interface: + return &dynamicEncoder{typ} + case reflect.Struct: + return &structEncoder{typ: typ} + case reflect.Array: + return &arrayEncoder{} + case reflect.Slice: + return &sliceEncoder{} + case reflect.Map: + return encoderOfMap(ctx, typ) + case reflect.Ptr: + return &OptionalEncoder{} + default: + return &lazyErrorEncoder{err: fmt.Errorf("unsupported type: %v", typ)} + } +} + +func resolveConflictBinding(cfg *frozenConfig, old, new *Binding) (ignoreOld, ignoreNew bool) { + newTagged := new.Field.Tag().Get(cfg.getTagKey()) != "" + oldTagged := old.Field.Tag().Get(cfg.getTagKey()) != "" + if newTagged { + if oldTagged { + if len(old.levels) > len(new.levels) { + return true, false + } else if len(new.levels) > len(old.levels) { + return false, true + } else { + return true, true + } + } else { + return true, false + } + } else { + if oldTagged { + return true, false + } + if len(old.levels) > len(new.levels) { + return true, false + } else if len(new.levels) > len(old.levels) { + return false, true + } else { + return true, true + } + } +} + +type structFieldEncoder struct { + field reflect2.StructField + fieldEncoder ValEncoder + omitempty bool +} + +func (encoder *structFieldEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { + fieldPtr := encoder.field.UnsafeGet(ptr) + encoder.fieldEncoder.Encode(fieldPtr, stream) + if stream.Error != nil && stream.Error != io.EOF { + stream.Error = fmt.Errorf("%s: %s", encoder.field.Name(), stream.Error.Error()) + } +} + +func (encoder *structFieldEncoder) IsEmpty(ptr unsafe.Pointer) bool { + fieldPtr := encoder.field.UnsafeGet(ptr) + return encoder.fieldEncoder.IsEmpty(fieldPtr) +} + +func (encoder *structFieldEncoder) IsEmbeddedPtrNil(ptr unsafe.Pointer) bool { + isEmbeddedPtrNil, converted := encoder.fieldEncoder.(IsEmbeddedPtrNil) + if !converted { + return false + } + fieldPtr := encoder.field.UnsafeGet(ptr) + return isEmbeddedPtrNil.IsEmbeddedPtrNil(fieldPtr) +} + +type IsEmbeddedPtrNil interface { + IsEmbeddedPtrNil(ptr unsafe.Pointer) bool +} + +type structEncoder struct { + typ reflect2.Type + fields []structFieldTo +} + +type structFieldTo struct { + encoder *structFieldEncoder + toName string +} + +func (encoder *structEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { + stream.WriteObjectStart() + isNotFirst := false + for _, field := range encoder.fields { + if field.encoder.omitempty && field.encoder.IsEmpty(ptr) { + continue + } + if field.encoder.IsEmbeddedPtrNil(ptr) { + continue + } + if isNotFirst { + stream.WriteMore() + } + stream.WriteObjectField(field.toName) + field.encoder.Encode(ptr, stream) + isNotFirst = true + } + stream.WriteObjectEnd() + if stream.Error != nil && stream.Error != io.EOF { + stream.Error = fmt.Errorf("%v.%s", encoder.typ, stream.Error.Error()) + } +} + +func (encoder *structEncoder) IsEmpty(ptr unsafe.Pointer) bool { + return false +} + +type emptyStructEncoder struct { +} + +func (encoder *emptyStructEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { + stream.WriteEmptyObject() +} + +func (encoder *emptyStructEncoder) IsEmpty(ptr unsafe.Pointer) bool { + return false +} + +type stringModeNumberEncoder struct { + elemEncoder ValEncoder +} + +func (encoder *stringModeNumberEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { + stream.writeByte('"') + encoder.elemEncoder.Encode(ptr, stream) + stream.writeByte('"') +} + +func (encoder *stringModeNumberEncoder) IsEmpty(ptr unsafe.Pointer) bool { + return encoder.elemEncoder.IsEmpty(ptr) +} + +type stringModeStringEncoder struct { + elemEncoder ValEncoder + cfg *frozenConfig +} + +func (encoder *stringModeStringEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { + tempStream := encoder.cfg.BorrowStream(nil) + defer encoder.cfg.ReturnStream(tempStream) + encoder.elemEncoder.Encode(ptr, tempStream) + stream.WriteString(string(tempStream.Buffer())) +} + +func (encoder *stringModeStringEncoder) IsEmpty(ptr unsafe.Pointer) bool { + return encoder.elemEncoder.IsEmpty(ptr) +} diff --git a/vendor/github.com/json-iterator/go/stream.go b/vendor/github.com/json-iterator/go/stream.go new file mode 100644 index 000000000..17662fded --- /dev/null +++ b/vendor/github.com/json-iterator/go/stream.go @@ -0,0 +1,211 @@ +package jsoniter + +import ( + "io" +) + +// stream is a io.Writer like object, with JSON specific write functions. +// Error is not returned as return value, but stored as Error member on this stream instance. +type Stream struct { + cfg *frozenConfig + out io.Writer + buf []byte + Error error + indention int + Attachment interface{} // open for customized encoder +} + +// NewStream create new stream instance. +// cfg can be jsoniter.ConfigDefault. +// out can be nil if write to internal buffer. +// bufSize is the initial size for the internal buffer in bytes. +func NewStream(cfg API, out io.Writer, bufSize int) *Stream { + return &Stream{ + cfg: cfg.(*frozenConfig), + out: out, + buf: make([]byte, 0, bufSize), + Error: nil, + indention: 0, + } +} + +// Pool returns a pool can provide more stream with same configuration +func (stream *Stream) Pool() StreamPool { + return stream.cfg +} + +// Reset reuse this stream instance by assign a new writer +func (stream *Stream) Reset(out io.Writer) { + stream.out = out + stream.buf = stream.buf[:0] +} + +// Available returns how many bytes are unused in the buffer. +func (stream *Stream) Available() int { + return cap(stream.buf) - len(stream.buf) +} + +// Buffered returns the number of bytes that have been written into the current buffer. +func (stream *Stream) Buffered() int { + return len(stream.buf) +} + +// Buffer if writer is nil, use this method to take the result +func (stream *Stream) Buffer() []byte { + return stream.buf +} + +// SetBuffer allows to append to the internal buffer directly +func (stream *Stream) SetBuffer(buf []byte) { + stream.buf = buf +} + +// Write writes the contents of p into the buffer. +// It returns the number of bytes written. +// If nn < len(p), it also returns an error explaining +// why the write is short. +func (stream *Stream) Write(p []byte) (nn int, err error) { + stream.buf = append(stream.buf, p...) + if stream.out != nil { + nn, err = stream.out.Write(stream.buf) + stream.buf = stream.buf[nn:] + return + } + return len(p), nil +} + +// WriteByte writes a single byte. +func (stream *Stream) writeByte(c byte) { + stream.buf = append(stream.buf, c) +} + +func (stream *Stream) writeTwoBytes(c1 byte, c2 byte) { + stream.buf = append(stream.buf, c1, c2) +} + +func (stream *Stream) writeThreeBytes(c1 byte, c2 byte, c3 byte) { + stream.buf = append(stream.buf, c1, c2, c3) +} + +func (stream *Stream) writeFourBytes(c1 byte, c2 byte, c3 byte, c4 byte) { + stream.buf = append(stream.buf, c1, c2, c3, c4) +} + +func (stream *Stream) writeFiveBytes(c1 byte, c2 byte, c3 byte, c4 byte, c5 byte) { + stream.buf = append(stream.buf, c1, c2, c3, c4, c5) +} + +// Flush writes any buffered data to the underlying io.Writer. +func (stream *Stream) Flush() error { + if stream.out == nil { + return nil + } + if stream.Error != nil { + return stream.Error + } + n, err := stream.out.Write(stream.buf) + if err != nil { + if stream.Error == nil { + stream.Error = err + } + return err + } + stream.buf = stream.buf[n:] + return nil +} + +// WriteRaw write string out without quotes, just like []byte +func (stream *Stream) WriteRaw(s string) { + stream.buf = append(stream.buf, s...) +} + +// WriteNil write null to stream +func (stream *Stream) WriteNil() { + stream.writeFourBytes('n', 'u', 'l', 'l') +} + +// WriteTrue write true to stream +func (stream *Stream) WriteTrue() { + stream.writeFourBytes('t', 'r', 'u', 'e') +} + +// WriteFalse write false to stream +func (stream *Stream) WriteFalse() { + stream.writeFiveBytes('f', 'a', 'l', 's', 'e') +} + +// WriteBool write true or false into stream +func (stream *Stream) WriteBool(val bool) { + if val { + stream.WriteTrue() + } else { + stream.WriteFalse() + } +} + +// WriteObjectStart write { with possible indention +func (stream *Stream) WriteObjectStart() { + stream.indention += stream.cfg.indentionStep + stream.writeByte('{') + stream.writeIndention(0) +} + +// WriteObjectField write "field": with possible indention +func (stream *Stream) WriteObjectField(field string) { + stream.WriteString(field) + if stream.indention > 0 { + stream.writeTwoBytes(':', ' ') + } else { + stream.writeByte(':') + } +} + +// WriteObjectEnd write } with possible indention +func (stream *Stream) WriteObjectEnd() { + stream.writeIndention(stream.cfg.indentionStep) + stream.indention -= stream.cfg.indentionStep + stream.writeByte('}') +} + +// WriteEmptyObject write {} +func (stream *Stream) WriteEmptyObject() { + stream.writeByte('{') + stream.writeByte('}') +} + +// WriteMore write , with possible indention +func (stream *Stream) WriteMore() { + stream.writeByte(',') + stream.writeIndention(0) + stream.Flush() +} + +// WriteArrayStart write [ with possible indention +func (stream *Stream) WriteArrayStart() { + stream.indention += stream.cfg.indentionStep + stream.writeByte('[') + stream.writeIndention(0) +} + +// WriteEmptyArray write [] +func (stream *Stream) WriteEmptyArray() { + stream.writeTwoBytes('[', ']') +} + +// WriteArrayEnd write ] with possible indention +func (stream *Stream) WriteArrayEnd() { + stream.writeIndention(stream.cfg.indentionStep) + stream.indention -= stream.cfg.indentionStep + stream.writeByte(']') +} + +func (stream *Stream) writeIndention(delta int) { + if stream.indention == 0 { + return + } + stream.writeByte('\n') + toWrite := stream.indention - delta + for i := 0; i < toWrite; i++ { + stream.buf = append(stream.buf, ' ') + } +} diff --git a/vendor/github.com/json-iterator/go/stream_float.go b/vendor/github.com/json-iterator/go/stream_float.go new file mode 100644 index 000000000..f318d2c59 --- /dev/null +++ b/vendor/github.com/json-iterator/go/stream_float.go @@ -0,0 +1,94 @@ +package jsoniter + +import ( + "math" + "strconv" +) + +var pow10 []uint64 + +func init() { + pow10 = []uint64{1, 10, 100, 1000, 10000, 100000, 1000000} +} + +// WriteFloat32 write float32 to stream +func (stream *Stream) WriteFloat32(val float32) { + abs := math.Abs(float64(val)) + fmt := byte('f') + // Note: Must use float32 comparisons for underlying float32 value to get precise cutoffs right. + if abs != 0 { + if float32(abs) < 1e-6 || float32(abs) >= 1e21 { + fmt = 'e' + } + } + stream.buf = strconv.AppendFloat(stream.buf, float64(val), fmt, -1, 32) +} + +// WriteFloat32Lossy write float32 to stream with ONLY 6 digits precision although much much faster +func (stream *Stream) WriteFloat32Lossy(val float32) { + if val < 0 { + stream.writeByte('-') + val = -val + } + if val > 0x4ffffff { + stream.WriteFloat32(val) + return + } + precision := 6 + exp := uint64(1000000) // 6 + lval := uint64(float64(val)*float64(exp) + 0.5) + stream.WriteUint64(lval / exp) + fval := lval % exp + if fval == 0 { + return + } + stream.writeByte('.') + for p := precision - 1; p > 0 && fval < pow10[p]; p-- { + stream.writeByte('0') + } + stream.WriteUint64(fval) + for stream.buf[len(stream.buf)-1] == '0' { + stream.buf = stream.buf[:len(stream.buf)-1] + } +} + +// WriteFloat64 write float64 to stream +func (stream *Stream) WriteFloat64(val float64) { + abs := math.Abs(val) + fmt := byte('f') + // Note: Must use float32 comparisons for underlying float32 value to get precise cutoffs right. + if abs != 0 { + if abs < 1e-6 || abs >= 1e21 { + fmt = 'e' + } + } + stream.buf = strconv.AppendFloat(stream.buf, float64(val), fmt, -1, 64) +} + +// WriteFloat64Lossy write float64 to stream with ONLY 6 digits precision although much much faster +func (stream *Stream) WriteFloat64Lossy(val float64) { + if val < 0 { + stream.writeByte('-') + val = -val + } + if val > 0x4ffffff { + stream.WriteFloat64(val) + return + } + precision := 6 + exp := uint64(1000000) // 6 + lval := uint64(val*float64(exp) + 0.5) + stream.WriteUint64(lval / exp) + fval := lval % exp + if fval == 0 { + return + } + stream.writeByte('.') + for p := precision - 1; p > 0 && fval < pow10[p]; p-- { + stream.writeByte('0') + } + stream.WriteUint64(fval) + for stream.buf[len(stream.buf)-1] == '0' { + stream.buf = stream.buf[:len(stream.buf)-1] + } +} diff --git a/vendor/github.com/json-iterator/go/stream_int.go b/vendor/github.com/json-iterator/go/stream_int.go new file mode 100644 index 000000000..d1059ee4c --- /dev/null +++ b/vendor/github.com/json-iterator/go/stream_int.go @@ -0,0 +1,190 @@ +package jsoniter + +var digits []uint32 + +func init() { + digits = make([]uint32, 1000) + for i := uint32(0); i < 1000; i++ { + digits[i] = (((i / 100) + '0') << 16) + ((((i / 10) % 10) + '0') << 8) + i%10 + '0' + if i < 10 { + digits[i] += 2 << 24 + } else if i < 100 { + digits[i] += 1 << 24 + } + } +} + +func writeFirstBuf(space []byte, v uint32) []byte { + start := v >> 24 + if start == 0 { + space = append(space, byte(v>>16), byte(v>>8)) + } else if start == 1 { + space = append(space, byte(v>>8)) + } + space = append(space, byte(v)) + return space +} + +func writeBuf(buf []byte, v uint32) []byte { + return append(buf, byte(v>>16), byte(v>>8), byte(v)) +} + +// WriteUint8 write uint8 to stream +func (stream *Stream) WriteUint8(val uint8) { + stream.buf = writeFirstBuf(stream.buf, digits[val]) +} + +// WriteInt8 write int8 to stream +func (stream *Stream) WriteInt8(nval int8) { + var val uint8 + if nval < 0 { + val = uint8(-nval) + stream.buf = append(stream.buf, '-') + } else { + val = uint8(nval) + } + stream.buf = writeFirstBuf(stream.buf, digits[val]) +} + +// WriteUint16 write uint16 to stream +func (stream *Stream) WriteUint16(val uint16) { + q1 := val / 1000 + if q1 == 0 { + stream.buf = writeFirstBuf(stream.buf, digits[val]) + return + } + r1 := val - q1*1000 + stream.buf = writeFirstBuf(stream.buf, digits[q1]) + stream.buf = writeBuf(stream.buf, digits[r1]) + return +} + +// WriteInt16 write int16 to stream +func (stream *Stream) WriteInt16(nval int16) { + var val uint16 + if nval < 0 { + val = uint16(-nval) + stream.buf = append(stream.buf, '-') + } else { + val = uint16(nval) + } + stream.WriteUint16(val) +} + +// WriteUint32 write uint32 to stream +func (stream *Stream) WriteUint32(val uint32) { + q1 := val / 1000 + if q1 == 0 { + stream.buf = writeFirstBuf(stream.buf, digits[val]) + return + } + r1 := val - q1*1000 + q2 := q1 / 1000 + if q2 == 0 { + stream.buf = writeFirstBuf(stream.buf, digits[q1]) + stream.buf = writeBuf(stream.buf, digits[r1]) + return + } + r2 := q1 - q2*1000 + q3 := q2 / 1000 + if q3 == 0 { + stream.buf = writeFirstBuf(stream.buf, digits[q2]) + } else { + r3 := q2 - q3*1000 + stream.buf = append(stream.buf, byte(q3+'0')) + stream.buf = writeBuf(stream.buf, digits[r3]) + } + stream.buf = writeBuf(stream.buf, digits[r2]) + stream.buf = writeBuf(stream.buf, digits[r1]) +} + +// WriteInt32 write int32 to stream +func (stream *Stream) WriteInt32(nval int32) { + var val uint32 + if nval < 0 { + val = uint32(-nval) + stream.buf = append(stream.buf, '-') + } else { + val = uint32(nval) + } + stream.WriteUint32(val) +} + +// WriteUint64 write uint64 to stream +func (stream *Stream) WriteUint64(val uint64) { + q1 := val / 1000 + if q1 == 0 { + stream.buf = writeFirstBuf(stream.buf, digits[val]) + return + } + r1 := val - q1*1000 + q2 := q1 / 1000 + if q2 == 0 { + stream.buf = writeFirstBuf(stream.buf, digits[q1]) + stream.buf = writeBuf(stream.buf, digits[r1]) + return + } + r2 := q1 - q2*1000 + q3 := q2 / 1000 + if q3 == 0 { + stream.buf = writeFirstBuf(stream.buf, digits[q2]) + stream.buf = writeBuf(stream.buf, digits[r2]) + stream.buf = writeBuf(stream.buf, digits[r1]) + return + } + r3 := q2 - q3*1000 + q4 := q3 / 1000 + if q4 == 0 { + stream.buf = writeFirstBuf(stream.buf, digits[q3]) + stream.buf = writeBuf(stream.buf, digits[r3]) + stream.buf = writeBuf(stream.buf, digits[r2]) + stream.buf = writeBuf(stream.buf, digits[r1]) + return + } + r4 := q3 - q4*1000 + q5 := q4 / 1000 + if q5 == 0 { + stream.buf = writeFirstBuf(stream.buf, digits[q4]) + stream.buf = writeBuf(stream.buf, digits[r4]) + stream.buf = writeBuf(stream.buf, digits[r3]) + stream.buf = writeBuf(stream.buf, digits[r2]) + stream.buf = writeBuf(stream.buf, digits[r1]) + return + } + r5 := q4 - q5*1000 + q6 := q5 / 1000 + if q6 == 0 { + stream.buf = writeFirstBuf(stream.buf, digits[q5]) + } else { + stream.buf = writeFirstBuf(stream.buf, digits[q6]) + r6 := q5 - q6*1000 + stream.buf = writeBuf(stream.buf, digits[r6]) + } + stream.buf = writeBuf(stream.buf, digits[r5]) + stream.buf = writeBuf(stream.buf, digits[r4]) + stream.buf = writeBuf(stream.buf, digits[r3]) + stream.buf = writeBuf(stream.buf, digits[r2]) + stream.buf = writeBuf(stream.buf, digits[r1]) +} + +// WriteInt64 write int64 to stream +func (stream *Stream) WriteInt64(nval int64) { + var val uint64 + if nval < 0 { + val = uint64(-nval) + stream.buf = append(stream.buf, '-') + } else { + val = uint64(nval) + } + stream.WriteUint64(val) +} + +// WriteInt write int to stream +func (stream *Stream) WriteInt(val int) { + stream.WriteInt64(int64(val)) +} + +// WriteUint write uint to stream +func (stream *Stream) WriteUint(val uint) { + stream.WriteUint64(uint64(val)) +} diff --git a/vendor/github.com/json-iterator/go/stream_str.go b/vendor/github.com/json-iterator/go/stream_str.go new file mode 100644 index 000000000..54c2ba0b3 --- /dev/null +++ b/vendor/github.com/json-iterator/go/stream_str.go @@ -0,0 +1,372 @@ +package jsoniter + +import ( + "unicode/utf8" +) + +// htmlSafeSet holds the value true if the ASCII character with the given +// array position can be safely represented inside a JSON string, embedded +// inside of HTML