add help on discovery modes

This commit is contained in:
Colin Gagnaire 2019-06-04 11:40:51 +02:00
parent ffe1a62eb2
commit 802225e6cc
4 changed files with 65 additions and 11 deletions

View File

@ -77,6 +77,15 @@ Resources discovery.
=over 8
=item B<--resource-type>
Choose the type of resources
to discover (Can be: 'esx', 'vm') (Mandatory).
=item B<--prettify>
Prettify JSON output.
=back
=cut

View File

@ -33,7 +33,6 @@ sub new {
$self->{version} = '1.0';
$options{options}->add_options(arguments => {
"region:s" => { name => 'region' },
"service:s@" => { name => 'service' },
"prettify" => { name => 'prettify' },
});
@ -53,11 +52,6 @@ sub check_options {
my ($self, %options) = @_;
$self->SUPER::init(%options);
if (!defined($self->{option_results}->{region}) || $self->{option_results}->{region} eq '') {
$self->{output}->add_option_msg(short_msg => "Need to specify --region option.");
$self->{output}->option_exit();
}
if (!defined($self->{option_results}->{service}) || $self->{option_results}->{service} eq '') {
$self->{output}->add_option_msg(short_msg => "Need to specify --service option.");
$self->{output}->option_exit();
@ -245,6 +239,16 @@ Resources discovery.
=over 8
=item B<--service>
Choose the service from which discover
resources (Can be: 'VPC', 'EC2', 'RDS',
'ELB', 'VPN') (Mandatory).
=item B<--prettify>
Prettify JSON output.
=back
=cut

View File

@ -113,6 +113,26 @@ Resources discovery.
=over 8
=item B<--namespace>
Specify resources namespace.
=item B<--type>
Specify resources type.
=item B<--resource-group>
Specify resources resource group.
=item B<--location>
Specify resources location.
=item B<--prettify>
Prettify JSON output.
=back
=cut

View File

@ -36,7 +36,7 @@ sub new {
$self->{version} = '1.0';
$options{options}->add_options(arguments => {
"subnet:s" => { name => 'subnet' },
"snmp-port:s" => { name => 'snmp_port' },
"snmp-port:s" => { name => 'snmp_port', default => 161 },
"snmp-version:s@" => { name => 'snmp_version' },
"snmp-community:s@" => { name => 'snmp_community' },
"snmp-timeout:s" => { name => 'snmp_timeout', default => 1 },
@ -57,10 +57,6 @@ sub check_options {
$self->{output}->add_option_msg(short_msg => "Need to specify --subnet option (<ip>/<cidr>).");
$self->{output}->option_exit();
}
if (!defined($self->{option_results}->{snmp_port}) || $self->{option_results}->{snmp_port} eq '') {
$self->{output}->add_option_msg(short_msg => "Need to specify --snmp-port option.");
$self->{output}->option_exit();
}
if (!defined($self->{option_results}->{snmp_community}) || $self->{option_results}->{snmp_community} eq '') {
$self->{output}->add_option_msg(short_msg => "Need to specify --snmp-community option.");
$self->{output}->option_exit();
@ -196,6 +192,31 @@ Resources discovery.
=over 8
=item B<--subnet>
Specify subnet from which discover
resources (Must be <ip>/<cidr> format) (Mandatory).
=item B<--snmp-port>
Specify SNMP port (Default: 161).
=item B<--snmp-version>
Specify SNMP version (Can be multiple) (Mandatory).
=item B<--snmp-community>
Specify SNMP community (Can be multiple) (Mandatory).
=item B<--snmp-timeout>
Specify SNMP timeout in second (Default: 1).
=item B<--prettify>
Prettify JSON output.
=back
=cut