Project

General

Profile

Actions

Architecture #8006

closed

API query on nodes doesn't give full inventory with option defined

Added by Florian Heigl over 8 years ago. Updated over 8 years ago.

Status:
Rejected
Priority:
2
Assignee:
-
Category:
API
Target version:
Effort required:
Name check:
Fix check:
Regression:

Description

The data I get back from this URL is quite a lot different than the API suggests.

I get back a very minimal amount of data for each node, example:

'machineType' => 'Physical',
'osVersion' => '11',
'osName' => 'Suse',
'status' => 'accepted',
'hostname' => 'hostname-tld',
'id' => 'id-id-id-id'

However, according to the API documentation I should get back far more information:

http://www.rudder-project.org/rudder-api-doc/#api-Nodes-listAcceptedNodes

Even in old versions of the API. I even tried ‘/api/latest/nodes?include=full’ and it did not change the output. I’m trying to get lastInventoryDate specifically (I also tried include=lastInventoryDate, no difference). If I get the status of a single node with /api/latest/nodes/<nodeid> then I get back all of the data I need, including lastInventoryDate, but this isn’t useful because I need the information about all nodes, so probing them one by one would take all day.

Is there a reason why the output only returns 6 fields even with ‘include=full’ despite that the API documentation says it should output much more data?

We also tested against versions 4/5 with same result.

Actions #1

Updated by François ARMAND over 8 years ago

Hello,

That feature is only available in API v6/Rudder 3.1. So it is normal that it does not work on v4/5 (but from an UX point of view, that kind of non recognized parameter should be reported to the user in one way or an other).

It acutlly works as expected on our labo (Rudder 3.1.7):

% curl -k -H "X-API-Token: XXXXXXXX"  -X GET 'https://xxxx.normation.com/rudder/api/latest/nodes?include=os,environmentVariables' | jq .
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  7457  100  7457    0     0  19851      0 --:--:-- --:--:-- --:--:-- 19832
{
  "action": "listAcceptedNodes",
  "result": "success",
  "data": {
    "nodes": [
      {
        "hostname": "xxxxx.normation.com",
        "machine": {
          "id": "7b572eb1-3131-3ea6-f6f1-d8acbbcd1fe8",
          "type": "Virtual",
          "provider": "qemu",
          "manufacturer": "Bochs" 
        },
        "managementTechnology": [
          {
            "name": "CFEngine Community" 
          }
        ],
        "lastInventoryDate": "2015-02-10 00:21",
        "id": "338dde28-a34b-4cd4-9668-da81d573a1ef",
        "status": "accepted",
        "ipAddresses": [
          "127.0.0.1",
          "192.168.110.54" 
        ],
        "properties": [],
        "environmentVariables": {
          "DEBIAN_FRONTEND": "noninteractive",
          "MAIL": "/var/spool/mail/root",
          "PATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/var/rudder/cfengine-community/bin:/var/rudder/cfengine-community/bin",
          "_": "/usr/bin/fusioninventory-agent",
          "HISTCONTROL": "ignoredups",
          "LOGNAME": "root",
          "BOOT_IMAGE": "/vmlinuz-3.11.10-100.fc18.i686.PAE",
          "HOSTNAME": "fedora-18-32",
          "PWD": "/var/rudder",
          "USER": "root",
          "HISTSIZE": "1000",
          "LESSOPEN": "||/usr/bin/lesspipe.sh %s",
          "LANG": "en_US.UTF-8",
          "SHLVL": "196" 
        },
        "architectureDescription": "i386-linux-thread-multi",
        "ram": 496,
        "os": {
          "type": "Linux",
          "name": "Fedora",
          "version": "18",
          "fullName": "Fedora release 18 (Spherical Cow)",
          "kernelVersion": "3.11.10-100.fc18.i686.PAE" 
        },
        "policyServerId": "root" 
      },
....

Could you tell me what is your exact version of Rudder, so that I can try to reproduce the problème ?

Thanks

Actions #2

Updated by Benoît PECCATTE over 8 years ago

  • Target version set to 4.0.0~rc2
Actions #3

Updated by François ARMAND over 8 years ago

It was discussed on irc (quiet a long time ago) and the problem was due to the use of a version not supporting the feature.
We are working on the documentation of the API to make it clearer what version support what.

Given these information, I'm proposing to close that one. Is it OK for you?

Actions #4

Updated by Janos Mattyasovszky over 8 years ago

Yes, thank you.

Actions #5

Updated by François ARMAND over 8 years ago

  • Status changed from New to Rejected
Actions

Also available in: Atom PDF