Jamie Hannaford | 2a13024 | 2014-10-28 11:19:46 +0100 | [diff] [blame] | 1 | package users |
Jamie Hannaford | b319d47 | 2014-10-29 10:57:22 +0100 | [diff] [blame] | 2 | |
Jon Perritt | 27249f4 | 2016-02-18 10:35:59 -0600 | [diff] [blame] | 3 | import "github.com/gophercloud/gophercloud" |
Jamie Hannaford | b319d47 | 2014-10-29 10:57:22 +0100 | [diff] [blame] | 4 | |
Jamie Hannaford | e680e42 | 2014-10-29 14:55:57 +0100 | [diff] [blame] | 5 | const ( |
| 6 | tenantPath = "tenants" |
| 7 | userPath = "users" |
Jamie Hannaford | 4cdfa92 | 2014-10-30 11:41:48 +0100 | [diff] [blame] | 8 | rolePath = "roles" |
Jamie Hannaford | e680e42 | 2014-10-29 14:55:57 +0100 | [diff] [blame] | 9 | ) |
Jamie Hannaford | b319d47 | 2014-10-29 10:57:22 +0100 | [diff] [blame] | 10 | |
Jamie Hannaford | 6e4d795 | 2014-10-29 16:18:29 +0100 | [diff] [blame] | 11 | func ResourceURL(c *gophercloud.ServiceClient, id string) string { |
Jamie Hannaford | e680e42 | 2014-10-29 14:55:57 +0100 | [diff] [blame] | 12 | return c.ServiceURL(userPath, id) |
Jamie Hannaford | b319d47 | 2014-10-29 10:57:22 +0100 | [diff] [blame] | 13 | } |
| 14 | |
| 15 | func rootURL(c *gophercloud.ServiceClient) string { |
Jamie Hannaford | e680e42 | 2014-10-29 14:55:57 +0100 | [diff] [blame] | 16 | return c.ServiceURL(userPath) |
| 17 | } |
| 18 | |
| 19 | func listRolesURL(c *gophercloud.ServiceClient, tenantID, userID string) string { |
Jamie Hannaford | 4cdfa92 | 2014-10-30 11:41:48 +0100 | [diff] [blame] | 20 | return c.ServiceURL(tenantPath, tenantID, userPath, userID, rolePath) |
Jamie Hannaford | b319d47 | 2014-10-29 10:57:22 +0100 | [diff] [blame] | 21 | } |