API

Welcome to the Nutanix NEXT community. To get started please read our short welcome post. Thanks!

cancel
Showing results for 
Search instead for 
Did you mean: 

API POST : Add VM to data protection

Wayfarer

API POST : Add VM to data protection

Hello, I'm beginner at Nx REST API.

 

I start with API GET to get value of cluster, it's no problem.

 

But now next project "Auto add VM to data protection script" with API POST, I can add vm to data protection by html REST API.

Capture.PNG

 

Next step, I want to run auto script. I have a code when I click "Try it out!"

 

{
  "name": "DGT_name",
  "vms": [
    {
      "vmHandle": xxxxx,
      "vmId": "xxxxx",
      "vmName": "VM_NAME1",
      "vmPowerStateOnRecovery": "Power state at time of snapshot",
      "consistencyGroup": "VM_NAME1",
      "appConsistentSnapshots": false,
      "vmRecoverability": [],
      "vmFiles": null,
      "relatedEntityUuids": []
    }
  ],
  "nfsFiles": [],
  "volumeGroups": [],
  "vstoreId": null,
  "active": true,
  "remoteSiteNames": [],
  "cronSchedules": [],
  "minSnapshotToRetain": null,
  "nextSnapshotTimeUsecs": null,
  "pendingReplicationCount": 0,
  "ongoingReplicationCount": 0,
  "markedForRemoval": false,
  "hybridSchedulesCount": null,
  "metroAvail": null,
  "totalUserWrittenBytes": null,
  "replicationLinks": [],
  "syncReplications": null,
  "annotations": []
}

 

I don't know how to use this code

 

Please give me "NX REST API using POST" example. (I'm very happy if you give me a data protection script haha)

 

Thank you very much.

 

Sorry for my poor english.

 

 

Tags (1)
3 REPLIES
Nutanix Employee

Re: API POST : Add VM to data protection

Tags (1)
Wayfarer

Re: API POST : Add VM to data protection

Thank you, I will learn it now!

 

.. I have some question, can this script write in python ?

Pathfinder

Re: API POST : Add VM to data protection