Question

API update VM categorie. "Cannot clear previously set time zone"

  • 30 January 2019
  • API
  • 1 reply
  • 26 views

Hi,

I want to set a VM to a categorie, using the REST API.
However I Get the message INVALID_REQUEST
code:
"Cannot clear previously set time zone


Don't know what to do with this.

Please note that I had to add the "power_state", because if I don't I get an INVALID_REQUEST
code:
 "VM power state must be specified for  Update operation."

Which I dont understand, as API documentation said power_state is optional.

Endpoint used: PUT /vms/{uuid}


Body:
code:
{
"spec": {
"name": "BACHELOR2018",
"resources": {
"power_state": "ON"
}
},
"api_version": "3.1",
"metadata": {
"kind": "vm",
"spec_version": 3,
"categories": {
"SLA": "A3"
}
}
}


Response body:
code:
{
"api_version": "3.1",
"code": 422,
"message_list": [
{
"message": "Cannot clear previously set time zone",
"reason": "INVALID_REQUEST"
}
],
"state": "ERROR"
}

1 reply

OK i found,

I had to define the attribute
code:
"hardware_clock_timezone"


Don't know why it is needed, but still it works!

Reply