* Author : see AUTHORS * Licence: MIT, see LICENSE ''' from flask_restplus import fields from src.api.apiConfig import api from src.api.fitcrack.responseModels import pagination notification_model = api.model( 'Notification', { 'job_id': fields.Integer(readOnly=True, required=False, description='id package'), 'text': fields.String(), 'type': fields.String(), 'seen': fields.Boolean(), 'time': fields.DateTime() }) page_of_notifications_model = api.inherit( 'Page of notifications', pagination, {'items': fields.List(fields.Nested(notification_model))}) notification_count_model = api.model('Notification count', {'count': fields.Integer()})
''' * Author : see AUTHORS * Licence: MIT, see LICENSE ''' from flask_restplus import fields from src.api.apiConfig import api from src.api.fitcrack.endpoints.job.responseModels import workunit_model from src.api.fitcrack.responseModels import pagination, host_short_model, job_short_model, boincHost_model, \ user_model hashes_model = api.model( 'Hashes model', { 'id': fields.Integer(readOnly=True, required=False), 'password': fields.String(), 'hash_type_name': fields.String(), 'hash': fields.String(attribute='hashText'), 'added': fields.DateTime(), 'job': fields.Nested(job_short_model) }) page_of_hashes_model = api.inherit( 'Page of hashes', pagination, {'items': fields.List(fields.Nested(hashes_model))})
''' * Author : see AUTHORS * Licence: MIT, see LICENSE ''' from flask_restplus import fields from src.api.apiConfig import api template_model = api.model( 'Job template', { 'id': fields.Integer(readOnly=True, required=False), 'name': fields.String(readOnly=True, required=False), 'created': fields.DateTime(readOnly=True, required=False), }) templates_model = api.inherit( 'Job template collection', {'items': fields.List(fields.Nested(template_model))}) template_data = api.inherit( 'Template with job settings', {'template': fields.String(readOnly=True, required=False)})
''' * Author : see AUTHORS * Licence: MIT, see LICENSE ''' from flask_restplus import fields from src.api.apiConfig import api from src.api.fitcrack.responseModels import simpleResponse protectedFile_model = api.model( 'Protected file', { 'id': fields.Integer(readOnly=True, required=False), 'name': fields.String(readOnly=True, required=False), 'hash': fields.String(readOnly=True, required=False), 'time': fields.DateTime(readOnly=True, required=False), }) protectedFilesCollection_model = api.inherit( 'Protected files collection', {'items': fields.List(fields.Nested(protectedFile_model))}) excryptedFileUploaded_model = api.inherit( 'Encryped file uploaded response', simpleResponse, { 'hash': fields.String(), 'hash_type': fields.String(), 'hash_type_name': fields.String(), 'file_id': fields.Integer() })
from src.api.apiConfig import api from src.api.fitcrack.responseModels import pagination, job_micro_model batch_status = api.model( 'Batch status object', { 'code': fields.Integer(), 'text': fields.String(), 'description': fields.String(), 'icon': fields.String(), 'color': fields.String() }) batch_model = api.model( 'Job batch', { 'id': fields.Integer(readOnly=True), 'name': fields.String(), 'total_jobs': fields.Integer(readOnly=True), 'waiting_jobs': fields.Integer(readOnly=True), 'status': fields.Nested(batch_status), 'current_user_can_edit': fields.Boolean(), 'current_user_can_operate': fields.Boolean() }) batch_with_jobs_model = api.inherit( 'Job batch with list of jobs', batch_model, {'jobs': fields.List(fields.Nested(job_micro_model))}) page_of_batches_model = api.inherit( 'Page of batches', pagination, {'items': fields.List(fields.Nested(batch_model))})
''' * Author : see AUTHORS * Licence: MIT, see LICENSE ''' from flask_restplus import fields from src.api.apiConfig import api status_model = api.model( 'status', { 'time': fields.DateTime(readOnly=True, required=False), 'status': fields.String(required=False), 'status_text': fields.String(required=False), 'status_tooltip': fields.String(required=False), 'status_type': fields.String(), }) JobStatusCollection_model = api.inherit( 'Job status collection', {'items': fields.List(fields.Nested(status_model))})
''' * Author : see AUTHORS * Licence: MIT, see LICENSE ''' from flask_restplus import fields from src.api.apiConfig import api from src.api.fitcrack.endpoints.job.responseModels import workunit_model from src.api.fitcrack.responseModels import pagination, host_short_model, job_short_model, boincHost_model, \ user_model page_of_hosts_model = api.inherit( 'Page of hosts', pagination, {'items': fields.List(fields.Nested(boincHost_model))}) workunitWithJob_model = api.inherit( 'Workunit with job', workunit_model, {'job': fields.Nested(job_short_model, attribute='job')}) boincHostDetail_model = api.model( 'Host detail boinc', { 'id': fields.Integer(readOnly=True, required=False), 'domain_name': fields.String(), 'p_model': fields.String(), 'user': fields.Nested(user_model), 'os_name': fields.String(), 'fc_host': fields.Nested(host_short_model), 'active': fields.Boolean(), 'workunits': fields.List(fields.Nested(workunitWithJob_model)), 'jobs': fields.List(fields.Nested(job_short_model))
''' * Author : see AUTHORS * Licence: MIT, see LICENSE ''' from flask_restplus import fields from src.api.apiConfig import api dictionary_model = api.model('Dictionary', { 'id': fields.Integer(readOnly=True, required=False), 'name': fields.String(readOnly=True, required=False), 'keyspace': fields.Integer(readOnly=True, required=False), 'time': fields.DateTime(readOnly=True, required=False), }) dictionaries_model = api.inherit('Dictionaries collection', { 'items': fields.List(fields.Nested(dictionary_model)) }) dictData_model = api.inherit('Dictionary with data', { 'data': fields.String(), 'status': fields.Boolean() })
''' * Author : see AUTHORS * Licence: MIT, see LICENSE ''' from flask_restplus import fields from src.api.apiConfig import api hcStat_model = api.model( 'HcStat', { 'id': fields.Integer(readOnly=True, required=False), 'name': fields.String(readOnly=True, required=False), 'time': fields.DateTime(readOnly=True, required=False), }) hcStatsCollection_model = api.inherit( 'HcStats collection', {'items': fields.List(fields.Nested(hcStat_model))})
* Author : see AUTHORS * Licence: MIT, see LICENSE ''' from flask_restplus import fields from src.api.apiConfig import api pcfg_model = api.model('PCFG', { 'id': fields.Integer(readOnly=True, required=False), 'name': fields.String(readOnly=True, required=False), 'keyspace': fields.Integer(readOnly=True, required=False), 'time_added': fields.DateTime(readOnly=True, required=False) }) pcfgs_model = api.inherit('PCFGs collection', { 'items': fields.List(fields.Nested(pcfg_model)) }) pcfgData_model = api.inherit('PCFG with data', { 'data': fields.String(), 'status': fields.Boolean() }) pcfgTree_model = api.model('PCFG Directory Tree', { 'name': fields.String(example='grammar name'), 'children': fields.Raw(example=[ { 'name': 'folder1', 'children': [ {'name': 'file1-in-folder.txt'}, {'name': 'file2-in-folder.txt'}
''' * Author : see AUTHORS * Licence: MIT, see LICENSE ''' from flask_restplus import fields from src.api.apiConfig import api charset_model = api.model( 'charset', { 'id': fields.Integer(readOnly=True, required=False), 'name': fields.String(readOnly=True, required=False), 'keyspace': fields.Integer(), 'time': fields.DateTime(readOnly=True, required=False), 'data': fields.String() }) charsetCollection_model = api.inherit( 'Charset collection', {'items': fields.List(fields.Nested(charset_model))})
'mask': fields.String(), 'current_index': fields.Integer(), 'keyspace': fields.Integer(), 'hc_keyspace': fields.Integer(), 'progress': fields.Float(required=False) }) hash_model = api.model( 'Hash', { 'hashText': fields.String(), 'password': fields.String(), 'time_cracked': fields.DateTime() }) page_of_jobs_model = api.inherit( 'Page of jobs', pagination, {'items': fields.List(fields.Nested(job_short_model))}) page_of_workunits_model = api.inherit( 'Page of workunits', pagination, {'items': fields.List(fields.Nested(workunit_model))}) verifyHash_model = api.model( 'Verified hash', { 'hash': fields.String(required=True, description='Hash being validated'), 'result': fields.String(required=True, description='Whether the hash is valid'), 'isInCache': fields.Boolean() })
''' * Author : see AUTHORS * Licence: MIT, see LICENSE ''' from flask_restplus import fields from src.api.apiConfig import api from src.api.fitcrack.endpoints.package.responseModels import job_model from src.api.fitcrack.responseModels import pagination, host_short_model, package_short_model, boincHost_model, \ user_model page_of_hosts_model = api.inherit( 'Page of hosts', pagination, {'items': fields.List(fields.Nested(boincHost_model))}) jobWithPackage_model = api.inherit( 'Job with package', job_model, {'job': fields.Nested(package_short_model, attribute='package')}) boincHostDetail_model = api.model( 'Host detail boinc', { 'id': fields.Integer(readOnly=True, required=False), 'domain_name': fields.String(), 'p_model': fields.String(), 'user': fields.Nested(user_model), 'os_name': fields.String(), 'fc_host': fields.Nested(host_short_model), 'active': fields.Boolean(), 'workunits': fields.List(fields.Nested(jobWithPackage_model)), 'jobs': fields.List(fields.Nested(package_short_model))
''' * Author : see AUTHORS * Licence: MIT, see LICENSE ''' from flask_restplus import fields from src.api.apiConfig import api log_model = api.model('log', { 'type': fields.String(readOnly=True, required=False), 'time': fields.DateTime(readOnly=True, required=False), 'host': fields.Integer(readOnly=True, required=False), 'package': fields.Integer(readOnly=True, required=False), 'log': fields.String(readOnly=True, required=False), 'raw': fields.String(readOnly=True, required=False) }) logsCollection_model = api.inherit('logs collection', { 'items': fields.List(fields.Nested(log_model)) })
''' * Author : see AUTHORS * Licence: MIT, see LICENSE ''' from flask_restplus import fields from src.api.apiConfig import api from src.api.fitcrack.responseModels import pagination, job_short_model bin_model = api.model('Job bin', { 'id': fields.Integer(readOnly=True), 'position': fields.Integer(readOnly=True), 'name': fields.String(), 'job_count': fields.Integer() }) bin_with_jobs_model = api.inherit('Job bin with jobs list', bin_model, { 'jobs': fields.List(fields.Nested(job_short_model)) }) bins_model = api.inherit('Job bin collection', { 'items': fields.List(fields.Nested(bin_model)) })
''' * Author : see AUTHORS * Licence: MIT, see LICENSE ''' from flask_restplus import fields from src.api.apiConfig import api rule_model = api.model('rule', { 'id': fields.Integer(readOnly=True, required=False), 'name': fields.String(readOnly=True, required=False), 'count': fields.Integer(readOnly=True), 'time': fields.DateTime(readOnly=True, required=False) }) rules_model = api.model('rules collection', { 'items': fields.List(fields.Nested(rule_model)) }) ruleData_model = api.inherit('Rules with data', { 'data': fields.String(), 'status': fields.Boolean() })
'mask': fields.String(), 'current_index': fields.Integer(), 'keyspace': fields.Integer(), 'hc_keyspace': fields.Integer(), 'progress': fields.Float(required=False) }) hash_model = api.model( 'Hash', { 'hashText': fields.String(), 'password': fields.String(), 'time_cracked': fields.DateTime() }) page_of_packages_model = api.inherit( 'Page of packages', pagination, {'items': fields.List(fields.Nested(package_short_model))}) page_of_jobs_model = api.inherit( 'Page of jobs', pagination, {'items': fields.List(fields.Nested(job_model))}) verifyHash_model = api.model( 'Verified hash', { 'hash': fields.String(required=True, description='Hash ktory sa overoval'), 'result': fields.String(required=True, description='Ak ma hash spravny format tak OK'), 'isInCache': fields.Boolean()