update doc

This commit is contained in:
Shini31 2016-06-08 11:29:31 +02:00
parent d9ff13b745
commit fe9832dfb0
8 changed files with 64 additions and 36 deletions

View File

@ -55,7 +55,6 @@ sub new {
"password:s" => { name => 'password' },
"ssl:s" => { name => 'ssl', },
"header:s@" => { name => 'header' },
"exclude:s" => { name => 'exclude' },
"timeout:s" => { name => 'timeout' },
"tenant-id:s" => { name => 'tenant_id' },
"hypervisor-id:s" => { name => 'hypervisor_id' },
@ -254,14 +253,16 @@ Specify SSL version (example : 'sslv3', 'tlsv1'...)
Set HTTP headers (Multiple option. Example: --header='Content-Type: xxxxx')
=item B<--exlude>
Exclude specific instance's state (comma seperated list) (Example: --exclude=Paused,Running,Off,Exited)
=item B<--timeout>
Threshold for HTTP timeout (Default: 3)
=item B<--threshold-overload>
Set to overload default threshold values (syntax: section,status,regexp)
It used before default thresholds (order stays).
Example: --threshold-overload='status,WARNING,^down$)'
=back
OPENSTACK OPTIONS:
@ -272,6 +273,10 @@ OPENSTACK OPTIONS:
Set Tenant's ID
=item B<--hypervisor-id>
Set Hypervisor's ID
=back
=cut

View File

@ -63,7 +63,6 @@ sub new {
"password:s" => { name => 'password' },
"ssl:s" => { name => 'ssl', },
"header:s@" => { name => 'header' },
"exclude:s" => { name => 'exclude' },
"timeout:s" => { name => 'timeout' },
"tenant-id:s" => { name => 'tenant_id' },
"instance-id:s" => { name => 'instance_id' },
@ -198,7 +197,7 @@ __END__
=head1 MODE
List OpenStack instances through Compute API V2
Monitor instance status through Compute API V2
JSON OPTIONS:
@ -262,14 +261,16 @@ Specify SSL version (example : 'sslv3', 'tlsv1'...)
Set HTTP headers (Multiple option. Example: --header='Content-Type: xxxxx')
=item B<--exlude>
Exclude specific instance's state (comma seperated list) (Example: --exclude=Paused,Running,Off,Exited)
=item B<--timeout>
Threshold for HTTP timeout (Default: 3)
=item B<--threshold-overload>
Set to overload default threshold values (syntax: section,status,regexp)
It used before default thresholds (order stays).
Example: --threshold-overload='status,CRITICAL,^STOPPED$)'
=back
OPENSTACK OPTIONS:
@ -280,6 +281,10 @@ OPENSTACK OPTIONS:
Set Tenant's ID
=item B<--instance-id>
Set Instance's ID
=back
=cut

View File

@ -254,7 +254,7 @@ Set HTTP headers (Multiple option. Example: --header='Content-Type: xxxxx')
=item B<--exlude>
Exclude specific instance's state (comma seperated list) (Example: --exclude=Paused,Running,Off,Exited)
Exclude specific instance's state (comma seperated list) (Example: --exclude=disabled)
=item B<--timeout>

View File

@ -139,6 +139,7 @@ sub api_request {
}
my $instancename = $val->{name};
$self->{instance_infos}->{$instancename}->{id} = $val->{id};
$self->{instance_infos}->{$instancename}->{zone} = $val->{'OS-EXT-AZ:availability_zone'};
$self->{instance_infos}->{$instancename}->{compute} = $val->{'OS-EXT-SRV-ATTR:host'};
$self->{instance_infos}->{$instancename}->{osname} = $val->{'OS-EXT-SRV-ATTR:instance_name'};
$self->{instance_infos}->{$instancename}->{state} = $instancestate;
@ -148,7 +149,7 @@ sub api_request {
sub disco_format {
my ($self, %options) = @_;
my $names = ['name', 'id', 'compute', 'osname', 'state'];
my $names = ['name', 'id', 'zone', 'compute', 'osname', 'state'];
$self->{output}->add_disco_format(elements => $names);
}
@ -161,6 +162,7 @@ sub disco_show {
foreach my $instancename (keys %{$self->{instance_infos}}) {
$self->{output}->add_disco_entry(name => $instancename,
id => $self->{instance_infos}->{$instancename}->{id},
zone => $self->{instance_infos}->{$instancename}->{zone},
compute => $self->{instance_infos}->{$instancename}->{compute},
osname => $self->{instance_infos}->{$instancename}->{osname},
state => $self->{instance_infos}->{$instancename}->{state},
@ -175,9 +177,10 @@ sub run {
$self->api_request();
foreach my $instancename (keys %{$self->{instance_infos}}) {
$self->{output}->output_add(long_msg => sprintf("%s [id = %s , compute = %s, osname = %s, state = %s]",
$self->{output}->output_add(long_msg => sprintf("%s [id = %s, zone = %s, compute = %s, osname = %s, state = %s]",
$instancename,
$self->{instance_infos}->{$instancename}->{id},
$self->{instance_infos}->{$instancename}->{zone},
$self->{instance_infos}->{$instancename}->{compute},
$self->{instance_infos}->{$instancename}->{osname},
$self->{instance_infos}->{$instancename}->{state}));

View File

@ -125,6 +125,7 @@ sub api_request {
foreach my $val (@{$webcontent->{volumes}}) {
my $volumename = $val->{name};
$self->{volumes_infos}->{$volumename}->{id} = $val->{id};
$self->{volumes_infos}->{$volumename}->{zone} = $val->{availability_zone};
$self->{volumes_infos}->{$volumename}->{size} = $val->{size};
$self->{volumes_infos}->{$volumename}->{type} = $val->{ivolume_type};
$self->{volumes_infos}->{$volumename}->{state} = $val->{status};
@ -134,7 +135,7 @@ sub api_request {
sub disco_format {
my ($self, %options) = @_;
my $names = ['name', 'id', 'type', 'size', 'state'];
my $names = ['name', 'id', 'zone', 'type', 'size', 'state'];
$self->{output}->add_disco_format(elements => $names);
}
@ -147,6 +148,7 @@ sub disco_show {
foreach my $volumename (keys %{$self->{volumes_infos}}) {
$self->{output}->add_disco_entry(name => $volumename,
id => $self->{volumes_infos}->{$volumename}->{id},
zone => $self->{volumes_infos}->{$volumename}->{zone},
size => $self->{volumes_infos}->{$volumename}->{size}."Gb",
type => $self->{volumes_infos}->{$volumename}->{type},
state => $self->{volumes_infos}->{$volumename}->{state},
@ -161,9 +163,10 @@ sub run {
$self->api_request();
foreach my $volumename (keys %{$self->{volumes_infos}}) {
$self->{output}->output_add(long_msg => sprintf("%s [id = %s , size = %sGb, type = %s, state = %s]",
$self->{output}->output_add(long_msg => sprintf("%s [id = %s, zone = %s, size = %sGb, type = %s, state = %s]",
$volumename,
$self->{volumes_infos}->{$volumename}->{id},
$self->{volumes_infos}->{$volumename}->{zone},
$self->{volumes_infos}->{$volumename}->{size},
$self->{volumes_infos}->{$volumename}->{type},
$self->{volumes_infos}->{$volumename}->{state}));
@ -184,7 +187,7 @@ __END__
=head1 MODE
List OpenStack instances through Compute API V2
List OpenStack volumes through Block Storage API V2
JSON OPTIONS:

View File

@ -57,7 +57,6 @@ sub new {
"password:s" => { name => 'password' },
"ssl:s" => { name => 'ssl', },
"header:s@" => { name => 'header' },
"exclude:s" => { name => 'exclude' },
"timeout:s" => { name => 'timeout' },
"network-id:s" => { name => 'network_id' },
"threshold-overload:s@" => { name => 'threshold_overload' },
@ -255,23 +254,25 @@ Specify SSL version (example : 'sslv3', 'tlsv1'...)
Set HTTP headers (Multiple option. Example: --header='Content-Type: xxxxx')
=item B<--exlude>
Exclude specific instance's state (comma seperated list) (Example: --exclude=Paused,Running,Off,Exited)
=item B<--timeout>
Threshold for HTTP timeout (Default: 3)
=item B<--threshold-overload>
Set to overload default threshold values (syntax: section,status,regexp)
It used before default thresholds (order stays).
Example: --threshold-overload='status,CRITICAL,^BUILD$)'
=back
OPENSTACK OPTIONS:
=over 8
=item B<--tenant-id>
=item B<--network-id>
Set Tenant's ID
Set Network's ID
=back

View File

@ -257,24 +257,27 @@ Specify SSL version (example : 'sslv3', 'tlsv1'...)
Set HTTP headers (Multiple option. Example: --header='Content-Type: xxxxx')
=item B<--exlude>
Exclude specific instance's state (comma seperated list) (Example: --exclude=Paused,Running,Off,Exited)
=item B<--timeout>
Threshold for HTTP timeout (Default: 3)
=back
=item B<--threshold-overload>
Set to overload default threshold values (syntax: section,status,regexp)
It used before default thresholds (order stays).
Example: --threshold-overload='status,CRITICAL,^N\/A$)'
=back
OPENSTACK OPTIONS:
=over 8
=item B<--tenant-id>
=item B<--port-id>
Set Tenant's ID
Set Port's ID
=back
=cut

View File

@ -64,7 +64,6 @@ sub new {
"password:s" => { name => 'password' },
"ssl:s" => { name => 'ssl', },
"header:s@" => { name => 'header' },
"exclude:s" => { name => 'exclude' },
"timeout:s" => { name => 'timeout' },
"tenant-id:s" => { name => 'tenant_id' },
"volume-id:s" => { name => 'volume_id' },
@ -261,16 +260,20 @@ Specify SSL version (example : 'sslv3', 'tlsv1'...)
Set HTTP headers (Multiple option. Example: --header='Content-Type: xxxxx')
=item B<--exlude>
Exclude specific instance's state (comma seperated list) (Example: --exclude=Paused,Running,Off,Exited)
=item B<--timeout>
Threshold for HTTP timeout (Default: 3)
=back
=item B<--threshold-overload>
Set to overload default threshold values (syntax: section,status,regexp)
It used before default thresholds (order stays).
Example: --threshold-overload='status,CRITICAL,^deleting$)'
=back
OPENSTACK OPTIONS:
=over 8
@ -279,6 +282,11 @@ OPENSTACK OPTIONS:
Set Tenant's ID
=item B<--volume-id>
Set Volume's ID
=back
=cut