Here are practical examples demonstrating how to manage roles using the Nova API, including creating, assigning, and retrieving role information.

🔧 Example 1: Creating a Role

curl -X POST http://localhost:8774/v2.1/os-roles \
  -H "Content-Type: application/json" \
  -H "X-Auth-Token: <your_token>" \
  -d '{
    "role": {
      "name": "custom_admin"
    }
  }'
Role_Creation

🧾 Example 2: Assigning a Role to a User

curl -X POST http://localhost:8774/v2.1/users/<user_id>/roles \
  -H "Content-Type: application/json" \
  -H "X-Auth-Token: <your_token>" \
  -d '{
    "role": {
      "name": "custom_admin"
    }
  }'
Role_Assignment

📊 Example 3: Listing All Roles

curl -X GET http://localhost:8774/v2.1/os-roles \
  -H "X-Auth-Token: <your_token>"
Role_Listing

📁 Reference

For detailed parameters and endpoints, see the Nova API Role Management Guide.