Brocade Virtual ADX XML API Programmer’s Guide (Supporting ADX v03.1.00) User Manual

Page 827

Advertising
background image

Brocade Virtual ADX XML API Programmer’s Guide

817

53-1003248-01

Example: Adding and binding a real server and a VIP

B

# Get the elapsed time (Time taken for the SOAP Response to arrive after the

request was sent)

$response_time = &get_elapsed_time($request_time);

# Write the Time taken to the Test Case LOG File

print LOG "SOAP Response Time for Creating the Real Server Port:

$response_time\n";

print LOG "===== Operation Complete =====\n\n";

#### Create a Virtual Server ####

#################################

# Build the SOAP Request Message with the XML Context and Header

@slbsoap_body = (name('configurationInfo')->value([

name('VirtualServerConfigurationSequence')->value([

name('virtualServer')->value([

name('IP')->value('222.22.2.1'),

name('Name')->value('VirtualServer-001')

])

])

]));

print LOG "Creating Virtual Server\n";

# Note the time before making a SOAP Request

$request_time = &start_timer;

# Make the SOAP Call and store the XML result in a variable

# Response is stored in "$xml_result" as XML. Further action can be taken based on

the Response Content.

$xml_result =

$slbsoap->call('urn:createVirtualServerWithConfiguration',@slbsoap_body,$slbsoap_

header);

# Get the elapsed time (Time taken for the SOAP Response to arrive after the

request was sent)

$response_time = &get_elapsed_time($request_time);

# Write the Time taken to the Test Case LOG File

print LOG "SOAP Response Time for Creating the Virtual Server:

$response_time\n";

print LOG "===== Operation Complete =====\n\n";

#### Create a Virtual Server Port ####

######################################

# Build the SOAP Request Message with the XML Context and Header

@slbsoap_body = (name('configurationInfo')->value([

name('VirtualServerPortConfigurationSequence')->value([

name('port')->value([

name('NameOrNumber')->value('http')

]),

name('virtualServer')->value([

name('IP')->value('222.22.2.1'),

name('Name')->value('VirtualServer-001')

])

])

]));

print LOG "Creating Virtual Server Port\n";

# Note the time before making a SOAP Request

$request_time = &start_timer;

Advertising