Move services to target nodes

To move service pods to target nodes ,we need to give service name(robot-postgres,cw-timeseries-db,local-postgres) and target nodes in request payload.

  1. To achieve it through API. (Using curl)
API Usage sample
'curl
--location 'https://<Crosswork Server IP>:<Crosswork port>/crosswork/platform/v2/placement/move_services_to_nodes'
--header 'Authorization: <Authorization token>'
--header 'Content-Type: application/json'
--data '{ <Payload in JSON Format >}’’

Sample Payload:

{
          "service_placements":
          [
            {
              "service": {
                "name": "robot-postgres",
                "clean_data_folder": true
              },
              "nodes": [
              {
                "name": "fded-1bc1-fc3e-96d0-192-168-6-114-worker.cisco.com"
              },
              {
                "name": "fded-1bc1-fc3e-96d0-192-168-6-115-worker.cisco.com"
              }
              ]
            }  
          ]
        }

Sample Output

{
                "job_id": "PJ1",
                "result": {
                    "request_result": "ACCEPTED",
                    "error": {}
                }
              }