Starting, stopping and restarting SNMP by using REST Administration APIs

System administrators can start, stop, and restart SNMP on Eclipse Amlen by using REST Administration APIs.

You can start, stop, and subsequently restart SNMP only if SNMP is enabled. For more information about enabling SNMP, see Enabling and disabling SNMP by using REST Administration APIs.
You can start, stop, and restart SNMP by using REST Administration APIs, or by using the Amlen WebUI. For more information about using the Amlen WebUI to start, stop, and restart SNMP, see Configuring SNMP by using the Amlen WebUI.
Note: The commands must be capitalized as shown.
  1. Check whether SNMP is running by using the Eclipse Amlen REST API GET method with the following Eclipse Amlen service URI:

    http://<admin-endpoint-IP:Port>/ima/v1/service/status/snmp

    • If the status of SNMP is Running, SNMP is running.
    • If the status of SNMP is Stopped, SNMP is stopped.
  2. Choose an appropriate action:
    • To start SNMP, use the Eclipse Amlen REST API POST method with the following Eclipse Amlen service URI:
      http://127.0.0.1:9089/ima/v1/service/start
      
    • To stop SNMP, use the Eclipse Amlen REST API POST method. with the following Eclipse Amlen service URI:
      http://127.0.0.1:9089/ima/v1/service/stop
      
    • To restart SNMP, use the Eclipse Amlen REST API POST method with the following Eclipse Amlen service URI:
      http://127.0.0.1:9089/ima/v1/service/restart
      
The following example shows how to start SNMP by using cURL:

curl -X POST \
   -H  'Content-Type: application/json'  \
   -d  '{ 
         "Service": "snmp"
         }
       ' \
http://127.0.0.1:9089/ima/v1/service/start
The following example shows how to stop SNMP by using cURL:

curl -X POST \
   -H  'Content-Type: application/json'  \
   -d  '{ 
         "Service": "snmp"
         }
       ' \
http://127.0.0.1:9089/ima/v1/service/stop
The following example shows how to restart SNMP by using cURL:

curl -X POST \
   -H  'Content-Type: application/json'  \
   -d  '{ 
         "Service": "snmp"
         }
       ' \
http://127.0.0.1:9089/ima/v1/service/restart
An example response to the GET method:

{           
  "Version": "v1",   
  "Code": "CWLNA6011",
  "Message": "The requested configuration change has completed successfully." 
}