Server reset in a RPM or Docker environment
Purpose
Erase all data on the messaging server and put it back to a factory-new state. All configuration is deleted, including the ssh server keys, license acceptance, and logs. All user IDs and passwords are also deleted and replaced with the default user ID and password that were set at the factory. The server will be restarted with this REST API for the changes to take effect.URI
Use the Eclipse Amlen REST API POST method with the following Eclipse Amlen service URI:
http://<admin-endpoint-IP:Port>/ima/v1/service/restart
Object configuration data
Provide object configuration data in the payload of the POST method by using the following
schema. Content-type is set to application/json
:
{
"Service":"Server",
"Reset":"config"
)
Usage NotesĀ®
- To access the reset server by using the Web UI, ensure that the Web UI has correct information specified to access the server. For more information about configuring servers to manage in the Web UI, see Configuring your first Eclipse Amlen to manage.
- This action only resets the messaging server.
Example
The following examples use cURL to test server reset by creating a TestHub, verifying that it is created, resetting the server and finally verifying that TestHub is deleted.
- Create a MessageHub called
TestHub
by using the POST method in the configuration domain:
The following successful response is received:curl -X POST http://127.0.0.1:9089/ima/v1/configuration -d '{"MessageHub":{"TestHub":{"Description":"Test Hub"}}}'
{ "Version":"v1","Code":"CWLNA6011","Message":"The requested configuration change has completed successfully." }
- Check that the MessageHub is created by using the GET method in the configuration domain:
The following response is received;curl -X GET http://127.0.0.1:9089/ima/v1/configuration/MessageHub
{ "Version": "v1", "MessageHub": { "DemoHub": { "Description": "Demo Message Hub." }, "TestHub": { "Description": "Test Hub" } } }
- Reset the configuration by restarting the server using the POST method in the service domain:
curl -X POST http://127.0.0.1:9089/ima/v1/service/restart -d '{"Service":"Server","Reset":"config" }'
Note: No message is returned when this REST API is run because the server is restarted. You might want to wait around 15 seconds after running the reset command before you check the status of the server. - Check server status by using the GET method in the service domain:
The following response is received;curl -X GET http://127.0.0.1:9089/ima/v1/service/status
{ "Version":"v1", "Server": { "Name": "TestSystem:9089", "UID": "aFWxYf32", "Status": "Running", "State": 1, "StateDescription": "Running (production)", "ServerTime": "2016-03-04T14:46:53.081Z", "UpTimeSeconds": 4134, "UpTimeDescription": "0 days 0 hours 0 minutes 15 seconds", "Version": "2.0 20160304-0400", "ErrorCode": 0, "ErrorMessage": "" }, "Container": { "UUID":"034c91ce828a4f5c2c21d7cd7f04628368b63bd308825ec2d9dab5096ff04ca0" }, "HighAvailability": { "Status": "Inactive", "Enabled": false }, "Cluster": { "Status": "Inactive", "Enabled": false }, "Plugin": { "Status": "Inactive", "Enabled": false }, "MQConnectivity": { "Status": "Inactive", "Enabled": false }, "SNMP": { "Status": "Inactive", "Enabled": false } }
- Check that
TestHub
which you created in step 1 is removed by using the GET method in the configuration domain:. Only DemoHub should be displayed in the response.
The following response is received;curl -X GET http://127.0.0.1:9089/ima/v1/configuration/MessageHub
{ "Version": "v1", "MessageHub": { "DemoHub": { "Description": "Demo Message Hub." } } }