ServerActionUpgradePlesk

From Hostway API Documentation
Jump to: navigation, search

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

Contents

POST /accounts/{accountId}/flexcloud/servers/{id}/action

Parameters

accountId - string
The selected account Id.
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}/accounts/{accountId}/flexcloud/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}/accounts/{accountId}/flexcloud/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}/accounts/{accountId}/flexcloud/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}/accounts/{accountId}/flexcloud/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}/accounts/{accountId}/flexcloud/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}/accounts/{accountId}/flexcloud/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}/accounts/{accountId}/flexcloud/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}/accounts/{accountId}/flexcloud/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"
  }
}

Failure while trying to upgrade Plesk for a non-existent Plesk server with invalid account number

POST http(s)://{api_server}/accounts/fake_account/flexcloud/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 404 Not Found

Response Body:

{
  "itemNotFound": {
     "message": "Resource not found", 
     "code": 404, 
     "details": "",
     "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
  }
}

Alternative URI /servers/{id}/action

An alternative way to execute this call is to omit the accountId portion of the URI. In this case the system assumes the request is executed for the account identified in the authorization header.

POST /servers/{id}/action

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox