(plugin) cloud::azure::management::costs - mode costs-explorer 411 bad request (#4175)

This commit is contained in:
qgarnier 2023-01-25 09:28:34 +00:00 committed by GitHub
parent a45e84435a
commit 6332bf9241
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -280,7 +280,7 @@ sub convert_iso8601_to_epoch {
nanosecond => $7
);
my $epoch_time = $dt->epoch;
my $epoch_time = $dt->epoch();
return $epoch_time;
}
@ -327,8 +327,13 @@ sub azure_get_subscription_cost_management {
$encoded_form_post = JSON::XS->new->utf8->encode($options{body_post});
};
$self->{http}->add_header(key => 'Content-Type', value => 'application/json');
my $response = $self->request_api(method => 'POST', full_url => $full_url, query_form_post => $encoded_form_post, hostname => '');
my $response = $self->request_api(
method => 'POST',
full_url => $full_url,
query_form_post => $encoded_form_post,
hostname => '',
header => ['Content-Type: application/json']
);
return $response->{properties}->{rows};
}
@ -577,8 +582,8 @@ sub azure_list_vms {
sub azure_list_file_shares_set_url {
my ($self, %options) = @_;
my $url = $self->{management_endpoint} . "/subscriptions/" . $self->{subscription} . "/resourceGroups/" . $options{resource_group} . "/providers/Microsoft.Storage/storageAccounts/"
. $options{storage_account} . "/fileServices/default/shares?api-version=" . $options{api_version};
my $url = $self->{management_endpoint} . "/subscriptions/" . $self->{subscription} . "/resourceGroups/" . $options{resource_group} . "/providers/Microsoft.Storage/storageAccounts/" .
$options{storage_account} . "/fileServices/default/shares?api-version=" . $options{api_version};
return $url;
}