Add: Job and params-vector schemas.
This commit is contained in:
39
src/schemas/job.js
Normal file
39
src/schemas/job.js
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
import paramsVector from 'job/params-vector'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
$schema: 'http://json-schema.org/draft-04/schema#',
|
||||||
|
type: 'object',
|
||||||
|
properties: {
|
||||||
|
type: {
|
||||||
|
enum: ['call']
|
||||||
|
},
|
||||||
|
id: {
|
||||||
|
type: 'string',
|
||||||
|
description: 'job identifier'
|
||||||
|
},
|
||||||
|
name: {
|
||||||
|
type: 'string',
|
||||||
|
description: 'human readable name'
|
||||||
|
},
|
||||||
|
userId: {
|
||||||
|
type: 'string',
|
||||||
|
description: 'identifier of the user who have created the job (the permissions of the user are used by the job)'
|
||||||
|
},
|
||||||
|
key: {
|
||||||
|
type: 'string'
|
||||||
|
// TODO description
|
||||||
|
},
|
||||||
|
method: {
|
||||||
|
type: 'string',
|
||||||
|
description: 'called method'
|
||||||
|
},
|
||||||
|
paramsVector
|
||||||
|
},
|
||||||
|
required: [
|
||||||
|
'type',
|
||||||
|
'id',
|
||||||
|
'userId',
|
||||||
|
'key',
|
||||||
|
'method'
|
||||||
|
]
|
||||||
|
}
|
||||||
59
src/schemas/job/params-vector.js
Normal file
59
src/schemas/job/params-vector.js
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
export default {
|
||||||
|
$schema: 'http://json-schema.org/draft-04/schema#',
|
||||||
|
type: 'object',
|
||||||
|
properties: {
|
||||||
|
type: {
|
||||||
|
enum: ['crossProduct']
|
||||||
|
},
|
||||||
|
items: {
|
||||||
|
type: 'array',
|
||||||
|
description: 'vector of values to multiply with others vectors',
|
||||||
|
items: {
|
||||||
|
type: 'object',
|
||||||
|
properties: {
|
||||||
|
type: {
|
||||||
|
enum: ['set']
|
||||||
|
},
|
||||||
|
values: {
|
||||||
|
type: 'array',
|
||||||
|
items: {
|
||||||
|
type: 'object'
|
||||||
|
},
|
||||||
|
minItems: 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
required: [
|
||||||
|
'type',
|
||||||
|
'values'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
minItems: 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
required: [
|
||||||
|
'type',
|
||||||
|
'items'
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Example:
|
||||||
|
{
|
||||||
|
"type": "cross product",
|
||||||
|
"items": [
|
||||||
|
{
|
||||||
|
"type": "set",
|
||||||
|
"values": [
|
||||||
|
{"id": 0, "name": "snapshost de 0"},
|
||||||
|
{"id": 1, "name": "snapshost de 1"}
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "set",
|
||||||
|
"values": [
|
||||||
|
{"force": true}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
*/
|
||||||
Reference in New Issue
Block a user