A valid request URL is required to generate request examples{
"srn": "srn2:policy#my-read-only-policy",
"name": "my-read-only-policy",
"description": "Policy allowing query on myTable",
"policyDocumentJson": "{\"version\":\"v1\",\"statements\":[{\"effect\":\"allow\",\"actions\":[\"query\"],\"resources\":[\"srn2:cluster#*:table#myTable\"]}]}",
"createdAt": "2024-09-04T00:28:30.876+00:00",
"lastUpdatedAt": "2024-09-04T00:28:30.876+00:00",
"createdBy": "srn:zone:user:default:abcd1234",
"lastUpdatedBy": "srn:zone:user:default:abcd1234"
}{
"timestamp": "2023-11-07T05:31:56Z",
"status": 404,
"error": "Not Found",
"message": "Not Found.",
"path": "/api/v1/rbac-manager/policies/srn2:policy%23missing"
}{
"timestamp": "2023-11-07T05:31:56Z",
"status": 404,
"error": "Not Found",
"message": "Not Found.",
"path": "/api/v1/rbac-manager/policies/srn2:policy%23missing"
}{
"timestamp": "2023-11-07T05:31:56Z",
"status": 404,
"error": "Not Found",
"message": "Not Found.",
"path": "/api/v1/rbac-manager/policies/srn2:policy%23missing"
}Create a policy
Creates a policy. The policy document is passed as a JSON string in policyDocumentJson.
See Custom Policy Configuration for the document format,
the list of actions, and SRN syntax.
A valid request URL is required to generate request examples{
"srn": "srn2:policy#my-read-only-policy",
"name": "my-read-only-policy",
"description": "Policy allowing query on myTable",
"policyDocumentJson": "{\"version\":\"v1\",\"statements\":[{\"effect\":\"allow\",\"actions\":[\"query\"],\"resources\":[\"srn2:cluster#*:table#myTable\"]}]}",
"createdAt": "2024-09-04T00:28:30.876+00:00",
"lastUpdatedAt": "2024-09-04T00:28:30.876+00:00",
"createdBy": "srn:zone:user:default:abcd1234",
"lastUpdatedBy": "srn:zone:user:default:abcd1234"
}{
"timestamp": "2023-11-07T05:31:56Z",
"status": 404,
"error": "Not Found",
"message": "Not Found.",
"path": "/api/v1/rbac-manager/policies/srn2:policy%23missing"
}{
"timestamp": "2023-11-07T05:31:56Z",
"status": 404,
"error": "Not Found",
"message": "Not Found.",
"path": "/api/v1/rbac-manager/policies/srn2:policy%23missing"
}{
"timestamp": "2023-11-07T05:31:56Z",
"status": 404,
"error": "Not Found",
"message": "Not Found.",
"path": "/api/v1/rbac-manager/policies/srn2:policy%23missing"
}Authorizations
A StarTree API token or a service token (st-<accessKey>-<secretKey>).
Body
Unique policy name. Becomes the identifier in the SRN srn2:policy#<name> and cannot be changed later.
"my-read-only-policy"
The policy document as a JSON string (escape the inner quotes). See Custom Policy Configuration for the format.
"{\"version\":\"v1\",\"statements\":[{\"effect\":\"allow\",\"actions\":[\"query\"],\"resources\":[\"srn2:cluster#*:table#myTable\"]}]}"
"Policy allowing query on myTable"
Response
The created policy.
"srn2:policy#my-read-only-policy"
"my-read-only-policy"
"Policy allowing query on myTable"
The policy document as a JSON string (escape the inner quotes). See Custom Policy Configuration for the format.
"{\"version\":\"v1\",\"statements\":[{\"effect\":\"allow\",\"actions\":[\"query\"],\"resources\":[\"srn2:cluster#*:table#myTable\"]}]}"
"2024-09-04T00:28:30.876+00:00"
"2024-09-04T00:28:30.876+00:00"
SRN of the principal that created the resource. Predefined StarTree resources show startree-rbac-manager.
"srn:zone:user:default:abcd1234"
"srn:zone:user:default:abcd1234"
Was this page helpful?

