node-ovh icon indicating copy to clipboard operation
node-ovh copied to clipboard

Example for instance creation from another backup image

Open 1ndistinct opened this issue 3 years ago • 0 comments

I am using your API in order to automate our systems setup process, I have run into an issue. I seem to be unable to figure out how to make a call to this endpoint: POST /cloud/project/{serviceName}/instance If you could provide me with an example, that would be great. I am using OVH- NodeJS as the use case requires it to be in JavaScript. For the example, we need to be able to create an instance from the backup of another instance. and we need automated backups on. here is what I have done so far, but a 400 gets returned! return new Promise((resolve,reject) => { ovh.request('POST', '/cloud/project/'+config.ovh_service_name+ '/instance', { flavorId: "4d4fd037-9493-4f2b-9afe-b542b5248eac", imageId: "309e9cc9-8318-49a0-9c41-6d9b7ec1f071", sshKeyId: "51326c68636d4675", monthlyBilling: false, name:"name", region: "ovh-eu", autobackup:{rotation:7,cron:"0 0 * * *"} }, function (err, result) { if(err) reject(err) else resolve(result); });

1ndistinct avatar Feb 11 '21 08:02 1ndistinct