Previous page

Next page

Locate page in Contents

Print this page

connect

Summary:

Establishes an exclusive connection with a remote Agent.

Request specification:

Name

Min/Max

Type

Description

connect

 

 

 

{

 

 

 

conn_info

1..1

connection_infoType

The remote server connection information.

}

 

 

 

Returns:

Name

Min/Max

Type

Description

id

0..1

string

The ID of the connection that was established to the remote server. When sending requests to the remote server, use this ID as the value of the target parameter in the message header. The target Agent operator must be supplied using the dst/target parameter (see code examples below).

Description:

The connect call allows to establish an exclusive connection between the Agent that you are currently connected to and the Agent installed on a remote server. The connection can then be used to route the messages from the current server to the remote server. Once the connection is established, it can be used infinitely with one exception. The connection times out and closes automatically in 10 minutes of inactivity. To keep the connection open without actually using it, it is enough to ping the remote server over it periodically using the ping call. When the connection is no longer needed, use close to terminate it.

Example:

Establishing an exclusive connection with the specified remote Agent.

Input

<packet version="4.0.0">

<data>

<system>

<connect>

<conn_info>

<protocol>SSL</protocol>

<address>192.168.0.84</address>

<login>

<name>cm9vdA==</name>

<realm>00000000-0000-0000-0000-000000000000</realm>

</login>

<password>bXlwYXNz</password>

<port>4434</port>

</conn_info>

</connect>

</system>

</data>

</packet>

Output

The output contains the connection ID.

<?xml version="1.0" encoding="UTF-8"?><ns1:packet xmlns:ns2="http://www.swsoft.com/webservices/vzl/4.0.0/system" xmlns:ns1="http://www.swsoft.com/webservices/vzl/4.0.0/protocol" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="21c466e9712t41bbra18" priority="0" version="4.0.0">

<ns1:origin>gend</ns1:origin>

<ns1:target>vzclient5-638a2a56-e689-c340-877d-bd0470f2448c</ns1:target>

<ns1:dst>

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

</ns1:dst>

<ns1:data>

<ns1:system>

<ns2:id>192.168.0.841</ns2:id>

</ns1:system>

</ns1:data>

</ns1:packet>

The returned connection ID can be used to send Agent requests to the remote server as shown in the following example.

Input

Retrieving a list of Virtuozzo Containers from the remote server. In order to route the messages to the remote server, the target element contains the connection ID that we obtained in the previous step. The dst/target element contains the name of the target Agent operator (the vzaenvm operator in our case). The data element is composed in a usual manner.

<packet version="4.0.0">

<target>192.168.0.841</target>

<dst>

<target>vzaenvm</target>

</dst>

<data>

<vzaenvm>

<get_list/>

</vzaenvm>

</data>

</packet>

The following example pings the remote server over the exclusive connection that we established earlier. Doing so will reset the timeout timer and will keep the connection open.

Input

<packet version="4.0.0">

<target>192.168.0.841</target>

<data>

<system>

<ping/>

</system>

</data>

</packet>

Please send us your feedback on this help page