vmware-samples / cloud-native-storage-self-service-manager

Cloud Native Storage (CNS) Manager is a diagnostic and self-service tool that helps detect and auto-remediate some of the known issues in storage control plane.
Apache License 2.0
15 stars 4 forks source link

Changes to update client-sdk files and documentation as per recent changes made for orphan volumes feature #25

Closed vdkotkar closed 9 months ago

vdkotkar commented 9 months ago

Testing done: Deployed cns-manager using instructions provided on GitHub repo and verified that orphan snapshot related APIs are working.

# curl -X 'GET' 'http://<ip>:30008/1.0.0/orphansnapshots?limit=50' -H 'accept: application/json' -u "Admin:Admin" | jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   412  100   412    0     0  27466      0 --:--:-- --:--:-- --:--:-- 29428
{
  "totalOrphanSnapshots": 1,
  "limit": 50,
  "offset": 0,
  "orphanSnapshots": [
    {
      "volumeId": "f2e73a8b-91d2-4c86-96e3-7e136dde1d3f",
      "volumeSnapshotId": "677d55d3-b51f-4413-bb09-23bfa2b2c001",
      "datacenter": "VSAN-DC",
      "datastore": "vsanDatastore",
      "createTime": "2024-02-14 12:37:45.787118 +0000 UTC",
      "snapshotDescription": "snapshot-b8071245-ad49-499c-8b8d-83669318ae6c-f2e73a8b-91d2-4c86-96e3-7e136dde1d3f"
    }
  ],
  "retryAfterMinutes": 60
}

# curl -X 'GET' 'http://<ip>:30008/1.0.0/volumes/f2e73a8b-91d2-4c86-96e3-7e136dde1d3f/snapshots?datacenter=VSAN-DC&datastore=vsanDatastore' -H 'accept: application/json' -u "Admin:Admin" | jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   279  100   279    0     0    365      0 --:--:-- --:--:-- --:--:--   365
{
  "Snapshots": [
    {
      "snapshotId": "677d55d3-b51f-4413-bb09-23bfa2b2c001",
      "volumeId": "f2e73a8b-91d2-4c86-96e3-7e136dde1d3f",
      "createTime": "2024-02-14 12:37:45.787118 +0000 UTC",
      "snapshotDescription": "snapshot-b8071245-ad49-499c-8b8d-83669318ae6c-f2e73a8b-91d2-4c86-96e3-7e136dde1d3f"
    }
  ]
}

# curl -X 'DELETE' 'http://<ip>:30008/1.0.0/volumes/f2e73a8b-91d2-4c86-96e3-7e136dde1d3f/snapshots?datacenter=VSAN-DC&datastore=vsanDatastore' -H 'accept: application/json' -u "Admin:Admin" | jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    69  100    69    0     0    160      0 --:--:-- --:--:-- --:--:--   160
{
  "jobId": "snapshotdeletionjob-fe04d66f-cb38-11ee-884f-e2330787a620"
}

# curl -X 'GET' 'http://<ip>:30008/1.0.0/getjobstatus?jobId=snapshotdeletionjob-fe04d66f-cb38-11ee-884f-e2330787a620' -H 'accept: application/json' -u "Admin:Admin" | jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   674  100   674    0     0   5912      0 --:--:-- --:--:-- --:--:--  5860
{
  "jobId": "snapshotdeletionjob-fe04d66f-cb38-11ee-884f-e2330787a620",
  "phase": "Success",
  "jobParameters": {
    "fcdId": "f2e73a8b-91d2-4c86-96e3-7e136dde1d3f",
    "datacenter": "VSAN-DC",
    "datastores": [
      "vsanDatastore"
    ],
    "snapshotPrefix": "snapshot"
  },
  "jobStatus": {
    "totalSnapshotsPlannedForDeletion": 1,
    "totalSnapshotsSuccessfullyDeleted": 1,
    "startTime": "2024-02-14T13:00:13Z",
    "endTime": "2024-02-14T13:00:15Z",
    "snapshotDeletionTasks": [
      {
        "fcdId": "f2e73a8b-91d2-4c86-96e3-7e136dde1d3f",
        "snapshotId": "677d55d3-b51f-4413-bb09-23bfa2b2c001",
        "datacenter": "VSAN-DC",
        "datastore": "vsanDatastore",
        "phase": "Success",
        "taskStartTime": "2024-02-14T13:00:14Z",
        "taskEndTime": "2024-02-14T13:00:15Z",
        "error": {}
      }
    ]
  }
}
vmwclabot commented 9 months ago

@vdkotkar, you must sign our contributor license agreement before your changes are merged. Click here to sign the agreement. If you are a VMware employee, read this for further instruction.

vmwclabot commented 9 months ago

@vdkotkar, we have received your signed contributor license agreement. The review is usually completed within a week, but may take longer under certain circumstances. Another comment will be added to the pull request to notify you when the merge can proceed.

vmwclabot commented 9 months ago

@vdkotkar, your company's legal contact has approved your signed contributor license agreement. It will also be reviewed by VMware, but the merge can proceed.

vmwclabot commented 9 months ago

@vdkotkar, VMware has approved your signed contributor license agreement.

gohilankit commented 9 months ago

/approve /lgtm