github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/apigw/v2/throttles/urls.go (about)

     1  package throttles
     2  
     3  import (
     4  	"fmt"
     5  
     6  	"github.com/huaweicloud/golangsdk"
     7  )
     8  
     9  func buildRootPath(instanceId string) string {
    10  	return fmt.Sprintf("instances/%s/throttles", instanceId)
    11  }
    12  
    13  func rootURL(c *golangsdk.ServiceClient, instanceId string) string {
    14  	return c.ServiceURL(buildRootPath(instanceId))
    15  }
    16  
    17  func resourceURL(c *golangsdk.ServiceClient, instanceId, policyId string) string {
    18  	return c.ServiceURL(buildRootPath(instanceId), policyId)
    19  }
    20  
    21  func specRootURL(c *golangsdk.ServiceClient, instanceId, policyId string) string {
    22  	return c.ServiceURL(buildRootPath(instanceId), policyId, "throttle-specials")
    23  }
    24  
    25  func specResourceURL(c *golangsdk.ServiceClient, instanceId, policyId, strategyId string) string {
    26  	return c.ServiceURL(buildRootPath(instanceId), policyId, "throttle-specials", strategyId)
    27  }