ServerActionUpgradePlesk
Mike.robski (Talk | contribs) |
Mike.robski (Talk | contribs) m (1 revision: Release 86) |
||
(4 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''' /accounts/''{accountId}''/flexcloud/servers/''{id}''/action= |
+ | |||
+ | == Parameters == | ||
+ | ; accountId - ''string'' | ||
+ | : The selected account Id. | ||
+ | |||
; id | ; id | ||
: The unique identifier of the server. | : The unique identifier of the server. | ||
− | + | == Request== | |
− | + | === JSON === | |
<nowiki> | <nowiki> | ||
{ | { | ||
Line 18: | Line 22: | ||
}</nowiki> | }</nowiki> | ||
− | + | ====upgradePlesk==== | |
; username - ''string'' | ; username - ''string'' | ||
: The username used for authentication for managing Plesk license. | : The username used for authentication for managing Plesk license. | ||
Line 31: | Line 35: | ||
: Plesk addon textkey to upgrade to. | : Plesk addon textkey to upgrade to. | ||
− | + | == 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 42: | Line 46: | ||
: ''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 == | |
'''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 65: | 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 90: | 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 123: | 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 143: | 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 173: | 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 203: | 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 233: | 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 263: | 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" | ||
+ | } | ||
+ | } | ||
+ | |||
+ | == 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]]. | ||
+ | |||
+ | <code>POST /servers/{id}/action</code> | ||
+ | |||
+ | [[Category:Hostway API]] | ||
+ | [[Category:FlexCloud Server API]] |
Latest revision as of 12:00, 11 October 2013
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