Recoverygroups/{rgName}/{oldNode}/replace/{newNode}: PUT

Replaces a server in an mmvdisk scale-out recovery group.

Availability

Available on Elastic Storage Server and IBM Storage Scale Erasure Code editions.

Description

The PUT scalemgmt/v2/gnr/recoverygroups/{rgName}/{oldNode}/replace/{newNode} request replaces a failed or unwanted server in a scale-out recovery group that is managed by the mmvdisk command. When replaced, the RAID data from the old server's pdisks are migrated to the replacement server's disks. For more information about the fields in the data structures that are returned, see the mmvdisk recoverygroup command.

Request URL

https://<IP address or host name of API server>:<port>scalemgmt/v2/gnr/recoverygroups/{rgName}/{oldNode}/replace/{newNode}
where
{oldNode}
Specifies the resource that must be updated.
{rgName}
Specifies the recovery group where the node belongs.
{newNode}
Specifies the new node name.

Request headers

Accept: application/json

Parameters

Table 1. List of parameters
Parameter name Description and applicable keywords Required/Optional
rgName The recovery group name. Required
oldNode The old node name that is replaced. Required
newNode The new node name that replaces the old node. Required

Request data

No Request data.

Response data

{
  "jobs": [
    {
      "jobId": ID of the job,
      "status": "Job status",
      "submitted": "Date and time when job was submitted",
      "completed": "Date and time when job was completed",
      "runtime": Time when Job ran,
      "request": {
        "type": "Request Type",
        "url": "Resource URL"
      },
      "result": {},
         "progress": [],
        "commands": [
          ""
        ],
        "stdout": [
          " "
        ],
        "stderr": [],
        "exitCode": 0
      },
        "pids": []
    }
  ],
  "status": {
    "code": return status code,
    "message": "Return message."
  }
}

For more information about the fields in the following data structures, see the links at the end of the topic.

"jobs":
An array of elements that describe jobs. Each element describes one job.
"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.
"runtime": "Time"
The duration for which the job ran.
"status": "RUNNING | COMPLETED | FAILED"
Status of the job.
"result"
"progress": Job progress
Progress information for the request.
"commands": "Command name
Array of commands that are run in this job.
"stdout": "message
Request Information.
"exitCode":"Exit code"
Exit code of command. Zero indicates success and any other value denotes failure.
"stderr":"Error"
CLI messages from stderr.
"pids": list
A list of process IDs for this job.
"request"
"type": "{GET | POST | PUT | DELETE}"
HTTP request type.
"url": "URL"
The URL through which the job is submitted.
"status":
Return status.
"message": "ReturnMessage",
The return message.
"code": ReturnCode
The return code.

Examples

The following example shows how to replace a server in an mmvdisk scale-out recovery group.

Request data:
curl -X PUT --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Authorization: Basic YWRtaW46VHJhY2VAMjAyMQ==' 'https://198.51.100.1:443/scalemgmt/v2/gnr/recoverygroups/rg1/ess-12/replace/ess-11''
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": 1000000000003,
      "status": "COMPLETED",
      "submitted": "2021-06-18 08:14:31,854",
      "completed": "2021-06-18 08:14:40,799",
      "runtime": 8945,
      "request": {
        "type": "PUT",
        "url": "/scalemgmt/v2/gnr/recoverygroups/rg1/ess-12/replace/ess-11'"
      },
      "result": {
        "progress": [],
        "commands": [
          "mmvdisk recoverygroup replace  --recovery-group rg1                             
          -N ess-12 --new-node ess-11 [--match 100]
                             [--fanout 32] [-v yes] "
        ],
        "stdout": [
         
         "info: "
        ],
        "stderr": [],
        "exitCode": 0
      },
      "pids": []
    }
  ],
  "status": {
    "code": 200,
    "message": "The request finished successfully."
  }
}