From a7f45ee455fe7ef97403332f52438a489669dbf3 Mon Sep 17 00:00:00 2001 From: Zhenguo Niu Date: Wed, 13 Nov 2019 10:40:41 +0800 Subject: [PATCH] Fix PrePaid ECS instance issue (#226) --- go.mod | 2 +- go.sum | 3 +- huaweicloud/config.go | 6 + .../resource_huaweicloud_ecs_instance_v1.go | 131 +++++++++++++----- .../openstack/cce/v3/clusters/requests.go | 31 +++++ .../openstack/cce/v3/clusters/results.go | 8 ++ .../openstack/cce/v3/clusters/urls.go | 9 +- .../huaweicloud/golangsdk/openstack/client.go | 16 +++ .../openstack/ecs/v1/cloudservers/requests.go | 34 +++++ .../ecs/v1/cloudservers/results_order.go | 113 +++++++++++++++ .../openstack/ecs/v1/cloudservers/urls.go | 8 ++ .../huaweicloud/golangsdk/provider_client.go | 3 + vendor/modules.txt | 3 +- 13 files changed, 327 insertions(+), 40 deletions(-) create mode 100644 vendor/github.com/huaweicloud/golangsdk/openstack/ecs/v1/cloudservers/results_order.go diff --git a/go.mod b/go.mod index 1aded92d76..f637310e43 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ require ( github.com/hashicorp/errwrap v1.0.0 github.com/hashicorp/go-cleanhttp v0.5.1 github.com/hashicorp/terraform-plugin-sdk v1.0.0 - github.com/huaweicloud/golangsdk v0.0.0-20191105032058-c1a523be9414 + github.com/huaweicloud/golangsdk v0.0.0-20191107120439-abaa653f0fb5 github.com/jen20/awspolicyequivalence v0.0.0-20170831201602-3d48364a137a github.com/mitchellh/go-homedir v1.1.0 github.com/smartystreets/goconvey v0.0.0-20190222223459-a17d461953aa // indirect diff --git a/go.sum b/go.sum index 02cd720535..267dce36ac 100644 --- a/go.sum +++ b/go.sum @@ -121,7 +121,8 @@ github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKe github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1vq2e6IsrXKrZit1bv/TDYFGMp4BQ= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/huaweicloud/golangsdk v0.0.0-20191105032058-c1a523be9414/go.mod h1:WQBcHRNX9shz3928lWEvstQJtAtYI7ks6XlgtRT9Tcw= +github.com/huaweicloud/golangsdk v0.0.0-20191107120439-abaa653f0fb5 h1:yr8Dlj8uPOLQ1ZYZSwHr9IVVOpVixeRvInJIU/7xQ4g= +github.com/huaweicloud/golangsdk v0.0.0-20191107120439-abaa653f0fb5/go.mod h1:WQBcHRNX9shz3928lWEvstQJtAtYI7ks6XlgtRT9Tcw= github.com/jen20/awspolicyequivalence v0.0.0-20170831201602-3d48364a137a h1:FyS/ubzBR5xJlnJGRTwe7GUHpJOR4ukYK3y+LFNffuA= github.com/jen20/awspolicyequivalence v0.0.0-20170831201602-3d48364a137a/go.mod h1:uoIMjNxUfXi48Ci40IXkPRbghZ1vbti6v9LCbNqRgHY= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= diff --git a/huaweicloud/config.go b/huaweicloud/config.go index 7124c3f15f..81522a1de2 100644 --- a/huaweicloud/config.go +++ b/huaweicloud/config.go @@ -667,6 +667,12 @@ func (c *Config) CdnV1Client(region string) (*golangsdk.ServiceClient, error) { }) } +func (c *Config) BssV1Client(region string) (*golangsdk.ServiceClient, error) { + return huaweisdk.NewBSSV1(c.HwClient, golangsdk.EndpointOpts{ + Availability: c.getHwEndpointType(), + }) +} + func (c *Config) sdkClient(region, serviceType string, level string) (*golangsdk.ServiceClient, error) { client := c.HwClient if level == serviceDomainLevel { diff --git a/huaweicloud/resource_huaweicloud_ecs_instance_v1.go b/huaweicloud/resource_huaweicloud_ecs_instance_v1.go index f063159683..21e5a731cc 100644 --- a/huaweicloud/resource_huaweicloud_ecs_instance_v1.go +++ b/huaweicloud/resource_huaweicloud_ecs_instance_v1.go @@ -244,38 +244,61 @@ func resourceEcsInstanceV1Create(d *schema.ResourceData, meta interface{}) error log.Printf("[DEBUG] Create Options: %#v", createOpts) - n, err := cloudservers.Create(computeClient, createOpts).ExtractJobResponse() - if err != nil { - return fmt.Errorf("Error creating HuaweiCloud server: %s", err) - } + var instance_id string + if d.Get("charging_mode") == "prePaid" { + bssV1Client, err := config.BssV1Client(GetRegion(d, config)) + if err != nil { + return fmt.Errorf("Error creating HuaweiCloud bss V1 client: %s", err) + } + n, err := cloudservers.CreatePrePaid(computeClient, createOpts).ExtractOrderResponse() + if err != nil { + return fmt.Errorf("Error creating HuaweiCloud server: %s", err) + } - if err := cloudservers.WaitForJobSuccess(computeV1Client, int(d.Timeout(schema.TimeoutCreate)/time.Second), n.JobID); err != nil { - return err - } + if err := cloudservers.WaitForOrderSuccess(bssV1Client, int(d.Timeout(schema.TimeoutCreate)/time.Second), n.OrderID); err != nil { + return err + } - entity, err := cloudservers.GetJobEntity(computeV1Client, n.JobID, "server_id") - if err != nil { - return err + resource, err := cloudservers.GetOrderResource(bssV1Client, n.OrderID) + if err != nil { + return err + } + instance_id = resource.(string) + } else { + n, err := cloudservers.Create(computeClient, createOpts).ExtractJobResponse() + if err != nil { + return fmt.Errorf("Error creating HuaweiCloud server: %s", err) + } + + if err := cloudservers.WaitForJobSuccess(computeV1Client, int(d.Timeout(schema.TimeoutCreate)/time.Second), n.JobID); err != nil { + return err + } + + entity, err := cloudservers.GetJobEntity(computeV1Client, n.JobID, "server_id") + if err != nil { + return err + } + instance_id = entity.(string) } - if id, ok := entity.(string); ok { - d.SetId(id) + if instance_id != "" { + d.SetId(instance_id) if hasFilledOpt(d, "tags") { tagmap := d.Get("tags").(map[string]interface{}) log.Printf("[DEBUG] Setting tags: %v", tagmap) - err = setTagForInstance(d, meta, id, tagmap) + err = setTagForInstance(d, meta, instance_id, tagmap) if err != nil { - log.Printf("[WARN] Error setting tags of instance:%s, err=%s", id, err) + log.Printf("[WARN] Error setting tags of instance:%s, err=%s", instance_id, err) } } if hasFilledOpt(d, "auto_recovery") { ar := d.Get("auto_recovery").(bool) log.Printf("[DEBUG] Set auto recovery of instance to %t", ar) - err = setAutoRecoveryForInstance(d, meta, id, ar) + err = setAutoRecoveryForInstance(d, meta, instance_id, ar) if err != nil { - log.Printf("[WARN] Error setting auto recovery of instance:%s, err=%s", id, err) + log.Printf("[WARN] Error setting auto recovery of instance:%s, err=%s", instance_id, err) } } @@ -306,12 +329,6 @@ func resourceEcsInstanceV1Read(d *schema.ResourceData, meta interface{}) error { d.Set("vpc_id", server.Metadata.VpcID) d.Set("availability_zone", server.AvailabilityZone) - secGrpNames := []string{} - for _, sg := range server.SecurityGroups { - secGrpNames = append(secGrpNames, sg.Name) - } - d.Set("security_groups", secGrpNames) - // Get the instance network and address information nics := flattenInstanceNicsV1(d, meta, server.Addresses) d.Set("nics", nics) @@ -489,25 +506,69 @@ func resourceEcsInstanceV1Delete(d *schema.ResourceData, meta interface{}) error if err != nil { return fmt.Errorf("Error creating HuaweiCloud compute client: %s", err) } - - var serverRequests []cloudservers.Server - server := cloudservers.Server{ - Id: d.Id(), + computeV2Client, err := config.computeV2Client(GetRegion(d, config)) + if err != nil { + return fmt.Errorf("Error creating HuaweiCloud compute V2 client: %s", err) } - serverRequests = append(serverRequests, server) - deleteOpts := cloudservers.DeleteOpts{ - Servers: serverRequests, - DeleteVolume: d.Get("delete_disks_on_termination").(bool), + if d.Get("charging_mode") == "prePaid" { + bssV1Client, err := config.BssV1Client(GetRegion(d, config)) + if err != nil { + return fmt.Errorf("Error creating HuaweiCloud bss V1 client: %s", err) + } + + resourceIds := []string{d.Id()} + deleteOrderOpts := cloudservers.DeleteOrderOpts{ + ResourceIds: resourceIds, + UnSubType: 1, + } + n, err := cloudservers.DeleteOrder(bssV1Client, deleteOrderOpts).ExtractDeleteOrderResponse() + if err != nil { + return fmt.Errorf("Error deleting HuaweiCloud server: %s", err) + } + + if err := cloudservers.WaitForOrderDeleteSuccess(bssV1Client, int(d.Timeout(schema.TimeoutCreate)/time.Second), n.OrderIDs[0]); err != nil { + return err + } + } else { + var serverRequests []cloudservers.Server + server := cloudservers.Server{ + Id: d.Id(), + } + serverRequests = append(serverRequests, server) + + deleteOpts := cloudservers.DeleteOpts{ + Servers: serverRequests, + DeleteVolume: d.Get("delete_disks_on_termination").(bool), + } + + n, err := cloudservers.Delete(computeV1Client, deleteOpts).ExtractJobResponse() + if err != nil { + return fmt.Errorf("Error deleting HuaweiCloud server: %s", err) + } + + if err := cloudservers.WaitForJobSuccess(computeV1Client, int(d.Timeout(schema.TimeoutCreate)/time.Second), n.JobID); err != nil { + return err + } } - n, err := cloudservers.Delete(computeV1Client, deleteOpts).ExtractJobResponse() - if err != nil { - return fmt.Errorf("Error deleting HuaweiCloud server: %s", err) + // Wait for the instance to delete before moving on. + log.Printf("[DEBUG] Waiting for instance (%s) to delete", d.Id()) + + stateConf := &resource.StateChangeConf{ + Pending: []string{"ACTIVE", "SHUTOFF"}, + Target: []string{"DELETED", "SOFT_DELETED"}, + Refresh: ServerV2StateRefreshFunc(computeV2Client, d.Id()), + Timeout: d.Timeout(schema.TimeoutDelete), + Delay: 10 * time.Second, + MinTimeout: 3 * time.Second, } - if err := cloudservers.WaitForJobSuccess(computeV1Client, int(d.Timeout(schema.TimeoutCreate)/time.Second), n.JobID); err != nil { - return err + _, err = stateConf.WaitForState() + if err != nil { + return fmt.Errorf( + "Error waiting for instance (%s) to delete: %s", + d.Id(), err) } d.SetId("") diff --git a/vendor/github.com/huaweicloud/golangsdk/openstack/cce/v3/clusters/requests.go b/vendor/github.com/huaweicloud/golangsdk/openstack/cce/v3/clusters/requests.go index b2881b518e..d6c5095785 100644 --- a/vendor/github.com/huaweicloud/golangsdk/openstack/cce/v3/clusters/requests.go +++ b/vendor/github.com/huaweicloud/golangsdk/openstack/cce/v3/clusters/requests.go @@ -199,3 +199,34 @@ func Delete(c *golangsdk.ServiceClient, id string) (r DeleteResult) { }) return } + +type UpdateIpOpts struct { + Action string `json:"action" required:"true"` + Spec IpSpec `json:"spec,omitempty"` + ElasticIp string `json:"elasticIp"` +} + +type IpSpec struct { + ID string `json:"id" required:"true"` +} + +type UpdateIpOptsBuilder interface { + ToMasterIpUpdateMap() (map[string]interface{}, error) +} + +func (opts UpdateIpOpts) ToMasterIpUpdateMap() (map[string]interface{}, error) { + return golangsdk.BuildRequestBody(opts, "spec") +} + +// Update the access information of a specified cluster. +func UpdateMasterIp(c *golangsdk.ServiceClient, id string, opts UpdateIpOptsBuilder) (r UpdateIpResult) { + b, err := opts.ToMasterIpUpdateMap() + if err != nil { + r.Err = err + return + } + _, r.Err = c.Put(masterIpURL(c, id), b, &r.Body, &golangsdk.RequestOpts{ + OkCodes: []int{200}, + }) + return +} diff --git a/vendor/github.com/huaweicloud/golangsdk/openstack/cce/v3/clusters/results.go b/vendor/github.com/huaweicloud/golangsdk/openstack/cce/v3/clusters/results.go index f4215da262..71d9ccb724 100644 --- a/vendor/github.com/huaweicloud/golangsdk/openstack/cce/v3/clusters/results.go +++ b/vendor/github.com/huaweicloud/golangsdk/openstack/cce/v3/clusters/results.go @@ -50,6 +50,8 @@ type Spec struct { Version string `json:"version,omitempty"` //Cluster description Description string `json:"description,omitempty"` + //Public IP ID + PublicIP string `json:"publicip_id,omitempty"` // Node network parameters HostNetwork HostNetworkSpec `json:"hostNetwork" required:"true"` //Container network parameters @@ -285,3 +287,9 @@ func (r GetCertResult) Extract() (*Certificate, error) { err := r.ExtractInto(&s) return &s, err } + +// UpdateIpResult represents the result of an update operation. Call its Extract +// method to interpret it as a Cluster. +type UpdateIpResult struct { + golangsdk.ErrResult +} diff --git a/vendor/github.com/huaweicloud/golangsdk/openstack/cce/v3/clusters/urls.go b/vendor/github.com/huaweicloud/golangsdk/openstack/cce/v3/clusters/urls.go index af2c00c437..1248ce0fd0 100644 --- a/vendor/github.com/huaweicloud/golangsdk/openstack/cce/v3/clusters/urls.go +++ b/vendor/github.com/huaweicloud/golangsdk/openstack/cce/v3/clusters/urls.go @@ -3,8 +3,9 @@ package clusters import "github.com/huaweicloud/golangsdk" const ( - rootPath = "clusters" - certPath = "clustercert" + rootPath = "clusters" + certPath = "clustercert" + masterIpPath = "mastereip" ) func rootURL(client *golangsdk.ServiceClient) string { @@ -18,3 +19,7 @@ func resourceURL(c *golangsdk.ServiceClient, id string) string { func certificateURL(c *golangsdk.ServiceClient, id string) string { return c.ServiceURL(rootPath, id, certPath) } + +func masterIpURL(c *golangsdk.ServiceClient, id string) string { + return c.ServiceURL(rootPath, id, masterIpPath) +} diff --git a/vendor/github.com/huaweicloud/golangsdk/openstack/client.go b/vendor/github.com/huaweicloud/golangsdk/openstack/client.go index 00cfb23468..cf2ac55537 100644 --- a/vendor/github.com/huaweicloud/golangsdk/openstack/client.go +++ b/vendor/github.com/huaweicloud/golangsdk/openstack/client.go @@ -233,6 +233,7 @@ func v3auth(client *golangsdk.ProviderClient, endpoint string, opts tokens3.Auth client.TokenID = token.ID if project != nil { client.ProjectID = project.ID + client.DomainID = project.Domain.ID } if opts.CanReauth() { @@ -339,6 +340,7 @@ func v3AKSKAuth(client *golangsdk.ProviderClient, endpoint string, options golan } client.ProjectID = options.ProjectId + client.DomainID = options.DomainID v3Client.ProjectID = options.ProjectId var entries = make([]tokens3.CatalogEntry, 0, 1) @@ -620,6 +622,14 @@ func NewDNSV2(client *golangsdk.ProviderClient, eo golangsdk.EndpointOpts) (*gol return sc, err } +// NewImageServiceV1 creates a ServiceClient that may be used to access the v1 +// image service. +func NewImageServiceV1(client *golangsdk.ProviderClient, eo golangsdk.EndpointOpts) (*golangsdk.ServiceClient, error) { + sc, err := initClientOpts(client, eo, "image") + sc.ResourceBase = sc.Endpoint + "v1/" + return sc, err +} + // NewImageServiceV2 creates a ServiceClient that may be used to access the v2 // image service. func NewImageServiceV2(client *golangsdk.ProviderClient, eo golangsdk.EndpointOpts) (*golangsdk.ServiceClient, error) { @@ -990,6 +1000,12 @@ func NewSDRSV1(client *golangsdk.ProviderClient, eo golangsdk.EndpointOpts) (*go return sc, err } +// NewBSSV1 creates a ServiceClient that may be used to access the BSS service. +func NewBSSV1(client *golangsdk.ProviderClient, eo golangsdk.EndpointOpts) (*golangsdk.ServiceClient, error) { + sc, err := initClientOpts(client, eo, "bssv1") + return sc, err +} + func NewSDKClient(c *golangsdk.ProviderClient, eo golangsdk.EndpointOpts, serviceType string) (*golangsdk.ServiceClient, error) { switch serviceType { case "mls": diff --git a/vendor/github.com/huaweicloud/golangsdk/openstack/ecs/v1/cloudservers/requests.go b/vendor/github.com/huaweicloud/golangsdk/openstack/ecs/v1/cloudservers/requests.go index bc17c98620..eac1f3f262 100644 --- a/vendor/github.com/huaweicloud/golangsdk/openstack/ecs/v1/cloudservers/requests.go +++ b/vendor/github.com/huaweicloud/golangsdk/openstack/ecs/v1/cloudservers/requests.go @@ -182,6 +182,18 @@ func Create(client *golangsdk.ServiceClient, opts CreateOptsBuilder) (r JobResul return } +// CreatePrePaid requests a server to be provisioned to the user in the current tenant. +func CreatePrePaid(client *golangsdk.ServiceClient, opts CreateOptsBuilder) (r OrderResult) { + reqBody, err := opts.ToServerCreateMap() + if err != nil { + r.Err = err + return + } + + _, r.Err = client.Post(createURL(client), reqBody, &r.Body, &golangsdk.RequestOpts{OkCodes: []int{200}}) + return +} + // Get retrieves a particular Server based on its unique ID. func Get(c *golangsdk.ServiceClient, id string) (r GetResult) { _, r.Err = c.Get(getURL(c, id), &r.Body, &golangsdk.RequestOpts{ @@ -216,3 +228,25 @@ func Delete(client *golangsdk.ServiceClient, opts DeleteOpts) (r JobResult) { _, r.Err = client.Post(deleteURL(client), reqBody, &r.Body, &golangsdk.RequestOpts{OkCodes: []int{200}}) return } + +type DeleteOrderOpts struct { + ResourceIds []string `json:"resourceIds" required:"true"` + UnSubType int `json:"unSubType" required:"true"` +} + +// ToServerDeleteOrderMap assembles a request body based on the contents of a +// DeleteOrderOpts. +func (opts DeleteOrderOpts) ToServerDeleteOrderMap() (map[string]interface{}, error) { + return golangsdk.BuildRequestBody(opts, "") +} + +// DeleteOrder requests a server to be deleted to the user in the current tenant. +func DeleteOrder(client *golangsdk.ServiceClient, opts DeleteOrderOpts) (r DeleteOrderResult) { + reqBody, err := opts.ToServerDeleteOrderMap() + if err != nil { + r.Err = err + return + } + _, r.Err = client.Post(deleteOrderURL(client), reqBody, &r.Body, &golangsdk.RequestOpts{OkCodes: []int{200}}) + return +} diff --git a/vendor/github.com/huaweicloud/golangsdk/openstack/ecs/v1/cloudservers/results_order.go b/vendor/github.com/huaweicloud/golangsdk/openstack/ecs/v1/cloudservers/results_order.go new file mode 100644 index 0000000000..76419e50da --- /dev/null +++ b/vendor/github.com/huaweicloud/golangsdk/openstack/ecs/v1/cloudservers/results_order.go @@ -0,0 +1,113 @@ +package cloudservers + +import ( + "fmt" + "time" + + "github.com/huaweicloud/golangsdk" +) + +type OrderResponse struct { + OrderID string `json:"order_id"` +} + +type OrderStatus struct { + ErrorCode string `json:"error_code"` + ErrorMsg string `json:"error_msg"` + Resources []Resource `json:"resources"` +} + +type Resource struct { + Status int `json:"status"` + ResourceId string `json:"resourceId"` +} + +type DeleteOrderResponse struct { + OrderIDs []string `json:"orderIds"` +} + +type OrderResult struct { + golangsdk.Result +} + +type DeleteOrderResult struct { + golangsdk.Result +} + +func (r OrderResult) ExtractOrderResponse() (*OrderResponse, error) { + order := new(OrderResponse) + err := r.ExtractInto(order) + return order, err +} + +func (r DeleteOrderResult) ExtractDeleteOrderResponse() (*DeleteOrderResponse, error) { + order := new(DeleteOrderResponse) + err := r.ExtractInto(order) + return order, err +} + +func (r OrderResult) ExtractOrderStatus() (*OrderStatus, error) { + order := new(OrderStatus) + err := r.ExtractInto(order) + return order, err +} + +func WaitForOrderSuccess(client *golangsdk.ServiceClient, secs int, orderID string) error { + return golangsdk.WaitFor(secs, func() (bool, error) { + order := new(OrderStatus) + _, err := client.Get(orderURL(client, orderID), &order, nil) + if err != nil { + return false, err + } + time.Sleep(5 * time.Second) + instance := order.Resources[0] + + if instance.Status == 1 { + return true, nil + } + if instance.Status == 2 { + err = fmt.Errorf("Order failed: %s.", orderID) + return false, err + } + + return false, nil + }) +} + +func WaitForOrderDeleteSuccess(client *golangsdk.ServiceClient, secs int, orderID string) error { + return golangsdk.WaitFor(secs, func() (bool, error) { + order := new(OrderStatus) + _, err := client.Get(orderURL(client, orderID), &order, nil) + if err != nil { + return false, err + } + time.Sleep(5 * time.Second) + instance := order.Resources[0] + + if instance.Status == 8 { + return true, nil + } + if instance.Status == 2 { + err = fmt.Errorf("Order failed: %s.", orderID) + return false, err + } + + return false, nil + }) +} + +func GetOrderResource(client *golangsdk.ServiceClient, orderID string) (interface{}, error) { + order := new(OrderStatus) + _, err := client.Get(orderURL(client, orderID), &order, nil) + if err != nil { + return false, err + } + instance := order.Resources[0] + if instance.Status == 1 { + if e := instance.ResourceId; e != "" { + return e, nil + } + } + + return nil, fmt.Errorf("Get Order resource ID error.") +} diff --git a/vendor/github.com/huaweicloud/golangsdk/openstack/ecs/v1/cloudservers/urls.go b/vendor/github.com/huaweicloud/golangsdk/openstack/ecs/v1/cloudservers/urls.go index e9074c687e..dfa5f5e20d 100644 --- a/vendor/github.com/huaweicloud/golangsdk/openstack/ecs/v1/cloudservers/urls.go +++ b/vendor/github.com/huaweicloud/golangsdk/openstack/ecs/v1/cloudservers/urls.go @@ -17,3 +17,11 @@ func getURL(sc *golangsdk.ServiceClient, serverID string) string { func jobURL(sc *golangsdk.ServiceClient, jobId string) string { return sc.ServiceURL("jobs", jobId) } + +func orderURL(sc *golangsdk.ServiceClient, orderId string) string { + return sc.ServiceURL(sc.DomainID, "common/order-mgr/orders-resource", orderId) +} + +func deleteOrderURL(sc *golangsdk.ServiceClient) string { + return sc.ServiceURL(sc.DomainID, "common/order-mgr/resources/delete") +} diff --git a/vendor/github.com/huaweicloud/golangsdk/provider_client.go b/vendor/github.com/huaweicloud/golangsdk/provider_client.go index 322f486198..6c60f118fe 100644 --- a/vendor/github.com/huaweicloud/golangsdk/provider_client.go +++ b/vendor/github.com/huaweicloud/golangsdk/provider_client.go @@ -59,6 +59,9 @@ type ProviderClient struct { // ProjectID is the ID of project to which User is authorized. ProjectID string + // DomainID is the ID of project to which User is authorized. + DomainID string + // EndpointLocator describes how this provider discovers the endpoints for // its constituent services. EndpointLocator EndpointLocator diff --git a/vendor/modules.txt b/vendor/modules.txt index 6acc3b6383..6e7a6fafb5 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -177,7 +177,7 @@ github.com/hashicorp/terraform-plugin-sdk/internal/svchost github.com/hashicorp/terraform-plugin-sdk/internal/svchost/auth # github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d github.com/hashicorp/yamux -# github.com/huaweicloud/golangsdk v0.0.0-20191015074635-101cf928fd59 +# github.com/huaweicloud/golangsdk v0.0.0-20191107120439-abaa653f0fb5 github.com/huaweicloud/golangsdk github.com/huaweicloud/golangsdk/openstack github.com/huaweicloud/golangsdk/openstack/antiddos/v1/antiddos @@ -189,6 +189,7 @@ github.com/huaweicloud/golangsdk/openstack/blockstorage/extensions/volumeactions github.com/huaweicloud/golangsdk/openstack/blockstorage/v2/volumes github.com/huaweicloud/golangsdk/openstack/cce/v3/clusters github.com/huaweicloud/golangsdk/openstack/cce/v3/nodes +github.com/huaweicloud/golangsdk/openstack/cdn/v1/domains github.com/huaweicloud/golangsdk/openstack/cloudeyeservice/alarmrule github.com/huaweicloud/golangsdk/openstack/compute/v2/extensions/attachinterfaces github.com/huaweicloud/golangsdk/openstack/compute/v2/extensions/availabilityzones