Exemplo n.º 1
0
 def take_action(self, parsed_args):
     client = self.app.client_manager.neutronclient
     data = client.list_sfc_port_chains()
     headers, columns = nc_osc_utils.get_column_definitions(
         _attr_map, long_listing=parsed_args.long)
     return (headers, (utils.get_dict_properties(s, columns)
                       for s in data['port_chains']))
Exemplo n.º 2
0
 def take_action(self, parsed_args):
     client = self.app.client_manager.neutronclient
     obj = client.list_fwaas_firewall_policies()[const.FWPS]
     headers, columns = osc_utils.get_column_definitions(
         _attr_map, long_listing=parsed_args.long)
     return (headers, (utils.get_dict_properties(
         s, columns, formatters=_formatters) for s in obj))
 def take_action(self, parsed_args):
     client = self.app.client_manager.neutronclient
     obj = client.list_ipsec_site_connections()['ipsec_site_connections']
     headers, columns = osc_utils.get_column_definitions(
         _attr_map, long_listing=parsed_args.long)
     return (headers, (utils.get_dict_properties(
         s, columns, formatters=_formatters) for s in obj))
Exemplo n.º 4
0
 def take_action(self, parsed_args):
     client = self.app.client_manager.neutronclient
     obj = client.list_fwaas_firewall_policies()[const.FWPS]
     headers, columns = osc_utils.get_column_definitions(
         _attr_map, long_listing=parsed_args.long)
     return (headers, (utils.get_dict_properties(
         s, columns, formatters=_formatters) for s in obj))
 def take_action(self, parsed_args):
     client = self.app.client_manager.neutronclient
     obj = client.list_sfc_flow_classifiers()
     obj_extend = self.extend_list(obj, parsed_args)
     headers, columns = nc_osc_utils.get_column_definitions(
         _attr_map, long_listing=parsed_args.long)
     return (headers, (utils.get_dict_properties(
         s, columns) for s in obj_extend))
Exemplo n.º 6
0
 def take_action(self, parsed_args):
     client = self.app.client_manager.neutronclient
     obj = client.list_sfc_flow_classifiers()
     obj_extend = self.extend_list(obj, parsed_args)
     headers, columns = nc_osc_utils.get_column_definitions(
         _attr_map, long_listing=parsed_args.long)
     return (headers, (utils.get_dict_properties(s, columns)
                       for s in obj_extend))
 def take_action(self, parsed_args):
     client = self.app.client_manager.neutronclient
     data = client.list_sfc_service_graphs()
     headers, columns = nc_osc_utils.get_column_definitions(
         _attr_map, long_listing=parsed_args.long)
     return (headers,
             (utils.get_dict_properties(s, columns)
              for s in data['service_graphs']))
Exemplo n.º 8
0
 def take_action(self, parsed_args):
     client = self.app.client_manager.neutronclient
     obj = client.list_network_logs()['logs']
     obj_extend = self._extend_list(obj, parsed_args)
     headers, columns = osc_utils.get_column_definitions(
         _attr_map, long_listing=parsed_args.long)
     return (headers, (
         utils.get_dict_properties(s, columns) for s in obj_extend))
Exemplo n.º 9
0
 def test_get_column_definitions_long(self):
     attr_map = (
         ('id', 'ID', utils.LIST_BOTH),
         ('tenant_id', 'Project', utils.LIST_LONG_ONLY),
         ('name', 'Name', utils.LIST_BOTH),
         ('summary', 'Summary', utils.LIST_SHORT_ONLY),
     )
     headers, columns = utils.get_column_definitions(attr_map,
                                                     long_listing=True)
     self.assertEqual(['id', 'tenant_id', 'name'], columns)
     self.assertEqual(['ID', 'Project', 'Name'], headers)
