github.com/gophercloud/gophercloud@v1.11.0/openstack/loadbalancer/v2/loadbalancers/urls.go (about)

     1  package loadbalancers
     2  
     3  import "github.com/gophercloud/gophercloud"
     4  
     5  const (
     6  	rootPath       = "lbaas"
     7  	resourcePath   = "loadbalancers"
     8  	statusPath     = "status"
     9  	statisticsPath = "stats"
    10  	failoverPath   = "failover"
    11  )
    12  
    13  func rootURL(c *gophercloud.ServiceClient) string {
    14  	return c.ServiceURL(rootPath, resourcePath)
    15  }
    16  
    17  func resourceURL(c *gophercloud.ServiceClient, id string) string {
    18  	return c.ServiceURL(rootPath, resourcePath, id)
    19  }
    20  
    21  func statusRootURL(c *gophercloud.ServiceClient, id string) string {
    22  	return c.ServiceURL(rootPath, resourcePath, id, statusPath)
    23  }
    24  
    25  func statisticsRootURL(c *gophercloud.ServiceClient, id string) string {
    26  	return c.ServiceURL(rootPath, resourcePath, id, statisticsPath)
    27  }
    28  
    29  func failoverRootURL(c *gophercloud.ServiceClient, id string) string {
    30  	return c.ServiceURL(rootPath, resourcePath, id, failoverPath)
    31  }