ServerActionUpgradePlesk

(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
 
This operation will upgrade the Plesk license for the specified [[Server]].
 
This operation will upgrade the Plesk license for the specified [[Server]].
  
=='''POST''' /servers/'''id'''/action==
+
='''POST''' /servers/'''id'''/action=
  
=== Parameters ===
+
== Parameters ==
 
; id
 
; id
 
: The unique identifier of the server.
 
: The unique identifier of the server.
  
=== Request===
+
== Request==
==== JSON ====
+
=== JSON ===
 
  <nowiki>
 
  <nowiki>
 
  {
 
  {
Line 19: Line 19:
 
  }</nowiki>
 
  }</nowiki>
  
=====upgradePlesk=====
+
====upgradePlesk====
 
; username - ''string''
 
; username - ''string''
 
: The username used for authentication for managing Plesk license.
 
: The username used for authentication for managing Plesk license.
Line 32: Line 32:
 
: Plesk addon textkey to upgrade to.
 
: Plesk addon textkey to upgrade to.
  
=== Response Codes ===
+
== Response Codes ==
 
; Success:  
 
; Success:  
 
: ''HTTP/1.1 202 Accepted'' : The request is accepted for processing.
 
: ''HTTP/1.1 202 Accepted'' : The request is accepted for processing.
Line 43: Line 43:
 
: ''HTTP/1.1 409 Conflict'' : The request could not be completed due to a conflict with the current state of the resource. / Wrong Addon TextKey
 
: ''HTTP/1.1 409 Conflict'' : The request could not be completed due to a conflict with the current state of the resource. / Wrong Addon TextKey
  
=== Examples ===
+
== Examples ==
 
'''Successfully upgrade Plesk server license'''
 
'''Successfully upgrade Plesk server license'''
 
:'''POST''' http(s)://{api_server}/servers/test_server_0013/action
 
:'''POST''' http(s)://{api_server}/servers/test_server_0013/action
Line 91: Line 91:
 
       "message": "PleskStillUpgrading",  
 
       "message": "PleskStillUpgrading",  
 
       "code": 409,  
 
       "code": 409,  
       "details": "Some task is in processing for this instance. please wait for a while"
+
       "details": "Some task is in processing for this instance. please wait for a while",
 +
      "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
 
   }
 
   }
 
  }
 
  }
Line 144: Line 145:
 
       "message": "Bad Request",  
 
       "message": "Bad Request",  
 
       "code": 400,  
 
       "code": 400,  
       "details": "Multiple actions per request are not allowed"
+
       "details": "Multiple actions per request are not allowed",
 +
      "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
 
   }
 
   }
 
  }
 
  }
Line 174: Line 176:
 
       "message": "WrongPleskAuthentication",  
 
       "message": "WrongPleskAuthentication",  
 
       "code": 403,  
 
       "code": 403,  
       "details": "Could not login to Plesk vm, check your VM login information"
+
       "details": "Could not login to Plesk vm, check your VM login information",
 +
      "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
 
   }
 
   }
 
  }
 
  }
Line 204: Line 207:
 
       "message": "WrongPleskAuthentication",  
 
       "message": "WrongPleskAuthentication",  
 
       "code": 403,  
 
       "code": 403,  
       "details": "Could not login to Plesk vm, check your VM login information"
+
       "details": "Could not login to Plesk vm, check your VM login information",
 +
      "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
 
   }
 
   }
 
  }
 
  }
Line 234: Line 238:
 
       "message": "WrongAddonTextkey",  
 
       "message": "WrongAddonTextkey",  
 
       "code": 409,  
 
       "code": 409,  
       "details": "Please specify proper addon textkey"
+
       "details": "Please specify proper addon textkey",
 +
      "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
 
   }
 
   }
 
  }
 
  }
Line 264: Line 269:
 
       "message": "Resource not found",  
 
       "message": "Resource not found",  
 
       "code": 404,  
 
       "code": 404,  
       "details": ""
+
       "details": "",
 +
      "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
 
   }
 
   }
 
  }
 
  }
Line 270: Line 276:
 
[[Category:Hostway API]]
 
[[Category:Hostway API]]
 
[[Category:FlexCloud Server API]]
 
[[Category:FlexCloud Server API]]
 
<!--  THIS CODE ENABLES DISQUS COMMENTS ON THE PAGE - DELETE TO DISABLE COMMENTING-->
 
 
{{#widget:DISQUS
 
|id=hostway
 
|uniqid={{PAGENAME}}
 
|url={{fullurl:{{PAGENAME}}}}
 
}}
 
 
<!--  ########################################################################### -->
 

Revision as of 07:13, 20 May 2013

This operation will upgrade the Plesk license for the specified Server.

Contents

POST /servers/id/action

Parameters

id
The unique identifier of the server.

Request

JSON

 {
    "upgradePlesk" : {
       "username": "{plesk_server_username}",
       "password": "{plesk_server_password}",
       "port_number": "{plesk_server_port}",
       "addon_textkey": "{plesk_addon_textkey}"
    }
 }

upgradePlesk

username - string
The username used for authentication for managing Plesk license.
password - string
The password used for authentication for managing Plesk license.
port_number - string
The port used for managing Plesk license.
addon_textkey - string
Plesk addon textkey to upgrade to.

Response Codes

