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

Description

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

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

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.

How to test

None

How to document

None

Activity

Nailya Kutlubaeva March 12, 2020 at 10:04 PM

tested:

Carlos Salguero March 11, 2020 at 9:27 PM
Edited

Alexey Palazhchenko March 11, 2020 at 10:07 AM

We forgot to update pmm-admin status non-JSON output:

It should use nice texts for types and statuses.

Alexey Palazhchenko March 4, 2020 at 3:11 PM

Also, status changes from "running" to "RUNNING"

We lost that part ^. I think we should do the same with statuses as we did for Node/Service/Agent types.

(there is also an issue with URL, but it is fixed already: https://github.com/percona/pmm-admin/pull/93. Please continue in that PR)

Alexey Palazhchenko December 27, 2019 at 9:30 AM
Edited

In text mode, CLI should output nice-looking types: "MySQL", "msqld_exporter", etc.
In JSON mode, CLI should output types as they are specified in Swagger: "MYSQL_SERVICE", "MYSQLD_EXPORTER", etc.

My idea was to add helpers to convert Swagger type strings/ints and gRPC strings/enums to nice-looking strings and use those helpers in pmm-admin templates. In result structures, original Swagger strings should be used for proper JSON output. See this PR: https://github.com/percona/pmm/pull/475

Done

Details

Assignee

Reporter

Priority

Components

Needs QA

Needs Doc

Fix versions

Story Points

Affects versions

Smart Checklist Progress

Created November 15, 2019 at 2:52 PM
Updated April 22, 2025 at 7:14 AM
Resolved March 13, 2020 at 9:25 AM