def view_pool(arg, opts, shell_opts):
res = Pool.list({ '<STR_LIT:name>': arg })<EOL>if len(res) == <NUM_LIT:0>:<EOL><INDENT>print("<STR_LIT>" % arg)<EOL>return<EOL><DEDENT>p = res[<NUM_LIT:0>]<EOL>vrf_rt = None<EOL>vrf_name = None<EOL>if p.vrf:<EOL><INDENT>vrf_rt = p.vrf.rt<EOL>vrf_name = p.vrf.name<EOL><DEDENT>print("<STR_LIT>")<EOL>print("<STR_LIT>" % ("<STR_LIT>", p.id))<EOL>print("<STR_LIT>" % ("<STR_LIT:Name>", p.name))<EOL>print("<STR_LIT>" % ("<STR_LIT>", p.description))<EOL>print("<STR_LIT>" % ("<STR_LIT>", p.default_type))<EOL>print("<STR_LIT>" % ("<STR_LIT>", vrf_rt, vrf_name))<EOL>print("<STR_LIT>" % ("<STR_LIT>", str(p.ipv4_default_prefix_length), str(p.ipv6_default_prefix_length)))<EOL>print("<STR_LIT>")<EOL>if p.avps is not None:<EOL><INDENT>for key in sorted(p.avps, key=lambda s: s.lower()):<EOL><INDENT>print("<STR_LIT>" % (key, p.avps[key]))<EOL><DEDENT><DEDENT>print("<STR_LIT>")<EOL>for tag_name in sorted(p.tags, key=lambda s: s.lower()):<EOL><INDENT>print("<STR_LIT>" % tag_name)<EOL><DEDENT>print("<STR_LIT>")<EOL>if p.member_prefixes_v4 == <NUM_LIT:0>:<EOL><INDENT>print("<STR_LIT>")<EOL><DEDENT>elif p.ipv4_default_prefix_length is None:<EOL><INDENT>print("<STR_LIT>")<EOL><DEDENT>else:<EOL><INDENT>if p.total_prefixes_v4 == <NUM_LIT:0>:<EOL><INDENT>used_percent_v4 = <NUM_LIT:0><EOL><DEDENT>else:<EOL><INDENT>used_percent_v4 = (float(p.used_prefixes_v4)/p.total_prefixes_v4)*<NUM_LIT:100><EOL><DEDENT>print("<STR_LIT>" % ("<STR_LIT>",<EOL>p.used_prefixes_v4, p.free_prefixes_v4, used_percent_v4,<EOL>p.total_prefixes_v4))<EOL><DEDENT>if p.member_prefixes_v6 == <NUM_LIT:0>:<EOL><INDENT>print("<STR_LIT>")<EOL><DEDENT>elif p.ipv6_default_prefix_length is None:<EOL><INDENT>print("<STR_LIT>")<EOL><DEDENT>else:<EOL><INDENT>if p.total_prefixes_v6 == <NUM_LIT:0>:<EOL><INDENT>used_percent_v6 = <NUM_LIT:0><EOL><DEDENT>else:<EOL><INDENT>used_percent_v6 = (float(p.used_prefixes_v6)/p.total_prefixes_v6)*<NUM_LIT:100><EOL><DEDENT>print("<STR_LIT>" % ("<STR_LIT>",<EOL>p.used_prefixes_v6, p.free_prefixes_v6, used_percent_v6,<EOL>p.total_prefixes_v6))<EOL><DEDENT>if p.member_prefixes_v4 == <NUM_LIT:0>:<EOL><INDENT>print("<STR_LIT>")<EOL><DEDENT>elif p.ipv4_default_prefix_length is None:<EOL><INDENT>print("<STR_LIT>")<EOL><DEDENT>else:<EOL><INDENT>if p.total_addresses_v4 == <NUM_LIT:0>:<EOL><INDENT>used_percent_v4 = <NUM_LIT:0><EOL><DEDENT>else:<EOL><INDENT>used_percent_v4 = (float(p.used_addresses_v4)/p.total_addresses_v4)*<NUM_LIT:100><EOL><DEDENT>print("<STR_LIT>" % ("<STR_LIT>",<EOL>p.used_addresses_v4, p.free_addresses_v4, used_percent_v4,<EOL>p.total_addresses_v4))<EOL><DEDENT>if p.member_prefixes_v6 == <NUM_LIT:0>:<EOL><INDENT>print("<STR_LIT>")<EOL><DEDENT>elif p.ipv6_default_prefix_length is None:<EOL><INDENT>print("<STR_LIT>")<EOL><DEDENT>else:<EOL><INDENT>if p.total_addresses_v6 == <NUM_LIT:0>:<EOL><INDENT>used_percent_v6 = <NUM_LIT:0><EOL><DEDENT>else:<EOL><INDENT>used_percent_v6 = (float(p.used_addresses_v6)/p.total_addresses_v6)*<NUM_LIT:100><EOL><DEDENT>print("<STR_LIT>" % ("<STR_LIT>",<EOL>p.used_addresses_v6, p.free_addresses_v6, used_percent_v6,<EOL>p.total_addresses_v6))<EOL><DEDENT>print("<STR_LIT>" % (p.member_prefixes_v4,<EOL>p.member_prefixes_v6))<EOL>res = Prefix.list({ '<STR_LIT>': p.id})<EOL>for pref in res:<EOL><INDENT>print("<STR_LIT>" % pref.display_prefix)<EOL><DEDENT>
View a single pool