Success
HTTP/1.1 202 Accepted : The request is accepted for processing.
Failure
HTTP/1.1 400 Bad Request : Check your parameter / Server not found
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 403 Forbidden : The server understood the request, but is refusing to fulfill it.
HTTP/1.1 404 Not Found : The resource does not exist.
HTTP/1.1 409 Conflict : The request could not be completed due to a conflict with the current state of the resource. / Wrong Addon TextKey

Examples

Successfully upgrade Plesk server license

POST http(s)://{api_server}/servers/test_server_0013/action

Request Headers:

   Content-Type:application/json
   Charset=UTF-8
   Authorization:Base64-encoded username & password string

Request Body:

{
   "upgradePlesk" : {
      "username": "plesk-username",
      "password": "plesk-password",
      "port_number": "12",
      "addon_textkey": "plesk.9.linux.powerpack"
   }
}

Response Code:

HTTP/1.1 202 Accepted

Failure while trying to upgrade Plesk while server is processing another task

POST http(s)://{api_server}/servers/test_server_0013/action

Request Headers:

   Content-Type:application/json
   Charset=UTF-8
   Authorization:Base64-encoded username & password string

Request Body:

{
   "upgradePlesk" : {
      "username": "plesk-username",
      "password": "plesk-password",
      "port_number": "12",
      "addon_textkey": "plesk.9.linux.powerpack"
   }
}

Response Code:

HTTP/1.1 409 Conflict

Response Body:

{
  "conflict": {
     "message": "PleskStillUpgrading", 
     "code": 409, 
     "details": "Some task is in processing for this instance. please wait for a while",
     "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
  }
}

Unauthorized access

POST http(s)://{api_server}/servers/test_server_0013/action

Request Headers:

   Content-Type:application/json
   Charset=UTF-8
   Authorization:Base64-encoded fake_authentication_string

Request Body:

{
   "upgradePlesk" : {
      "username": "plesk-username",
      "password": "plesk-password",
      "port_number": "12",
      "addon_textkey": "plesk.9.linux.powerpack"
   }
}

Response Code:

HTTP/1.1 401 Unauthorized

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.

Failure while trying to upgrade Plesk with an empty parameter body

POST http(s)://{api_server}/servers/test_server_0013/action

Request Headers:

   Content-Type:application/json
   Charset=UTF-8
   Authorization:Base64-encoded username & password string

Request Body:

{
   empty
}

Response Code:

HTTP/1.1 400 Bad Request

Response Body:

{
  "badRequest": {
     "message": "Bad Request", 
     "code": 400, 
     "details": "Multiple actions per request are not allowed",
     "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
  }
}

Failure while trying to upgrade Plesk with incorrect Plesk server credentials

POST http(s)://{api_server}/servers/test_server_0013/action

Request Headers:

   Content-Type:application/json
   Charset=UTF-8
   Authorization:Base64-encoded username & password string

Request Body:

{
   "upgradePlesk" : {
      "username": "fake-plesk-username",
      "password": "fake-plesk-password",
      "port_number": "12",
      "addon_textkey": "plesk.9.linux.powerpack"
   }
}

Response Code:

HTTP/1.1 403 Forbidden

Response Body:

{
  "forbidden": {
     "message": "WrongPleskAuthentication", 
     "code": 403, 
     "details": "Could not login to Plesk vm, check your VM login information",
     "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
  }
}

Failure while trying to upgrade Plesk for a non-existent port server

POST http(s)://{api_server}/servers/test_server_0013/action

Request Headers:

   Content-Type:application/json
   Charset=UTF-8
   Authorization:Base64-encoded username & password string

Request Body:

{
   "upgradePlesk" : {
      "username": "plesk-username",
      "password": "plesk-password",
      "port_number": "1222",
      "addon_textkey": "plesk.9.linux.powerpack"
   }
}

Response Code:

HTTP/1.1 403 Forbidden

Response Body:

{
  "forbidden": {
     "message": "WrongPleskAuthentication", 
     "code": 403, 
     "details": "Could not login to Plesk vm, check your VM login information",
     "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
  }
}

Failure while trying to upgrade Plesk for a non-existent Plesk addon textkey

POST http(s)://{api_server}/servers/test_server_0013/action

Request Headers:

   Content-Type:application/json
   Charset=UTF-8
   Authorization:Base64-encoded username & password string

Request Body:

{
   "upgradePlesk" : {
      "username": "plesk-username",
      "password": "plesk-password",
      "port_number": "12",
      "addon_textkey": "fake.plesk.addon.textkey"
   }
}

Response Code:

HTTP/1.1 409 Conflict

Response Body:

{
  "conflict": {
     "message": "WrongAddonTextkey", 
     "code": 409, 
     "details": "Please specify proper addon textkey",
     "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
  }
}

Failure while trying to upgrade Plesk for a non-existent Plesk server

POST http(s)://{api_server}/servers/fake_server_name/action

Request Headers:

   Content-Type:application/json
   Charset=UTF-8
   Authorization:Base64-encoded username & password string

Request Body:

{
   "upgradePlesk" : {
      "username": "plesk-username",
      "password": "plesk-password",
      "port_number": "12",
      "addon_textkey": "plesk.9.linux.powerpack"
   }
}

Response Code:

HTTP/1.1 404 Not Found

Response Body:

{
  "itemNotFound": {
     "message": "Resource not found", 
     "code": 404, 
     "details": "",
     "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
  }
}
Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox