{ "$schema": "http://json-schema.org/draft-07/schema", "$id": "instance-group-database", "title": "Resource Instance Group Document", "description": "A Resource Instance Group document as it is stored in the database.", "type": "object", "allOf": [ { "propertyNames": { "anyOf": [ { "$ref": "common#/definitions/metadataFieldNames" }, { "$ref": "common-db#/definitions/commonFieldNames" }, { "$ref": "instance-group-common#/definitions/commonFieldNames" } ] } }, { "$ref": "common#/definitions/metadataFieldsRequired" }, { "$ref": "common#/definitions/metadataFields" }, { "$ref": "common-db#/definitions/commonFieldsRequired" }, { "type": "object", "properties": { "name": { "$ref": "common#/definitions/name" }, "description": { "$ref": "common#/definitions/description" }, "modelId": { "$ref": "common-db#/definitions/MongoDB_ObjectId" } } }, { "oneOf": [ { "$ref": "#/definitions/manualFields" }, { "$ref": "#/definitions/dynamicFields" } ] }, { "$ref": "instance-group-common#/definitions/commonFieldsRequired" }, { "$ref": "instance-group-common#/definitions/commonFields" }, { "type": "object", "properties": { "lastAction": { "$ref": "common#/definitions/lastAction" } } } ], "definitions": { "instances": { "type": "array", "items": { "$ref": "common-db#/definitions/MongoDB_ObjectId" } }, "filter": {}, "manualFields": { "type": "object", "not": { "required": [ "filter" ] }, "properties": { "type": { "const": "manual" }, "instances": { "$ref": "#/definitions/instances" } } }, "dynamicFields": { "type": "object", "not": { "required": [ "instances" ] }, "properties": { "type": { "const": "dynamic" }, "filter": { "$ref": "#/definitions/filter" } } } } }