OVH API - /vps/{serviceName}/reboot
BMPCreated with Sketch.BMPZIPCreated with Sketch.ZIPXLSCreated with Sketch.XLSTXTCreated with Sketch.TXTPPTCreated with Sketch.PPTPNGCreated with Sketch.PNGPDFCreated with Sketch.PDFJPGCreated with Sketch.JPGGIFCreated with Sketch.GIFDOCCreated with Sketch.DOC Error Created with Sketch.
Question

OVH API - /vps/{serviceName}/reboot

by
AurelienB10
Created on 2019-05-17 07:41:26 (edited on 2024-09-04 14:05:41) in Serveurs Privés Virtuels (VPS)

Bonjour,

Je rencontre un problème lorsque j'essaye d'utiliser l'API vps reboot documentée ici:
https://api.ovh.com/console/#/vps/%7BserviceName%7D/reboot#POST

Au départ, j'avais des erreurs d'authentification avec des messages d'erreur comme "This credential is not valid" ou bien "This call has not been granted", mais je suis finalement parvenu à aller plus loin.
En effet, je parviens bien désormais à contacter l'API en utilisant le wrapper PERL, mais je reçois l'erreur suivante: "Invalid JSON received" que je ne parviens pas à résoudre.
Pouvez-vous svp m'aider ?

Mon code perl:
--------------------------------------------
use OvhApi;
my $applicationKey = "xxx";
my $applicationSecret = "xxx";
my $consumer_key = "xxx";
my $Api = OvhApi->new(type => OvhApi::OVH_API_EU, applicationKey => $applicationKey, applicationSecret => $applicationSecret, consumerKey => $consumer_key);
my $Answer = $Api->post(path => '/vps/vpsxxxxxx.ovh.net/reboot');
if ($Answer)
{
my $content = $Answer->content;
print "$content";
}
else
{
my $error = $Answer->error;
print "$error";
}
--------------------------------------------
Avec ceci, $Answer retourne "Invalid JSON received".

Merci d'avance !
Cordialement,