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 `
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
Modify all policy imports
Modify all imports of the Policy identified by the <namespace>/<policyName>
pair in the topic
field.
Command
Field | Value |
---|---|
topic | <namespace>/<policyName>/policies/commands/modify |
path | /imports |
value | The imports of the policy as JSON. see Policy representation (JSON) |
Response
Field | Value | |
---|---|---|
topic | <namespace>/<policyName>/policies/commands/modify |
|
path | /imports |
|
status | code | |
204 |
Success - The Policy imports were successfully updated. |
Example: Modify all imports
Create or modify a single policy import
Create or modify the import identified by the path
field of the Policy import identified the
<namespace>/<policyName>
pair in the topic
field and the <importedPolicyId>
in the path
field.
Command
Field | Value |
---|---|
topic | <namespace>/<policyName>/policies/commands/modify |
path | /imports/<importedPolicyId> |
value | The Policy import as JSON. see Policy representation (JSON) |
Response
Field | Value | |
---|---|---|
topic | <namespace>/<policyName>/policies/commands/modify |
|
path | /imports/<importedPolicyId> |
|
value | The created Policy import as JSON object, see Policy representation (JSON). This field is not available, if the resource already existed. | |
status | code | |
201 |
Success - The import was successfully created. | |
204 |
Success - The import was successfully updated. |
Example: Modify a single import