Uploaded image for project: 'Percona Monitoring and Management'
  1. Percona Monitoring and Management
  2. PMM-5003

pmm-admin list and status use different JSON naming for the same data

Details

    • Bug
    • Status: Done
    • Medium
    • Resolution: Fixed
    • 2.1.0
    • 2.4.0
    • PMM Admin
    • None
    • 2
    • Yes
    • Yes
    • No

    Description

      If I use list to show the agents then the JSON output uses agent to name the list of agents:

      => pmm-admin list --json | python -c 'import json; print json.load(open("/dev/stdin", "r")).get("agent")'                                    
      [{u'status': u'connected', u'service_id': u'', u'agent_type': u'pmm-agent', u'agent_id': u'/agent_id/0a40910a-a829-4f82-9bb2-953e12144ace'}, {u'status': u'running', u'service_id': u'', u'agent_type': u'node_exporter', u'agent_id': u'/agent_id/53f2d2b6-b2a5-4721-aba0-78f1f607fdcd'}]
      

      Whereas, if I use status then the JSON output uses agents:

      => pmm-admin status --json | python -c 'import json; print json.load(open("/dev/stdin", "r")).get("pmm_agent_status", {}).get("agents")'   
      [{u'status': u'RUNNING', u'agent_type': u'NODE_EXPORTER', u'agent_id': u'/agent_id/53f2d2b6-b2a5-4721-aba0-78f1f607fdcd'}]
      

      Also, status changes from "running" to "RUNNING", agent_type changes from "node_exporter" to "NODE_EXPORTER", etc


      Most pmm-admin command results use generated API object strucutres:

      Some commands (list, inventory list) use plain strings instead:

      All results should use generated API object structures. Tests should be added.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ceri.williams Ceri Williams
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - Not Specified
                  Not Specified
                  Logged:
                  Time Spent - 1 day, 2 hours, 25 minutes
                  1d 2h 25m

                  Smart Checklist