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

Ability to output ls/ps in json format #889

Merged
merged 1 commit into from
Aug 25, 2023
Merged

Commits on Aug 18, 2023

  1. Ability to output ls/ps in json format

    Let's allow to use --format=json option to display lists
    in machine-readable format.
    
    ```
    $ ./eden volume ls --format=json
    [
        {
            "Name": "pedantic_ganguly_0_m_0",
            "UUID": "77a786a5-fc09-4b3d-946c-fbb4d77a72ce",
            "Image": "lfedge/eden-eclient:b1c1de6",
            "VolumeType": "CONTAINER",
            "Size": "82 MB",
            "MaxSize": "-",
            "AdamState": "IN_CONFIG",
            "EveState": "DELIVERED",
            "LastError": "",
            "Ref": "app: pedantic_ganguly",
            "MountPoint": "/",
            "OriginType": "VCOT_DOWNLOAD"
        }
    ]
    ```
    
    ```
    $ ./eden network ls --format=json
    [
        {
            "Name": "flamboyant_goldstine",
            "UUID": "c7b73fe8-f2eb-4304-b07a-9f8adcca8178",
            "NetworkType": "ZnetInstLocal",
            "CIDR": "10.11.12.0/24",
            "Stats": "rx:{totalPackets:570 totalBytes:54758} tx:{totalPackets:2260 totalBytes:2607824}",
            "AdamState": "IN_CONFIG",
            "EveState": "ACTIVATED",
            "Activated": true
        }
    ]
    ```
    
    ```
    $ ./eden pod ps --format=json
    [
        {
            "Name": "pedantic_ganguly",
            "UUID": "2877759b-5443-4952-b95e-004f244c87ad",
            "Image": "lfedge/eden-eclient:b1c1de6",
            "AdamState": "IN_CONFIG",
            "EVEState": "RUNNING",
            "InternalIP": [
                "10.11.12.2"
            ],
            "ExternalIP": "127.0.0.1",
            "InternalPort": "22",
            "ExternalPort": "8027",
            "MemoryUsed": 181,
            "MemoryAvail": 896,
            "CPUUsage": 0,
            "Macs": [
                "ce:5b:cd:11:50:0f"
            ],
            "Volumes": {
                "77a786a5-fc09-4b3d-946c-fbb4d77a72ce": 100
            }
        }
    ]
    ```
    
    Signed-off-by: Petr Fedchenkov <[email protected]>
    giggsoff committed Aug 18, 2023
    Configuration menu
    Copy the full SHA
    57c245b View commit details
    Browse the repository at this point in the history