urls.go 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package roles
  2. import "devel.mephi.ru/iacherepanov/openstack-gophercloud"
  3. const (
  4. rolePath = "roles"
  5. )
  6. func listURL(client *gophercloud.ServiceClient) string {
  7. return client.ServiceURL(rolePath)
  8. }
  9. func getURL(client *gophercloud.ServiceClient, roleID string) string {
  10. return client.ServiceURL(rolePath, roleID)
  11. }
  12. func createURL(client *gophercloud.ServiceClient) string {
  13. return client.ServiceURL(rolePath)
  14. }
  15. func updateURL(client *gophercloud.ServiceClient, roleID string) string {
  16. return client.ServiceURL(rolePath, roleID)
  17. }
  18. func deleteURL(client *gophercloud.ServiceClient, roleID string) string {
  19. return client.ServiceURL(rolePath, roleID)
  20. }
  21. func listAssignmentsURL(client *gophercloud.ServiceClient) string {
  22. return client.ServiceURL("role_assignments")
  23. }
  24. func listAssignmentsOnResourceURL(client *gophercloud.ServiceClient, targetType, targetID, actorType, actorID string) string {
  25. return client.ServiceURL(targetType, targetID, actorType, actorID, rolePath)
  26. }
  27. func assignURL(client *gophercloud.ServiceClient, targetType, targetID, actorType, actorID, roleID string) string {
  28. return client.ServiceURL(targetType, targetID, actorType, actorID, rolePath, roleID)
  29. }