blob: 170658df064fa134ea0fc0414aa2379a40ff95fe [file] [log] [blame]
Jamie Hannaford0ca076c2014-10-30 13:12:35 +01001package roles
2
3import "github.com/rackspace/gophercloud"
4
Jamie Hannaford46e07ae2014-10-30 13:53:43 +01005const (
6 ExtPath = "OS-KSADMN/roles"
7 UserPath = "users"
8)
Jamie Hannaford0ca076c2014-10-30 13:12:35 +01009
10func resourceURL(c *gophercloud.ServiceClient, id string) string {
Jamie Hannaford46e07ae2014-10-30 13:53:43 +010011 return c.ServiceURL(ExtPath, id)
Jamie Hannaford0ca076c2014-10-30 13:12:35 +010012}
13
14func rootURL(c *gophercloud.ServiceClient) string {
Jamie Hannaford46e07ae2014-10-30 13:53:43 +010015 return c.ServiceURL(ExtPath)
Jamie Hannaford1d58e7a2014-10-30 13:23:33 +010016}
17
18func userRoleURL(c *gophercloud.ServiceClient, tenantID, userID, roleID string) string {
Jamie Hannaford46e07ae2014-10-30 13:53:43 +010019 return c.ServiceURL("tenants", tenantID, UserPath, userID, ExtPath, roleID)
Jamie Hannaford0ca076c2014-10-30 13:12:35 +010020}