Forum Discussion
Ross_79170
Dec 28, 2011Nimbostratus
System.VCMP.VCMPCompletionStatus structure
Hi Chaps
I hope you are all well.
I am doing some work using iControl on perl (SOAP::Lite) to create vCMP instances and am a bit stuck with accessing the data structure returned by System.VCMP.get_completion_status.
I can see it clearly using Data::Dumper, but cant seem to get the code right to be able to access the hash elements.
$VAR1 = [
bless( [
bless( {
'request_complete' => 'true',
'comment' => '',
'status' => 'VCMP_STATUS_RUNNING',
'requested_state' => 'VCMP_GUEST_STATE_DEPLOYED',
'slot_id' => 1
}, 'System::VCMP::VCMPCompletionStatus' )
], 'System::VCMP::VCMPCompletionStatus[]' )
];
Could anybody suggest an example?
Many thanks!
Ross
- Mark_Worrell_98Historic F5 AccountHere's a perl example that should get you going:
- Mark_Worrell_98Historic F5 AccountLet's try that again and see if the system will preserve the indentation:
- hooleylistCirrostratusHi Mark,
- Mark_Worrell_98Historic F5 AccountThanks! Let's see how this looks:
@list = @{$soap_response->result}; foreach $guest (0 .. $list) { $ref = $list[$guest]; $n = @$ref - 1; printf(STDOUT "Guest: %s\n", $opt_n); foreach $slot (0 .. $n) { $foo = $list[$guest][$slot]; $slot_id = $foo->{"slot_id"}; $requested_state = $foo->{"requested_state"}; $request_complete = $foo->{"request_complete"}; $status = $foo->{"status"}; $comment = $foo->{"comment"}; printf(STDOUT "Slot ID: %s\n", $slot_id); printf(STDOUT "Requested State: %s\n", $requested_state); printf(STDOUT "Request Complete: %s\n", $request_complete); printf(STDOUT "Status: %s\n", $status); printf(STDOUT "Comment: %s\n", $comment); } }
- Mark_Worrell_98Historic F5 AccountOne more shot with spaces...
@list = @{$soap_response->result}; foreach $guest (0 .. $list) { $ref = $list[$guest]; $n = @$ref - 1; printf(STDOUT "Guest: %s\n", $opt_n); foreach $slot (0 .. $n) { $foo = $list[$guest][$slot]; $slot_id = $foo->{"slot_id"}; $requested_state = $foo->{"requested_state"}; $request_complete = $foo->{"request_complete"}; $status = $foo->{"status"}; $comment = $foo->{"comment"}; printf(STDOUT "Slot ID: %s\n", $slot_id); printf(STDOUT "Requested State: %s\n", $requested_state); printf(STDOUT "Request Complete: %s\n", $request_complete); printf(STDOUT "Status: %s\n", $status); printf(STDOUT "Comment: %s\n", $comment); } }
- Ross_79170NimbostratusThat's Perfect.
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects