Previous page

Next page

Locate page in Contents

Print this page

allocate

Summary:

Allocates a resource from a resource pool.

Request specification:

Name

Min/Max

Type

Description

allocate

1..1

 

 

{

 

 

 

resource_pool

0..1

resource_poolType

Use this element to specify the type of the resource pool.

resource

0..1

resourceType

The resource to allocate (e.g. IP address). If this element is omitted, the resource will be allocated automatically from those available in the pool.

Use the appropriate subtype of resourceType to match the resource type specified in the resource_pool element.

count

0..1

int

Number of resource items to allocate. If not specified, one item will be allocated.

}

 

 

 

Returns:

Name

Min/Max

Type

Description

resource

1..1

resourceType

The allocated resource information.

Description:

Use the allocate call to allocate a resource from a resource pool. You can allocate a specific resource (for example, a specific IP address) or you can get the next available resource by omitting the resource element. Once the resource is allocated, you can use it in your application. For example, after you allocate an IP address, you can assign it to a server.

Example 1:

The following example shows how to allocate a specific IP address from the IP address pool.

Input

<packet xmlns:ns2="http://www.swsoft.com/webservices/vzl/4.0.0/resourcem" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="4.0.0">

<target>resourcem</target>

<data>

<resourcem>

<allocate>

<resource_pool xsi:type="ns2:resource_ip_poolType">

<type>resource_ip</type>

</resource_pool>

<resource xsi:type="ns2:resource_ipType">

<ip>10.17.3.127</ip>

</resource>

</allocate>

</resourcem>

</data>

</packet>

Output

<?xml version="1.0" encoding="UTF-8"?><ns1:packet xmlns:ns2="http://www.swsoft.com/webservices/vzl/4.0.0/resourcem" xmlns:ns1="http://www.swsoft.com/webservices/vzl/4.0.0/protocol" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="3ac45ffded6t6b89r4e4" time="2007-03-15T23:40:55+0000" priority="0" version="4.0.0">

<ns1:origin>resourcem</ns1:origin>

<ns1:target>vzclient8</ns1:target>

<ns1:dst>

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

</ns1:dst>

<ns1:data>

<ns2:resourcem>

<ns2:resource xsi:type="ns2:resource_ipType">

<ns2:ip>10.17.3.127</ns2:ip>

</ns2:resource>

</ns2:resourcem>

</ns1:data>

<ns1:src>

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

</ns1:src>

</ns1:packet>

Example 2:

Automatically allocating an IP address from the IP address pool.

Input

<packet xmlns:ns2="http://www.swsoft.com/webservices/vzl/4.0.0/resourcem" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="4.0.0">

<target>resourcem</target>

<data>

<resourcem>

<allocate>

<resource_pool xsi:type="ns2:resource_ip_poolType">

<type>resource_ip</type>

</resource_pool>

</allocate>

</resourcem>

</data>

</packet>

Output

<?xml version="1.0" encoding="UTF-8"?><ns1:packet xmlns:ns2="http://www.swsoft.com/webservices/vzl/4.0.0/resourcem" xmlns:ns1="http://www.swsoft.com/webservices/vzl/4.0.0/protocol" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="43c45ffe196t22eer4e4" time="2007-03-15T23:48:49+0000" priority="0" version="4.0.0">

<ns1:origin>resourcem</ns1:origin>

<ns1:target>vzclient8</ns1:target>

<ns1:dst>

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

</ns1:dst>

<ns1:data>

<ns2:resourcem>

<ns2:resource xsi:type="ns2:resource_ipType">

<ns2:ip>10.17.3.126</ns2:ip>

</ns2:resource>

</ns2:resourcem>

</ns1:data>

<ns1:src>

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

</ns1:src>

</ns1:packet>

Please send us your feedback on this help page