Ejemplo n.º 1
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>')
    })
Ejemplo n.º 2
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>')
    })
Ejemplo n.º 3
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>')})
Ejemplo n.º 4
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>')})
Ejemplo n.º 5
0
    class CardSchema(ma.ModelSchema):
        class Meta:
            model = Card
            fields = ('id', 'name', 'product', 'ppc', 'operational_state', 'ports', '_links')

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

        _links = ma.Hyperlinks(
            {'self': ma.URLFor(
                'show_card', box_id='<box_id>', id='<id>')})
Ejemplo n.º 6
0
class SubrackSchema(ma.ModelSchema):
    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.º 7
0
    class MgmtCardSchema(ma.ModelSchema):
        class Meta:
            model = MgmtCard
            fields = ('id', 'name', 'operational_state', 'mgmt_ports',
                      '_links')

        mgmt_ports = ma.Nested(MgmtPortsSchema.MgmtPortSchema, many=True)

        _links = ma.Hyperlinks({
            'self':
            ma.URLFor('show_mgmt_card', box_id='<box_id>', id='<id>')
        })
Ejemplo n.º 8
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>')})
Ejemplo n.º 9
0
class BoxenSchema(ma.ModelSchema):
    class Meta:
        fields = ('members', 'count', '_links')

    class BoxSchema(ma.ModelSchema):
        class Meta:
            model = Box
            fields = ('id', 'vendor', 'model', 'version', 'uuid', '_links')

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

    members = ma.Nested(BoxSchema, many=True)

    _links = ma.Hyperlinks({'self': ma.URLFor('show_boxen')})
Ejemplo n.º 10
0
class OntsSchema(ma.ModelSchema):
    class Meta:
        fields = ('members', 'count', '_links')

    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>')})

    members = ma.Nested(OntSchema, many=True)

    _links = ma.Hyperlinks({'self': ma.URLFor('show_onts', box_id='<box_id>')})
Ejemplo n.º 11
0
class EmusSchema(ma.ModelSchema):
    class Meta:
        fields = ('members', 'count', '_links')

    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>')})

    members = ma.Nested(EmuSchema, many=True)

    _links = ma.Hyperlinks({'self': ma.URLFor('show_emus', box_id='<box_id>')})
Ejemplo n.º 12
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>')})
Ejemplo n.º 13
0
class VlansSchema(ma.ModelSchema):
    class Meta:
        fields = ('members', 'count', '_links')

    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>')})

    members = ma.Nested(VlanSchema, many=True)

    _links = ma.Hyperlinks(
        {'self': ma.URLFor('show_vlans', box_id='<box_id>')})
Ejemplo n.º 14
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>')})
Ejemplo n.º 15
0
class PortsSchema(ma.ModelSchema):
    class Meta:
        fields = ('members', 'count', '_links')

    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>')})

    members = ma.Nested(PortSchema, many=True)

    _links = ma.Hyperlinks(
        {'self': ma.URLFor('show_ports', box_id='<box_id>')})
Ejemplo n.º 16
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>')})
Ejemplo n.º 17
0
class RoutesSchema(ma.ModelSchema):
    class Meta:
        fields = ('members', 'count', '_links')

    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>')})

    members = ma.Nested(RouteSchema, many=True)

    _links = ma.Hyperlinks(
        {'self': ma.URLFor('show_routes', box_id='<box_id>')})
Ejemplo n.º 18
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>')})
Ejemplo n.º 19
0
class SubscribersSchema(ma.ModelSchema):
    class Meta:
        fields = ('members', 'count', '_links')

    class SubscriberSchema(ma.ModelSchema):
        class Meta:
            model = Subscriber
            fields = ('id', '_links')

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

    members = ma.Nested(SubscriberSchema, many=True)

    _links = ma.Hyperlinks(
        {'self': ma.URLFor('show_subscribers', box_id='<box_id>')})
Ejemplo n.º 20
0
class UsersSchema(ma.ModelSchema):
    class Meta:
        fields = ('members', 'count', '_links')

    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>')})

    members = ma.Nested(UserSchema, many=True)

    _links = ma.Hyperlinks(
        {'self': ma.URLFor('show_users', box_id='<box_id>')})