Exemplo n.º 10
0
 def test_get_column_definitions_long(self):
     attr_map = (
         ('id', 'ID', utils.LIST_BOTH),
         ('tenant_id', 'Project', utils.LIST_LONG_ONLY),
         ('name', 'Name', utils.LIST_BOTH),
         ('summary', 'Summary', utils.LIST_SHORT_ONLY),
     )
     headers, columns = utils.get_column_definitions(attr_map,
                                                     long_listing=True)
     self.assertEqual(['id', 'tenant_id', 'name'], columns)
     self.assertEqual(['ID', 'Project', 'Name'], headers)
 def take_action(self, parsed_args):
     client = self.app.client_manager.neutronclient
     list_method = getattr(client,
                           'list_bgpvpn_%s_assocs' % self._assoc_res_name)
     bgpvpn = client.find_resource(constants.BGPVPN, parsed_args.bgpvpn)
     objs = list_method(bgpvpn['id'],
                        retrieve_all=True)[self._resource_plural]
     headers, columns = nc_osc_utils.get_column_definitions(
         self._attr_map, long_listing=parsed_args.long)
     return (headers,
             (osc_utils.get_dict_properties(s,
                                            columns,
                                            formatters=self._formatters)
              for s in objs))
 def take_action(self, parsed_args):
     client = self.app.client_manager.neutronclient
     list_method = getattr(client,
                           'list_bgpvpn_%s_assocs' % self._assoc_res_name)
     bgpvpn = client.find_resource(constants.BGPVPN, parsed_args.bgpvpn)
     params = {}
     if parsed_args.property:
         params.update(parsed_args.property)
     objs = list_method(bgpvpn['id'],
                        retrieve_all=True, **params)[self._resource_plural]
     transform = getattr(self, '_transform_resource', None)
     if callable(transform):
         [transform(obj) for obj in objs]
     headers, columns = nc_osc_utils.get_column_definitions(
         self._attr_map, long_listing=parsed_args.long)
     return (headers, (osc_utils.get_dict_properties(
         s, columns, formatters=self._formatters) for s in objs))
Exemplo n.º 13
0
 def take_action(self, parsed_args):
     client = self.app.client_manager.neutronclient
     params = {}
     if parsed_args.project is not None:
         project_id = nc_osc_utils.find_project(
             self.app.client_manager.identity,
             parsed_args.project,
             parsed_args.project_domain,
         ).id
         params['tenant_id'] = project_id
     if parsed_args.property:
         params.update(parsed_args.property)
     objs = client.list_bgpvpns(**params)[constants.BGPVPNS]
     headers, columns = nc_osc_utils.get_column_definitions(
         _attr_map, long_listing=parsed_args.long)
     return (headers, (osc_utils.get_dict_properties(
         s, columns, formatters=_formatters) for s in objs))
Exemplo n.º 14
0
 def take_action(self, parsed_args):
     client = self.app.client_manager.neutronclient
     params = {}
     if parsed_args.project is not None:
         project_id = nc_osc_utils.find_project(
             self.app.client_manager.identity,
             parsed_args.project,
             parsed_args.project_domain,
         ).id
         params['tenant_id'] = project_id
     if parsed_args.property:
         params.update(parsed_args.property)
     objs = client.list_bgpvpns(**params)[constants.BGPVPNS]
     headers, columns = nc_osc_utils.get_column_definitions(
         _attr_map, long_listing=parsed_args.long)
     return (headers, (osc_utils.get_dict_properties(s,
                                                     columns,
                                                     formatters=_formatters)
                       for s in objs))
Exemplo n.º 15
0
 def take_action(self, parsed_args):
     client = self.app.client_manager.neutronclient
     obj = client.list_vpnservices()['vpnservices']
     headers, columns = osc_utils.get_column_definitions(
         _attr_map, long_listing=parsed_args.long)
     return (headers, (utils.get_dict_properties(s, columns) for s in obj))
Exemplo n.º 16
0
 def take_action(self, parsed_args):
     client = self.app.client_manager.neutronclient
     obj = client.list_network_loggable_resources()['loggable_resources']
     headers, columns = osc_utils.get_column_definitions(
         _attr_map_for_loggable, long_listing=parsed_args.long)
     return (headers, (utils.get_dict_properties(s, columns) for s in obj))