Previous page

Next page

Locate page in Contents

Print this page

execute

Summary:

Executes a program on a server.

Request specification:

Name

Min/Max

Type

Description

execute

 

 

 

{

 

 

 

argv

0..[]

base64Binary

Program name and expected arguments in proper order.

envp

0..[]

base64Binary

Definitions of the OS environment variables used by the program (if any).

cred

1..1

 

Execute the program as user specified here. By default, the default administrative account will be used (e.g. root).

{

 

 

 

[

 

 

Specify either the user name or the user ID.

user

0..1

string

User name.

uid

0..1

long

Linux User ID.

]

 

 

 

[

 

 

Specify either the group name or the group ID.

group

0..[]

string

Group name. You may specify more than one group. If you do, the first group will be set as the effective group, the others will be set as supplementary groups. The supplementary group list will affect all of the new elements.

gid

0..[]

long

Linux Group id.

NOTE: There are no dedicated operations to get a group ID by its name. Therefore, do not use this parameter if you're not sure it is correct. If it is wrong, the entire operation will be canceled.

]

 

 

 

chroot

0..1

base64Binary

Linux Run command or interface shell with root directory set to the value specified here (same as chroot Linux command).

chdir

0..1

base64Binary

Change working directory.

umask

0..1

int

Operation umask.

}

 

 

 

stdio

0..1

 

Standard input/output options.

{

 

 

 

input

0..1

base64Binary

Program input.

output

0..1

none

Include this element to report standard program output.

error

0..1

none

Include this element to report program error output.

mixed

0..1

none

Include this element to report mixed output.

}

 

 

 

}

 

 

 

Returns:

Name

Min/Max

Type

Description

exec

0..1

 

The program execution results.

{

 

 

 

status

1..1

int

Execution status. Will contain 0 (zero) on success or non-zero value on error.

output

0..1

base64Binary

Program standard output.

error

0..1

base64Binary

Program error output.

}

 

 

 

Example:

Executing the ls command inside a Linux-based Virtuozzo Container.

Input

<packet version="4.0.0">

<dst>

<host>37ea79c2-3565-0e43-887f-91d4678c843e</host>

</dst>

<target>processm</target>

<data>

<processm>

<execute>

<argv>bHM=</argv>

<cred>

<chroot>/</chroot>

</cred>

<stdio>

<output/>

<error/>

</stdio>

</execute>

</processm>

</data>

</packet>

Output

<?xml version="1.0" encoding="UTF-8"?><ns1:packet xmlns:ns1="http://www.swsoft.com/webservices/vzl/4.0.0/protocol" xmlns:ns2="http://www.swsoft.com/webservices/vzl/4.0.0/processm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" type="0" id="4fc4631f282t2350re14" time="2007-04-27T00:55:52+0000" priority="0" version="4.0.0">

<ns1:origin>37ea79c2-3565-0e43-887f-91d4678c843e</ns1:origin>

<ns1:dst>

<ns1:director>gend</ns1:director>

<ns1:target>vzclient3</ns1:target>

</ns1:dst>

<ns1:data>

<ns2:processm>

<ns2:exec>

<ns2:status>0</ns2:status>

<ns2:output>YmluCmJvb3QKZGV2CmV0Ywpob21lCmluaXRyZApsaWIKbW50Cm9wdApwcm9jCnJvb3QKc2Jpbgp0bXAKdXNyCnZhcgp+dnphZ2VudDAK</ns2:output>

<ns2:error></ns2:error>

</ns2:exec>

</ns2:processm>

</ns1:data>

<ns1:src>

<ns1:director>vpsd</ns1:director>

<ns1:target>processm</ns1:target>

</ns1:src>

<ns1:target>vzclient3</ns1:target>

</ns1:packet>

If you decode the data contained in the output element, you'll get the requested root directory listing:

bin

boot

dev

etc

home

initrd

lib

mnt

opt

proc

root

sbin

tmp

usr

var

Please send us your feedback on this help page