blob: 61b31551dd970fed93deb67ed1ff063c5d3390b3 [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 (
Jamie Hannaford36a7dfd2014-10-30 14:31:34 +01006 ExtPath = "OS-KSADM"
7 RolePath = "roles"
Jamie Hannaford46e07ae2014-10-30 13:53:43 +01008 UserPath = "users"
9)
Jamie Hannaford0ca076c2014-10-30 13:12:35 +010010
11func resourceURL(c *gophercloud.ServiceClient, id string) string {
Jamie Hannaford36a7dfd2014-10-30 14:31:34 +010012 return c.ServiceURL(ExtPath, RolePath, id)
Jamie Hannaford0ca076c2014-10-30 13:12:35 +010013}
14
15func rootURL(c *gophercloud.ServiceClient) string {
Jamie Hannaford36a7dfd2014-10-30 14:31:34 +010016 return c.ServiceURL(ExtPath, RolePath)
Jamie Hannaford1d58e7a2014-10-30 13:23:33 +010017}
18
19func userRoleURL(c *gophercloud.ServiceClient, tenantID, userID, roleID string) string {
Jamie Hannaford36a7dfd2014-10-30 14:31:34 +010020 return c.ServiceURL("tenants", tenantID, UserPath, userID, RolePath, ExtPath, roleID)
Jamie Hannaford0ca076c2014-10-30 13:12:35 +010021}