Git Product home page Git Product logo

libredfish's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libredfish's Issues

Core file in libredfish 1.3.4

while using libredfish a core was produced. I believe this was produced when a event was generated and returned, potentially to a service that had been destroyed prior.

Program terminated with signal SIGABRT, Aborted.

(gdb) bt full
#0 __pthread_clockjoin_ex (threadid=2699005728, thread_return=0x0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, block=block@entry=true) at pthread_join_common.c:145
_a1 = -1595961464
_nr = 240
_a3tmp = 21545
_a3 = 21545
_a4tmp = 0
_a2tmp = 0
_a2 = 0
_a4 = 0
__ret =
__oldtype = 0
tid = 21545
_buffer = {__routine = 0xa6af75dc , __arg = 0xa0df913c, __canceltype = 16769168, __prev = 0x0}
pd = 0xa0df8f20
self =
result = 0
pd_result =
#1 0xa6af7564 in __pthread_join (threadid=, thread_return=) at pthread_join.c:24
No locals.
#2 0xa6cfae3c in createRequest (url=0x1 <error: Cannot access memory at address 0x1>, method=HTTP_POST, bodysize=16769168, body=0xa6d12d04 "\344;\002")
at ../../../../../../../../../externalsrc/libredfish/src/asyncRaw.c:40
ret = 0xa4000ab0
#3 0xa6cf41a4 in getPayloadBody (payload=0xa0df8f88) at ../../../../../../../../../externalsrc/libredfish/src/payload.c:200
No locals.
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

What is correct Expression for Bios Attribute?

