- Community Home
- >
- Software
- >
- HPE OneView
- >
- Re: Set default login directory
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2019 09:35 AM
08-07-2019 09:35 AM
Re: Set default login directory
hi @BradV
I wasnt expecting to see the "ADHQ=" in the error.
My request looks like this
curl -k -X POST \
--header "Content-Type:application/json" \
--header "X-API-Version:800" \
--header "Auth:xyz" \
--data '"ADHQ"' 'https://myappliance.hpe.com/rest/logindomains/global-settings/default-login-domain'
Can you check and compare against what you send to the server after all the substitutions?
ADHQ is the name of the directory that I want to be set as default.
Regards,
Bhaskar
I am an HPE employee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2019 10:02 AM - edited 08-07-2019 10:03 AM
08-07-2019 10:02 AM - edited 08-07-2019 10:03 AM
Re: Set default login directory
Changing any setting within OneView via the API requires authorization. Your account needs to have Infrastructure administrator role.
As for setting the default auth directory for the appliance, you need to just encapsulate the directory name in double-quotes:
--data "ADHQ"
Otherwise, the API will be wanting to look for 'ADHQ', not just ADHQ.
Also, when providing code, either use the Insert Code button (which is the </> icon), or use another font type like Courier New.
I am an HPE employee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2019 04:06 AM - edited 08-08-2019 04:08 AM
08-08-2019 04:06 AM - edited 08-08-2019 04:08 AM
Re: Set default login directory
Hi Chris,
I was just pointing out that the API Reference is invalid again.
It says:
Authorization
This API requires no authorization.
then in the Request Headers section:
Auth Session authorization token obtained from logging in. If this header is not included or if the session-token is invalid, the response code will be 401 Unauthorized.
So, inconsistent.
Bashkar/Chris,
I am just using --data "ADHQ." I believe the API reference example is also missleading. It shows including the header, Content-Type: application/json. The single name is not a valid json. So, if I include that header, I get malformed json as the error.
If I run:
curl --insecure \
--header "X-API-Version: ${currentVersion}" \
--header "auth: ${sessionID}" \
--data "ADHQ" \
--request POST ${OneView}/rest/logindomains/global-settings/default-login-domain | jq -r '.'
I get the error with "errorSource": "ADHQ=" in the response. I don't see any difference between what I have and what you presented other than the json header?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2019 05:23 PM
08-08-2019 05:23 PM
Re: Set default login directory
Hi @BradV
In this specific case, you need an extra pair of single quotes enclosing the "ADHQ". It needs to be <single quote>"ADHQ"<single quote>. Substitute all the variables, form a command line that works, then go back and fix the script accordingly.
curl --insecure \
--header "X-API-Version: 800" \
--header "auth: XYZ" \
--data '"ADHQ"' \
--request POST ${OneView}/rest/logindomains/global-settings/default-login-domain | jq -r '.'
The below reliably works.
curl -k -X POST --header "Content-Type:application/json" --header "X-API-Version:800" --header "Auth:XYZ" --data '"ADHQ"' 'https://myappliance.hpe.com/rest/logindomains/global-settings/default-login-domain'
Try it out and let me know.
Regards,
Bhaskar
I am an HPE employee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2019 02:06 AM
08-09-2019 02:06 AM
Re: Set default login directory
Hi Bashkar,
I finally got it worked out. The REST API documentation needs updated. First, correct the information about authorization. Next is the content type header. When I included content type header of application/json, I always got back malformed json since a single word is not a valid json. So, I just dropped that header, but kept getting back invalid global settings and the errorsource was ADHQ=. This worked:
DATA="ADHQ"
curl --insecure \
--header "content-type: text/plain" \
--header "X-API-Version: ${currentVersion}" \
--header "auth: ${sessionID}" \
--data "${DATA}" \
--request POST ${OneView}/rest/logindomains/global-settings/default-login-domain | jq -r '.'
Thanks for the help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2019 08:32 AM
08-11-2019 08:32 AM
Re: Set default login directory
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2019 02:08 AM
08-12-2019 02:08 AM
Re: Set default login directory
Hi Bashkar,
So, just to make sure, someone is entering a change request for the REST API documentation to fix the information on authorization, change the header information to show that header content-type: text/plain is required, and give a valid example?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2019 05:11 PM
08-12-2019 05:11 PM
Re: Set default login directory
hi @BradV
Yes, the error with the REST API documentation about authorization is being corrected.
On the content type, checking on the version of curl we use.
Regards
Bhaskar
I am an HPE employee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2019 01:40 AM
08-13-2019 01:40 AM
Re: Set default login directory
Hi Bashkar,
If it helps, I am running on a RHEL 6.10 server with curl 7.19.7. I wouldn't think that the version of curl would matter? The content supplied was not a JSON. It was just plain text.
Regards,
Brad
- « Previous
-
- 1
- 2
- Next »