A.4.3. PUT 请求及 cURL
例 A.3. PUT
请求
以下
PUT
请求更新了虚拟机资源的内存。请注意,PUT
请求需要一个正文。
PUT /ovirt-engine/api/vms/082c794b-771f-452f-83c9-b2b5a19c0399 HTTP/1.1 Accept: application/xml Content-type: application/xml <vm> <memory>1073741824</memory> </vm>
调整方法(
PUT
)、标头(Accept: application/xml
and Content-type: application/xml
), URI (https://[RHEVM-Host]:443/ovirt-engine/api/vms/082c794b-771f-452f-83c9-b2b5a19c0399
),请求正文到以下 cURL 命令中:
$ curl -X PUT -H "Accept: application/xml" -H "Content-type: application/xml" -u [USER:PASS] --cacert [CERT] -d "<vm><memory>1073741824</memory></vm>" https://[RHEVM-Host]:443//ovirt-engine/api/vms/082c794b-771f-452f-83c9-b2b5a19c039
REST API 使用新的内存配置来更新虚拟机。