From ea053e6d0504eb5b2031f8a89bd178d797664ab6 Mon Sep 17 00:00:00 2001 From: Bruno Cornec Date: Fri, 10 Apr 2015 14:42:16 +0200 Subject: [PATCH] - Use the new Redfish specification 0.95.0a (code was previously based on 0.94) --- redfish/functions.py | 2 +- redfish/server.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/redfish/functions.py b/redfish/functions.py index 843d9d8..9c1b0e0 100644 --- a/redfish/functions.py +++ b/redfish/functions.py @@ -28,7 +28,7 @@ from redfish import connection class RedfishOperation(connection.RedfishConnection): def reset_server(self): - (status, headers, system) = self.rest_get('/rest/v1/Systems', None) + (status, headers, system) = self.rest_get('/redfish/v1/Systems', None) memberuri = system['links']['Member'][0]['href'] # verify expected type diff --git a/redfish/server.py b/redfish/server.py index 3b3d88d..c86b4a9 100644 --- a/redfish/server.py +++ b/redfish/server.py @@ -27,7 +27,7 @@ resources. A URI should be treated by the client as opaque, and thus should not be attempted to be understood or deconstructed by the client. Only specific top level URIs (any URI in this sample code) may be assumed, and even these may be -absent based upon the implementation (e.g. there might be no /rest/v1/Systems +absent based upon the implementation (e.g. there might be no /redfish/v1/Systems collection on something that doesn't have compute nodes.) The other URIs must be discovered dynamically by following href links. This is @@ -35,8 +35,8 @@ because the API will eventually be implemented on a system that breaks any existing data model "shape" assumptions we may make now. In particular, clients should not make assumptions about the URIs for the resource members of a collection. For instance, the URI of a collection member will NOT always be -/rest/v1/.../collection/1, or 2. On systems with multiple compute nodes per -manager, a System collection member might be /rest/v1/Systems/C1N1. +/redfish/v1/.../collection/1, or 2. On systems with multiple compute nodes per +manager, a System collection member might be /redfish/v1/Systems/C1N1. This sounds very complicated, but in reality (as these examples demonstrate), if you are looking for specific items, the traversal logic isn't too @@ -93,7 +93,7 @@ header will point to a resource with task information and status. JSON-SCHEMA: -The json-schema available at /rest/v1/Schemas governs the content of the +The json-schema available at /redfish/v1/Schemas governs the content of the resources, but keep in mind: * not every property in the schema is implemented in every implementation. * some properties are schemed to allow both null and anotehr type like string @@ -170,7 +170,7 @@ class RedfishConnection(object): LOG.debug('Initiating session with host %s', self.host) auth_dict = {'Password': self.password, 'UserName': self.user_name} response = self.rest_post( - '/rest/v1/Sessions', None, json.dumps(auth_dict)) + '/redfish/v1/Sessions', None, json.dumps(auth_dict)) # TODO: do some schema discovery here and cache the result # self.schema = ... @@ -328,7 +328,7 @@ class RedfishConnection(object): return self._op('DELETE', suburi, request_headers, None) def get_root(self): - return types.Root(self.rest_get('/rest/v1', {}), connection=self) + return types.Root(self.rest_get('/redfish/v1', {}), connection=self) class Version(object):