Ejemplo n.º 1
0
        'vmware_ipaddr':
        fields.String(required=False,
                      description='System\'s IP Address in VMware.'),
        'vmware_tools_version_status':
        fields.String(required=False,
                      description='VMware tools status on this Guest.'),
        'vmware_hostname':
        fields.String(required=False,
                      description='System\'s hostname in VMware.'),
        'puppet_certname':
        fields.String(required=False,
                      description='System\'s Puppet certificate name.'),
        'puppet_env':
        fields.String(required=False,
                      description='System\'s Puppet environment.'),
        'puppet_include_default':
        fields.Boolean(
            required=False,
            description='Whether to include the Puppet default classes.'),
        'puppet_classes':
        fields.String(required=False,
                      description='Puppet classes applied to this System'),
        'puppet_variables':
        fields.String(required=False,
                      description='Puppet variables applied to this System.'),
    })

page_systems_info_view_serializer = api_manager.inherit(
    'Paginated systems_info_view', pagination,
    {'items': fields.List(fields.Nested(systems_info_view_serializer))})
Ejemplo n.º 2
0
tasks_serializer = api_manager.model(
    'task', {
        'id':
        fields.Integer(required=True, description='Task ID.'),
        'module':
        fields.String(required=True,
                      description='The module that started the task'),
        'username':
        fields.String(required=True,
                      description='The user that started the task'),
        'start':
        fields.DateTime(required=False,
                        description='The date and time this task was started'),
        'end':
        fields.DateTime(required=False,
                        description='The date and time this task finished'),
        'status':
        fields.Integer(
            required=True,
            description=
            'The status of the task - 0: in progress, 1: success, 2: failure, 3: warnings'
        ),
        'description':
        fields.String(required=False,
                      description='The description of the task'),
    })

page_tasks_serializer = api_manager.inherit(
    'Paginated tasks', pagination,
    {'items': fields.List(fields.Nested(tasks_serializer))})
Ejemplo n.º 3
0
        ),
        'numHosts':
        fields.Integer(
            required=True,
            description=
            'The number of unique locations that the certificate has been discovered by certificate scans'
        ),
        'keySize':
        fields.Integer(
            required=True,
            description=
            'The size (in bits) of the key used with the certificate')
    })

page_certificates_serializer = api_manager.inherit(
    'Paginated certificates', pagination,
    {'items': fields.List(fields.Nested(certificates_serializer))})

cert_last_seen_serializer = api_manager.model(
    'certificate_last_seen', {
        'timestamp':
        fields.DateTime(
            required=True,
            description=
            'The date and time the certificate was seen at this location'),
        'location':
        fields.String(
            required=True,
            description='The IP address and post where the certificate was seen'
        ),
        'chain_state':
Ejemplo n.º 4
0
from flask_restplus import fields
from cortex.api import api_manager
from cortex.api.serializers import pagination

# This is not actually getting used since nothing should be returned

puppet_serializer = api_manager.model(
    'puppet', {
        'id':
        fields.Integer(required=True, description='Entry ID'),
        'module_name':
        fields.String(required=True, description='Name of the puppet module'),
        'class_name':
        fields.String(required=True, description='Name of the puppet class'),
        'class_parameter':
        fields.String(required=False,
                      description='Name of the parameter in that class'),
        'description':
        fields.String(required=False,
                      description='The description of the parameter'),
        'tag_name':
        fields.String(required=False, description='Tag name for this entry'),
    })

page_puppet_serializer = api_manager.inherit(
    'Paginated puppet', pagination,
    {'items': fields.List(fields.Nested(puppet_serializer))})