Ejemplo n.º 21
0
class ServicePortsSchema(ma.ModelSchema):
    class Meta:
        fields = ('members', 'count', '_links')

    class ServicePortSchema(ma.ModelSchema):
        class Meta:
            model = ServicePort
            fields = ('id', '_links')

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

    members = ma.Nested(ServicePortSchema, many=True)

    _links = ma.Hyperlinks(
        {'self': ma.URLFor('show_service_ports', box_id='<box_id>')})
Ejemplo n.º 22
0
class PortProfilesSchema(ma.ModelSchema):
    class Meta:
        fields = ('members', 'count', '_links')

    class PortProfileSchema(ma.ModelSchema):
        class Meta:
            model = PortProfile
            fields = ('id', 'name', '_links')

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

    members = ma.Nested(PortProfileSchema, many=True)

    _links = ma.Hyperlinks(
        {'self': ma.URLFor('show_port_profiles', box_id='<box_id>')})
Ejemplo n.º 23
0
class CredentialsSchema(ma.ModelSchema):
    class Meta:
        fields = ('members', 'count', '_links')

    class CredentialSchema(ma.ModelSchema):
        class Meta:
            model = Credential
            fields = ('id', 'username', 'password', '_links')

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

    members = ma.Nested(CredentialSchema, many=True)

    _links = ma.Hyperlinks(
        {'self': ma.URLFor('show_credentials', box_id='<box_id>')})
Ejemplo n.º 24
0
class InterfacesSchema(ma.ModelSchema):
    class Meta:
        fields = ('members', 'count', '_links')

    class InterfaceSchema(ma.ModelSchema):
        class Meta:
            model = Interface
            fields = ('id', 'name', '_links')

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

    members = ma.Nested(InterfaceSchema, many=True)

    _links = ma.Hyperlinks(
        {'self': ma.URLFor('show_interfaces', box_id='<box_id>')})
Ejemplo n.º 25
0
class OntSchema(ma.ModelSchema):
    class Meta:
        model = Ont
        fields = ('id', 'box_id', 'box', 'port_id', 'ont_ports', 'name',
                  'description', '_links', 'admin_state', 'operational_state')

    ont_ports = ma.Nested(OntPortsSchema.OntPortSchema, many=True)

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

    _links = ma.Hyperlinks({
        'self':
        ma.URLFor('show_ont', box_id='<box_id>', id='<id>'),
        'collection':
        ma.URLFor('show_onts', box_id='<box_id>')
    })
Ejemplo n.º 26
0
class MgmtCardSchema(ma.ModelSchema):
    class Meta:
        model = MgmtCard
        fields = ('id', 'box_id', 'box', 'name', 'subrack_id', 'admin_state',
                  'operational_state', 'description', 'mgmt_ports')

    mgmt_ports = ma.Nested(MgmtPortsSchema.MgmtPortSchema, many=True)

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

    _links = ma.Hyperlinks({
        'self':
        ma.URLFor('show_mgmt_card', box_id='<box_id>', id='<id>'),
        'collection':
        ma.URLFor('show_mgmt_cards', box_id='<box_id>')
    })
Ejemplo n.º 27
0
class BoxSchema(ma.ModelSchema):
    class Meta:
        model = Box
        fields = ('id', 'vendor', 'model', 'version', 'software_version',
                  'network_protocol', 'network_address', 'network_port',
                  'uuid', 'description', 'interfaces', 'logports', 'ont_ports',
                  'cpes', 'srvcs', 'hostname', 'mgmt_address', 'credentials',
                  'credential_details', 'port_profiles', 'mgmt_ports',
                  'port_profile_details', 'vlans', 'service_vlans',
                  'vlan_details', 'subscribers', 'currTemperature', 'subracks',
                  'subrack_details', 'cards', 'ports', 'channels',
                  'service_ports', 'emus', 'onts', 'cpe_ports', 'routes',
                  'login_banner', 'vlan_interfaces', 'users', 'user_details',
                  'portgroupports', 'mgmt_cards', 'welcome_banner',
                  'last_login', 'last_logout', 'sntp_server_ip_address',
                  'timezone_offset', 'net_mask', 'default_gateway', '_links')

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

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

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

    user_details = ma.Nested(UsersSchema.UserSchema, many=True)

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

    subrack_details = ma.Nested(SubracksSchema.SubrackSchema, many=True)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    port_profile_details = ma.Nested(PortProfilesSchema.PortProfileSchema,
                                     many=True)

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

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

    vlan_details = ma.Nested(VlansSchema.VlanSchema, many=True)

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

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

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