Start server

Overview

Starts a stopped server and changes its status to ACTIVE.

Classification

  • Start

API Operation Object

  • action

Synchronous / Asynchronous

  • asynchronous

Request

HTTP Request Method

  • POST

HTTP Request Path

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

HTTP Request Header

Format

Accept-Encoding: gzip, deflate, compress (optional)
Accept: application/json
X-Auth-Token: <token_id>
Content-Type: application/json

HTTP Request Body

Format

{
    "os-start" : null
}

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. 202 Accepted)
  • <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
202 normal end
400 invalid project_id
401 unauthorized
404 not found a specified instance
- not found a specified project
409 vm_state isn't STOPPED

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}/action

Request Header

Accept-Encoding: gzip, deflate, compress (optional)
Accept: application/json
X-Auth-Token: ajk3adjiown02
Content-Type: application/json

Request Body

{
    "os-start" : null
}

Sample API Response

Response Header

HTTP/1.1 202 Accepted
  • <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

POST /v2/b72dc11461c84102b97576ae24d2b88c/servers/0199340e-0f3e-4612-96be-6f1861b192b5/action 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: 592869f591004412afe69dee28e7ed33
Content-Type: application/json
Content-Length: 21

{ "os-start" : null }

HTTP Response

HTTP/1.1 202 Accepted
Content-Type: text/html; charset=UTF-8
Content-Length: 0
X-Compute-Request-Id: req-92e83972-921c-4cc9-97f7-9ef17fec4c22
Date: Thu, 31 Jul 2014 08:55:30 GMT

Error Execution Example

HTTP Request

POST /v2/w95f0b8574504834bd6249d91dbd5a9c/servers/fd2caaa0-cdcb-4f43-bd65-2bdbe29e06b1/action HTTP/1.1
User-Agent: curl/7.35.0
Host: 192.168.56.250:8774
X-Auth-Token:cd08bf66ed2044c0ae07458cfeb42e82
Content-type: application/json
Accept: application/json
Content-Length: 16

HTTP Response

HTTP/1.1 400 Bad Request
Content-Length: 188
Content-Type: application/json; charset=UTF-8
X-Compute-Request-Id: req-b0be15dd-d75d-45d9-b3a7-f09a0449efb4
Date: Thu, 08 Oct 2015 09:24:33 GMT

{"badRequest": {"message": "Malformed request URL: URL's project_id 'w95f0b8574504834bd6249d91dbd5a9c' doesn't match Context's project_id '895f0b8574504834bd6249d91dbd5a9c'", "code": 400}}