T
Tomasz Chmielewski
My hosting provider lets me change the IP assigned to each of the servers (IP failover).
It can be done in the web interface, but in reality, it's much better to do this automatically with Heartbeat as it detects that one of the servers is down.
For that, there is some Perl code using SOAP::Lite - but I'm not sure how I can get the values out of it to use them in my own code.
my $result = $soap->call( 'dedicatedFailoverList' => ($session, $hosts{$hostname}) );
my $return = $result->result();
Now, Data:umper would return this - I'd like to access the values through a hash, array, variable, but I' not sure how:
print $return;
MyArrayOfDedicatedFailoverStructType=ARRAY(0x25608d8)
print Dumper $return;
$VAR1 = bless( [
bless( {
'routedTo' => 'aaa.bbb.ccc.ddd',
'comment' => 'webserver failover',
'ip' => '1.1.1.1',
'ssl' => 0
}, 'dedicatedFailoverStruct' ),
bless( {
'routedTo' => 'aaa.bbb.ccc.ddd',
'comment' => 'webserver failover',
'ip' => '2.2.2.2',
'ssl' => 0
}, 'dedicatedFailoverStruct' ),
bless( {
'routedTo' => 'aaa.bbb.ccc.ddd',
'comment' => 'webserver failover',
'ip' => '3.3.3.3',
'ssl' => 0
}, 'dedicatedFailoverStruct' ),
bless( {
'routedTo' => 'aaa.bbb.ccc.ddd',
'comment' => 'webserver failover',
'ip' => '4.4.4.4',
'ssl' => 0
}, 'dedicatedFailoverStruct' ),
bless( {
'routedTo' => undef,
'comment' => undef,
'ip' => undef,
'ssl' => 0
}, 'dedicatedFailoverStruct' )
], 'MyArrayOfDedicatedFailoverStructType' );
It can be done in the web interface, but in reality, it's much better to do this automatically with Heartbeat as it detects that one of the servers is down.
For that, there is some Perl code using SOAP::Lite - but I'm not sure how I can get the values out of it to use them in my own code.
my $result = $soap->call( 'dedicatedFailoverList' => ($session, $hosts{$hostname}) );
my $return = $result->result();
Now, Data:umper would return this - I'd like to access the values through a hash, array, variable, but I' not sure how:
print $return;
MyArrayOfDedicatedFailoverStructType=ARRAY(0x25608d8)
print Dumper $return;
$VAR1 = bless( [
bless( {
'routedTo' => 'aaa.bbb.ccc.ddd',
'comment' => 'webserver failover',
'ip' => '1.1.1.1',
'ssl' => 0
}, 'dedicatedFailoverStruct' ),
bless( {
'routedTo' => 'aaa.bbb.ccc.ddd',
'comment' => 'webserver failover',
'ip' => '2.2.2.2',
'ssl' => 0
}, 'dedicatedFailoverStruct' ),
bless( {
'routedTo' => 'aaa.bbb.ccc.ddd',
'comment' => 'webserver failover',
'ip' => '3.3.3.3',
'ssl' => 0
}, 'dedicatedFailoverStruct' ),
bless( {
'routedTo' => 'aaa.bbb.ccc.ddd',
'comment' => 'webserver failover',
'ip' => '4.4.4.4',
'ssl' => 0
}, 'dedicatedFailoverStruct' ),
bless( {
'routedTo' => undef,
'comment' => undef,
'ip' => undef,
'ssl' => 0
}, 'dedicatedFailoverStruct' )
], 'MyArrayOfDedicatedFailoverStructType' );