Project

General

Profile

Actions

User story #4579

closed

User story #4578: Add information from inventory when looking for Nodes through Rest API

Add inventory detail to GET /api/nodes/id method API Rest method

Added by Vincent MEMBRÉ over 10 years ago. Updated over 9 years ago.

Status:
Released
Priority:
1 (highest)
Category:
API
Target version:
UX impact:
Suggestion strength:
User visibility:
Effort required:
Name check:
Fix check:
Regression:

Description

This feature should add some new informations in the API about Node information.

This shoudl Add defaut, minimal and Full informations about inventory.

First version should only have full scope to be equal to default scope.

Actions #1

Updated by Vincent MEMBRÉ over 10 years ago

  • Status changed from New to In progress
Actions #2

Updated by Vincent MEMBRÉ over 10 years ago

  • Pull Request set to https://github.com/Normation/rudder/pull/466

PR here: https://github.com/Normation/rudder/pull/466

here si an exemple of a full inventory:

url -X GET 'http://localhost:8042/api/4/nodes/0697d6d0-31ba-4f92-affc-54c677c44708?prettify=true&include=full' -k -H "X-API-Token: rHMfUJTMAMFsmSgIxJ6NbdHTWN1zw6nm" 
{
  "action":"nodeDetails",
  "id":"0697d6d0-31ba-4f92-affc-54c677c44708",
  "result":"success",
  "data":{
    "nodes":[{
      "lastInventoryDate":"2014-03-11 11:01",
      "architectureDescription":"x86_64-linux-thread-multi",
      "description":"",
      "OS":{
        "type":"Linux",
        "name":"Debian",
        "version":"6.0.7",
        "servicePack":"N/A",
        "kernelVersion":"2.6.32-5-amd64" 
      },
      "id":"0697d6d0-31ba-4f92-affc-54c677c44708",
      "status":"pending",
      "environmentVariables":{
        "PATH":"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin::/var/lib/gems/1.8/bin",
        "BOOT_IMAGE":"/boot/vmlinuz-2.6.32-5-amd64",
        "init":"/sbin/init",
        "LC_ALL":"C",
        "DEBIAN_FRONTEND":"noninteractive",
        "LANG":"C",
        "TERM":"linux",
        "INIT_VERSION":"sysvinit-2.88",
        "rootmnt":"/root",
        "VERBOSE":"no",
        "runlevel":"2",
        "SHLVL":"1",
        "LINES":"25",
        "previous":"N",
        "PWD":"/var/rudder",
        "SHELL":"/bin/sh",
        "HOME":"/",
        "RUNLEVEL":"2",
        "_":"/var/rudder/cfengine-community/bin/cf-execd",
        "PREVLEVEL":"N",
        "CONSOLE":"/dev/console" 
      },
      "machine":{
        "type":"Virtual",
        "provider":"vbox",
        "id":"0830F9AB-9C40-4C38-A963-4B562129FF18" 
      },
      "ipAdresses":["127.0.0.1","10.0.2.15","192.168.42.82"],
      "managementTechnologyDetails":{
        "CFEngineKeys":["MIIBCAKCAQEAz9BbxKwtx4ux8cICDXZA43dqoL6qq3w1DeTSWxSv8OTEQYNbi4jsyYlWspMDRREGyzVyPngu72436ubAQIaIXFOdDWXUKmeu3xJ/roWkmWWRYTcmYprX8h/TyVeqHVIamcUaY2uOwcZ9IjoTHuu1X13aEEHt5HWoOOJi3lDzk8IoVJDbBT+oieaZiqtVOGyN/OZ0zEdZYKIgSFPCmfswH4Mm1k62G/Kt4WmJa+LdDLd2kWcSa6GT1zB3Hd0epDTT1URJEaIWN/pmQFCaghgH8Tr8cSi94Ly3zOYc4JlLYgkKGGCsY94uWh7ddq4YLgQ1Hb3HnKhXYywjHHEVXEYY1QIBIw=="],
        "CFEngineUser":"root" 
      },
      "ram":"244 MB",
      "networkInterfaces":[{
        "name":"eth1",
        "ipAdresses":["192.168.42.82"],
        "MACAdress":"08:00:27:a8:1f:bf",
        "status":"Up" 
      },{
        "name":"lo",
        "ipAdresses":["127.0.0.1"],
        "MACAdress":"00:00:00:00:00:00",
        "status":"Up" 
      },{
        "name":"eth0",
        "ipAdresses":["10.0.2.15"],
        "MACAdress":"08:00:27:63:5e:f5",
        "status":"Up" 
      }],
      "managementTechnology":[{
        "name":"CFEngine Community",
        "version":"N/A" 
      }],
      "hostname":"node2.rudder.local",
      "policyServerId":"root" 
    }]
  }

I have a question:

  • If a data is missing (ie here: Service Pack of OS) should we display "N/A" or should we skip that data ?
Actions #3

Updated by François ARMAND over 10 years ago

Skip the data.

It is expected in JSON structure to not have all information if the information is not mandatory. All the JSON library are used to handle that, and not at all to deals with a "N/A".

Of course, if we defined the data as mandatory and it's not available, we should return an error. But mandatory variable are quite few, and we should never have the case where a data is mandatory in the JSON strcuture but not in Rudder.

Actions #4

Updated by Vincent MEMBRÉ over 10 years ago

  • Status changed from In progress to Pending technical review
  • Assignee changed from Vincent MEMBRÉ to François ARMAND
Actions #5

Updated by Vincent MEMBRÉ over 10 years ago

  • Status changed from Pending technical review to Pending release
  • % Done changed from 0 to 100
Actions #6

Updated by Anonymous over 10 years ago

Actions #7

Updated by Vincent MEMBRÉ over 10 years ago

  • Status changed from Pending release to Released

This bug has been fixed in Rudder 2.10.0~beta1, which was released today.
Check out:

The release announcement: http://www.rudder-project.org/pipermail/rudder-announce/2014-March/000084.html
The full ChangeLog: http://www.rudder-project.org/foswiki/bin/view/System/Documentation:ChangeLog210
Download information: https://www.rudder-project.org/site/get-rudder/downloads/
Actions #8

Updated by Benoît PECCATTE over 9 years ago

  • Tracker changed from Enhancement to User story
Actions

Also available in: Atom PDF