ServerActionReboot

(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
The reboot function allows for either a soft or hard reboot of a server. With a soft reboot (SOFT), the operating system is signaled to restart, which allows for a graceful shutdown of all processes. A hard reboot (HARD) is the equivalent of power cycling the server.
+
The reboot action allows for either a soft or hard reboot of a [[Server]]. With a soft reboot (SOFT), the operating system is signaled to restart, which allows for a graceful shutdown of all processes. A hard reboot (HARD) is the equivalent of power cycling the server.
  
'''POST''' /servers/'''id'''/action
+
='''POST''' /servers/'''id'''/action=
  
 
== Parameters ==
 
== Parameters ==
 
; id
 
; id
: The unique identifier of the image to be retrieved. ''Note see warnings in [[Hypermedia]]''.
+
: The unique identifier of the server to reboot.
  
 
=== JSON ===
 
=== JSON ===
 
+
<nowiki>
<big><source lang="javascript">
+
 
{
 
{
 
   "reboot":
 
   "reboot":
 
       {
 
       {
         "type":"HARD"
+
         "type": "HARD"
 
       }
 
       }
}
+
}</nowiki>
</source></big>
+
  
 
; type - ''string''
 
; type - ''string''
: Type of reboot to preform. Values: '''HARD''', '''SOFT'''.
+
: Type of reboot to perform. Values: '''HARD''', '''SOFT'''.
  
 
== Response Codes ==
 
== Response Codes ==
 
; Success:  
 
; Success:  
:''HTTP/1.1 202 Accepted''
+
: ''HTTP/1.1 202 Accepted'' : The request is accepted for processing.
:The request is accepted for processing.
+
 
 
; Failure:
 
; Failure:
:''HTTP/1.1 200 OK Unauthorized'' - This server could not verify that you are authorized to access the document you requested.  Either you supplied the wrong credentials (e.g., bad password), or your browser does not understand how to supply the credentials required.
+
: ''HTTP/1.1 400 Bad Request'' : Check your parameter. / Other error
 
+
: ''HTTP/1.1 401 Unauthorized'' - This server could not verify that you are authorized to access the document you requested.  Either you supplied the wrong credentials (e.g., bad password), or your browser does not understand how to supply the credentials required.
== Examples ==
+
: ''HTTP/1.1 404 Not Found'' : The resource requested is not found.
'''Successfully reboot a server'''
+
: ''HTTP/1.1 405 Method Not Allowed'' : The requested action is not supported.
:'''POST''' http(s)://{api_server}/167/action
+
: ''HTTP/1.1 409 Conflict'' : Already rebooting.
 
+
''Request Headers:''
+
    Content-Type:application/json
+
    Charset=UTF-8
+
    Authorization:Base64-encoded username & password string
+
 
+
''Request Body:''
+
{
+
    "reboot":
+
      {
+
          "type":"SOFT"
+
      }
+
}
+
 
+
''Response Code:''
+
<pre>HTTP/1.1 202 Accepted</pre>
+
 
+
'''Unauthorized access'''
+
:'''POST''' http(s)://{api_server}/{server_id}/action
+
 
+
 
+
''Request Headers:''
+
    Content-Type:application/json
+
    Charset=UTF-8
+
    Authorization:Base64-encoded fake_authentication_string
+
 
+
''Response Code:''
+
<pre>HTTP/1.1 401 Unauthorized</pre>
+
 
+
''Response Body:''
+
    401 Unauthorized
+
    This server could not verify that you are authorized to
+
    access the document you requested.  Either you supplied the
+
    wrong credentials (e.g., bad password), or your browser
+
    does not understand how to supply the credentials required.
+
  
 
<!--  THIS CODE ENABLES DISQUS COMMENTS ON THE PAGE - DELETE TO DISABLE COMMENTING-->
 
<!--  THIS CODE ENABLES DISQUS COMMENTS ON THE PAGE - DELETE TO DISABLE COMMENTING-->

Revision as of 15:08, 4 July 2012

The reboot action allows for either a soft or hard reboot of a Server. With a soft reboot (SOFT), the operating system is signaled to restart, which allows for a graceful shutdown of all processes. A hard reboot (HARD) is the equivalent of power cycling the server.

Contents

POST /servers/id/action

Parameters

id
The unique identifier of the server to reboot.

JSON

{
   "reboot":
      {
         "type": "HARD"
      }
}
type - string
Type of reboot to perform. Values: HARD, SOFT.

Response Codes

Success
HTTP/1.1 202 Accepted : The request is accepted for processing.
Failure
HTTP/1.1 400 Bad Request : Check your parameter. / Other error
HTTP/1.1 401 Unauthorized - This server could not verify that you are authorized to access the document you requested. Either you supplied the wrong credentials (e.g., bad password), or your browser does not understand how to supply the credentials required.
HTTP/1.1 404 Not Found : The resource requested is not found.
HTTP/1.1 405 Method Not Allowed : The requested action is not supported.
HTTP/1.1 409 Conflict : Already rebooting.


blog comments powered by Disqus


Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox