Create a Role¶
-
POST
/api/v1.2/roles
¶
This API is used to create a role such as system user and system administrator in a QDS account.
Required Role¶
The following users can make this API call:
- Users who belong to the system-admin or system-user group.
- Users who belong to a group associated with a role that allows creating roles. See Managing Groups and Managing Roles for more information.
Parameters¶
Note
Parameters marked in bold are mandatory. Others are optional and have default values.
Parameter | Description |
---|---|
name | Name of the role that must be unique in the Qubole account. |
policies | Array of policies to be assigned to role. Each policy include following parameters:
|
Request API Syntax¶
curl -X POST -H "X-AUTH-TOKEN: $AUTH_TOKEN" -H "Content-Type: application/json" -H "Accept: application/json" \
-d '{"policies":"[{\"resource\":\"all\",\"action\":[\"all\"],\"access\":\"allow\"}]",
"name":"my_role"}' \ "https://gcp.qubole.com/api/v1.2/roles"
Sample Request¶
curl -X POST -H "X-AUTH-TOKEN: $AUTH_TOKEN" -H "Content-Type: application/json" -H "Accept: application/json" \
-d '{"policies":"[{\"resource\":\"all\",\"action\":[\"all\"],\"access\":\"allow\"}]",
"name":"my_role"}' \ "https://gcp.qubole.com/api/v1.2/roles"
Sample Response¶
{"status":"success","roles":{"id":6,"name":"my_role","source":"user-defined",
"policy":"[{\"resource\":\"all\",\"action\":[\"all\"],\"access\":\"allow\"}]","account_id":64}}