/redfish/v1/Systems/123456789/Bios
has this
"@Redfish.Settings": {
"@odata.type": "#Settings.v1_0_0.Settings",
"Messages": [
{
"MessageId": "Base.1.0.Success"
}
],
"Time": "2018-10-17T17:57:17+00:00",
"SettingsObject": {
"@odata.id": "/redfish/v1/Systems/123456789/Bios/Settings"
}
And
/redfish/v1/Systems/123456789/Bios/Settings
has this
"Attributes": {
"Quick_Boot_0001": "Disabled", ...other settings... }

Can redfishtest use PATCH to modify Settings?
What would the expression look like?

Inconsistency of implementation in Redpath

Recently I am making some exploration for further use of libredfish. I tried to call getPayloadByPath after reading documents and README page,

In such an environment that contains one member of System, the redPath /Systems returns the payload below:

{
    "@odata.context":"/redfish/v1/$metadata#ComputerSystemCollection.ComputerSystemCollection",
    "@odata.id":"/redfish/v1/Systems",
    "@odata.type":"#ComputerSystemCollection.ComputerSystemCollection",
    "Description":"Collection of Computer Systems",
    "Members":[
        {
            "@odata.id":"/redfish/v1/Systems/System.Embedded.1"
        }
    ],
    "[email protected]":1,
    "Name":"Computer System Collection"
}

But when I tried to access its only member, getPayloadByPath returns NULL for error when I passed the redPath /Systems/Members[1]. In an occasional attempt, I got the right result with /Systems/Members[0].

According to the freshly released Redpath Specification, index is 1-based instead of 0-based in conventional programming language (JSON in this issue which caused the problem). This is also specially noted in the example query at line 102:

* /Chassis[1]: Returns the first Chassis resource

Therefore I think implementation of redpath in the current version has conflicts with specification.

#iwork4dell

ETag support

We have a use case where we are considering ETags as a mechanism for supporting caching Redfish resources. At the moment, it doesn't seem like libredfish supports HTTP ETag.

We were just wondering if there would be interest in ETag support, and whether there were already some considerations or constraints that were considered for this feature.

getRedfishServiceRoot stops working forever if the connection drops

I noticed that getRedfishServiceRoot probably keeps some sort of state that prevents it from reconnecting if the conection flakes out. If I use getPayloadByUri(redfish, "/redfish/v1") instead I do not see this problem.

I think there is some state in service->versions being kept causing this to fail: https://github.com/DMTF/libredfish/blob/master/src/service.c#L725

We can workaround for now with getPayloadByUri(redfish, "/redfish/v1"), but just wanted to file this out to let you know.

#include <memory>
#include <iostream>

extern "C" {
#include "libredfish/include/redfish.h"
#include "libredfish/include/redfishService.h"
}  // extern "C"

namespace {

struct RedfishPayloadDeleter {
  void operator()(redfishPayload *payload) {
    if (payload) cleanupPayload(payload);
  }
};
using PayloadUniquePtr = std::unique_ptr<redfishPayload, RedfishPayloadDeleter>;

}  // namespace

int main(int argc, char **argv) {
  redfishService *redfish =
      createServiceEnumerator("localhost:8000", nullptr, nullptr, 0);

  while (true) {
    sleep(1);
    PayloadUniquePtr payload(getRedfishServiceRoot(redfish, NULL));
    if (!payload) {
      std::cerr << "Could not get root\n";
    } else {
      std::cerr << "Got root\n";
    }
  }

  cleanupServiceEnumerator(redfish);
  return 0;
}

  1. Run a mockup server on localhost:8000
  2. Run the above code snippet
  3. Stop the mockup server
  4. Start the mockup server again on localhost:8000
  5. Code snippet in loop doesn't recover gracefully
Got root
Got root
Could not get root
Could not get root
...

If I change the code snippet to instead get root via getPayloadByUri(redfish, "/redfish/v1") it can recover:

Got root
Got root
Could not get root
Could not get root
Got root
Got root
Could not get root
Could not get root
Could not get root
Got root
Got root
Could not get root

RedPaths referencing properties are returned as objects

Hey Patrick,

My motivation for understanding this is to better define what RedPath should do if we were to standardize RedPath into a specification.

Just wanted to see if there was a particular reason why a RedPath terminating in a property would return an object rather than the raw JSON value:

$ ./redfishtest -H localhost:8000 /Chassis[0]/Status
{
  "Health": "OK",
  "HealthRollup": "OK",
  "State": "Enabled"
}

$ ./redfishtest -H localhost:8000 /Chassis[0]/Status/Health
{
  "Health": "OK"
}

$ ./redfishtest -H localhost:8000 /Chassis[0]/Status/Health/Health
{
  "Health": "OK"
}

$ ./redfishtest -H localhost:8000 /Chassis[0]/Status/Health/Health/Health
{
  "Health": "OK"
}

$ ./redfishtest -H localhost:8000 /Chassis[0]/Status/Health/Health/Health/Health
{
  "Health": "OK"
}

It leads to an interesting behaviour where a RedPath could repeatedly reference a property.

In my opinion, an alternate behaviour would look something like:

$ ./redfishtest -H localhost:8000 /Chassis[0]/Status
{
  "Health": "OK",
  "HealthRollup": "OK",
  "State": "Enabled"
}
$ echo $?
0

$ ./redfishtest -H localhost:8000 /Chassis[0]/Status/Health
"OK"
$ echo $?
0

$ ./redfishtest -H localhost:8000 /Chassis[0]/Status/Health/Health
$ echo $?
1

Unable to retrieve Systems members

Hi,
I am currently not able to get members of the Systems endpoint (/v1/redfish/Systems/X).

{
"@odata.context": "/redfish/v1/$metadata#Systems",
"@odata.id": "/redfish/v1/Systems",
"@odata.type": "#ComputerSystemCollection.ComputerSystemCollection",
"[email protected]": 1,
"Name": "Computer System Collection",
"Members": {
"@odata.id": "/redfish/v1/Systems/1"
}
}

Tried command:

./redfishtest -u admin -p admin -W verdoc -H https://localhost:20000 /Systems[0]

It just hangs and does not return json. Iam using verdoc to skip version validation because I do not have access to /v1/ endpoint.

Retrieving Chassis members works as expected.

redfishtest failed with timeout (CURL returned 28) when CURLOPT_FORBID_REUSE=0

I'm running redfish test to PowerEdge server like this:

./bin/redfishtest -vvv -H "https://idrac-ip-address" -u root -p password -M GET /v1/Chassis/Members[0]/Thermal

And get this timeout error (CURL returned 28):

addRequestHeader: Adding Accept => application/json to (nil)
addRequestHeader: Adding OData-Version => 4.0 to 0x96f1b0
addRequestHeader: Adding User-Agent => libredfish to 0x96f1b0
addRequestHeader: Adding Authorization => Basic cm9vdDpjYWx2aW4= to 0x96f1b0
asyncHeaderCallback: Adding OData-Version => 4.0 to (nil)
asyncHeaderCallback: Adding Keep-Alive => timeout=60, max=199 to 0x7f13e410fc70
asyncHeaderCallback: Adding Content-Type => application/json; charset=utf-8 to 0x7f13e410fc70
asyncHeaderCallback: Adding Server => Appweb/4.5.4 to 0x7f13e410fc70
asyncHeaderCallback: Adding Date => Wed, 28 Nov 2018 01 to 0x7f13e410fc70
asyncHeaderCallback: Adding Cache-Control => no-cache to 0x7f13e410fc70
asyncHeaderCallback: Adding Connection => Keep-Alive to 0x7f13e410fc70
asyncHeaderCallback: Adding Access-Control-Allow-Origin => * to 0x7f13e410fc70
asyncHeaderCallback: Adding Transfer-Encoding => chunked to 0x7f13e410fc70
asyncHeaderCallback: Adding Accept-Ranges => bytes to 0x7f13e410fc70
rawAsyncWorkThread: Got response for url https://idrac-ip-address/redfish with code 200
freeHeaders: Freeing 0x96f1b0
freeHeaders: Freeing 0x7f13e410fc70
addRequestHeader: Adding Accept => application/json to (nil)
addRequestHeader: Adding OData-Version => 4.0 to 0x96f390
addRequestHeader: Adding User-Agent => libredfish to 0x96f390
addRequestHeader: Adding Authorization => Basic cm9vdDpjYWx2aW4= to 0x96f390
asyncHeaderCallback: Adding OData-Version => 4.0 to (nil)
asyncHeaderCallback: Adding Keep-Alive => timeout=60, max=198 to 0x7f13e4138f30
asyncHeaderCallback: Adding Content-Type => application/json;odata.metadata=minimal;charset=utf-8 to 0x7f13e4138f30
asyncHeaderCallback: Adding Server => Appweb/4.5.4 to 0x7f13e4138f30
asyncHeaderCallback: Adding Date => Wed, 28 Nov 2018 01 to 0x7f13e4138f30
asyncHeaderCallback: Adding Cache-Control => no-cache to 0x7f13e4138f30
asyncHeaderCallback: Adding Content-Length => 789 to 0x7f13e4138f30
asyncHeaderCallback: Adding Connection => Keep-Alive to 0x7f13e4138f30
asyncHeaderCallback: Adding Access-Control-Allow-Origin => * to 0x7f13e4138f30
asyncHeaderCallback: Adding Accept-Ranges => bytes to 0x7f13e4138f30
rawAsyncWorkThread: Got response for url https://idrac-ip-address/redfish/v1/ with code 200
addRequestHeader: Adding Accept => application/json to (nil)
addRequestHeader: Adding OData-Version => 4.0 to 0x7f13e413a550
addRequestHeader: Adding User-Agent => libredfish to 0x7f13e413a550
addRequestHeader: Adding Authorization => Basic cm9vdDpjYWx2aW4= to 0x7f13e413a550
freeHeaders: Freeing 0x96f390
freeHeaders: Freeing 0x7f13e4138f30
rawAsyncWorkThread: CURL returned 28
getPayloadFromAsyncResponse: Error, called without response data...
Got a failure, httpCode = 65535
freeHeaders: Freeing 0x7f13e413a550
freeHeaders: Freeing (nil)

If I apply this patch:

diff --git a/src/asyncRaw.c b/src/asyncRaw.c
index 781acad..57c0d00 100644
--- a/src/asyncRaw.c
+++ b/src/asyncRaw.c
@@ -225,6 +225,7 @@ threadRet rawAsyncWorkThread(void* data)
     }
     //curl_easy_setopt(curl, CURLOPT_VERBOSE, true);
     //curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
