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

Display "Published ports" information when output format is JSON #634

Closed
hellt opened this issue Sep 30, 2021 Discussed in #633 · 1 comment
Closed

Display "Published ports" information when output format is JSON #634

hellt opened this issue Sep 30, 2021 Discussed in #633 · 1 comment
Labels
enhancement New feature or request

Comments

@hellt
Copy link
Member

hellt commented Sep 30, 2021

Discussed in #633

Originally posted by fredsem September 30, 2021
Hello,
When I inspect the labs are running, I can see the detail of the published ports in mysocket.io.

[root@mylab ~]# containerlab inspect --all
+---+-----------------------------------+----------+-----------------------+--------------+---------------------------------+------------+-------+---------+---------------+--------------+
| # |             Topo Path             | Lab Name |         Name          | Container ID |              Image              |    Kind    | Group |  State  | IPv4 Address  | IPv6 Address |
+---+-----------------------------------+----------+-----------------------+--------------+---------------------------------+------------+-------+---------+---------------+--------------+
| 1 | ../opt/mylab/topologies/lab01.yml | lab01    | clab-lab01-R01        | 911157b0b763 | vrnetlab/vr-sros:20.10.R1       | vr-sros    |       | running | 10.10.10.4/24 | NA           |
| 2 |                                   |          | clab-lab01-R02        | 3b35023c0cbe | vrnetlab/vr-sros:20.10.R1       | vr-sros    |       | running | 10.10.10.3/24 | NA           |
| 3 |                                   |          | clab-lab01-mysocketio | 2e688c170687 | ghcr.io/hellt/mysocketctl:0.4.0 | mysocketio |       | running | 10.10.10.2/24 | NA           |
+---+-----------------------------------+----------+-----------------------+--------------+---------------------------------+------------+-------+---------+---------------+--------------+
**Published ports:
┌──────────────────────────────────────┬─────────────────────────────────────────┬─────────┬──────┬────────────┬─────────────────┐
│ SOCKET ID                            │ DNS NAME                                │ PORT(S) │ TYPE │ CLOUD AUTH │ NAME            │
├──────────────────────────────────────┼─────────────────────────────────────────┼─────────┼──────┼────────────┼─────────────────┤
│ dad6ed7f-f601-4b35-aba1-233711334485 │ lingering-glitter-9346.edge.mysocket.io │ 31181   │ tcp  │ false      │ clab-R01-tcp-22 │
│ e2eccbee-09bb-4c13-bbe6-9df82d8dfd5b │ late-pine-8645.edge.mysocket.io         │ 50297   │ tcp  │ false      │ clab-R02-tcp-22 │
└──────────────────────────────────────┴─────────────────────────────────────────┴─────────┴──────┴────────────┴─────────────────┘**

But when I get the output in json format, the published ports are not detailed.

[root@mylab ~]# containerlab inspect --all -f json
[
  {
    "lab_name": "lab01",
    "labPath": "../opt/mylab/topologies/lab01.yml",
    "name": "clab-lab01-R01",
    "container_id": "911157b0b763",
    "image": "vrnetlab/vr-sros:20.10.R1",
    "kind": "vr-sros",
    "state": "running",
    "ipv4_address": "10.10.10.4/24",
    "ipv6_address": "NA"
  },
  {
    "lab_name": "lab01",
    "labPath": "../opt/mylab/topologies/lab01.yml",
    "name": "clab-lab01-R02",
    "container_id": "3b35023c0cbe",
    "image": "vrnetlab/vr-sros:20.10.R1",
    "kind": "vr-sros",
    "state": "running",
    "ipv4_address": "10.10.10.3/24",
    "ipv6_address": "NA"
  },
  {
    "lab_name": "lab01",
    "labPath": "../opt/mylab/topologies/lab01.yml",
    "name": "clab-lab01-mysocketio",
    "container_id": "2e688c170687",
    "image": "ghcr.io/hellt/mysocketctl:0.4.0",
    "kind": "mysocketio",
    "state": "running",
    "ipv4_address": "10.10.10.2/24",
    "ipv6_address": "NA"
  }
]

How can I get the sockets detail in json format?.

Thanks.

@hellt
Copy link
Member Author

hellt commented Aug 10, 2022

delivered in #887

@hellt hellt closed this as completed Aug 10, 2022
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
None yet
Development

No branches or pull requests

1 participant