#AIQUM how to authenticate with REST-API
1 messages · Page 1 of 1 (latest)
I don't believe AIQUM uses token-based authentication - only basic auth (username:password). It does need to be in the header of the request. In PowerShell it'd look something like this:
$um_gw_url = 'https://' + $um_address + '/api/gateways'
$umInfo = "$um_login_account`:$um_login_password"
$umInfo = [System.Text.Encoding]::UTF8.GetBytes($umInfo)
$umInfo = [System.Convert]::ToBase64String($umInfo)
$umHeader = @{ 'Authorization' = ("Basic {0}" -f $umInfo); 'Content-Type' = 'application/json' }
If the challenge is using the AIQUM API Gateway / REST passthrough you'll need to get the UUID for the cluster from AIQUM and than use the gateway URL along with the cluster uuid as part of the request. So to run the ONTAP REST call /cluster it'd look something like this:
$um_cluster_url = 'https://aiqumip/api/gateways/cluster_uuid/cluster'
The API gateway also needs to be enabled in AIQUM.
The gateway will use its saved credentials for that cluster in the request.
Hello John,
Thanks for the information.
I am not sure about the use of Gateways in AIQUM but what I am trying to do is add new clusters with the endpoint https://{{AIQUM}}/api/admin/datasources/clusters. This is a POST calls and the error which I am receiving is 401 Unauthorized however if I make a GET call to the same endpoint https://{{AIQUM}}/api/admin/datasources/clusters the status is: 200 OK.
what cluster credentials are you trying to add the cluster with?
to add a cluster for the first time, a local user with the admin role is required. starting with UM 9.11, the account needs the ontapi, http, and console roles. a read only user is not sufficient to add the cluster.
Hi Dawn,
I am using the same information in API that I used from the graphical interface (which is working). The problem isn't the provided information for the cluster which we are going to add, I think that the issue is related with the authentication with OCUM/AIQUM to perform this kind of request/call. In my case I use the umadmin and the password to launch the POST request.
Example PSv7 script using REST