+    curl_easy_setopt(curl, CURLOPT_FORBID_REUSE, 1L);
     curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
     curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
     curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curlWriteMemory);

I get a correct response:

addRequestHeader: Adding Accept => application/json to (nil)
addRequestHeader: Adding OData-Version => 4.0 to 0x7781b0
addRequestHeader: Adding User-Agent => libredfish to 0x7781b0
addRequestHeader: Adding Authorization => Basic cm9vdDpjYWx2aW4= to 0x7781b0
asyncHeaderCallback: Adding OData-Version => 4.0 to (nil)
asyncHeaderCallback: Adding Keep-Alive => timeout=60, max=199 to 0x7f7c9c10fbe0
asyncHeaderCallback: Adding Content-Type => application/json; charset=utf-8 to 0x7f7c9c10fbe0
asyncHeaderCallback: Adding Server => Appweb/4.5.4 to 0x7f7c9c10fbe0
asyncHeaderCallback: Adding Date => Wed, 28 Nov 2018 01 to 0x7f7c9c10fbe0
asyncHeaderCallback: Adding Cache-Control => no-cache to 0x7f7c9c10fbe0
asyncHeaderCallback: Adding Connection => Keep-Alive to 0x7f7c9c10fbe0
asyncHeaderCallback: Adding Access-Control-Allow-Origin => * to 0x7f7c9c10fbe0
asyncHeaderCallback: Adding Transfer-Encoding => chunked to 0x7f7c9c10fbe0
asyncHeaderCallback: Adding Accept-Ranges => bytes to 0x7f7c9c10fbe0
rawAsyncWorkThread: Got response for url https://idrac-ip-address/redfish with code 200
freeHeaders: Freeing 0x7781b0
freeHeaders: Freeing 0x7f7c9c10fbe0
addRequestHeader: Adding Accept => application/json to (nil)
addRequestHeader: Adding OData-Version => 4.0 to 0x778390
addRequestHeader: Adding User-Agent => libredfish to 0x778390
addRequestHeader: Adding Authorization => Basic cm9vdDpjYWx2aW4= to 0x778390
asyncHeaderCallback: Adding OData-Version => 4.0 to (nil)
asyncHeaderCallback: Adding Keep-Alive => timeout=60, max=199 to 0x7f7c9c138ea0
asyncHeaderCallback: Adding Content-Type => application/json;odata.metadata=minimal;charset=utf-8 to 0x7f7c9c138ea0
asyncHeaderCallback: Adding Server => Appweb/4.5.4 to 0x7f7c9c138ea0
asyncHeaderCallback: Adding Date => Wed, 28 Nov 2018 01 to 0x7f7c9c138ea0
asyncHeaderCallback: Adding Cache-Control => no-cache to 0x7f7c9c138ea0
asyncHeaderCallback: Adding Content-Length => 789 to 0x7f7c9c138ea0
asyncHeaderCallback: Adding Connection => Keep-Alive to 0x7f7c9c138ea0
asyncHeaderCallback: Adding Access-Control-Allow-Origin => * to 0x7f7c9c138ea0
asyncHeaderCallback: Adding Accept-Ranges => bytes to 0x7f7c9c138ea0
rawAsyncWorkThread: Got response for url https://idrac-ip-address/redfish/v1/ with code 200
addRequestHeader: Adding Accept => application/json to (nil)
addRequestHeader: Adding OData-Version => 4.0 to 0x7f7c9c138f40
addRequestHeader: Adding User-Agent => libredfish to 0x7f7c9c138f40
addRequestHeader: Adding Authorization => Basic cm9vdDpjYWx2aW4= to 0x7f7c9c138f40
freeHeaders: Freeing 0x778390
freeHeaders: Freeing 0x7f7c9c138ea0
asyncHeaderCallback: Adding OData-Version => 4.0 to (nil)
asyncHeaderCallback: Adding Keep-Alive => timeout=60, max=199 to 0x7f7c9c112750
asyncHeaderCallback: Adding Content-Type => application/json;odata.metadata=minimal;charset=utf-8 to 0x7f7c9c112750
asyncHeaderCallback: Adding Server => Appweb/4.5.4 to 0x7f7c9c112750
asyncHeaderCallback: Adding Date => Wed, 28 Nov 2018 01 to 0x7f7c9c112750
asyncHeaderCallback: Adding Cache-Control => no-cache to 0x7f7c9c112750
asyncHeaderCallback: Adding Content-Length => 284 to 0x7f7c9c112750
asyncHeaderCallback: Adding Connection => Keep-Alive to 0x7f7c9c112750
asyncHeaderCallback: Adding Access-Control-Allow-Origin => * to 0x7f7c9c112750
asyncHeaderCallback: Adding Accept-Ranges => bytes to 0x7f7c9c112750
rawAsyncWorkThread: Got response for url https://idrac-ip-address/redfish/v1/Chassis with code 200
addRequestHeader: Adding Accept => application/json to (nil)
addRequestHeader: Adding OData-Version => 4.0 to 0x7f7c9c112770
addRequestHeader: Adding User-Agent => libredfish to 0x7f7c9c112770
addRequestHeader: Adding Authorization => Basic cm9vdDpjYWx2aW4= to 0x7f7c9c112770
freeHeaders: Freeing 0x7f7c9c138f40
freeHeaders: Freeing 0x7f7c9c112750
asyncHeaderCallback: Adding OData-Version => 4.0 to (nil)
asyncHeaderCallback: Adding Keep-Alive => timeout=60, max=199 to 0x7f7c9c11bbe0
asyncHeaderCallback: Adding Content-Type => application/json;odata.metadata=minimal;charset=utf-8 to 0x7f7c9c11bbe0
asyncHeaderCallback: Adding Server => Appweb/4.5.4 to 0x7f7c9c11bbe0
asyncHeaderCallback: Adding Date => Wed, 28 Nov 2018 01 to 0x7f7c9c11bbe0
asyncHeaderCallback: Adding Cache-Control => no-cache to 0x7f7c9c11bbe0
asyncHeaderCallback: Adding Content-Length => 1928 to 0x7f7c9c11bbe0
asyncHeaderCallback: Adding Allow => POST,PATCH to 0x7f7c9c11bbe0
asyncHeaderCallback: Adding Connection => Keep-Alive to 0x7f7c9c11bbe0
asyncHeaderCallback: Adding Access-Control-Allow-Origin => * to 0x7f7c9c11bbe0
asyncHeaderCallback: Adding Accept-Ranges => bytes to 0x7f7c9c11bbe0
rawAsyncWorkThread: Got response for url https://idrac-ip-address/redfish/v1/Chassis/System.Embedded.1 with code 200
addRequestHeader: Adding Accept => application/json to (nil)
addRequestHeader: Adding OData-Version => 4.0 to 0x7f7c9c11bc60
addRequestHeader: Adding User-Agent => libredfish to 0x7f7c9c11bc60
addRequestHeader: Adding Authorization => Basic cm9vdDpjYWx2aW4= to 0x7f7c9c11bc60
freeHeaders: Freeing 0x7f7c9c112770
freeHeaders: Freeing 0x7f7c9c11bbe0
asyncHeaderCallback: Adding OData-Version => 4.0 to (nil)
asyncHeaderCallback: Adding Keep-Alive => timeout=60, max=199 to 0x7f7c9c11a6b0
asyncHeaderCallback: Adding Content-Type => application/json;odata.metadata=minimal;charset=utf-8 to 0x7f7c9c11a6b0
asyncHeaderCallback: Adding Server => Appweb/4.5.4 to 0x7f7c9c11a6b0
asyncHeaderCallback: Adding Date => Wed, 28 Nov 2018 01 to 0x7f7c9c11a6b0
asyncHeaderCallback: Adding Cache-Control => no-cache to 0x7f7c9c11a6b0
asyncHeaderCallback: Adding Content-Length => 6979 to 0x7f7c9c11a6b0
asyncHeaderCallback: Adding Connection => Keep-Alive to 0x7f7c9c11a6b0
asyncHeaderCallback: Adding Access-Control-Allow-Origin => * to 0x7f7c9c11a6b0
asyncHeaderCallback: Adding Accept-Ranges => bytes to 0x7f7c9c11a6b0
rawAsyncWorkThread: Got response for url https://idrac-ip-address/redfish/v1/Chassis/System.Embedded.1/Thermal with code 200
...
...
...

