Project

General

Profile

Actions

User story #6137

closed

Retrieve compliance from the API

Added by Benoît PECCATTE over 9 years ago. Updated almost 9 years ago.

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

Description

I want to be able to get the compliance of a given node from the API.
And maybe be get the global compliance status too.

The proposed endpoints are:

GET .../api/latest/compliance/nodes
=> return the list of compliance by node for all nodes, see proposed format belove
GET .../api/latest/compliance/nodes/UUID-OF-NODE
=> return the list of compliance for the node with the given UUID, see proposed format belove
GET .../api/latest/compliance/rules
=> return the list of compliance by rule for all rules, see proposed format belove
GET .../api/latest/compliance/rules/UUID-OF-RULE
=> return the list of compliance for the rule with the given UUID, see proposed format belove

The name of the compliance level would bi:
- successNotApplicable
- successAlreadyOK
- successRepaired
- error
- unexpectedUnknownComponent
- unexpectedMissingComponent
- noReport
- applaying

For a node, we will have the hierarchy: Node -> Rules -> Directives -> Components -> Values, like:

      {
        "id": "root",
        "compliance": {
          "successAlreadyOK": 100
        },
        "rules": [
          {
            "id": "2278f76f-28d3-4326-8199-99561dd8c785",
            "compliance": {
              "successAlreadyOK": 100
            },
            "directives": [
              {
                "id": "ab459975-7116-40ad-aab7-6479694ff606",
                "compliance": {
                  "successAlreadyOK": 100
                },
                "components": [
                  {
                    "name": "MOTD Configuration",
                    "compliance": {
                      "successAlreadyOK": 100
                    },
                    "values": [
                      {
                        "value": "None",
                        "reports": [
                          {
                            "status": "successAlreadyOK" 
                          }
                        ]
                      }
                    ]
                  }
                ]
              }
            ]
          }
        ]
      }

And for a rule, the hierarchy would be: Rule -> Directives -> Components -> Nodes -> Values, like:

      {
        "id": "inventory-all",
        "compliance": {
          "successAlreadyOK": 33.33,
          "noReport": 66.67
        },
        "directives": [
          {
            "id": "inventory-all",
            "compliance": {
              "successAlreadyOK": 33.33,
              "noReport": 66.67
            },
            "components": [
              {
                "name": "inventory",
                "compliance": {
                  "successAlreadyOK": 33.33,
                  "noReport": 66.67
                },
                "nodes": [
                  {
                    "id": "729be5c4-55a2-4b97-8529-5154cbb63a18",
                    "values": [
                      {
                        "value": "None",
                        "reports": [
                          {
                            "status": "noReport" 
                          }
                        ]
                      }
                    ]
                  },
                  {
                    "id": "0876521e-3c81-4775-85c7-5dd7f9d5d3da",
                    "values": [
                      {
                        "value": "None",
                        "reports": [
                          {
                            "status": "noReport" 
                          }
                        ]
                      }
                    ]
                  },
                  {
                    "id": "root",
                    "values": [
                      {
                        "value": "None",
                        "reports": [
                          {
                            "status": "successAlreadyOK" 
                          }
                        ]
                      }
                    ]
                  }
                ]
              }
            ]
          }
        ]
      }


Subtasks 1 (0 open1 closed)

Bug #6753: Compliance API throws exceptionReleasedNicolas CHARLES2015-06-12Actions
Actions #1

Updated by François ARMAND about 9 years ago

  • Target version set to 3.1.0~beta1

Clearly a 3.1 target !

Actions #2

Updated by François ARMAND about 9 years ago

It could also be as a first approximation the inclusion of itop-compliance plugin : https://github.com/Normation/rudder-plugin-itop/

Actions #3

Updated by Nicolas CHARLES about 9 years ago

I would love that ! +1

Actions #4

Updated by Vincent MEMBRÉ almost 9 years ago

  • Target version changed from 3.1.0~beta1 to 3.1.0~rc1
Actions #5

Updated by François ARMAND almost 9 years ago

  • Description updated (diff)
  • Status changed from New to Pending technical review
  • Assignee set to Vincent MEMBRÉ
  • Priority changed from N/A to 2
  • Pull Request set to https://github.com/Normation/rudder/pull/868
Actions #6

Updated by Vincent MEMBRÉ almost 9 years ago

  • Status changed from Pending technical review to 12
Actions #7

Updated by Vincent MEMBRÉ almost 9 years ago

  • Status changed from 12 to Pending release
Actions #8

Updated by Vincent MEMBRÉ almost 9 years ago

  • Status changed from Pending release to Released

This bug has been fixed in Rudder 3.1.0~rc1 which was released on the 16th June 2015.

Actions

Also available in: Atom PDF