Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
412 views
in Technique[技术] by (71.8m points)

VmWare Workstation API REST failed in method configparams

I am trying to use the following function of the REST API in VmWare Workstation 16:

/vms/{id}/configparams  update the vm config params

the CURL command is:

curl 'https://localhost:8697/api/vms/78BC37CO4B5GCTSVHKPVEIHGQ4DBQK1K/configparams' -X PUT --header 'Content-Type: application/vnd.vmware.vmw.rest-v1+json' --header 'Accept: text/plain' --header 'Authorization: Basic XXXXXXXXXXXXXXXXXX=' -d @- <<REQUEST_BODY 
{
  "name": "displayName",
  "value": "test"
}
REQUEST_BODY

and the response is:

404 page not found

In the other hand when I try the following function

/vms/{id}  Updates the VM settings

the CURL command is:

curl 'https://localhost:8697/api/vms/78BC37CO4B5GCTSVHKPVEIHGQ4DBQK1K' -X PUT --header 'Content-Type: application/vnd.vmware.vmw.rest-v1+json' --header 'Accept: application/vnd.vmware.vmw.rest-v1+json' --header 'Authorization: Basic XXXXXXXXXXXXXXXXXX=' -d @- <<REQUEST_BODY 
{
  "processors": 2,
  "memory": 1024
}
REQUEST_BODY

and the response is:

{
  "id": "78BC37CO4B5GCTSVHKPVEIHGQ4DBQK1K",
  "cpu": {
    "processors": 2
  },
  "memory": 1024
}

As you can see, the first function is not working correctly, while the second yes.

It seems that the REST API is not responding correctly to the second URL, please could someone help me?

Thanks in advance, regards

question from:https://stackoverflow.com/questions/65928722/vmware-workstation-api-rest-failed-in-method-configparams

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...