Jamie Hannaford | 0ca076c | 2014-10-30 13:12:35 +0100 | [diff] [blame] | 1 | package roles |
| 2 | |
| 3 | import "github.com/rackspace/gophercloud" |
| 4 | |
Jamie Hannaford | 46e07ae | 2014-10-30 13:53:43 +0100 | [diff] [blame^] | 5 | const ( |
| 6 | ExtPath = "OS-KSADMN/roles" |
| 7 | UserPath = "users" |
| 8 | ) |
Jamie Hannaford | 0ca076c | 2014-10-30 13:12:35 +0100 | [diff] [blame] | 9 | |
| 10 | func resourceURL(c *gophercloud.ServiceClient, id string) string { |
Jamie Hannaford | 46e07ae | 2014-10-30 13:53:43 +0100 | [diff] [blame^] | 11 | return c.ServiceURL(ExtPath, id) |
Jamie Hannaford | 0ca076c | 2014-10-30 13:12:35 +0100 | [diff] [blame] | 12 | } |
| 13 | |
| 14 | func rootURL(c *gophercloud.ServiceClient) string { |
Jamie Hannaford | 46e07ae | 2014-10-30 13:53:43 +0100 | [diff] [blame^] | 15 | return c.ServiceURL(ExtPath) |
Jamie Hannaford | 1d58e7a | 2014-10-30 13:23:33 +0100 | [diff] [blame] | 16 | } |
| 17 | |
| 18 | func userRoleURL(c *gophercloud.ServiceClient, tenantID, userID, roleID string) string { |
Jamie Hannaford | 46e07ae | 2014-10-30 13:53:43 +0100 | [diff] [blame^] | 19 | return c.ServiceURL("tenants", tenantID, UserPath, userID, ExtPath, roleID) |
Jamie Hannaford | 0ca076c | 2014-10-30 13:12:35 +0100 | [diff] [blame] | 20 | } |