Ditto Protocol topic structure for Policies
A valid topic consists of five elements, describing the policy affected by this message and the type of the message:
<namespace>/<policyName>/policies/commands/<action>
namespace: the namespace of the Policy.policyName: the name of the Policy.group: the group for addressing Policies ispolicies.criterion: the type of Protocol messages addressing Policies iscommands, for announcements it isannouncements.action: the action executed on the Policy viacommandscriterion:create/modify,retrieveordelete.subject: for announcements thesubjectcontains the announcement name
Note: The topic path of the policies group does not contain a channel unlike the things group.
Policy representation
The representation of a Policy is specified as follows:
Commands
The following Policy commands are available:
Common errors to commands
Each Policy command could also result in an error response.
The "topic" of such errors differ from the command "topic" - correlation is however possible via the
"correlation-id" header which is preserved in the error message.
The following table contains common error codes for Policy commands:
| 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/deleted/retrieved as the requester had insufficient permissions. |
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 Policy is larger than the configured limit (defaults to 100 kB). |
429 |
Too many modifying requests are already outstanding to a specific Policy. |