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 ( |
Jamie Hannaford | 36a7dfd | 2014-10-30 14:31:34 +0100 | [diff] [blame^] | 6 | ExtPath = "OS-KSADM" |
| 7 | RolePath = "roles" |
Jamie Hannaford | 46e07ae | 2014-10-30 13:53:43 +0100 | [diff] [blame] | 8 | UserPath = "users" |
| 9 | ) |
Jamie Hannaford | 0ca076c | 2014-10-30 13:12:35 +0100 | [diff] [blame] | 10 | |
| 11 | func resourceURL(c *gophercloud.ServiceClient, id string) string { |
Jamie Hannaford | 36a7dfd | 2014-10-30 14:31:34 +0100 | [diff] [blame^] | 12 | return c.ServiceURL(ExtPath, RolePath, id) |
Jamie Hannaford | 0ca076c | 2014-10-30 13:12:35 +0100 | [diff] [blame] | 13 | } |
| 14 | |
| 15 | func rootURL(c *gophercloud.ServiceClient) string { |
Jamie Hannaford | 36a7dfd | 2014-10-30 14:31:34 +0100 | [diff] [blame^] | 16 | return c.ServiceURL(ExtPath, RolePath) |
Jamie Hannaford | 1d58e7a | 2014-10-30 13:23:33 +0100 | [diff] [blame] | 17 | } |
| 18 | |
| 19 | func userRoleURL(c *gophercloud.ServiceClient, tenantID, userID, roleID string) string { |
Jamie Hannaford | 36a7dfd | 2014-10-30 14:31:34 +0100 | [diff] [blame^] | 20 | return c.ServiceURL("tenants", tenantID, UserPath, userID, RolePath, ExtPath, roleID) |
Jamie Hannaford | 0ca076c | 2014-10-30 13:12:35 +0100 | [diff] [blame] | 21 | } |