cancel
Showing results for 
Search instead for 
Did you mean: 

Problem this snippet solves:

This Perl client code sample uses the iControl Proxy to retrieve the platform version for each device managed by the referenced Enterprise Manager.

Code :

# Query devices from EM.
$resp = $soap->uri('urn:iControl:Management/EM')->get_devices();

# Get the device list.
my $device_list = $resp->result;

# Get a context ID.
$resp = $soap->uri("urn:iControl:Management/EM")->get_context_id();
my $context_id = $resp->result;

# Append context ID to SOAP URI.
$proxy_uri = sprintf("%s?context_id=%s", $proxy_uri, $context_id);
$soap = SOAP::Lite->proxy($proxy_uri);

# Iterate through the device list.
foreach (@{$device_list}) {

    # Get current device address.
    my $device = $_;

    # Set device context.
    $resp = $soap->uri("urn:iControl:Management/EM")->
        set_device_context(SOAP::Data->name("ip_address" => $device));

    # Get platform version from device.
    $resp = $soap->uri("urn:iControl:System/SystemInfo")->get_version();
}
Version history
Last update:
‎07-Mar-2015 16:34
Updated by:
Contributors