Thank you both for the response , Ilya , the ports{\>}1191229a-6878-4dfc-b07a-47e6e2a4dcfe syntax was exactly what I was looking for :)
Thanks Gav On Mon, 17 Jul 2023 at 11:57, Ilya Maximets <i.maxim...@ovn.org> wrote: > On 7/17/23 07:52, Numan Siddique via discuss wrote: > > On Mon, Jul 17, 2023 at 5:51 AM Gavin McKee via discuss > > <ovs-discuss@openvswitch.org> wrote: > >> > >> Hi, > >> > >> Can someone help me understand how to find a uuid in a set of Ports > using the table below as an example? > >> > >> I want to check if the uuid 1191229a-6878-4dfc-b07a-47e6e2a4dcfe is in > the set of assigned ports (in some cases I have a large number of ports and > want to search for membership in a port list). > >> > >> [root@ovnkube-db-0 ~]# ovn-nbctl --no-leader-only find Logical_Switch > name=a_b461d3e2_621c_43f4_8d7c_e39c13bcba08_ls_bca4b75e_9b21_4454_98a3_e490feecae9f > >> > >> _uuid : 7c28c854-a40d-4145-b6f3-7d0f0e69d5ab > >> acls : [] > >> copp : [] > >> dns_records : [] > >> external_ids : > {crusoe_subnet_id="bca4b75e-9b21-4454-98a3-e490feecae9f", > crusoe_vpc_id="ec7f1ea4-66a2-4b9e-ac0d-79e9ec0998db", > customer_id="b461d3e2-621c-43f4-8d7c-e39c13bcba08"} > >> forwarding_groups : [] > >> load_balancer : [] > >> load_balancer_group : [] > >> name : > a_b461d3e2_621c_43f4_8d7c_e39c13bcba08_ls_bca4b75e_9b21_4454_98a3_e490feecae9f > >> other_config : {exclude_ips="172.27.16.0..172.27.16.4", subnet=" > 172.27.16.0/20"} > >> ports : [1191229a-6878-4dfc-b07a-47e6e2a4dcfe, > 2937d508-3db0-4d40-8c06-10849abcf9d9, 327e037a-b11e-4dc4-8846-08a9c262b911] > >> qos_rules : [] > >> > >> > >> Thanks > >> > > > > One way I can think of is running the below command. > > > > # ovn-nbctl get logical_switch > > > a_b461d3e2_621c_43f4_8d7c_e39c13bcba08_ls_bca4b75e_9b21_4454_98a3_e490feecae9f > > ports | grep 1191229a-6878-4dfc-b07a-47e6e2a4dcfe > > > > If you don't want to use grep, then I'm not sure. > > Something like this should work (not tested): > > ovn-nbctl --no-leader-only find Logical_Switch \ > > name=a_b461d3e2_621c_43f4_8d7c_e39c13bcba08_ls_bca4b75e_9b21_4454_98a3_e490feecae9f > \ > ports{\>}1191229a-6878-4dfc-b07a-47e6e2a4dcfe > > Following command should check if two ports are there: > > ovn-nbctl --no-leader-only find Logical_Switch \ > > name=a_b461d3e2_621c_43f4_8d7c_e39c13bcba08_ls_bca4b75e_9b21_4454_98a3_e490feecae9f > \ > > ports{\>}1191229a-6878-4dfc-b07a-47e6e2a4dcfe,2937d508-3db0-4d40-8c06-10849abcf9d9 > > Best regards, Ilya Maximets. >
_______________________________________________ discuss mailing list disc...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-discuss