HPE OneView
1752790 Members
5991 Online
108789 Solutions
New Discussion

Re: initalScopeUris

 
SOLVED
Go to solution
BradV
Esteemed Contributor

initalScopeUris

I successfully deleted all servers from our OneView (lots of problems - just restarting clean).  Trying to add using the REST API.  I'm a little lost on the initialScopeUris.  Not sure what it is?  When I queried: GET /rest/scopes, I got back 0 scopes.  So, it does not look like we have any scopes defined.  So, when trying to add a hardware server, for I used: 

"initalScopeUris": [""]

since we did not have any.  OneView did not like that.  "Resource creation in the specified scope is not authorized.  The scope does not match the user session permissions or does not exist."

How do I find a list of available initialScopeUris?

10 REPLIES 10
ChrisLynch
HPE Pro
Solution

Re: initalScopeUris

That property is used to specify what Scope or Scopes the resource being created should be assigned to.  If there are no Scopes created on your appliance, than that property needs to be null.  Also, if your user account does not have atleast Scope Administrator or Infrastructure Administrator, or be scoped to an existing Scope you have access to.


I am an HPE employee

Accept or Kudo

BradV
Esteemed Contributor

Re: initalScopeUris

Got it working by removing the "" within the braces.  So, "" isn't exactly null, but nothing is null.  If that makes sense?  :)

"initalScopeUris": []
ChrisLynch
HPE Pro

Re: initalScopeUris

It actually needs to be a null array/collection.  So yes, "initialScopeUris": [""] is diffferent than "initialScopeUris": [], which is what our REST API documentation would show in the examples.  You could of course use our scripting SDK's.


I am an HPE employee

Accept or Kudo

BradV
Esteemed Contributor

Re: initalScopeUris

Hi Chris,

All of your stuff is in powershell.  I can't use that.  All of my systems are running linux.  So, powershell is useless to me.  So, just using the REST API.  The documentation in the REST API is not clear about that.  At least not as I read it.  :)

ChrisLynch
HPE Pro

Re: initalScopeUris

A few clarifications:

All of your stuff is in powershell.

That is not correct.  We have plenty of Linux options, including Python and Ruby (which are not exclusive to Linux/Unix).  Please take a look at our GitHub org, and search for OneView to find all of our HPE OneView specific projects.

All of your stuff is in powershell.  I can't use that. 

I have some idea on how to transition the PowerShell library to PowerShellCore, which would run on Linux and MacOS.


I am an HPE employee

Accept or Kudo

BradV
Esteemed Contributor

Re: initalScopeUris

Hi Chris,

Well, I was initially trying to use ansible, but could not figure out how to make it work.  Angie Hays sat with me for a few hours and helped me a lot.  Any help you could provide would be greatly appreciated.

Regards,

Brad

ChrisLynch
HPE Pro

Re: initalScopeUris

Did any of the examples help?  Are you new to Ansible?  That partner integration kit is one of our popular kits and we have quite a number of customers successfully using it.  Feel free to PM me so we can exchange email addresses and I could help from there.


I am an HPE employee

Accept or Kudo

BradV
Esteemed Contributor

Re: initalScopeUris

Hi Chris,

No.  Not really.  I have been using ansible to set up and kickstart server, run post scripts, hardening and configuration.  So, think I pretty much understand ansible.  I did: 

# Get the HPE OneView Python SDK
git clone git@github.com:HewlettPackard-github-com/python-hpOneView.git
# Run the installer
cd python-hpOneView
python seetup.py install --user
cd ..
# Get the OneView Ansible modules
git clone git@github.com:HewlettPackard-github-com/oneview-ansible.git
# Define some environment variables
cd oneview-ansible/library
export ANSIBLE_LIBRARY=$(pwd)
cd module_utils
export ANSIBLE_MODULE_UTILS=$(pwd)
cd ../..
cat > oneview.json <, EOF
{
  "ip": "1.2.3.4",
  "credentials": {
    "userName": "Administrator",
    "authLoginDomain": "",
    "password": 'mypassword'
  },
  "api_version": 1000
}
EOF

(might not be exact - took from internal git repositories).  Just not sure what to put in my inventory file?  All of my Proliant servers, or just the OneView appliance?  Not really finding a good example from nothing to getting at least a simple inventory done.

 

ChrisLynch
HPE Pro

Re: initalScopeUris

I would review the examples within the /examples directory.  You will find oneview_server_hardware.yml sample that would return the server hardware.  If you have additional questions on our Ansible module, please use the issue tracker there.


I am an HPE employee

Accept or Kudo