Closed AsLY4 closed 8 years ago
This one is a nasty one. https://api.ovh.com/console/#/dedicated/server/{serviceName}#PUT
expects a param of type "dedicated.server.Dedicated". But of course, this does not exist. So you have to expand the object. Won't be fun to do.
./ovh-eu --debug dedicated-server ks1234.kimsufi.com update --monitoring true
PUT, /dedicated/server/ks390517.kimsufi.com({'monitoring': 'true'})
Success
Can you confirm this fix works for you and does not break anything else ?
fix for another domain {IP}.
./ovh-eu ip 8.9.1.2/32 update --description Message
Success
But for dedicated-server, monitoring become mandatory and other arguments still unknow
./ovh-eu dedicated-server ns7654321.ip-1-2-3.eu update --bootId 22 --monitoring true
usage: PUT /dedicated/server/ns7654321.ip-1-2-3.eu [-h] --monitoring
MONITORING
PUT /dedicated/server/ns7654321.ip-1-2-3.eu: error: unrecognized arguments: --bootId 22
Stupid keybord...
diff --git a/ovhcli/parser.py b/ovhcli/parser.py
index 8d28ec2..71d0cff 100644
--- a/ovhcli/parser.py
+++ b/ovhcli/parser.py
@@ -246,7 +246,7 @@ class ArgParser(object):
not bool(prop.get('canBeNull', 0)),
prop.get('description', ''),
)
- return
+ return
else:
pass
else:
Will yield:
usage: PUT /dedicated/server/ks390517.kimsufi.com [-h] --monitoring MONITORING
[--rescueMail RESCUEMAIL]
[--bootId BOOTID] --state
{error,hacked,hackedBlocked,ok}
[--rootDevice ROOTDEVICE]
optional arguments:
-h, --help show this help message and exit
--monitoring MONITORING
Icmp monitoring state
--rescueMail RESCUEMAIL
--bootId BOOTID
--state {error,hacked,hackedBlocked,ok}
--rootDevice ROOTDEVICE
The issue above is fixed, and all parameters have been made option on "update". Can you confirm ?
Yes it's good. ./ovh-eu dedicated-server ns7654321.ip-1-2-3.eu update --monitoring false --state ok --bootId 1 Success
But in fact --monitoring and --state parameters seems to be mandatory (maybe in API definition) usage: PUT /dedicated/server/ns7654321.ip-1-2-3.eu [-h] --monitoring MONITORING [--rescueMail RESCUEMAIL] [--bootId BOOTID] --state {error,hacked,hackedBlocked,ok} [--rootDevice ROOTDEVICE]
Fix pushed to master. Thx!
I try to update a object (dedicated-server for example)
ovh-eu dedicated-server ns7654321.ip-1-2-3.eu update --monitoring false
Return :