fix getmetrics resource parsing
This commit is contained in:
parent
ac6acf237e
commit
df69f26234
|
@ -115,15 +115,15 @@ sub check_options {
|
||||||
}
|
}
|
||||||
|
|
||||||
$self->{az_resource} = $self->{option_results}->{resource};
|
$self->{az_resource} = $self->{option_results}->{resource};
|
||||||
|
$self->{az_resource_group} = $self->{option_results}->{resource_group};
|
||||||
|
$self->{az_resource_type} = $self->{option_results}->{resource_type};
|
||||||
|
$self->{az_resource_namespace} = $self->{option_results}->{resource_namespace};
|
||||||
|
|
||||||
if ($self->{az_resource} =~ /^\/subscriptions\/.*\/resourceGroups\/.*\/providers\/Microsoft\..*\/.*\/.*$/) {
|
if ($self->{az_resource} =~ /^\/subscriptions\/.*\/resourceGroups\/(.*)\/providers\/(.*)\/(.*)\/(.*)$/) {
|
||||||
$self->{az_resource_group} = '';
|
$self->{az_resource_group} = $1;
|
||||||
$self->{az_resource_type} = '';
|
$self->{az_resource_namespace} = $2;
|
||||||
$self->{az_resource_namespace} = '';
|
$self->{az_resource_type} = $3;
|
||||||
} else {
|
$self->{az_resource} = $4;
|
||||||
$self->{az_resource_group} = $self->{option_results}->{resource_group};
|
|
||||||
$self->{az_resource_type} = $self->{option_results}->{resource_type};
|
|
||||||
$self->{az_resource_namespace} = $self->{option_results}->{resource_namespace};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$self->{az_metrics} = [];
|
$self->{az_metrics} = [];
|
||||||
|
@ -157,15 +157,15 @@ sub manage_selection {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
my ($results, $raw_results) = $options{custom}->azure_get_metrics(
|
my ($results, $raw_results) = $options{custom}->azure_get_metrics(
|
||||||
resource => $self->{az_resource},
|
resource => $self->{az_resource},
|
||||||
resource_group => $self->{az_resource_group},
|
resource_group => $self->{az_resource_group},
|
||||||
resource_type => $self->{az_resource_type},
|
resource_type => $self->{az_resource_type},
|
||||||
resource_namespace => $self->{az_resource_namespace},
|
resource_namespace => $self->{az_resource_namespace},
|
||||||
metrics => $self->{az_metrics},
|
metrics => $self->{az_metrics},
|
||||||
aggregations => $self->{az_aggregation},
|
aggregations => $self->{az_aggregation},
|
||||||
timeframe => $self->{az_timeframe},
|
timeframe => $self->{az_timeframe},
|
||||||
interval => $self->{az_interval},
|
interval => $self->{az_interval},
|
||||||
dimension => $self->{az_metrics_dimension}
|
dimension => $self->{az_metrics_dimension}
|
||||||
);
|
);
|
||||||
|
|
||||||
$self->{metrics} = {};
|
$self->{metrics} = {};
|
||||||
|
|
Loading…
Reference in New Issue