Create a Policy
Create a Policy with the ID specified by the <namespace>/<policyName>
pair in the topic and the
JSON representation provided in the value
.
Command
Field | Value |
---|---|
topic | <namespace>/<policyName>/policies/commands/create |
path | / |
value | The complete Policy as JSON object, see Policy representation (JSON). |
Response
Field | Value | |
---|---|---|
topic | <namespace>/<policyName>/policies/commands/create |
|
path | / |
|
value | The created Policy as JSON object, see Policy representation (JSON). | |
status | code | |
201 |
Success - The Policy was successfully created. |
Example: Create a Policy.
Create or modify a Policy
This command modifies the Policy with the ID specified by the <namespace>/<policyName>
pair in the topic
and with the
JSON provided in the value
, if it already exists. Otherwise, the Policy is created.
Command
Field | Value |
---|---|
topic | <namespace>/<policyName>/policies/commands/modify |
path | / |
value | The complete Policy as JSON. see Policy representation (JSON) |
For modifying an existing policy, the authorized subject needs WRITE permission on the policy:/.
resource.
If the Policy does not yet exist, the same rules apply as described for the create command.
Response
Field | Value | |
---|---|---|
topic | <namespace>/<policyName>/policies/commands/modify |
|
path | / |
|
value | The created Policy as JSON object, see Policy representation (JSON). This field is not available, if the Policy entry already existed. | |
status | code | |
201 |
Success - The Policy was successfully created. | |
204 |
Success - The Policy was successfully updated. |
Example: Modify a Policy
Modify Policy entries
Modify the Policy entries of the Policy identified by the <namespace>/<policyName>
pair in the topic
field.
Command
Field | Value |
---|---|
topic | <namespace>/<policyName>/policies/commands/modify |
path | /entries |
value | The Policy entries as JSON. see Policy representation (JSON) |
Response
Field | Value | |
---|---|---|
topic | <namespace>/<policyName>/policies/commands/modify |
|
path | /entries |
|
status | code | |
204 |
Success - The Policy entries were successfully updated. |
Example: Modify all Policy entries
Create or modify a Policy entry
Create or modify the Policy entry identified by the <namespace>/<policyName>
pair in the topic
field and the <label>
in
the path
field.
If you specify a new label, the respective Policy entry will be created.
If you specify an existing label, the respective Policy entry will be updated.
Command
Field | Value |
---|---|
topic | <namespace>/<policyName>/policies/commands/modify |
path | /entries/<label> |
value | The Policy entry as JSON. see Policy representation (JSON) |
Response
Field | Value | |
---|---|---|
topic | <namespace>/<policyName>/policies/commands/modify |
|
path | /entries/<label> |
|
value | The created Policy entry as JSON object, see Policy representation (JSON). This field is not available, if the Policy entry already existed. | |
status | code | |
201 |
Success - The Policy entry was successfully created. | |
204 |
Success - The Policy entry was successfully updated. |
Example: Modify a single Policy entry
Modify all subjects
Modify at once all subjects of the Policy entry identified by the <namespace>/<policyName>
pair in the topic
field and by the <label>
in the path
topic.
Command
Field | Value |
---|---|
topic | <namespace>/<policyName>/policies/commands/modify |
path | /entries/<label>/subjects |
value | The subjects of the policy as JSON. see Policy representation (JSON) |
Response
Field | Value | |
---|---|---|
topic | <namespace>/<policyName>/policies/commands/modify |
|
path | /entries/<label>/subjects |
|
status | code | |
204 |
Success - The subjects of the policy were successfully updated. |
Example: Modify all subjects
Create or modify a single subject
Create or modify the subject with ID subjectId
of the Policy identified by the <namespace>/<policyName>
pair in the
topic
field and by the <label>
and the <subjectId>
in the path
field.
Command
Field | Value |
---|---|
topic | <namespace>/<policyName>/policies/commands/modify |
path | /entries/<label>/subjects/<subjectId> |
value | The subject of the policy as JSON. see Policy representation (JSON) |
Response
Field | Value | |
---|---|---|
topic | <namespace>/<policyName>/policies/commands/modify |
|
path | /entries/<label>/subjects/<subjectId> |
|
value | The created subject as JSON object, see Policy representation (JSON). This field is not available, if the subject already existed. | |
status | code | |
201 |
Success - The subject was successfully created. | |
204 |
Success - The subject was successfully updated. |
Example: Modify a single subject
Modify all resources
Modify all resources of the Policy identified by the <namespace>/<policyName>
pair in the topic
field and by the <label>
in the path
field.
Command
Field | Value |
---|---|
topic | <namespace>/<policyName>/policies/commands/modify |
path | /entries/<label>/resources |
value | The resources of the policy as JSON. see Policy representation (JSON) |
Response
Field | Value | |
---|---|---|
topic | <namespace>/<policyName>/policies/commands/modify |
|
path | /entries/<label>/resources |
|
status | code | |
204 |
Success - The Policy resources were successfully updated. |
Example: Modify all resources
Create or modify a single resource
Create or modify the resource identified by the path
field of the Policy entry identified the
<namespace>/<policyName>
pair in the topic
field and the <resource>
in the path
field.
Command
Field | Value |
---|---|
topic | <namespace>/<policyName>/policies/commands/modify |
path | /entries/<label>/resources/<resource> |
value | The Policy resource as JSON. see Policy representation (JSON) |
Response
Field | Value | |
---|---|---|
topic | <namespace>/<policyName>/policies/commands/modify |
|
path | /entries/<label>/resources/<resource> |
|
value | The created Policy resource as JSON object, see Policy representation (JSON). This field is not available, if the resource already existed. | |
status | code | |
201 |
Success - The resource was successfully created. | |
204 |
Success - The resource was successfully updated. |
Example: Modify a single resource
Common errors
status | Value |
---|---|
400 |
Bad Format - The request could not be completed due to malformed request syntax. |
401 |
Unauthorized - The request could not be completed due to missing authentication. |
403 |
Forbidden - The Policy could not be modified as the requester had insufficient permissions (‘WRITE’ is required). |
404 |
Not Found - The request could not be completed. The Policy with the given ID was not found in the context of the authenticated user. |
412 |
Precondition Failed - A precondition for reading or writing the (sub-)resource failed. This will happen for write requests, if you specified an If-Match or If-None-Match header, which fails the precondition check against the current ETag of the (sub-)resource. |
413 |
Request Entity Too Large - The created or modified entity is larger than the accepted limit of 100 kB. |
See Policy Error Responses for examples of other error responses. |