Create Policy
Create a Policy
Request
URI
POST
https://{api_host}/tca/policy/api/v1/orgs/{orgIdForPolicy}/policies
COPY
Path Parameters
string
orgIdForPolicy
Required
The identifier of the tenant
Request Body
RestPolicyData
of type(s)
application/json
Optional
{
"name": "string",
"description": "string",
"type": "string",
"content": "apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata:\n name: abc\nrules:\n - apiGroups: \n - rbac.authorization.k8s.io/v1\n resources: \n - clusterrolebindings\n - clusterroles\n verbs: \n - get \n - list\n - create\n - update\n - patch\n - delete\n - apiGroups: [v1]\n resources: [serviceaccounts]\n verbs: [get, list, create, update, patch, delete]\n",
"state": "string"
}
Responses
201
The created Policy
Returns
RestPolicyInfo
of type(s)
application/json
This response body class contains all of the following:
RestPolicyData ,
InlineRestPolicyInfo1
{
"name": "string",
"description": "string",
"type": "string",
"content": "apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata:\n name: abc\nrules:\n - apiGroups: \n - rbac.authorization.k8s.io/v1\n resources: \n - clusterrolebindings\n - clusterroles\n verbs: \n - get \n - list\n - create\n - update\n - patch\n - delete\n - apiGroups: [v1]\n resources: [serviceaccounts]\n verbs: [get, list, create, update, patch, delete]\n",
"state": "string",
"id": "string",
"username": "string",
"updatedAt": "string",
"expiresAt": "string",
"_links": {
"self": {
"href": "string"
},
"list": {
"href": "string"
},
"export": {
"href": "string"
},
"edit": {
"href": "string"
},
"finalize": {
"href": "string"
},
"delete": {
"href": "string"
},
"grant": {
"href": "string"
},
"listGrants": {
"href": "string"
}
}
}
Response Headers
undefined
Location
undefined
400
Returns
BadRequest
of type(s)
application/json
{
"errors": [
{
"code": "string",
"message": "string"
}
]
}
401
Operation doesn't return any data structure
403
Operation doesn't return any data structure
409
Returns
Conflict
of type(s)
application/json
{
"errors": [
{
"code": "string",
"message": "string"
}
]
}
500
Returns
InrenalServerError
of type(s)
application/json
{
"errors": [
{
"code": "string",
"message": "string"
}
]
}