(plugin) apps::backup::rubrik::restapi - retrieve token (#3518)

This commit is contained in:
qgarnier 2022-03-02 10:30:29 +01:00 committed by GitHub
parent 19df1b0b09
commit 94a7374394
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -136,7 +136,8 @@ sub get_token {
) {
$self->settings();
my $content = $self->{http}->request(
url_path => '/api/v1/cluster/me',
method => 'POST',
url_path => '/api/v1/session',
credentials => 1,
basic => 1,
username => $self->{api_username},
@ -208,6 +209,7 @@ sub request_api {
$self->settings();
my $creds = $self->credentials();
my ($content) = $self->{http}->request(
method => 'GET',
url_path => '/api/internal' . $options{endpoint},
get_param => $options{get_param},
%$creds
@ -218,6 +220,7 @@ sub request_api {
$self->clean_token();
$creds = $self->credentials();
$content = $self->{http}->request(
method => 'GET',
url_path => '/api/internal' . $options{endpoint},
get_param => $options{get_param},
%$creds,