Creating and updating a message hub by using REST Administration APIs
System administrators can create and update endpoints, connection policies, messaging policy types, and message hubs by using REST Administration APIs.
You can create a message hub or update an existing message hub by using a REST Administration API, or by using the Amlen WebUI. For more information about using the Amlen WebUI to create a message hub, see Configuring message hubs by using the Amlen WebUI.
You can use the Eclipse Amlen REST API POST method to create or update one or more message hubs. If the message hub that is specified in the request does not exist in the Eclipse Amlen configuration table, then the message hub is created. Otherwise the message hub configuration is updated.
For more information about the components you must specify to create a message hub, including naming restrictions, see Configuring message hubs.
The following example shows a POST method to create a message hub called "MyHub" by using cURL:
curl -X POST \
-H 'Content-Type: application/json' \
-d '{
"MessageHub": {
"MyHub": {
"Description": "Message Hub to service demo clients."
}
}
}
' \
http://127.0.0.1:9089/ima/v1/configuration/
The following example shows an example response to the POST method:
{
"Version": "v1",
"Code": "CWLNA6011",
"Message": "The requested configuration change has completed successfully."
}
When you create a message hub, you must also create at least one endpoint. The endpoint must have at least one connection policy, and at least one type of messaging policy. When you create the endpoint, you must specify the connection policies and types of messaging policy that are associated with the endpoint. Therefore, you must create the connection policies and messaging policy types before you create the endpoint.