Nodes/{name}/services/{serviceName}: PUT

Starts or stops a service on a node or node class.

Availability

Available on all IBM Storage Scale editions.

Description

The PUT nodes/name/services/serviceName request starts or stops a service that is hosted on a node or node class. For more information about the fields in the returned data structure, see mmces command.

Request URL

https://<IP address or host name of API server>:<port>/scalemgmt/v2/nodes/name/services/serviceName
where
nodes/name
Specifies the node or node class on which the service is hosted.
/services/serviceName
Specifies the target service of the request.

Request headers

Accept: application/json

Parameters

The following parameters can be used in the request URL to customize the request:
Table 1. List of parameters
Parameter name Description and applicable keywords Required/optional
name Name of the node or node class on which the service is hosted. Required.
serviceName Name of the service about which the information is required. Required.
body Body of the request that contains the required parameters to be passed on to the IBM Storage Scale system to perform the requested operation. Required.

Request data

{  
  "status": {
      "code":ReturnCode",
      "message":"ReturnMessage"
   },
   "performanceData": {}
}
For more information about the fields in the following data structures, see the links at the end of this topic.
"status":
Return status.
"message": "ReturnMessage",
The return message.
"code": ReturnCode
The return code.
"action":
The action to be performed on the service. You can either start or stop the service.

Response data

{
   "status": {
      "code":ReturnCode",
      "message":"ReturnMessage"
   },
   "jobs": [
      {
         "result":"", 
           { 
             "commands":"String",
             "progress":"String,
             "exitCode":"Exit code",
             "stderr":"Error",
             "stdout":"String",
           },
         "request":" ",
           {
             "type":"{GET | POST | PUT | DELETE}",
             "url":"URL",
             "data":""",
           }
         "jobId":"ID",
         "submitted":"Time",
         "completed":Time",
         "status":"Job status",
         }
   ],
  }
For more information about the fields in the following data structures, see the links at the end of this topic.
"jobs":
An array of elements that describe jobs. Each element describes one job.
"status":
Return status.
"message": "ReturnMessage",
The return message.
"code": ReturnCode
The return code.
"result"
"commands":"String'
Array of commands that are run in this job.
"progress":"String'
Progress information for the request.
"exitCode":"Exit code"
Exit code of command. Zero is success, nonzero denotes failure.
"stderr":"Error"
CLI messages from stderr.
"stdout":"String"
CLI messages from stdout.
"request"
"type":"{GET | POST | PUT | DELETE}"
HTTP request type.
"url":"URL"
The URL through which the job is submitted.
"data":" "
Optional.
"jobId":"ID",
The unique ID of the job.
"submitted":"Time"
The time at which the job was submitted.
"completed":"Time"
The time at which the job was completed.
"status":"RUNNING | COMPLETED | FAILED"
Status of the job.

Examples

The following example stops the NFS service that is hosted on the node scale01.

Request data:
curl -k -u admin:admin001 -X PUT --header 'content-type:application/json' --header 'accept:application/json'  
'https://198.51.100.1:443/scalemgmt/v2/nodes/scale01/services/nfs'
Response data:
Note: In the JSON data that is returned, the return code indicates whether the command is successful. The response code 200 indicates that the command successfully retrieved the information. Error code 400 represents an invalid request and 500 represents internal server error.
{
  "jobs" : [ {
    "jobId" : 1000000000001,
    "status" : "RUNNING",
    "submitted" : "2018-03-20 12:54:01,922",
    "completed" : "N/A",
    "runtime" : 3,
    "request" : {
      "type" : "PUT",
      "url" : "/scalemgmt/v2/nodes/scale01/services/nfs"
    },
    "result" : { },
    "pids" : [ ]
  } ],
  "status" : {
    "code" : 202,
    "message" : "The request was accepted for processing."
  }
}