RedfishTool works as expected in the same environment:

redfishtool -vvv -r idrac-ip-address -u root -p calvin Chassis -I System.Embedded.1 Thermal
#REQUEST: Transport:SendRecv:    GET http://idrac-ip-address/redfish/v1/
#REQUEST: Transport:SendRecv:    GET https://idrac-ip-address/redfish/v1/Chassis
#REQUEST: Transport:SendRecv:    GET https://idrac-ip-address/redfish/v1/Chassis/System.Embedded.1
#REQUEST: Transport:SendRecv:    GET https://idrac-ip-address/redfish/v1/Chassis/System.Embedded.1/Thermal
...
...

Please advise

libredfish doesn't install entities/chassis.h or entitites/resource.h

libredfish isn't usable as installed. To reproduce, build and install libredfish:

mkdir build
cd build
cmake .. -G Ninja
ninja
sudo ninja install

Then create a separate file test.c that attempts to use libredfish with the content:

#include <redfish.h>
int main(int argc, const char** argv){}

Try to compile with:

gcc test.c

Observe that compilation fails on an unfound entities/resource.h.

The above test was done on a debian 10 distro, but it is likely the same on all distros.

A quick scan through the code shows that those entities were not included in REDFISH_HDR_PUBLIC, although it's not clear if they're intended to be public or not, and even if they were, would require special handling because of the entities subfolder.

