Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions openstack/autoscaling/v1/configurations/urls.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ import (
const resourcePath = "scaling_configuration"

func createURL(client *golangsdk.ServiceClient) string {
return client.ServiceURL(client.ProjectID, resourcePath)
return client.ServiceURL(resourcePath)
}

func getURL(client *golangsdk.ServiceClient, id string) string {
return client.ServiceURL(client.ProjectID, resourcePath, id)
return client.ServiceURL(resourcePath, id)
}

func deleteURL(client *golangsdk.ServiceClient, id string) string {
return client.ServiceURL(client.ProjectID, resourcePath, id)
return client.ServiceURL(resourcePath, id)
}

func listURL(client *golangsdk.ServiceClient) string {
return client.ServiceURL(client.ProjectID, resourcePath)
return client.ServiceURL(resourcePath)
}
12 changes: 6 additions & 6 deletions openstack/autoscaling/v1/groups/urls.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,27 @@ import (
const resourcePath = "scaling_group"

func createURL(c *golangsdk.ServiceClient) string {
ur := c.ServiceURL(c.ProjectID, resourcePath)
ur := c.ServiceURL(resourcePath)
log.Printf("[DEBUG] Create URL is: %#v", ur)
return ur
}

func deleteURL(c *golangsdk.ServiceClient, id string) string {
return c.ServiceURL(c.ProjectID, resourcePath, id)
return c.ServiceURL(resourcePath, id)
}

func getURL(c *golangsdk.ServiceClient, id string) string {
return c.ServiceURL(c.ProjectID, resourcePath, id)
return c.ServiceURL(resourcePath, id)
}

func listURL(c *golangsdk.ServiceClient) string {
return c.ServiceURL(c.ProjectID, resourcePath)
return c.ServiceURL(resourcePath)
}

func enableURL(c *golangsdk.ServiceClient, id string) string {
return c.ServiceURL(c.ProjectID, resourcePath, id, "action")
return c.ServiceURL(resourcePath, id, "action")
}

func updateURL(c *golangsdk.ServiceClient, id string) string {
return c.ServiceURL(c.ProjectID, resourcePath, id)
return c.ServiceURL(resourcePath, id)
}
6 changes: 3 additions & 3 deletions openstack/autoscaling/v1/instances/urls.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ const resourcePath = "scaling_group_instance"
//getURL will build the querystring by which can be able to query all the instances
//of group
func listURL(client *golangsdk.ServiceClient, groupID string) string {
return client.ServiceURL(client.ProjectID, resourcePath, groupID, "list")
return client.ServiceURL(resourcePath, groupID, "list")
}

//deleteURL will build the query url by which can be able to delete an instance from
//the group
func deleteURL(client *golangsdk.ServiceClient, id string) string {
return client.ServiceURL(client.ProjectID, resourcePath, id)
return client.ServiceURL(resourcePath, id)
}

//batchURL will build the query url by which can be able to batch add or delete
//instances
func batchURL(client *golangsdk.ServiceClient, groupID string) string {
return client.ServiceURL(client.ProjectID, resourcePath, groupID, "action")
return client.ServiceURL(resourcePath, groupID, "action")
}
8 changes: 4 additions & 4 deletions openstack/autoscaling/v1/policies/urls.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ const resourcePath = "scaling_policy"
//createURL will build the rest query url of creation
//the create url is endpoint/scaling_policy
func createURL(client *golangsdk.ServiceClient) string {
return client.ServiceURL(client.ProjectID, resourcePath)
return client.ServiceURL(resourcePath)
}

//deleteURL will build the url of deletion
//its pattern is endpoint/scaling_policy/<policy-id>
func deleteURL(client *golangsdk.ServiceClient, id string) string {
return client.ServiceURL(client.ProjectID, resourcePath, id)
return client.ServiceURL(resourcePath, id)
}

//getURL will build the get url of get function
func getURL(client *golangsdk.ServiceClient, id string) string {
return client.ServiceURL(client.ProjectID, resourcePath, id)
return client.ServiceURL(resourcePath, id)
}

func updateURL(c *golangsdk.ServiceClient, id string) string {
return c.ServiceURL(c.ProjectID, resourcePath, id)
return c.ServiceURL(resourcePath, id)
}
12 changes: 10 additions & 2 deletions openstack/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -513,10 +513,12 @@ func NewRdsServiceV1(client *golangsdk.ProviderClient, eo golangsdk.EndpointOpts
}

func NewCESClient(client *golangsdk.ProviderClient, eo golangsdk.EndpointOpts) (*golangsdk.ServiceClient, error) {
sc, err := initClientOpts(client, eo, "ces")
sc, err := initClientOpts(client, eo, "volumev2")
if err != nil {
return nil, err
}
e := strings.Replace(sc.Endpoint, "v2", "V1.0", 1)
sc.Endpoint = strings.Replace(e, "evs", "ces", 1)
sc.ResourceBase = sc.Endpoint
return sc, err
}
Expand All @@ -538,7 +540,13 @@ func NewComputeV1(client *golangsdk.ProviderClient, eo golangsdk.EndpointOpts) (
//NewAutoScalingService creates a ServiceClient that may be used to access the
//auto-scaling service of huawei public cloud
func NewAutoScalingService(client *golangsdk.ProviderClient, eo golangsdk.EndpointOpts) (*golangsdk.ServiceClient, error) {
sc, err := initClientOpts(client, eo, "as")
sc, err := initClientOpts(client, eo, "volumev2")
if err != nil {
return nil, err
}
e := strings.Replace(sc.Endpoint, "v2", "autoscaling-api/v1", 1)
sc.Endpoint = strings.Replace(e, "evs", "as", 1)
sc.ResourceBase = sc.Endpoint
return sc, err
}

Expand Down
6 changes: 3 additions & 3 deletions openstack/cloudeyeservice/alarmrule/urls.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ const (
)

func rootURL(c *golangsdk.ServiceClient) string {
return c.ServiceURL(c.ProjectID, rootPath)
return c.ServiceURL(rootPath)
}

func resourceURL(c *golangsdk.ServiceClient, id string) string {
return c.ServiceURL(c.ProjectID, rootPath, id)
return c.ServiceURL(rootPath, id)
}

func actionURL(c *golangsdk.ServiceClient, id string) string {
return c.ServiceURL(c.ProjectID, rootPath, id, "action")
return c.ServiceURL(rootPath, id, "action")
}