Ejemplo n.º 1
0
class PortSchema(ma.Schema):
    class Meta:
        model = Port
        fields = ('id', 'box_id', 'box', 'card_id', 'cpes', 'onts', 'channels',
                  'loopback', 'name', 'interfaces', 'description',
                  'admin_state', 'operational_state', 'upstream',
                  'upstream_max', 'downstream', 'downstream_max', '_links')

    cpes = ma.Nested(CpesSchema.CpeSchema, many=True)

    onts = ma.Nested(OntsSchema.OntSchema, many=True)

    channels = ma.Nested(ChannelsSchema.ChannelSchema, many=True)

    interfaces = ma.Nested(InterfacesSchema.InterfaceSchema, many=True)

    box = ma.Hyperlinks(
        {'_links': {
            'self': ma.URLFor('show_box', id='<box_id>')
        }})

    _links = ma.Hyperlinks({
        'self':
        ma.URLFor('show_port', box_id='<box_id>', id='<id>'),
        'collection':
        ma.URLFor('show_ports', box_id='<box_id>')
    })
Ejemplo n.º 2
0
class PortGroupPortSchema(ma.Schema):
    class Meta:
        model = PortGroupPort
        fields = ('id', 'name', 'box_id', 'card_id', 'operational_state',
                  'admin_state', 'description', 'label1', 'label2', 'type',
                  'enable', 'register_as_global', 'subscribers',
                  'register_default_number_only',
                  'layer_1_permanently_activated', 'sip_profile',
                  'isdnba_profile', 'proxy_registrar_profile',
                  'codec_sdp_profile', 'pay_phone', 'pstn_profile',
                  'enterprise_profile', '_links')

    subscribers = ma.Nested(SubscribersSchema.SubscriberSchema, many=True)

    box = ma.Hyperlinks(
        {'_links': {
            'self': ma.URLFor('show_box', id='<box_id>')
        }})

    _links = ma.Hyperlinks({
        'self':
        ma.URLFor('show_portgroupport', box_id='<box_id>', id='<id>'),
        'collection':
        ma.URLFor('show_portgroupports', box_id='<box_id>')
    })
Ejemplo n.º 3
0
    class Meta:
        model = VlanInterface
        fields = ('id', 'name', 'box', 'box_id', 'vlan_id', '_links')

        _links = ma.Hyperlinks({
            'self':
            ma.URLFor('show_vlan_interface', box_id='<box_id>', id='<id>'),
            'collection':
            ma.URLFor('show_vlan_interfaces', box_id='<box_id>')
        })
Ejemplo n.º 4
0
class PortProfileSchema(ma.Schema):
    class Meta:
        model = PortProfile
        fields = ('id', 'name', 'description', 'box_id', 'type', '_links')

    _links = ma.Hyperlinks({
        'self':
        ma.URLFor('show_port_profile', box_id='<box_id>', id='<id>'),
        'collection':
        ma.URLFor('show_port_profiles', box_id='<box_id>')
    })
Ejemplo n.º 5
0
class QosInterfaceSchema(ma.Schema):
    class Meta:
        model = QosInterface
        fields = ('id', 'name', 'description', 'box', 'box_id', '_links')

    _links = ma.Hyperlinks({
        'self':
        ma.URLFor('show_qos_interface', box_id='<box_id>', id='<id>'),
        'collection':
        ma.URLFor('show_qos_interfaces', box_id='<box_id>')
    })
Ejemplo n.º 6
0
class RouteSchema(ma.Schema):
    class Meta:
        model = Route
        fields = ('id', 'dst', 'gw', 'metric', 'box', 'box_id', '_links')

    box = ma.Hyperlinks(
        {'_links': {
            'self': ma.URLFor('show_box', id='<box_id>')}})

    _links = ma.Hyperlinks(
        {'self': ma.URLFor('show_route', box_id='<box_id>', id='<id>'),
         'collection': ma.URLFor('show_routes', box_id='<box_id>')})
Ejemplo n.º 7
0
class InterfaceSchema(ma.Schema):
    class Meta:
        model = Interface
        fields = ('id', 'box_id', 'box', 'name', 'description', '_links')

    box = ma.Hyperlinks(
        {'_links': {
            'self': ma.URLFor('show_box', id='<box_id>')
        }})

    _links = ma.Hyperlinks(
        {'self': ma.URLFor('show_interface', box_id='<box_id>', id='<id>')})
Ejemplo n.º 8
0
class SubscriberSchema(ma.Schema):
    class Meta:
        model = Subscriber
        fields = ('id', 'name', 'box', 'box_id', 'number', 'address', 'registration_state', 'display_name',
                  'autorisation_user_name', 'autorisation_password', 'privacy', 'portgroupport_id',
                  '_links')

    box = ma.Hyperlinks(
        {'_links': {
            'self': ma.URLFor('show_box', id='<box_id>')}})

    _links = ma.Hyperlinks(
        {'self': ma.URLFor('show_subscriber', box_id='<box_id>', id='<id>'),
         'collection': ma.URLFor('show_subscribers', box_id='<box_id>')})
