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

     1  package apis
     2  
     3  import (
     4  	"fmt"
     5  
     6  	"github.com/huaweicloud/golangsdk"
     7  )
     8  
     9  const rootPath = "instances"
    10  
    11  func buildRootPath(instanceId string) string {
    12  	return fmt.Sprintf("instances/%s/apis", instanceId)
    13  }
    14  
    15  func rootURL(c *golangsdk.ServiceClient, instanceId string) string {
    16  	return c.ServiceURL(buildRootPath(instanceId))
    17  }
    18  
    19  func resourceURL(c *golangsdk.ServiceClient, instanceId, apiId string) string {
    20  	return c.ServiceURL(buildRootPath(instanceId), apiId)
    21  }