GitHub user YashasAnand edited a discussion: How to call scaleVirtualMachine 
api with details parameter

I am trying to call scaleVirtualMachine API using python, but the documentation 
is very vague on how to use details parameter
[https://cloudstack.apache.org/api/apidocs-4.19/apis/scaleVirtualMachine.html](url)

I am trying to create request like this, is this wrong? can anyone pls suggest 
what is right way to call this api?

request = {
    'command': 'scaleVirtualMachine',  
    'id': 'xys',  # ID of the system VM
    'serviceofferingid': 'xyz', 
    'response': 'json', 
    'details' : [
    {"name": "memory", "value": "3072"},
    {"name": "cpunumber", "value": "2"}
    ]
}

I get error 

{
    "scalevirtualmachineresponse": {
        "uuidList": [],
        "errorcode": 431,
        "cserrorcode": 9999,
        "errortext": "Unable to execute API command scalevirtualmachine due to 
invalid value [{\"name\": \"memory\", \"value\": \"3072\"}, {\"name\": 
\"cpunumber\", \"value\": \"2\"}] for parameter details"
    }
}



GitHub link: https://github.com/apache/cloudstack/discussions/9961

----
This is an automatically sent email for users@cloudstack.apache.org.
To unsubscribe, please send an email to: users-unsubscr...@cloudstack.apache.org

Reply via email to