Comments (6)
I don't have access to a Cisco UCS server, but the basic idea is to just traverse the resources from the Chassis to the NetworkAdapters, etc. If that service follows the standard schemas, something like this should work:
import redfish
def main():
context = redfish.redfish_client(base_url='https://contoso.com',
username='...', password='...')
context.login(auth="session")
service_root = context.get("/redfish/v1/")
if 'Chassis' not in service_root.dict:
print('No Chassis found')
return
chassis_col = context.get(service_root.dict["Chassis"]["@odata.id"])
for chassis_member in chassis_col.dict["Members"]:
chassis = context.get(chassis_member["@odata.id"])
print('Chassis: %s' % chassis.dict['Id'])
if 'NetworkAdapters' in chassis.dict:
na_col = context.get(chassis.dict['NetworkAdapters']["@odata.id"])
for na_member in na_col.dict["Members"]:
na_res = context.get(na_member["@odata.id"])
print(' NetworkAdapter: %s' % na_res.dict['Id'])
if 'NetworkDeviceFunctions' in na_res.dict:
ndf_col = context.get(na_res.dict['NetworkDeviceFunctions']['@odata.id'])
for ndf_member in ndf_col.dict["Members"]:
ndf_res = context.get(ndf_member["@odata.id"])
print(' NetworkDeviceFunction: %s' % ndf_res.dict['Id'])
if 'Ethernet' in ndf_res.dict:
if 'MACAddress' in ndf_res.dict['Ethernet']:
mac = ndf_res.dict['Ethernet']['MACAddress']
print(' MACAddress: %s' % mac)
if __name__ == "__main__":
main()
from python-redfish-library.
I have already tried that and unfortunately i am getting nil under NetworkAdapters response.
{
"Members":[{
"@odata.id":"/redfish/v1/Chassis/1/NetworkAdapters/nil"
}]
Let me know in case if there's any other way to find this.
from python-redfish-library.
Is the service actually returning the URI /redfish/v1/Chassis/1/NetworkAdapters/nil
? Can you open that URI in a browser?
This sounds like an issue with the implementation you're working with and may need to contact the vendor for support.
from python-redfish-library.
The other thing to consider is some implementations might only support the EthernetInterfaces resource for this, which would be found under the respective ComputerSystem resource.
from python-redfish-library.
@nagaphani23 do the previous responses answer your question? Can we close out this issue?
from python-redfish-library.
@mraineri I was not able to get the proper output with the above url. This might differ from specific vendor to vendor.
Anyways I am closing this now and will reopen in case if required.
from python-redfish-library.
Related Issues (20)
- AttributeError: module 'redfish' has no attribute 'redfish_client' HOT 35
- Proper format for multipart/form-data POST request HOT 8
- Can't terminate a redfish session via .logout() HOT 13
- Problem using skip and expand params HOT 4
- So trying to use the example and I keep getting time outs. HOT 47
- What is the default_prefix for? HOT 1
- Unix socket support HOT 4
- Returned data type from Assembly.bin changed in versioning 3.1.0 HOT 1
- Requirements doesn't list dependencies HOT 2
- InvalidCredentialsError on service unavailable HOT 1
- Issue with initial root object retrieval HOT 2
- Timeout in HTTP Method HOT 4
- Does the library work also with Simulator/Emulator/Mockyup Server? HOT 4
- Need to document "body" HOT 5
- rf_discover.py can not found AMI redfish server service
- can the redfish GET/PUT/POST/DELETE/HEAD method have a timeout option to send a request with a specific timeout HOT 2
- For HPE OEM - What all write operation can be performed on FC card ? HOT 2
- redfish.redfish_client insecure connection HOT 14
- Getting Fans infromation HOT 2
- Redfish exception handling HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-redfish-library.