Implement timeout for each redfishService

Hey,
I am currently using your fine piece of software for a collectd read plugin and I want to configure timeout for requests. It is currently set to 20 seconds for curl.
I would like to attach the timeout to a redfishService.
I think you would just have to pass the redfishService struct to rawAsyncWorkThread, and assign the curl timeout.

Any plans to introduce this?
Thank you for your time.

[redfishtest] "/" works, but "/redfish/v1/Managers/" does not work

# ./bin/redfishtest -vvv -u admin -p admin -H "https://192.168.13.248" /
{
"@odata.context": "/redfish/v1/$metadata#ServiceRoot",
"@odata.id": "/redfish/v1/",
"@odata.type": "#ServiceRoot.v1_1_0.ServiceRoot",
"Id": "RootService",
"Name": "Root Service",
"RedfishVersion": "1.0.2",
"UUID": "759F24F5-B008-9CF2-EA11-3E30F6168036",
"Systems": {
"@odata.id": "/redfish/v1/Systems"
},
"Chassis": {
"@odata.id": "/redfish/v1/Chassis"
},
"Managers": {
"@odata.id": "/redfish/v1/Managers"
},
......

# ./bin/redfishtest -vvv -u admin -p admin -H "https://192.168.13.248" /redfish/v1/Managers/
createServiceEnumerator: Entered. host = https://192.168.13.248, rootUri = (null), auth = 0xffffd3b4f8c0, flags = 0
serviceIncRef: New count = 1
getVersions: Entered. service = 0xaaaaff789600, rootUri = (null)
getUriFromService: Entered. service = 0xaaaaff789600, uri = /redfish
getUriFromServiceAsync: Entered. service = 0xaaaaff789600, uri = /redfish, options = (nil), callback = 0xffff87b191d8, context = 0xaaaaff7896e0
serviceIncRef: New count = 2
addRequestHeader: Adding Accept => application/json to (nil)
addRequestHeader: Adding OData-Version => 4.0 to 0xaaaaff76f7f0
addRequestHeader: Adding User-Agent => libredfish to 0xaaaaff76f7f0
addRequestHeader: Adding Authorization => Basic VGVjaC5PTjpUaWFuR29uZzgwMDBA to 0xaaaaff76f7f0
serviceIncRef: New count = 3
serviceDecRef: New count = 2
getUriFromServiceAsync: Exit. ret = 1
asyncHeaderCallback: Adding Date => Mon, 08 Jan 2024 17 to (nil)
asyncHeaderCallback: Adding Referrer-Policy => no-referrer to 0xffff800fdca0
asyncHeaderCallback: Adding X-Frame-Options => SAMEORIGIN to 0xffff800fdca0
asyncHeaderCallback: Adding X-Download-Options => noopen to 0xffff800fdca0
asyncHeaderCallback: Adding Content-Security-Policy => default-src 'none'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; connect-src 'self' wss to 0xffff800fdca0
asyncHeaderCallback: Adding Cache-Control => max-age=0, no-cache, no-store, must-revalidate to 0xffff800fdca0
asyncHeaderCallback: Adding Expires => 0 to 0xffff800fdca0
asyncHeaderCallback: Adding OData-Version => 4.0 to 0xffff800fdca0
asyncHeaderCallback: Adding ETag => W/"51cac760" to 0xffff800fdca0
asyncHeaderCallback: Adding Allow => GET to 0xffff800fdca0
asyncHeaderCallback: Adding X-XSS-Protection => 1; mode=block to 0xffff800fdca0
asyncHeaderCallback: Adding Strict-Transport-Security => max-age=31536000; includeSubDomains to 0xffff800fdca0
asyncHeaderCallback: Adding X-Content-Type-Options => nosniff to 0xffff800fdca0
asyncHeaderCallback: Adding Content-Length => 21 to 0xffff800fdca0
asyncHeaderCallback: Adding Content-Type => application/json;charset=utf-8 to 0xffff800fdca0
rawAsyncWorkThread: Got response for url https://192.168.13.248/redfish with code 200
rawCallbackWrapper: Entered. request = 0xaaaaff789790, response = 0xffff8001b320, context = 0xaaaaff789800
createRedfishPayloadFromContent: Entered. content = 0xffff8001d5e0, contentLength = 21, contentType = application/json;charset=utf-8, service = 0xaaaaff789600
serviceIncRef: New count = 3
asyncToSyncConverter: Entered. success = 1, httpCode = 200, payload = 0xffff800fe270, context = 0xaaaaff7896e0
freeHeaders: Freeing 0xaaaaff76f7f0
freeHeaders: Freeing 0xffff800fdca0
serviceDecRef: New count = 2
rawCallbackWrapper: Exit.
serviceDecRef: New count = 1
getUriFromService: Exit. json = 0xffff800818d0
getVersions: Exited. data = 0xffff800818d0
getUriFromServiceAsync: Entered. service = 0xaaaaff789600, uri = /redfish/v1/, options = (nil), callback = 0xffff87b18d98, context = 0xaaaaff789a50
serviceIncRef: New count = 2
addRequestHeader: Adding Accept => application/json to (nil)
addRequestHeader: Adding OData-Version => 4.0 to 0xaaaaff76c030
addRequestHeader: Adding User-Agent => libredfish to 0xaaaaff76c030
addRequestHeader: Adding Authorization => Basic VGVjaC5PTjpUaWFuR29uZzgwMDBA to 0xaaaaff76c030
getUriFromServiceAsync: Exit. ret = 1
serviceDecRefAndWait: New count = 1
asyncHeaderCallback: Adding Date => Mon, 08 Jan 2024 17 to (nil)
asyncHeaderCallback: Adding Referrer-Policy => no-referrer to 0xffff80103cf0
asyncHeaderCallback: Adding X-Frame-Options => SAMEORIGIN to 0xffff80103cf0
asyncHeaderCallback: Adding X-Download-Options => noopen to 0xffff80103cf0
asyncHeaderCallback: Adding Content-Security-Policy => default-src 'none'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; connect-src 'self' wss to 0xffff80103cf0
asyncHeaderCallback: Adding Cache-Control => max-age=0, no-cache, no-store, must-revalidate to 0xffff80103cf0
asyncHeaderCallback: Adding Expires => 0 to 0xffff80103cf0
asyncHeaderCallback: Adding OData-Version => 4.0 to 0xffff80103cf0
asyncHeaderCallback: Adding ETag => W/"a4f48d64" to 0xffff80103cf0
asyncHeaderCallback: Adding Link => </redfish/v1/SchemaStore/en/ServiceRoot.json>;rel=describedby to 0xffff80103cf0
asyncHeaderCallback: Adding Allow => GET,PATCH to 0xffff80103cf0
asyncHeaderCallback: Adding X-XSS-Protection => 1; mode=block to 0xffff80103cf0
asyncHeaderCallback: Adding Strict-Transport-Security => max-age=31536000; includeSubDomains to 0xffff80103cf0
asyncHeaderCallback: Adding X-Content-Type-Options => nosniff to 0xffff80103cf0
asyncHeaderCallback: Adding Content-Length => 1840 to 0xffff80103cf0
asyncHeaderCallback: Adding Content-Type => application/json;charset=utf-8 to 0xffff80103cf0
rawAsyncWorkThread: Got response for url https://192.168.13.248/redfish/v1/ with code 200
rawCallbackWrapper: Entered. request = 0xffff800fe270, response = 0xffff80090ad0, context = 0xaaaaff789c40
createRedfishPayloadFromContent: Entered. content = 0xaaaaff789ca0, contentLength = 1840, contentType = application/json;charset=utf-8, service = 0xaaaaff789600
serviceIncRef: New count = 2
gotServiceRootAsync: Entered. success = 1, httpCode = 0xc8, payload = 0xffff800ffb10, context = 0xaaaaff789a50
getPayloadForPathAsync: Entered. payload = 0xffff800ffb10, redpath = 0xaaaaff789b20
getPayloadByNodeNameAsync: Payload contains no element named redfish
serviceDecRef: New count = 1
gotServiceRootAsync: Failed to get next path section immediately...Got a failure, httpCode = 65535
freeHeaders: Freeing 0xaaaaff76c030
freeHeaders: Freeing 0xffff80103cf0
serviceDecRef: New count = 0
freeServicePtr: Service session URI = (null)
terminateAsyncThread: Async thread self cleanup...
rawCallbackWrapper: Exit.

Broken Redpath

Hey,

I'm having trouble using the library with RedPath.
The [node.child] expression doesn't get parsed correctly.

Redpath works as expected when I use /Chassis[0]/Sensors[Status]
But when I use /Chassis[0]/Sensors[Status.Health] nothing gets returned.
I verified these do exist using the redfishcli demo from this repository.

The endnode looks like this in VSCode, when debugging with GDB:

  • endNode: 0x555555574640
    • isRoot: false
    • isIndex: false
    • version: 0x0
    • nodeName: 0x0
    • index: 0
    • op: REDPATH_OP_EXISTS
    • propName: "Status.Health"
    • value: 0x0
    • next: 0x0

I'm developing and running this application on Linux.
And I use the Redfish-Interface-Emulator to test my application.
If you need any additional information to be able to help please tell me.

Thanks a lot.

Unable to parse json! unable to decode byte

I'm running libredfish to one of DellEmc servers
On of the fields (SerialNumber) is gibberish - known bug, working with vendor to fix it.

See example here (using curl):

        "Status":       {
                "State":        "Enabled",
                "Health":       "OK"
        },
        "ChassisType":  "Enclosure",
        "IndicatorLED": "Off",
        "Manufacturer": "▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒",
        "Model":        "▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒",
        "PartNumber":   "303-589-000A",
        "SerialNumber": "▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒",
        "UUID": "ffffffff-ffff-ffff-ffff-ffffffffffff",
        "PowerState":   "On",

But libredfish returns NOTHING because json parsing failed on 1 field.

Expected behavior:

See example of debug output:

asyncHeaderCallback: Adding Connection => keep-alive to (nil)
asyncHeaderCallback: Adding OData-Version => 4.0 to 0x7fe594113e40
asyncHeaderCallback: Adding Cache-Control => no-cache to 0x7fe594113e40
asyncHeaderCallback: Adding Server => EMC-Redfish-Management to 0x7fe594113e40
asyncHeaderCallback: Adding Content-Length => 2708 to 0x7fe594113e40
asyncHeaderCallback: Adding Content-Type => application/json to 0x7fe594113e40
asyncHeaderCallback: Adding Allow => GET, PATCH to 0x7fe594113e40
rawAsyncWorkThread: Got response for url https://my-server/redfish/v1/Chassis/Chassis with code 200
createRedfishPayloadFromString: Unable to parse json! unable to decode byte 0xff near '"' UH\ufffd\ufffdH\ufffd\ufffd\ufffd
freeHeaders: Freeing 0x7fe594113330
freeHeaders: Freeing 0x7fe594113e40

Unable to terminate program correctly

Hey all,
My program is asynchronously using your software to make queries to a redfish API. I am having trouble safely closely my program. How would you recommend safely terminating the threads created by libredfish?

Thank you for any input.

SSE stream creates Events

Dear libredfish maintainers,

Currently the SSE thread does nothing but log the buffer. Are there any plans to process the buffer, extract events, and add events into the event queue?

Support int64 in GetPayloadIntValue()

In file libredfish/src/payload.c, getPayloadIntValue() is casting json_int_t(long long) to int, which doesn't support read of large int, should we return fixed width of 64 instead? Or we need to add another getPayloadInt64Value() to read int64.

problem with sending requests

Hi,
I've built and run examples/test.c and it doesn't send any curl request.
It looks like the job is pushed to the queue but right after that workItem->term is set to true which ends up with job pop before calling curl send.
I'll appreciate any help.

Ubuntu 16.04.4 LTS
commit: 4161c43

serviceDecRefAndWait is hanging while serviceDecRef() works, why?

Hi Team. We are using libredfish to create a program which is enumerating redfish service using createServiceEnumerator(). When function getPayloadByPath encounters an error with http response code 401 or 404, redfish service cleanup serviceDecRefAndWait() is hanging. But when we use serviceDecRef() our program terminate normally even though getPayloadbyPath gets an error like 401 or 404.

Question: What is the correct cleanup function for redfish service created using createServiceEnumerator()?

Help needed to get redfishtest working

Sending requests to an iLO using the python-ilorest-library just works fine, either using basic or session auth, I do get the json output with e.g. all the temperatures.

#!/usr/bin/python3

import json
import redfish

ilo_host="https://10.224.115.109"
ilo_account="Administrator"
ilo_password="xxx"

REDFISH_OBJ = redfish.RedfishClient(base_url=ilo_host, username=ilo_account, password=ilo_password)
REDFISH_OBJ.login(auth="basic")
response = REDFISH_OBJ.get("/redfish/v1/Chassis/1/Thermal/")
print(json.dumps(response.dict, indent = 1))

I'd like to achieve the same thing using libredfish and associated plugin in collectd, however it seems to give the same error I get while trying with redfishtest.

./redfishtest -v -H "https://10.224.115.109" -u Administrator -p xxx -W verdoc /redfish/v1/Chassis/1/Thermal/
Got a failure, httpCode = 65535
./redfishtest -v -H "https://10.224.115.109" -u Administrator -p xxx -W verdoc -S /redfish/v1/Chassis/1/Thermal/
Unable to create service enumerator
journalctl -f -u collectd.service
giu 01 12:39:15 hp-probook-450-g5-fred collectd[38042]: redfish: Query has failed, HTTP code = 65535

Help appreciated to understand what I am missing ... I hope that if I can understand what's wrong with redfishtest then I have a chance to also get collectd plugin right since they basically use the same parameters.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.