Delete server metadata item¶
Overview¶
Deletes a metadata item by key for a specified server.
Classification¶
- Delete
API Operation Object¶
- metadata
Synchronous / Asynchronous¶
- asynchronous
Request¶
HTTP Request Method¶
- DELETE
HTTP Request Path¶
{api_endpoint}/v2/{project_id}/servers/{server_id}/metadata/{key}
HTTP Request Header¶
Format¶
Accept-Encoding: gzip, deflate, compress (optional)
Accept: application/json
X-Auth-Token: <token_id>
HTTP Request Body¶
Format¶
- none
Request Parameter¶
name | style | format | description | required/optional | default value | action for invalid parameter | response code for invalid parameter |
---|---|---|---|---|---|---|---|
project_id | URL | UUID(3) | project id | required | - | Terminate | 400, 404 |
server_id | URL | UUID String | instance id | required | - | Terminate | 404 |
key | Body | String(1-255 characters) | key for metadata | required | - | Terminate | 404 |
token_id | Header | authentication token string | keystone authentication token | required | - | Terminate | 401 |
Response¶
HTTP Response Header¶
Format¶
HTTP/1.1 <response_code> <message> (ex. 204 No Content)
<response_code>: see “HTTP Responses” section
<message>: message based on the response code
- skip auto insert field such as “X-Compute-Request-Id” and “Content-Length”, “Date”
Response Code¶
response code | condition |
---|---|
204 | normal end |
400 | project is not found |
401 | unauthorized |
403 | Not authorized to perform the requested action |
404 | specified the instance id that not found |
- | not found a specified project |
- | specified metadata item is not found |
409 | specified instance has been locked |
- | instance status is invalid(status isn’t ACTIVE,PAUSED,SUSPENDED,STOPPED) |
- | instance task status is not None. |
Sample API Request and Response¶
Sample API Request¶
Request URI¶
https://example.com/v2/{project_id}/servers/{server_id}/metadata/{key}
Request Header¶
Accept-Encoding: gzip, deflate, compress (optional)
Accept: application/json
X-Auth-Token: ajk3adjiown02
Request Body¶
- none
Sample API Response¶
Response Header¶
HTTP/1.1 204 No Content
<response_code>: see “HTTP Responses” section
<message>: message based on the response code
- skip auto insert field such as “X-Compute-Request-Id” and “Content-Length”, “Date”
Execution Example¶
HTTP Request¶
DELETE /v2/e4ee5a9bdf934e35b62c8b995152feee/servers/5ec95878-b74d-40f2-be61-c3c1ae5e5b19/metadata/sample_key HTTP/1.1
User-Agent: curl/7.35.0
Host: localhost:8774
Accept: */*
X-Auth-Token: 870466f60fd3461abbcf1f2f16ffc30f
HTTP Response¶
HTTP/1.1 204 No Content
Content-Length: 0
Content-Type: application/json
X-Compute-Request-Id: req-88f77efc-4ef4-4d26-99bd-091e062b669c
Date: Fri, 19 Dec 2014 06:56:18 GMT
Error Execution Example¶
HTTP Request¶
DELETE /v2/cb8aa2a2c7244af5aab1fa7881ba7f4/servers/df82dc3f-98e0-4f68-8b75-db8aee7905ab/metadata/key1 HTTP/1.1
User-Agent: curl/7.35.0
Host: 192.168.56.250:8774
X-Auth-Token: 5ea07aa3793a43c3b5d0988d1253c01d
Content-type: application/json
Accept: application/json
HTTP Response¶
HTTP/1.1 400 Bad Request
Content-Length: 187
Content-Type: application/json; charset=UTF-8
X-Compute-Request-Id: req-a659294a-f439-4479-94a2-66d543d5e9d2
Date: Thu, 15 Oct 2015 04:17:31 GMT
{"badRequest": {"message": "Malformed request URL: URL's project_id 'cb8aa2a2c7244af5aab1fa7881ba7f4' doesn't match Context's project_id 'cb8aa2a2c7244af5aab1fa7881ba7f4c'", "code": 400}}