Ejemplo n.º 9
0
class CpeSchema(ma.Schema):
    class Meta:
        model = Cpe
        fields = ('id', 'box_id', 'box', 'port_id', 'ont_port_id', 'cpe_ports', 'cpe_ports', 'mac',
                  'name', 'description', 'serial_no', 'admin_state', '_links')

    cpe_ports = ma.Nested(CpePortsSchema.CpePortSchema, many=True)

    box = ma.Hyperlinks(
        {'_links': {
            'self': ma.URLFor('show_box', id='<box_id>')}})

    _links = ma.Hyperlinks(
        {'self': ma.URLFor('show_cpe', box_id='<box_id>', id='<id>')})
Ejemplo n.º 10
0
class OntPortSchema(ma.Schema):
    class Meta:
        model = OntPort
        fields = ('id', 'box_id', 'box', 'ont_id', 'cpes',
                  'name', 'description', '_links', 'admin_state')

    cpes = ma.Nested(CpesSchema.CpeSchema, many=True)

    box = ma.Hyperlinks(
        {'_links': {
            'self': ma.URLFor('show_box', id='<box_id>')}})

    _links = ma.Hyperlinks(
        {'self': ma.URLFor('show_ont_port', box_id='<box_id>', id='<id>'),
         'collection': ma.URLFor('show_ont_ports', box_id='<box_id>')})
Ejemplo n.º 11
0
class SubrackSchema(ma.Schema):
    class Meta:
        model = Subrack
        fields = ('id', 'box_id', 'box', 'cards', 'mgmt_cards',
                  'name', 'description', '_links')

    cards = ma.Nested(CardsSchema.CardSchema, many=True)
    mgmt_cards = ma.Nested(MgmtCardsSchema.MgmtCardSchema, many=True)

    box = ma.Hyperlinks(
        {'_links': {
            'self': ma.URLFor('show_box', id='<box_id>')}})

    _links = ma.Hyperlinks(
        {'self': ma.URLFor('show_subrack', box_id='<box_id>', id='<id>'),
            'collection': ma.URLFor('show_subracks', box_id='<box_id>')})
Ejemplo n.º 12
0
    class ChannelSchema(ma.Schema):
        class Meta:
            model = Channel
            fields = ('id', 'name', '_links')

        _links = ma.Hyperlinks(
            {'self': ma.URLFor('show_channel', box_id='<box_id>', id='<id>')})
Ejemplo n.º 13
0
    class PortSchema(ma.Schema):
        class Meta:
            model = Port
            fields = ('id', 'name', 'operational_state', '_links')

        _links = ma.Hyperlinks(
            {'self': ma.URLFor('show_port', box_id='<box_id>', id='<id>')})
Ejemplo n.º 14
0
    class VlanSchema(ma.Schema):
        class Meta:
            model = Vlan
            fields = ('id', 'name', 'number', '_links')

        _links = ma.Hyperlinks(
            {'self': ma.URLFor('show_vlan', box_id='<box_id>', id='<id>')})
Ejemplo n.º 15
0
    class SrvcSchema(ma.Schema):
        class Meta:
            model = Srvc
            fields = ('id', 'name', '_links')

        _links = ma.Hyperlinks(
            {'self': ma.URLFor('show_srvc', box_id='<box_id>', id='<id>')})
Ejemplo n.º 16
0
    class OntSchema(ma.Schema):
        class Meta:
            model = Ont
            fields = ('id', 'name', '_links')

        _links = ma.Hyperlinks(
            {'self': ma.URLFor('show_ont', box_id='<box_id>', id='<id>')})
Ejemplo n.º 17
0
class LogPortSchema(ma.Schema):
    class Meta:
        model = LogPort
        fields = ('id', 'box_id', 'box', 'card_id', 'name', 'ports', 'interfaces', 'description', 'admin_state',
                  'operational_state', 'label1', 'label2', 'profile',
                  '_links')

    interfaces = ma.Nested(InterfacesSchema.InterfaceSchema, many=True)

    box = ma.Hyperlinks(
        {'_links': {
            'self': ma.URLFor('show_box', id='<box_id>')}})

    _links = ma.Hyperlinks(
        {'self': ma.URLFor('show_logport', box_id='<box_id>', id='<id>'),
         'collection': ma.URLFor('show_logports', box_id='<box_id>')})
Ejemplo n.º 18
0
    class UserSchema(ma.Schema):
        class Meta:
            model = User
            fields = ('id', 'name', 'status', '_links')

        _links = ma.Hyperlinks(
            {'self': ma.URLFor('show_user', box_id='<box_id>', id='<id>')})
Ejemplo n.º 19
0
class VersionSchema(ma.Schema):
    class Meta:
        model = Version
        fields = ('id', 'name', 'model_id', '_links')

    _links = ma.Hyperlinks(
        {'self': ma.URLFor('show_version', id='<id>')})
Ejemplo n.º 20
0
    class CpePortSchema(ma.Schema):
        class Meta:
            model = CpePort
            fields = ('id', 'name', '_links')

        _links = ma.Hyperlinks(
            {'self': ma.URLFor('show_cpe_port', box_id='<box_id>', id='<id>')})
