# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.

#*** nmeta - Network Metadata - API definition file

identities_schema = {
        'dpid': {
            'type': 'string'
        },
        'in_port': {
            'type': 'string'
        },
        'harvest_time': {
            'type': 'string'
        },
        'harvest_type': {
            'type': 'string'
        },
        'mac_address': {
            'type': 'string'
        },
        'ip_address': {
            'type': 'string'
        },
        'host_name': {
            'type': 'string'
        },
        'host_type': {
            'type': 'string'
        },
        'host_os': {
            'type': 'string'
        },
        'host_desc': {
            'type': 'string'
        },
        'service_name': {
            'type': 'string'
        },
        'service_alias': {
            'type': 'string'
        },
        'user_id': {
            'type': 'string'
        },
        'valid_from': {
            'type': 'string'
        },
        'valid_to': {
            'type': 'string'
        },
        'id_hash': {
            'type': 'string'
        }
    }

#*** Note the reverse sort by harvest time:
identities_settings = {
    'url': 'identities',
    'item_title': 'Identity Records',
    'schema': identities_schema,
    'datasource': {
        'default_sort': [('harvest_time', -1)],
    }
}




