ServerActionUpgradePlesk

From Hostway API Documentation
(Difference between revisions)
Jump to: navigation, search
(Created page with "This operation will upgrade the Plesk license for the specified server. ='''POST''' /servers/'''id'''/action= == Parameters == ; id : The unique identifier of the server...")
 
m (1 revision: Release 86)
 
(7 intermediate revisions by 3 users not shown)
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''' /accounts/''{accountId}''/flexcloud/servers/''{id}''/action=
  
 
== Parameters ==
 
== Parameters ==
 +
; accountId - ''string''
 +
: The selected account Id.
 +
 
; id
 
; id
 
: The unique identifier of the server.
 
: The unique identifier of the server.
Line 45: Line 48:
 
== 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}/accounts/{accountId}/flexcloud/servers/test_server_0013/action
  
 
''Request Headers:''
 
''Request Headers:''
Line 66: Line 69:
  
 
'''Failure while trying to upgrade Plesk while server is processing another task'''
 
'''Failure while trying to upgrade Plesk while server is processing another task'''
:'''POST''' http(s)://{api_server}/servers/test_server_0013/action
+
:'''POST''' http(s)://{api_server}/accounts/{accountId}/flexcloud/servers/test_server_0013/action
  
 
''Request Headers:''
 
''Request Headers:''
Line 91: Line 94:
 
       "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"
 
   }
 
   }
 
  }
 
  }
  
 
'''Unauthorized access'''
 
'''Unauthorized access'''
:'''POST''' http(s)://{api_server}/servers/test_server_0013/action
+
:'''POST''' http(s)://{api_server}/accounts/{accountId}/flexcloud/servers/test_server_0013/action
  
 
''Request Headers:''
 
''Request Headers:''
Line 124: Line 128:
  
 
'''Failure while trying to upgrade Plesk with an empty parameter body'''
 
'''Failure while trying to upgrade Plesk with an empty parameter body'''
:'''POST''' http(s)://{api_server}/servers/test_server_0013/action
+
:'''POST''' http(s)://{api_server}/accounts/{accountId}/flexcloud/servers/test_server_0013/action
  
 
''Request Headers:''
 
''Request Headers:''
Line 144: Line 148:
 
       "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"
 
   }
 
   }
 
  }
 
  }
  
 
'''Failure while trying to upgrade Plesk with incorrect Plesk server credentials'''
 
'''Failure while trying to upgrade Plesk with incorrect Plesk server credentials'''
:'''POST''' http(s)://{api_server}/servers/test_server_0013/action
+
:'''POST''' http(s)://{api_server}/accounts/{accountId}/flexcloud/servers/test_server_0013/action
  
 
''Request Headers:''
 
''Request Headers:''
Line 174: Line 179:
 
       "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"
 
   }
 
   }
 
  }
 
  }
  
 
'''Failure while trying to upgrade Plesk for a non-existent port server'''
 
'''Failure while trying to upgrade Plesk for a non-existent port server'''
:'''POST''' http(s)://{api_server}/servers/test_server_0013/action
+
:'''POST''' http(s)://{api_server}/accounts/{accountId}/flexcloud/servers/test_server_0013/action
  
 
''Request Headers:''
 
''Request Headers:''
Line 204: Line 210:
 
       "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"
 
   }
 
   }
 
  }
 
  }
  
 
'''Failure while trying to upgrade Plesk for a non-existent Plesk addon textkey'''
 
'''Failure while trying to upgrade Plesk for a non-existent Plesk addon textkey'''
:'''POST''' http(s)://{api_server}/servers/test_server_0013/action
+
:'''POST''' http(s)://{api_server}/accounts/{accountId}/flexcloud/servers/test_server_0013/action
  
 
''Request Headers:''
 
''Request Headers:''
Line 234: Line 241:
 
       "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"
 
   }
 
   }
 
  }
 
  }
  
 
'''Failure while trying to upgrade Plesk for a non-existent Plesk server'''
 
'''Failure while trying to upgrade Plesk for a non-existent Plesk server'''
:'''POST''' http(s)://{api_server}/servers/<span style="color:red">fake_server_name</span>/action
+
:'''POST''' http(s)://{api_server}/accounts/{accountId}/flexcloud/servers/<span style="color:red">fake_server_name</span>/action
  
 
''Request Headers:''
 
''Request Headers:''
Line 264: Line 272:
 
       "message": "Resource not found",  
 
       "message": "Resource not found",  
 
       "code": 404,  
 
       "code": 404,  
       "details": ""
+
       "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/<span style="color:red">fake_account</span>/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:''
 +
<pre>HTTP/1.1 404 Not Found</pre>
 +
 +
''Response Body:''
 +
{
 +
  "itemNotFound": {
 +
      "message": "Resource not found",
 +
      "code": 404,
 +
      "details": "",
 +
      "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
 +
  }
 +
}
  
<!--  THIS CODE ENABLES DISQUS COMMENTS ON THE PAGE - DELETE TO DISABLE COMMENTING-->
+
== 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 [[Authentication|authorization header]].
  
{{#widget:DISQUS
+
<code>POST /servers/{id}/action</code>
|id=hostway
+
|uniqid={{PAGENAME}}
+
|url={{fullurl:{{PAGENAME}}}}
+
}}
+
  
<!--  ########################################################################### -->
+
[[Category:Hostway API]]
 +
[[Category:FlexCloud Server API]]

Latest revision as of 11:00, 11 October 2013

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

Contents

[edit] POST /accounts/{accountId}/flexcloud/servers/{id}/action

[edit] Parameters

accountId - string
The selected account Id.
id
The unique identifier of the server.

[edit] Request

[edit] JSON

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

[edit] 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.

[edit] 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

[edit] 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"
  }
}

[edit] 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