Ejemplo n.º 21
0
    class EmuSchema(ma.Schema):
        class Meta:
            model = Emu
            fields = ('id', '_links')

        _links = ma.Hyperlinks(
            {'self': ma.URLFor('show_emu', box_id='<box_id>', id='<id>')})
Ejemplo n.º 22
0
class EmuSchema(ma.Schema):
    class Meta:
        model = Emu
        fields = ('id', 'name', 'box', 'box_id', '_links')

    box = ma.Hyperlinks(
        {'_links': {
            'self': ma.URLFor('show_box', id='<box_id>')
        }})

    _links = ma.Hyperlinks({
        'self':
        ma.URLFor('show_emu', box_id='<box_id>', id='<id>'),
        'collection':
        ma.URLFor('show_emus', box_id='<box_id>')
    })
Ejemplo n.º 23
0
class MgmtPortSchema(ma.Schema):
    class Meta:
        model = MgmtPort
        fields = ('id', 'box_id', 'box', 'mgmt_card_id', 'name', 'description',
                  'admin_state', 'operational_state', '_links')

    box = ma.Hyperlinks(
        {'_links': {
            'self': ma.URLFor('show_box', id='<box_id>')
        }})

    _links = ma.Hyperlinks({
        'self':
        ma.URLFor('show_mgmt_port', box_id='<box_id>', id='<id>'),
        'collection':
        ma.URLFor('show_mgmt_ports', box_id='<box_id>')
    })
Ejemplo n.º 24
0
class CpePortSchema(ma.Schema):
    class Meta:
        model = CpePort
        fields = ('id', 'box_id', 'box', 'cpe_id', 'name', 'description',
                  'cpe', '_links')

    box = ma.Hyperlinks(
        {'_links': {
            'self': ma.URLFor('show_box', id='<box_id>')
        }})

    _links = ma.Hyperlinks({
        'self':
        ma.URLFor('show_cpe_port', box_id='<box_id>', id='<id>'),
        'collection':
        ma.URLFor('show_cpe_ports', box_id='<box_id>')
    })
Ejemplo n.º 25
0
    class SubscriberSchema(ma.Schema):
        class Meta:
            model = Subscriber
            fields = ('id', '_links')

        _links = ma.Hyperlinks(
            {'self': ma.URLFor(
                'show_subscriber', box_id='<box_id>', id='<id>')})
Ejemplo n.º 26
0
class ServiceVlanSchema(ma.Schema):
    class Meta:
        model = ServiceVlan
        fields = ('id', 'name', 'service_port_id', 'vlan_id', 'box', 'box_id',
                  'card_id', '_links')

    box = ma.Hyperlinks(
        {'_links': {
            'self': ma.URLFor('show_box', id='<box_id>')
        }})

    _links = ma.Hyperlinks({
        'self':
        ma.URLFor('show_service_vlan', box_id='<box_id>', id='<id>'),
        'collection':
        ma.URLFor('show_service_vlans', box_id='<box_id>')
    })
Ejemplo n.º 27
0
    class VendorSchema(ma.Schema):
        class Meta:
            model = Vendor
            fields = ('id', 'name', 'models', '_links')

        models = ma.Nested(ModelsSchema.ModelSchema, many=True)

        _links = ma.Hyperlinks({'self': ma.URLFor('show_vendor', id='<id>')})
Ejemplo n.º 28
0
class ChannelSchema(ma.Schema):
    class Meta:
        model = Channel
        fields = ('id', 'box_id', 'box', 'port_id', 'interfaces',
                  'curr_rate_u', 'curr_rate_d', 'prev_rate_u', 'name',
                  'description', 'prev_rate_d', 'curr_delay_u', 'curr_delay_d',
                  '_links')

    interfaces = ma.Nested(InterfacesSchema.InterfaceSchema, many=True)

    box = ma.Hyperlinks(
        {'_links': {
            'self': ma.URLFor('show_box', id='<box_id>')
        }})

    _links = ma.Hyperlinks(
        {'self': ma.URLFor('show_channel', box_id='<box_id>', id='<id>')})
Ejemplo n.º 29
0
    class RouteSchema(ma.Schema):
        class Meta:
            model = Route
            fields = ('id', '_links')

        _links = ma.Hyperlinks(
            {'self': ma.URLFor(
                'show_route', box_id='<box_id>', id='<id>')})
Ejemplo n.º 30
0
class CredentialSchema(ma.Schema):
    class Meta:
        model = Credential
        fields = ('id', 'protocol', 'credential', 'username', 'password',
                  'box', 'box_id', 'user_id', '_links')

    box = ma.Hyperlinks(
        {'_links': {
            'self': ma.URLFor('show_box', id='<box_id>')
        }})

    _links = ma.Hyperlinks({
        'self':
        ma.URLFor('show_credential', box_id='<box_id>', id='<id>'),
        'collection':
        ma.URLFor('show_credentials', box_id='<box_id>')
    })