Using nebius-cloud-cli
I am trying to list only name and id of all folders in my account.
I tried this:
yc vpc networks list --format json | jq ".[] "
The output I got was:
{
"id": "ccm979ujel7gpcq6aulc",
"folder_id": "b489aa1fe17nphuomth8",
"created_at": "2022-12-12T17:47:24Z",
"name": "default",
"description": "Auto-created network"
}
{
"id": "ccmn8qvg1uaaaiblc05e",
"folder_id": "b4aaav1fe1gnphuomth8",
"created_at": "2022-12-29T12:07:40Z",
"name": "my-network"
}
{
"id": "campid2asepq3bc68fn6",
"folder_id": "b489kv3ae1ga1huomth8",
"created_at": "2021-12-18T09:54:01Z",
"name": "my-nw",
"description": "Auto-created network"
}
Expected output:
[
{"name": "default",
"folder_id": "b4aaav1fe1gnphuomth8"
},
{"name": my-nw,
"folder_id": "b489kv3ae1ga1huomth8"
}
]
The output I got is a multi line non standard JSON coming from this output, and needs to be handled correctly.
I'm looking for a simple transformation, not redirection and awks and stuff like this <<
in bash which defeats the purpose.