forked from huaweicloud/huaweicloud-sdk-go
/
urls.go
35 lines (26 loc) · 966 Bytes
/
urls.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package roles
import "github.com/gophercloud/gophercloud"
const (
rolePath = "roles"
)
func listURL(client *gophercloud.ServiceClient) string {
return client.ServiceURL(rolePath)
}
func getURL(client *gophercloud.ServiceClient, roleID string) string {
return client.ServiceURL(rolePath, roleID)
}
func createURL(client *gophercloud.ServiceClient) string {
return client.ServiceURL(rolePath)
}
func updateURL(client *gophercloud.ServiceClient, roleID string) string {
return client.ServiceURL(rolePath, roleID)
}
func deleteURL(client *gophercloud.ServiceClient, roleID string) string {
return client.ServiceURL(rolePath, roleID)
}
func listAssignmentsURL(client *gophercloud.ServiceClient) string {
return client.ServiceURL("role_assignments")
}
func assignURL(client *gophercloud.ServiceClient, targetType, targetID, actorType, actorID, roleID string) string {
return client.ServiceURL(targetType, targetID, actorType, actorID, rolePath, roleID)
}