- Community Home
- >
- Software
- >
- HPE Morpheus Software
- >
- HPE Morpheus Enterprise
- >
- Issue updated 'sites' permission for Network via A...
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
Forums
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
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
09-10-2024 06:02 AM
09-10-2024 06:02 AM
I’m hitting an issue updating a network via API. All the JSON fields seem to work and update correctly except for the “sites” setting, where the UI doesn’t show the group that should have access is checked to have access.
The API docs show the format of the JSON payload as:
payload = { "network": {
"visibility": "private",
"resourcePermissions": {
"all": False,
"sites": [2]
},
"cidr": "127.0.0.0/24",
"gateway": "127.0.0.1",
"dnsPrimary": "8.8.8.8",
"dnsSecondary": "8.8.4.4,
"vlanId": 9,
"pool": 15886,
"allowStaticOverride": False,
"active": True,
"dhcpServer": False,
"applianceUrlProxyBypass": True,
"tenants": [{ "id": 1 }]
} }
What I’m sending is:
{ 'network': {
'visibility': 'private',
'tenants': [{'id': 1}],
'resourcePermissions': {
'all': False,
'sites': [2]
},
'pool': 15886,
'displayName': None,
'cidr': '172.0.0.0/24',
'gateway': '172.0.0.1',
'dnsPrimary': '8.8.8.8',
'dnsSecondary': '8.8.4.4',
'vlanId': 9,
'allowStatisOverride': False,
'active': True,
'dhcpServer': False,
'searchDomains': None,
'applianceUrlProxyBypass': True
}
}
I’m not sure what I’m missing on why the actual group access isn’t adjusting. The “ALL” goes depending on if I set that True or False, but even leaving that out the Sites values don’t get updated.
Can you tell me what I’m missing/doing wrong? I’m hoping to have this ready by this afternoon to migrate some things, duplicating permissions and settings from existing networks, but this group part is being a pain.
Solved! Go to Solution.
- Tags:
- API

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2024 07:27 AM
09-10-2024 07:27 AM
Re: Issue updated 'sites' permission for Network via API
Perfect! tl;dr we’re setting up more vSphere clusters which will have “networks” (portgroups) that need configured in Morpheus, and my plan is to read in one of the existing configured network values and then basically spit back to the API targeting the new matching port group to make it a super simple “copy/paste” type function. Knowing the default works in there too makes it that much easier as I can just return the full existing sites value instead of looping over to pull out only any ID values.
Thanks again!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2024 07:03 AM
09-10-2024 07:03 AM
Re: Issue updated 'sites' permission for Network via API
That did it!
it also made things a bit easier since I could pre-stage the “sites”: amd then just do a [‘sites’].extend() to add in the [{ ‘id’: site[‘id’] }] from my loop.
I know the API doesn’t mention the sites: values of ‘name’ and ‘default’, but does the API accept those as well?
The reason I’m asking is I could avoid my loop and just add the ‘sites’ section from my JSON call for the old network information and update the new JSON I’m sending back for the new network via the .extend()
I guess I can try and see what happens
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2024 07:24 AM
09-10-2024 07:24 AM
Re: Issue updated 'sites' permission for Network via API
Glad to hear it worked!
You can supply name
, it won’t have any functionality but it won’t throw an error. The ID is the reference that would matter.
As for the default, I used the following to set the default (includes name example too):
{
"network": {
"resourcePermissions": {
"sites": [
{
"id": 15,
"name": "testname",
"default": false
},
{
"id": 4,
"default": true
}
],
"all": false
}
}
}
I’ve added the default
property to the 7.0.6 documentation as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2024 06:16 AM
09-10-2024 06:16 AM
SolutionHello @rjr162!
I think the documentation may need to be updated. Here is what I am using to set them:
{
"network": {
"resourcePermissions": {
"sites": [
{
"id": 15
},
{
"id": 4
}
],
"all": false
}
}
}
Obviously, you can send the above with other changes you are submitting. When using the above, I get the following:
I figured this out by using a GET
on a network that I had modified and inspecting it.
I’ve also changed the documentation, which should appear in the 7.0.6 version, once released.
I hope that helps!