From 94a7374394582a5d086546a8647d67d359ba5506 Mon Sep 17 00:00:00 2001 From: qgarnier Date: Wed, 2 Mar 2022 10:30:29 +0100 Subject: [PATCH] (plugin) apps::backup::rubrik::restapi - retrieve token (#3518) --- apps/backup/rubrik/restapi/custom/api.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/backup/rubrik/restapi/custom/api.pm b/apps/backup/rubrik/restapi/custom/api.pm index 1c1e03053..7f580e65d 100644 --- a/apps/backup/rubrik/restapi/custom/api.pm +++ b/apps/backup/rubrik/restapi/custom/api.pm @@ -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,