Create or update a connection policy
Purpose
Creates a connection policy. A connection policy is used to authorize a connection to Eclipse Amlen based on one or more connection level attributes.URI
Use the Eclipse Amlen REST API POST method with the following Eclipse Amlen configuration URI:
http://<admin-endpoint-IP:Port>/ima/v1/configuration/
Object configuration data
Provide ConnectionPolicy object configuration data in the payload of the POST method by using the following schema. Content-type is set to application/json:
{
"ConnectionPolicy": {
"<NameOfConnectionPolicy>": {
"Description": "string",
"AllowDurable": true|false,
"AllowPersistentMessages": true|false,
"ClientID": "string",
"ClientAddress": "string",
"UserID": "string",
"GroupID": "string",
"CommonNames": "string",
"Protocol": "string",
"MaximumSessionExpiryInterval" : "string",
"ExpectedMsgRate" : "string"
}
}
}
Where:- NameOfConnectionPolicy
- Required.
- Description
- Optional.
- AllowDurable: true|false
- Optional.
- AllowPersistentMessages: true|false
- Optional.
Specify at least one of the following filters:
- ClientID
- Specifies the client ID that is allowed to connect to Eclipse Amlen.
- ClientAddress
- Specifies the client IP addresses that are allowed to connect to Eclipse Amlen.
- UserID
- Specifies the messaging user ID that is allowed to connect to Eclipse Amlen.
- GroupID
- Optional.
- CommonNames
- Specifies the client certificate common name that must be used to connect to Eclipse Amlen.
- Protocol
- Specifies which protocols are allowed to connect to Eclipse Amlen.
- MaximumSessionExpiryInterval
- Optional.
- ExpectedMsgRate
- Optional.
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 client to connect to Eclipse Amlen. For each filter that you do not specify, all values for that filter are allowed.
For example, a connection policy is created that specifies:
"GroupID": "SILVER" "UserID": "SIL*" "Protocol": "JMS"
. A client with User IDSIL1
, in groupSILVER
, that is using JMS can connect. A client with a User IDSIL2
, in groupGOLD
, that is using JMS cannot connect because not all of the filter conditions are met.
Related REST Administration APIs
Example
Creates a connection policy called "MyConnectionPolicy" by using cURL:
curl -X POST \
-H 'Content-Type: application/json' \
-d '{
"ConnectionPolicy": {
"MyConnectionPolicy": {
"Description": "Connection policy to authorize connection from demo client.",
"ClientID": "*"
}
}
}
' \
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."
}