ServerActionUpgradePlesk

(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
 +
=='''POST''' /servers/'''id'''/action==
 
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=
+
=== 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 18:
 
  }</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 31:
 
: 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 42:
 
: ''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 268: Line 267:
 
  }
 
  }
  
 
+
[[Category:Hostway API]]
[[Category:API]]
+
[[Category:FlexCloud Server API]]
  
 
<!--  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 16:45, 14 December 2012

Contents

POST /servers/id/action

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

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"
  }
}

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"
  }
}

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"
  }
}

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"
  }
}

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"
  }
}

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": ""
  }
}


blog comments powered by Disqus


Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox