# Path: networking_sfc/_i18n.py
# DOMAIN = "networking_sfc"
# _C = _translators.contextual_form
# _P = _translators.plural_form
# def get_available_languages():


from neutronclient.common import extension
from neutronclient.common import utils
from neutronclient.neutron import v2_0 as neutronv20
from networking_sfc._i18n import _

def get_port_id(client, id_or_name):
    return neutronv20.find_resourceid_by_name_or_id(client,
                                                    PORT_RESOURCE,
                                                    id_or_name)


def get_port_pair_id(client, id_or_name):
    return neutronv20.find_resourceid_by_name_or_id(client,
                                                    PORT_PAIR_RESOURCE,
                                                    id_or_name)


class PortPair(extension.NeutronClientExtension):
    resource = PORT_PAIR_RESOURCE
    resource_plural = '%ss' % resource
    object_path = '/sfc/%s' % resource_plural
    resource_path = '/sfc/%s/%%s' % resource_plural
    versions = ['2.0']


class PortPairCreate(extension.ClientExtensionCreate, PortPair):
    """Create a Port Pair."""

    shell_command = 'port-pair-create'

    def add_known_arguments(self, parser):
        parser.add_argument(
            'name',
            metavar='NAME',

# Path: networking_sfc/_i18n.py
# DOMAIN = "networking_sfc"
# _C = _translators.contextual_form
# _P = _translators.plural_form
# def get_available_languages():


# Path: networking_sfc/cli/port_pair.py
from neutronclient.common import extension
from neutronclient.common import utils
from neutronclient.neutron import v2_0 as neutronv20
from networking_sfc._i18n import _


def get_port_id(client, id_or_name):
    return neutronv20.find_resourceid_by_name_or_id(client,
                                                    PORT_RESOURCE,
                                                    id_or_name)


def get_port_pair_id(client, id_or_name):
    return neutronv20.find_resourceid_by_name_or_id(client,
                                                    PORT_PAIR_RESOURCE,
                                                    id_or_name)


class PortPair(extension.NeutronClientExtension):
    resource = PORT_PAIR_RESOURCE
    resource_plural = '%ss' % resource
    object_path = '/sfc/%s' % resource_plural
    resource_path = '/sfc/%s/%%s' % resource_plural
    versions = ['2.0']


class PortPairCreate(extension.ClientExtensionCreate, PortPair):
    """Create a Port Pair."""

    shell_command = 'port-pair-create'

    def add_known_arguments(self, parser):
        parser.add_argument(
            'name',
            metavar='NAME',

            help=_('Name of the Port Pair.'))