Delete server

Overview

Deletes a specified server.

Classification

  • Delete

API Operation Object

  • servers

Synchronous / Asynchronous

  • asynchronous

Request

HTTP Request Method

  • DELETE

HTTP Request Path

{api_endpoint}/v2/{project_id}/servers/{server_id}

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

Request Parameters
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
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 Codes
response code condition
204 normal end
400 not found a specified tenant
401 unauthorized
404 not found a specified instance
- not found a specified project

HTTP Response Body

Format

  • none

Response Parameter

Response Parameters
item format description
none - -

Sample API Request and Response

Sample API Request

Request URI

https://example.com/v2/{project_id}/servers/{server_id}

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"

Response Body

  • none

Execution Example

HTTP Request

DELETE /v2/5d8b99310e6c49eaa5413aa659170deb/servers/cbce6087-6156-453c-a512-60bf3d75d69f HTTP/1.1
User-Agent: curl/7.35.0
Host: 192.168.150.51:8774
Accept-Encoding: gzip, deflate, compress
Accept: application/json
X-Auth-Token: 8f305e33f23745e8ac3abbd894d7c546
X-Auth-Project-Id: demo

HTTP Response

HTTP/1.1 204 No Content
Content-Length: 0
Content-Type: application/json
X-Compute-Request-Id: req-b206a777-0f14-4519-8df7-0805245ba3fd
Date: Thu, 24 Jul 2014 05:51:31 GMT

Error Execution Example

HTTP Request

DELETE /v2/5d8b99310e6c49eaa5413aa659170deb/servers/cbce6087-6156-453c-a512-60bf3d75d69f HTTP/1.1
User-Agent: curl/7.35.0
Host: 192.168.56.250:8774
X-Auth-Token: d5167ec495ff446999601ba779884f08
Content-type: application/json
Accept: application/json

HTTP Response

HTTP/1.1 400 Bad Request
Content-Length: 188
Content-Type: application/json; charset=UTF-8
X-Compute-Request-Id: req-ef192c92-85b2-4deb-af29-3f179f26df1f
Date: Thu, 08 Oct 2015 05:17:10 GMT

{"badRequest": {"message": "Malformed request URL: URL's project_id '5d8b99310e6c49eaa5413aa659170deb' doesn't match Context's project_id '29d7c07b31c34cf4bf99c280240a5d22'", "code": 400}}