In the previous post, I showed how to access Cohesity objects via the REST API. Now let's look at how to make changes. Let's have a look at our protection jobs again:
Now let's say we want to change the start time of the job to 11PM. First we can make the changes to the job object we just retrieved:
then we can put the job back to save it back to Cohesity:
Notice the use of the put verb. This verb is used when updating an existing object.
Next, let's add a VM called CentOS5 to our protection job. First we need to find the ID of the VM, then add it to the list of source IDs in the job:
Easily done. Now, what if you want to create a brand new job? Well, that can be more challenging, but if you know where to look, you can see everything that is going on behind the scenes in the Cohesity UI. That will be the topic of my next post...