示例#1
0
class VirtualNetwork(Schema):
    networkResourceId = fields.String(
        required=True,
        description='Identifier of the virtualised network resource.')
    networkResourceName = fields.String(
        required=True, description='Name of the virtualised network resource.')
    subnet = fields.String(
        required=True,
        many=True,
        description='Only present if the network provides layer 3 '
        'connectivity.')
    networkPort = fields.Nested(
        VirtualNetworkPort,
        required=True,
        many=True,
        description='Element providing information of an instantiated virtual '
        'network port.')
    bandwidth = fields.Number(
        required=True, description='Minimum network bandwidth (in Mbps).')
    networkType = fields.Str(
        required=True,
        description='The type of network that maps to the virtualised '
        'network. This list is extensible. Examples are: "local", '
        '"vlan", "vxlan", "gre", "l3-vpn", etc. The cardinality '
        'can be "0" to cover the case where this attribute is not '
        'required to create the virtualised network.')
    segmentType = fields.Str(
        required=True,
        description='The isolated segment for the virtualised network. For '
        'instance, for a "vlan" networkType, it corresponds to '
        'the vlan identifier; and for a "gre" networkType, this '
        'corresponds to a gre key. The cardinality can be "0" to '
        'allow for flat networks without any specific '
        'segmentation.')
    networkQoS = fields.Nested(
        NetworkQoS,
        many=True,
        required=True,
        description='Element providing information about Quality of Service '
        'attributes that the network shall support. The '
        'cardinality can be "0" to allow for networks without any '
        'specified QoS requirements.')
    isShared = fields.Bool(
        required=True,
        description='It defines whether the virtualised network is shared '
        'among consumers.')
    sharingCriteria = fields.Str(
        required=True,
        description='Only present for shared networks. Indicate the sharing '
        'criteria for this network. This criteria might be a list '
        'of authorized consumers.')

    zoneId = fields.String(
        required=True,
        description='If present, it identifies the Resource Zone where the '
        'virtual network resources have been allocated.')
    operationalState = fields.String(
        required=True,
        description='The operational state of the virtualised network.')
示例#2
0
class OrbitSchema(Schema):
    """
     "orbitCategory": "airportRide",
            "eventRef": "testeventref1",
            "userTicketPairs": {
            },
            "chatroomRef": "testchatroomref1",
            "costEstimate": 987654321,
            "status": 1
    TODO: implement
    """

    orbitCategory = fields.String()
    chatroomRef = fields.String()
    costEstimate = fields.Number()
    status = fields.Number()
示例#3
0
文件: schema.py 项目: cnxtech/5gt-mtp
class VirtualCompute(Schema):
    """Attributes for the VirtualCompute information element."""

    computeId = fields.Str(
        required=True,
        description='Identifier of the virtualised compute resource.')
    computeName = fields.Str(
        required=True, description='Name of the virtualised compute resource.')
    flavourId = fields.Str(
        required=True,
        description='Identifier of the given compute flavour used to '
        'instantiate this virtual compute.')
    accelerationCapability = fields.List(
        fields.String(),
        required=True,
        description='Selected acceleration capabilities (e.g. crypto, GPU) '
        'from the set of capabilities offered by the compute node '
        'acceleration resources. The cardinality can be 0, if no '
        'particular acceleration capability is provided.')
    virtualCpu = fields.Nested(
        VirtualCpu,
        required=True,
        description='The virtual CPU(s) of the virtualised compute.')
    virtualMemory = fields.Nested(
        VirtualMemory,
        required=True,
        description='The virtual memory of the compute.')
    virtualNetworkInterface = fields.Nested(
        VirtualNetworkInterface,
        required=True,
        many=True,
        description='Element with information of the instantiated virtual '
        'network interfaces of the compute resource.')
    virtualDisks = fields.Str(
        VirtualStorage,
        required=True,
        many=True,
        description='Element with information of the virtualised storage '
        'resources (volumes, ephemeral that are attached to the '
        'compute resource.)')
    vcImageId = fields.Str(
        required=True,
        description='Identifier of the virtualisation container software '
        'image (e.g. virtual machine image). Cardinality can be 0 '
        'if an "empty" virtualisation container is allocated.')
    zoneId = fields.Str(
        required=True,
        description='If present, it identifies the Resource Zone where the '
        'virtual compute resources have been allocated.')
    hostId = fields.Str(
        required=True,
        description='Identifier of the host the virtualised compute resource '
        'is allocated on.')
    operationalState = fields.Str(
        required=True,
        description='Operational state of the compute resource.')
示例#4
0
class Query(Schema):
    color = fields.String(required=True,
                          validate=OneOf(["white", "blue", "red"]))

    def swag_validation_function(self, data, main_def):
        self.load(data)

    def swag_validation_error_handler(self, err, data, main_def):
        abort(400, err)

    swag_in = "query"
示例#5
0
class Body(Schema):
    color = fields.List(fields.String(),
                        required=True,
                        validate=Length(max=5),
                        example=["white", "blue", "red"])

    def swag_validation_function(self, data, main_def):
        self.load(data)

    def swag_validation_error_handler(self, err, data, main_def):
        abort(400, err)
示例#6
0
class AvailableGradingSchema(Schema):
    id = fields.Integer(required=True)
    due_date = fields.Date(required=True)
    type_of_day = fields.String(required=True)
    tile_name = fields.String(required=True)
    time_interval = fields.Nested(TimeIntervalSchema, required=True)
示例#7
0
class TimeIntervalSchema(Schema):
    time_description = fields.String(required=True)
    start = fields.Time(required=True)
    end = fields.Time(required=True)