Execute Commands on Server

Description

Use this request to execute commands directly from a virtual server as if you are logged in. You need to supply the arguments to define what and how to execute.

Syntax

POST baseURL/of/{customer_id}/ve/{ve_name}/exec

Request Parameters

Element

Attribute

Description

run-program

 

Container for information about the commands.

command

 

Command to be executed on the server.

Type: string

args

 

Container for list of arguments.

Type: string

arg

 

Argument of the command to be executed on the server.

Type: string

Response

Exec in VE has been initiated.

Example

The following example executes the sh command on a virtual server.

Request

POST https://c2u-web:4465/paci/v1.0/of/1000002/ve/Web60/exec

Request Body

For Linux:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<run-program>
  <command>sh</command>
	<args>
	  <arg>-c</arg>
	  <arg>ls</arg>
	</args>
</run-program>

For Windows:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<run-program>
  <command>cmd</command>
   <args>
     <arg>/c</arg>
     <arg>tasklist</arg>
   </args>
</run-program>

Response

Exec in VE has been initiated