Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need Ceph NVMeMon map response to be Json compatible #583

Open
sunilkumarn417 opened this issue Apr 15, 2024 · 0 comments
Open

Need Ceph NVMeMon map response to be Json compatible #583

sunilkumarn417 opened this issue Apr 15, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@sunilkumarn417
Copy link

Need JSON reponse for the NVMeMON map command response, it might help us in easy way of parsing data.

 {
    "pool": "rbd",
    "group": "",
    "num gws": 2,
    "Anagrp list": "[ 2 1 ]"
}
{
    "gw-id": "client.nvmeof.rbd.ceph-sunilkumar-00-7v6gmf-node6.ltohgy",
    "anagrp-id": 2,
    "last-gw_map-epoch-valid": 1,
    "Availability": "AVAILABLE",
    "ana states": " 2: OWNER_FAILBACK_PREPARED , 1: STANDBY ,"
}
{
    "gw-id": "client.nvmeof.rbd.ceph-sunilkumar-00-7v6gmf-node7.qraoia",
    "anagrp-id": 1,
    "last-gw_map-epoch-valid": 1,
    "Availability": "AVAILABLE",
    "ana states": " 2: WAIT_FAILBACK_PREPARED , 1: ACTIVE ,"
}

Validate Json fails

>>> import json
>>> data = """{
...     "pool": "rbd",
...     "group": "",
...     "num gws": 2,
...     "Anagrp list": "[ 2 1 ]"
... }
... {
...     "gw-id": "client.nvmeof.rbd.ceph-sunilkumar-00-7v6gmf-node6.ltohgy",
...     "anagrp-id": 2,
...     "last-gw_map-epoch-valid": 1,
...     "Availability": "AVAILABLE",
...     "ana states": " 2: OWNER_FAILBACK_PREPARED , 1: STANDBY ,"
... }
... {
...     "gw-id": "client.nvmeof.rbd.ceph-sunilkumar-00-7v6gmf-node7.qraoia",
...     "anagrp-id": 1,
...     "last-gw_map-epoch-valid": 1,
...     "Availability": "AVAILABLE",
...     "ana states": " 2: WAIT_FAILBACK_PREPARED , 1: ACTIVE ,"
... }"""
>>>
>>> json.loads(data)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/lib64/python3.9/json/decoder.py", line 340, in decode
    raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 7 column 1 (char 87)
@sunilkumarn417 sunilkumarn417 added the enhancement New feature or request label Apr 15, 2024
@github-project-automation github-project-automation bot moved this to 🆕 New in NVMe-oF Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: 🆕 New
Development

No branches or pull requests

1 participant