Hello, I guess many of you have a similiar problem as me: My scripts are often targeting a specific organization/network. The problem here is, that you first have to fine out what the id really is. My previous approach was often like this: Either I've used the developer.cisco.com feature to run the endpoints (e.g. getOrganizations) in the browser or you are just printing every value in the script to get the correct one. To solve that I wrote a script which will print every name/description of an organization, network, device, client or bluetooth client based on a given input pattern powered by regular expressions. usage: id_finder.py [-h] -p PATTERN [-s OPTIONS]
[-o ORGANIZATION [ORGANIZATION ...]]
[-n NETWORKS [NETWORKS ...]]
This scripts helps to find the id of an organization, network, device or
(bluetooth) client
optional arguments:
-h, --help show this help message and exit
-p PATTERN, --pattern PATTERN
the regular expression to search for (default: None)
-s OPTIONS, --search_options OPTIONS
specifies which objects should be looked up:
o=organizations, n=networks, d=devices, c=clients,
b=bluetooth clients (default: ond)
-o ORGANIZATION [ORGANIZATION ...], --organization ORGANIZATION [ORGANIZATION ...]
The name/id of the organizations under which you want
to limit the search. This makes the o option of -s
obsolete. (default: None)
-n NETWORKS [NETWORKS ...], --network NETWORKS [NETWORKS ...]
the name/id of the networks under which you want to
limit the search. This makes the n option of -s
obsolete. (default: None) By default it will only search in the organization-, network- or device name. To match also clients/bluetooth clients you have to specify the -s parameter example output running id_finder.py -p .* -o Home -s ondcb Critics and comments are welcome 😃
... View more