示例#1
0
class PortGroupPortSchema(ma.ModelSchema):
    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>')
    })
示例#2
0
class PortSchema(ma.ModelSchema):
    class Meta:
        model = Port
        fields = ('id', 'box_id', 'box', 'card_id', 'cpes', 'onts', 'channels',
                  'loopback', 'name', 'interfaces', 'description',
                  'admin_state', 'operational_state', '_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>')
    })
示例#3
0
class RouteSchema(ma.ModelSchema):
    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>')})
示例#4
0
class InterfaceSchema(ma.ModelSchema):
    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>')})
示例#5
0
class UserSchema(ma.ModelSchema):
    class Meta:
        model = User
        fields = ('id', 'box', 'box_id', 'credential_details', 'name', 'status', 'lock_status', 'profile', '_links')

    credential_details = ma.Nested(CredentialsSchema.CredentialSchema, many=True)

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

    _links = ma.Hyperlinks(
        {'self': ma.URLFor('show_user', box_id='<box_id>', id='<id>'),
         'collection': ma.URLFor('show_users', box_id='<box_id>')})
示例#6
0
class SubscriberSchema(ma.ModelSchema):
    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>')})
示例#7
0
class CardSchema(ma.ModelSchema):
    class Meta:
        model = Card
        fields = ('id', 'box_id', 'box', 'subrack_id', 'ports', 'ppc',
                  'product', 'name', 'description', '_links')

    ports = ma.Nested(PortsSchema.PortSchema, many=True)

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

    _links = ma.Hyperlinks(
        {'self': ma.URLFor('show_card', box_id='<box_id>', id='<id>'),
            'collection': ma.URLFor('show_cards', box_id='<box_id>')})
示例#8
0
    class EmuSchema(ma.ModelSchema):
        class Meta:
            model = Emu
            fields = ('id', '_links')

        _links = ma.Hyperlinks(
            {'self': ma.URLFor('show_emu', box_id='<box_id>', id='<id>')})
示例#9
0
class EmuSchema(ma.ModelSchema):
    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>')
    })
示例#10
0
    class ChannelSchema(ma.ModelSchema):
        class Meta:
            model = Channel
            fields = ('id', 'name', '_links')

        _links = ma.Hyperlinks(
            {'self': ma.URLFor('show_channel', box_id='<box_id>', id='<id>')})
示例#11
0
    class VlanSchema(ma.ModelSchema):
        class Meta:
            model = Vlan
            fields = ('id', 'name', 'number', '_links')

        _links = ma.Hyperlinks(
            {'self': ma.URLFor('show_vlan', box_id='<box_id>', id='<id>')})
示例#12
0
class CpeSchema(ma.ModelSchema):
    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>')})
示例#13
0
    class SubrackSchema(ma.ModelSchema):
        class Meta:
            model = Subrack
            fields = ('id', 'name', '_links')

        _links = ma.Hyperlinks(
            {'self': ma.URLFor('show_subrack', box_id='<box_id>', id='<id>')})
示例#14
0
class LogPortSchema(ma.ModelSchema):
    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>')})
示例#15
0
    class OntSchema(ma.ModelSchema):
        class Meta:
            model = Ont
            fields = ('id', 'name', '_links')

        _links = ma.Hyperlinks(
            {'self': ma.URLFor('show_ont', box_id='<box_id>', id='<id>')})
示例#16
0
    class CpePortSchema(ma.ModelSchema):
        class Meta:
            model = CpePort
            fields = ('id', 'name', '_links')

        _links = ma.Hyperlinks(
            {'self': ma.URLFor('show_cpe_port', box_id='<box_id>', id='<id>')})
示例#17
0
    class PortSchema(ma.ModelSchema):
        class Meta:
            model = Port
            fields = ('id', 'name', 'operational_state', '_links')

        _links = ma.Hyperlinks(
            {'self': ma.URLFor('show_port', box_id='<box_id>', id='<id>')})
示例#18
0
class CpePortSchema(ma.ModelSchema):
    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>')
    })
示例#19
0
class SrvcSchema(ma.ModelSchema):
    class Meta:
        model = Srvc
        fields = ('id', 'box', 'box_id', 'name', 'service_type', 'address',
                  'svid', 'stag_priority', 'vlan_handling', '_links')

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

    _links = ma.Hyperlinks({
        'self':
        ma.URLFor('show_srvc', box_id='<box_id>', id='<id>'),
        'collection':
        ma.URLFor('show_srvcs', box_id='<box_id>')
    })
示例#20
0
class ServiceVlanSchema(ma.ModelSchema):
    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>')
    })
示例#21
0
class MgmtPortSchema(ma.ModelSchema):
    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>')
    })
示例#22
0
    class UserSchema(ma.ModelSchema):
        class Meta:
            model = User
            fields = ('id', 'name', 'status', '_links')

        _links = ma.Hyperlinks(
            {'self': ma.URLFor(
                'show_user', box_id='<box_id>', id='<id>')})
示例#23
0
class CredentialSchema(ma.ModelSchema):
    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>')
    })
示例#24
0
class VlanSchema(ma.ModelSchema):
    class Meta:
        model = Vlan
        fields = ('id', 'box_id', 'number', 'mtu', 'box', 'description',
                  'name', '_links')

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

    _links = ma.Hyperlinks({
        'self':
        ma.URLFor('show_vlan', box_id='<box_id>', id='<id>'),
        'collection':
        ma.URLFor('show_vlans', box_id='<box_id>')
    })
示例#25
0
    class VlanInterfaceSchema(ma.ModelSchema):
        class Meta:
            model = VlanInterface
            fields = ('id', 'name', '_links')

        _links = ma.Hyperlinks(
            {'self': ma.URLFor(
                'show_vlan_interface', box_id='<box_id>', id='<id>')})
示例#26
0
    class ModelSchema(ma.ModelSchema):
        class Meta:
            model = Model
            fields = ('id', 'name', 'versions', '_links')

        versions = ma.Nested(VersionsSchema.VersionSchema, many=True)

        _links = ma.Hyperlinks({'self': ma.URLFor('show_model', id='<id>')})
示例#27
0
    class VendorSchema(ma.ModelSchema):
        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>')})
示例#28
0
class ChannelSchema(ma.ModelSchema):
    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>')})
示例#29
0
    class RouteSchema(ma.ModelSchema):
        class Meta:
            model = Route
            fields = ('id', '_links')

        _links = ma.Hyperlinks(
            {'self': ma.URLFor(
                'show_route', box_id='<box_id>', id='<id>')})
示例#30
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>')})