Create or update a queue policy
Purpose
Creates or updates a queue policy. A queue policy is a type of messaging policy that is used to control which clients can send to, receive from, or browse a specified queue.URI
Use theEclipse Amlen REST API POST method with the following Eclipse Amlen configuration URI:
http://<admin-endpoint-IP:Port>/ima/v1/configuration/
Object configuration data
Provide QueuePolicy object configuration data in the payload of the POST method by using the following schema. Content-type is set to application/json:
Where:
{
"QueuePolicy": {
"<NameOfQueuePolicy>": {
"Description": "string",
"Queue": "string",
"ActionList": "string",
"MaxMessageTimeToLive": "string",
"ClientID": "string",
"UserID": "string",
"GroupID": "string",
"CommonNames": "string",
"ClientAddress": "string",
"Protocol": "string"
}
}
}
- NameOfQueuePolicy
- Required.
- Description
- Optional.
- Queue
- Required if you are creating a queue policy.
- ActionList
- Required if you are creating a queue policy.
- MaxMessageTimeToLive
- Optional.
Specify at least one of the following filters:
- ClientID
- Specifies the client ID that is allowed to use the messaging actions that are specified in the queue policy. The client ID is allowed to use the messaging actions only on the queues that are specified in the policy.
- UserID
- Specifies the messaging user ID that is allowed to use the messaging actions that are specified in the queue policy. The messaging user ID is allowed to use the messaging actions only on the queues that are specified in the policy.
- GroupID
- Specifies the messaging group that is allowed to use the messaging actions that are specified in the queue policy. The messaging group is allowed to use the messaging actions only on the queues that are specified in the policy.
- CommonNames
- Specifies the client certificate common name that must be used for a client to be allowed to use the actions that are specified in the queue policy. The client certificate common name allows clients to use the messaging actions only on the queues that are specified in the policy.
- ClientAddress
- Specifies the client IP addresses that are allowed to use the messaging actions that are specified in the queue policy. The client IP addresses are allowed to use the messaging actions only on the queues that are specified in the policy.
- Protocol
- Specifies which protocols are allowed to use the actions that are specified in the queue policy on the queues that are specified in the policy.
Usage NotesĀ®
- Capitalization and double quotation marks must be used as shown.
- Each of the filters, ClientAddress, ClientID, UserID, GroupID, CommonNames, and Protocol, is applied in combination. If you specify several filters, each condition must be met in order for the actions that are specified in the messaging policy to be allowed. For each filter that you do not specify, all values for that filter are allowed.
For example, a queue policy is created that specifies:
"ActionList": "Publish" "GroupID": "SILVER" "ClientID": "SIL*" "Protocol": "JMS"
. A client with User IDSIL1
, in groupSILVER
, that is using JMS can publish messages. A client with a User IDSIL2
, in groupGOLD
, that is using JMS cannot publish messages because not all of the filter conditions are met.
Related REST Administration APIs
Example
Creates a queue policy called "MyQueuePolicy" by using cURL:
curl -X POST \
-H 'Content-Type: application/json' \
-d '{
"QueuePolicy": {
"MyQueuePolicy": {
"Description": "Queue policy to authorize a client to send messages to and receive messages from a queue.",
"Queue": "*",
"ClientID": "*",
"ActionList": "Send,Receive"
}
}
}
' \
http://127.0.0.1:9089/ima/v1/configuration/
An example response to the POST method:
{
"Version": "v1",
"Code": "CWLNA6011",
"Message": "The requested configuration change has completed successfully."
}