Create Cloud Role (V2)
Creates a custom organization- or project-scoped Cloud ACL role.
Policy reference — allowed resourceType values and their combinations:
| resourceType | Privileges | Requires resources | Note |
|---|---|---|---|
project_member |
view, create, modify, delete | No | |
project_role |
view, create, modify, delete, grant | No | |
project |
view, modify, delete | No | |
security |
view, manage | No | |
backup |
view, manage | No | |
observability |
view, manage | No | |
serving_cluster |
create, view, modify, delete | Yes (except create) |
resources = cluster id, e.g. in01-xxx. Use * to cover all clusters including future ones. |
on_demand_cluster |
create, view, modify, delete | Yes (except create) |
resources = cluster id |
volume |
create, view, modify, delete, usage | Yes (except create) |
resources = volume id |
storage_integration |
create, view, modify, delete, usage | Yes (except create) |
resources = integration id |
model_provider_integration |
create, view, modify, delete, usage | Yes (except create) |
resources = integration id |
kms_integration |
create, view, modify, delete, usage | Yes (except create) |
resources = integration id (CMEK) |
datadog_integration |
create, view, modify, delete, usage | Yes (except create) |
resources = integration id |
serving_cluster_data |
read, write, all | Yes | resources = cluster id |
on_demand_compute_data |
read, write, all | No | |
volume_data |
read, write, all | Yes | resources = volume id |
The base URL for this API is in the following format:
https://api.cloud.zilliz.com
The endpoints on the control plane currently supports up to 20 requests per second per user per endpoint.
export BASE_URL="https://api.cloud.zilliz.com"
The authentication token should be an API key with appropriate privileges.
The project ID for a project-scoped role. Omit this field for an organization-scoped role.
The unique role display name within its scope.
The optional role description.
The policy statements assigned to the role.
A policy statement attached to a custom Cloud role.
The second-level resource the statement targets. Organization-level types: org_member, group, api_key, org_role, project_role, project, billing, authentication, org_control_ops, recovery. Project-level types: project_member, security, backup, observability, serving_cluster, on_demand_cluster, volume, storage_integration, model_provider_integration, kms_integration, datadog_integration, serving_cluster_data, on_demand_compute_data, volume_data.
Atomic privileges on that resource, e.g. ["view", "create"].
Which instances the statement covers: * for all, or explicit ids (validated against the role's project). Required on serving_cluster, on_demand_cluster, volume, serving_cluster_data, volume_data, storage_integration, model_provider_integration, kms_integration and datadog_integration, unless the statement's only privilege is create. For on_demand_compute_data, predefined roles return ["*"]; on write this field is rejected and should be omitted. Everywhere else, omit it — it is rejected on write and never returned.
Reserved for future use. Omit this field.
export TOKEN="YOUR_API_KEY"
curl --request POST \
--url "${BASE_URL}/v2/roles" \
--header "Authorization: Bearer ${TOKEN}" \
--header "Request-Timeout: 5" \
--header "Content-Type: application/json" \
-d '{
"roleName": "Org Manager",
"description": "Can view members and manage org roles",
"policies": [
{
"resourceType": "org_member",
"privileges": [
"view"
]
},
{
"resourceType": "org_role",
"privileges": [
"grant",
"manage"
]
}
]
}'
export TOKEN="YOUR_API_KEY"
curl --request POST \
--url "${BASE_URL}/v2/roles" \
--header "Authorization: Bearer ${TOKEN}" \
--header "Request-Timeout: 5" \
--header "Content-Type: application/json" \
-d '{
"projectId": "proj-xxxxxxxx",
"roleName": "Data Reader",
"description": "Can read serving clusters",
"policies": [
{
"resourceType": "serving_cluster",
"resources": [
"*"
],
"privileges": [
"view"
]
}
]
}'
Returns a successful result or an error message.
A successful response.
The response code.
A Cloud ACL role.
The role ID.
The role display name.
The role scope.
Whether the role is predefined or custom.
The project ID for a project-scoped role. For an organization-scoped role, this field returns an empty string.
The role description.
The policy statements attached to the role.
A policy statement attached to a custom Cloud role.
The second-level resource the statement targets. Organization-level types: org_member, group, api_key, org_role, project_role, project, billing, authentication, org_control_ops, recovery. Project-level types: project_member, security, backup, observability, serving_cluster, on_demand_cluster, volume, storage_integration, model_provider_integration, kms_integration, datadog_integration, serving_cluster_data, on_demand_compute_data, volume_data.
Atomic privileges on that resource, e.g. ["view", "create"].
Which instances the statement covers: * for all, or explicit ids (validated against the role's project). Required on serving_cluster, on_demand_cluster, volume, serving_cluster_data, volume_data, storage_integration, model_provider_integration, kms_integration and datadog_integration, unless the statement's only privilege is create. For on_demand_compute_data, predefined roles return ["*"]; on write this field is rejected and should be omitted. Everywhere else, omit it — it is rejected on write and never returned.
Reserved for future use. Omit this field.
A failure response.
The response code.
The error message.
{
"code": 0,
"data": {
"roleId": "r-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"roleName": "Org Manager",
"roleType": "org",
"roleKind": "custom",
"description": "Can view members and manage org roles",
"policies": [
{
"resourceType": "org_member",
"privileges": [
"view"
]
},
{
"resourceType": "org_role",
"privileges": [
"grant",
"manage"
]
}
]
}
}