def get_parser(self, prog_name): parser = super(ListPort, self).get_parser(prog_name) parser.add_argument( '--device-owner', metavar='<device-owner>', help=_("List only ports with the specified device owner. " "This is the entity that uses the port (for example, " "network:dhcp).") ) parser.add_argument( '--network', metavar='<network>', help=_("List only ports connected to this network (name or ID)")) device_group = parser.add_mutually_exclusive_group() device_group.add_argument( '--router', metavar='<router>', dest='router', help=_("List only ports attached to this router (name or ID)") ) device_group.add_argument( '--server', metavar='<server>', help=_("List only ports attached to this server (name or ID)"), ) device_group.add_argument( '--device-id', metavar='<device-id>', help=_("List only ports with the specified device ID") ) parser.add_argument( '--mac-address', metavar='<mac-address>', help=_("List only ports with this MAC address") ) parser.add_argument( '--long', action='store_true', default=False, help=_("List additional fields in output") ) parser.add_argument( '--project', metavar='<project>', help=_("List ports according to their project (name or ID)") ) identity_common.add_project_domain_option_to_parser(parser) parser.add_argument( '--fixed-ip', metavar=('subnet=<subnet>,ip-address=<ip-address>,' 'ip-substring=<ip-substring>'), action=parseractions.MultiKeyValueAction, optional_keys=['subnet', 'ip-address', 'ip-substring'], help=_("Desired IP and/or subnet for filtering ports " "(name or ID): subnet=<subnet>,ip-address=<ip-address>," "ip-substring=<ip-substring> " "(repeat option to set multiple fixed IP addresses)"), ) _tag.add_tag_filtering_option_to_parser(parser, _('ports')) return parser
def get_parser(self, prog_name): parser = super(ListRouter, self).get_parser(prog_name) parser.add_argument('--name', metavar='<name>', help=_("List routers according to their name")) admin_state_group = parser.add_mutually_exclusive_group() admin_state_group.add_argument('--enable', action='store_true', help=_("List enabled routers")) admin_state_group.add_argument('--disable', action='store_true', help=_("List disabled routers")) parser.add_argument('--long', action='store_true', default=False, help=_("List additional fields in output")) parser.add_argument( '--project', metavar='<project>', help=_("List routers according to their project (name or ID)")) identity_common.add_project_domain_option_to_parser(parser) parser.add_argument( '--agent', metavar='<agent-id>', help=_("List routers hosted by an agent (ID only)")) _tag.add_tag_filtering_option_to_parser(parser, _('routers')) return parser
def update_parser_network(self, parser): parser.add_argument('--network', metavar='<network>', help=_("List floating IP(s) according to " "given network (name or ID)")) parser.add_argument('--port', metavar='<port>', help=_("List floating IP(s) according to " "given port (name or ID)")) parser.add_argument('--fixed-ip-address', metavar='<ip-address>', help=_("List floating IP(s) according to " "given fixed IP address")) parser.add_argument('--long', action='store_true', default=False, help=_("List additional fields in output")) parser.add_argument('--status', metavar='<status>', choices=['ACTIVE', 'DOWN'], help=_("List floating IP(s) according to " "given status ('ACTIVE', 'DOWN')")) parser.add_argument('--project', metavar='<project>', help=_("List floating IP(s) according to " "given project (name or ID)")) identity_common.add_project_domain_option_to_parser(parser) parser.add_argument('--router', metavar='<router>', help=_("List floating IP(s) according to " "given router (name or ID)")) _tag.add_tag_filtering_option_to_parser(parser, _('floating IP')) return parser
def get_parser(self, prog_name): parser = super(ListPort, self).get_parser(prog_name) parser.add_argument( '--device-owner', metavar='<device-owner>', help=_("List only ports with the specified device owner. " "This is the entity that uses the port (for example, " "network:dhcp).") ) parser.add_argument( '--network', metavar='<network>', help=_("List only ports connected to this network (name or ID)")) device_group = parser.add_mutually_exclusive_group() device_group.add_argument( '--router', metavar='<router>', dest='router', help=_("List only ports attached to this router (name or ID)") ) device_group.add_argument( '--server', metavar='<server>', help=_("List only ports attached to this server (name or ID)"), ) device_group.add_argument( '--device-id', metavar='<device-id>', help=_("List only ports with the specified device ID") ) parser.add_argument( '--mac-address', metavar='<mac-address>', help=_("List only ports with this MAC address") ) parser.add_argument( '--long', action='store_true', default=False, help=_("List additional fields in output") ) parser.add_argument( '--project', metavar='<project>', help=_("List ports according to their project (name or ID)") ) identity_common.add_project_domain_option_to_parser(parser) parser.add_argument( '--fixed-ip', metavar=('subnet=<subnet>,ip-address=<ip-address>,' 'ip-substring=<ip-substring>'), action=parseractions.MultiKeyValueAction, optional_keys=['subnet', 'ip-address', 'ip-substring'], help=_("Desired IP and/or subnet for filtering ports " "(name or ID): subnet=<subnet>,ip-address=<ip-address>," "ip-substring=<ip-substring> " "(repeat option to set multiple fixed IP addresses)"), ) _tag.add_tag_filtering_option_to_parser(parser, _('ports')) return parser
def get_parser(self, prog_name): parser = super(ListSubnet, self).get_parser(prog_name) parser.add_argument('--long', action='store_true', default=False, help=_("List additional fields in output")) parser.add_argument( '--ip-version', type=int, choices=[4, 6], metavar='<ip-version>', dest='ip_version', help=_("List only subnets of given IP version in output. " "Allowed values for IP version are 4 and 6."), ) dhcp_enable_group = parser.add_mutually_exclusive_group() dhcp_enable_group.add_argument( '--dhcp', action='store_true', help=_("List subnets which have DHCP enabled")) dhcp_enable_group.add_argument( '--no-dhcp', action='store_true', help=_("List subnets which have DHCP disabled")) parser.add_argument( '--service-type', metavar='<service-type>', action='append', dest='service_types', help=_("List only subnets of a given service type in output " "e.g.: network:floatingip_agent_gateway. " "Must be a valid device owner value for a network port " "(repeat option to list multiple service types)")) parser.add_argument( '--project', metavar='<project>', help=_("List only subnets which belong to a given project " "in output (name or ID)")) identity_common.add_project_domain_option_to_parser(parser) parser.add_argument( '--network', metavar='<network>', help=_("List only subnets which belong to a given network " "in output (name or ID)")) parser.add_argument( '--gateway', metavar='<gateway>', help=_("List only subnets of given gateway IP in output")) parser.add_argument( '--name', metavar='<name>', help=_("List only subnets of given name in output")) parser.add_argument('--subnet-range', metavar='<subnet-range>', help=_("List only subnets of given subnet range " "(in CIDR notation) in output " "e.g.: --subnet-range 10.10.0.0/16")) _tag.add_tag_filtering_option_to_parser(parser, _('subnets')) return parser
def get_parser(self, prog_name): parser = super(ListSubnetPool, self).get_parser(prog_name) parser.add_argument( '--long', action='store_true', default=False, help=_("List additional fields in output") ) shared_group = parser.add_mutually_exclusive_group() shared_group.add_argument( '--share', action='store_true', help=_("List subnet pools shared between projects"), ) shared_group.add_argument( '--no-share', action='store_true', help=_("List subnet pools not shared between projects"), ) default_group = parser.add_mutually_exclusive_group() default_group.add_argument( '--default', action='store_true', help=_("List subnet pools used as the default external " "subnet pool"), ) default_group.add_argument( '--no-default', action='store_true', help=_("List subnet pools not used as the default external " "subnet pool") ) parser.add_argument( '--project', metavar='<project>', help=_("List subnet pools according to their project (name or ID)") ) identity_common.add_project_domain_option_to_parser(parser) parser.add_argument( '--name', metavar='<name>', help=_("List only subnet pools of given name in output") ) parser.add_argument( '--address-scope', metavar='<address-scope>', help=_("List only subnet pools of given address scope " "in output (name or ID)") ) _tag.add_tag_filtering_option_to_parser(parser, _('subnet pools')) return parser
def update_parser_network(self, parser): # Maintain and hide the argument for backwards compatibility. # Network will always return all projects for an admin. parser.add_argument( '--all-projects', action='store_true', default=False, help=argparse.SUPPRESS, ) parser.add_argument( '--project', metavar='<project>', help=_("List security groups according to the project " "(name or ID)")) identity_common.add_project_domain_option_to_parser(parser) _tag.add_tag_filtering_option_to_parser(parser, _('security group')) return parser
def update_parser_network(self, parser): # Maintain and hide the argument for backwards compatibility. # Network will always return all projects for an admin. parser.add_argument( '--all-projects', action='store_true', default=False, help=argparse.SUPPRESS, ) parser.add_argument( '--project', metavar='<project>', help=_("List security groups according to the project " "(name or ID)") ) identity_common.add_project_domain_option_to_parser(parser) _tag.add_tag_filtering_option_to_parser(parser, _('security group')) return parser
def get_parser(self, prog_name): parser = super(ListRouter, self).get_parser(prog_name) parser.add_argument( '--name', metavar='<name>', help=_("List routers according to their name") ) admin_state_group = parser.add_mutually_exclusive_group() admin_state_group.add_argument( '--enable', action='store_true', help=_("List enabled routers") ) admin_state_group.add_argument( '--disable', action='store_true', help=_("List disabled routers") ) parser.add_argument( '--long', action='store_true', default=False, help=_("List additional fields in output") ) parser.add_argument( '--project', metavar='<project>', help=_("List routers according to their project (name or ID)") ) identity_common.add_project_domain_option_to_parser(parser) parser.add_argument( '--agent', metavar='<agent-id>', help=_("List routers hosted by an agent (ID only)") ) _tag.add_tag_filtering_option_to_parser(parser, _('routers')) return parser
def update_parser_network(self, parser): router_ext_group = parser.add_mutually_exclusive_group() router_ext_group.add_argument('--external', action='store_true', help=_("List external networks")) router_ext_group.add_argument('--internal', action='store_true', help=_("List internal networks")) parser.add_argument('--long', action='store_true', help=_("List additional fields in output")) parser.add_argument('--name', metavar='<name>', help=_("List networks according to their name")) admin_state_group = parser.add_mutually_exclusive_group() admin_state_group.add_argument('--enable', action='store_true', help=_("List enabled networks")) admin_state_group.add_argument('--disable', action='store_true', help=_("List disabled networks")) parser.add_argument( '--project', metavar='<project>', help=_("List networks according to their project (name or ID)")) identity_common.add_project_domain_option_to_parser(parser) shared_group = parser.add_mutually_exclusive_group() shared_group.add_argument( '--share', action='store_true', help=_("List networks shared between projects")) shared_group.add_argument( '--no-share', action='store_true', help=_("List networks not shared between projects")) parser.add_argument('--status', metavar='<status>', choices=['ACTIVE', 'BUILD', 'DOWN', 'ERROR'], help=_("List networks according to their status " "('ACTIVE', 'BUILD', 'DOWN', 'ERROR')")) parser.add_argument( '--provider-network-type', metavar='<provider-network-type>', choices=['flat', 'geneve', 'gre', 'local', 'vlan', 'vxlan'], help=_("List networks according to their physical mechanisms. " "The supported options are: flat, geneve, gre, local, " "vlan, vxlan.")) parser.add_argument( '--provider-physical-network', metavar='<provider-physical-network>', dest='physical_network', help=_("List networks according to name of the physical network")) parser.add_argument( '--provider-segment', metavar='<provider-segment>', dest='segmentation_id', help=_("List networks according to VLAN ID for VLAN networks " "or Tunnel ID for GENEVE/GRE/VXLAN networks")) parser.add_argument('--agent', metavar='<agent-id>', dest='agent_id', help=_('List networks hosted by agent (ID only)')) _tag.add_tag_filtering_option_to_parser(parser, _('networks')) return parser