summaryrefslogtreecommitdiffstats
path: root/component-json-schemas
diff options
context:
space:
mode:
authorMichael Hwang <mhwang@research.att.com>2017-08-24 12:18:43 -0400
committerMichael Hwang <mhwang@research.att.com>2017-08-24 12:20:41 -0400
commitb86b42713a1fbfb1929bd5019aed7e5275b78d64 (patch)
tree3caff5eacba397aa5960354ff8b4a00788544822 /component-json-schemas
parentd4c6fea2ab91b2e72cc188f10178f1f3cd8b99d5 (diff)
Add dcae-cli and component-json-schemas projects
Change-Id: I2d920da7902bb5c1faf3d66173d62c942e9a19e9 Issue-Id: DCAEGEN2-50 Signed-off-by: Michael Hwang <mhwang@research.att.com>
Diffstat (limited to 'component-json-schemas')
-rw-r--r--component-json-schemas/README.md36
-rw-r--r--component-json-schemas/component-spec-schema.json712
-rw-r--r--component-json-schemas/data-format-schema.json205
-rw-r--r--component-json-schemas/tests/component-spec-cdap.json78
-rw-r--r--component-json-schemas/tests/component-spec-docker.json110
5 files changed, 1141 insertions, 0 deletions
diff --git a/component-json-schemas/README.md b/component-json-schemas/README.md
new file mode 100644
index 0000000..f1dfcd5
--- /dev/null
+++ b/component-json-schemas/README.md
@@ -0,0 +1,36 @@
+# Component JSON Schemas
+
+This repository contains the custom JSON schemas to support the onboarding of components:
+
+* Component specification schema
+* Auxilary component specification schema for Docker
+* Auxilary component specification schema for CDAP
+* Data formats schema
+
+## Testing changes
+
+Use the Python `jsonschema` command-line tool to do validation checks:
+
+Example:
+
+```
+$ jsonschema -i tests/component-spec-docker.json component-spec-schema.json
+```
+
+## Uploading to Nexus
+
+For the component specification schema:
+
+```
+curl -v --user <user>:<password> https://<your file server host>/schemas/component-specification/<tag>/component-spec-schema.json --upload-file component-spec-schema.json
+```
+
+For the data format schema:
+
+```
+curl -v --user <user>:<password> https://<your file server host>/schemas/data-format/<tag>/data-format-schema.json --upload-file data-format-schema.json
+```
+
+### `dcae-cli`
+
+The `dcae-cli` looks for these schemas under a tag that is of the format `dcae-cli-v<major version>` where the major version is an integer that is the major part of semver. For schema changes that are breaking, you must bump the `<major version>`. Otherwise, you can simply replace the existing schema by uploading using the same tag.
diff --git a/component-json-schemas/component-spec-schema.json b/component-json-schemas/component-spec-schema.json
new file mode 100644
index 0000000..690cc96
--- /dev/null
+++ b/component-json-schemas/component-spec-schema.json
@@ -0,0 +1,712 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Component specification schema",
+ "type": "object",
+ "properties": {
+ "self": {
+ "type": "object",
+ "properties": {
+ "version": {
+ "$ref": "#/definitions/version"
+ },
+ "description": {
+ "type": "string"
+ },
+ "component_type": {
+ "type": "string",
+ "enum": [
+ "docker",
+ "cdap"
+ ]
+ },
+ "name": {
+ "$ref": "#/definitions/name"
+ }
+ },
+ "required": [
+ "version",
+ "name",
+ "description",
+ "component_type"
+ ]
+ },
+ "streams": {
+ "type": "object",
+ "properties": {
+ "publishes": {
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "oneOf": [
+ { "$ref": "#/definitions/publisher_http" },
+ { "$ref": "#/definitions/publisher_message_router" },
+ { "$ref": "#/definitions/publisher_data_router" }
+ ]
+ }
+ },
+ "subscribes": {
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "oneOf": [
+ { "$ref": "#/definitions/subscriber_http" },
+ { "$ref": "#/definitions/subscriber_message_router" },
+ { "$ref": "#/definitions/subscriber_data_router" }
+ ]
+ }
+ }
+ },
+ "required": [
+ "publishes",
+ "subscribes"
+ ]
+ },
+ "services": {
+ "type": "object",
+ "properties": {
+ "calls": {
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "$ref": "#/definitions/caller"
+ }
+ },
+ "provides": {
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "$ref": "#/definitions/provider"
+ }
+ }
+ },
+ "required": [
+ "calls",
+ "provides"
+ ]
+ },
+ "parameters" : {
+ "anyOf" : [
+ {"$ref": "#/definitions/docker-parameters"},
+ {"$ref": "#/definitions/cdap-parameters"}
+ ]
+ },
+ "auxilary": {
+ "oneOf" : [
+ {"$ref": "#/definitions/auxilary_cdap"},
+ {"$ref": "#/definitions/auxilary_docker"}
+ ]
+ },
+ "artifacts": {
+ "type": "array",
+ "description": "List of component artifacts",
+ "items": {
+ "$ref": "#/definitions/artifact"
+ }
+ }
+ },
+ "required": [
+ "self",
+ "streams",
+ "services",
+ "parameters",
+ "auxilary",
+ "artifacts"
+ ],
+ "additionalProperties": false,
+ "definitions": {
+ "cdap-parameters": {
+ "description" : "There are three seperate ways to pass parameters to CDAP: app config, app preferences, program preferences. These are all treated as optional.",
+ "type": "object",
+ "properties" : {
+ "program_preferences": {
+ "description" : "A list of {program_id, program_type, program_preference} objects where program_preference is an object passed into program_id of type program_type",
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "$ref": "#/definitions/program_preference"
+ }
+ },
+ "app_preferences" : {
+ "description" : "Parameters Passed down to the CDAP preference API",
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "$ref": "#/definitions/parameter"
+ }
+ },
+ "app_config" : {
+ "description" : "Parameters Passed down to the CDAP App Config",
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "$ref": "#/definitions/parameter"
+ }
+ }
+ }
+ },
+ "program_preference": {
+ "type": "object",
+ "properties": {
+ "program_type": {
+ "$ref": "#/definitions/program_type"
+ },
+ "program_id": {
+ "type": "string"
+ },
+ "program_pref":{
+ "description" : "Parameters that the CDAP developer wants pushed to this program's preferences API. Optional",
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "$ref": "#/definitions/parameter"
+ }
+ }
+ },
+ "required": ["program_type", "program_id", "program_pref"]
+ },
+ "program_type": {
+ "type": "string",
+ "enum": ["flows","mapreduce","schedules","spark","workflows","workers","services"]
+ },
+ "docker-parameters": {
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "$ref": "#/definitions/parameter"
+ }
+ },
+ "parameter": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "value": {
+ "description": "Default value for the parameter"
+ },
+ "description": {
+ "description": "Description for the parameter.",
+ "type": "string"
+ },
+ "type": {
+ "description": "The required data type for the parameter.",
+ "type": "string",
+ "enum": [ "string", "number", "boolean", "datetime" ]
+ },
+ "required": {
+ "description": "An optional key that declares a parameter as required (true) or not (false). Default is true.",
+ "type": "boolean",
+ "default": true
+ },
+ "constraints": {
+ "description": "The optional list of sequenced constraint clauses for the parameter.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/parameter-constraints"
+ }
+ },
+ "entry_schema": {
+ "description": "used for complex data type in the future. 'type' must be map or array for entry_schema to kick_in. ",
+ "type": "string"
+ },
+ "designer_editable": {
+ "description": "An optional key that declares a parameter to be editable by designer (true) or not (false). Default is true.",
+ "type": "boolean",
+ "default": true
+ },
+ "policy_editable": {
+ "description": "An optional key that declares a parameter to be editable by policy (true) or not (false). Default is true.",
+ "type": "boolean",
+ "default": false
+ },
+ "policy_schema" :{
+ "type": "array",
+ "uniqueItems": true,
+ "items": {"$ref": "#/definitions/policy_schema_parameter"}
+ }
+ },
+ "required": [
+ "name",
+ "value",
+ "description"
+ ],
+ "additionalProperties": false,
+ "dependencies": { "policy_schema": ["policy_editable"]}
+ },
+ "policy_schema_parameter": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "value": {
+ "description": "Default value for the parameter"
+ },
+ "description": {
+ "description": "Description for the parameter.",
+ "type": "string"
+ },
+ "type": {
+ "description": "The required data type for the parameter.",
+ "type": "string",
+ "enum": [ "string", "number", "boolean", "datetime", "list", "map" ]
+ },
+ "required": {
+ "description": "An optional key that declares a parameter as required (true) or not (false). Default is true.",
+ "type": "boolean",
+ "default": true
+ },
+ "constraints": {
+ "description": "The optional list of sequenced constraint clauses for the parameter.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/parameter-constraints"
+ }
+ },
+ "entry_schema": {
+ "description": "The optional key that is used to declare the name of the Datatype definition for entries of certain types. entry_schema must be defined when the type is either list or map. If the type is list and the entry type is a simple type (string, number, boolean, datetime), follow with a simple string to describe the entry type. If the type is list and the entry type is a map, follow with an array to describe the keys for the entry map. If the type is list and the entry type is also list, this is not currently supported here. If the type is map, then follow with an array to describe the keys for this map. ",
+ "type": "array", "uniqueItems": true, "items": {"$ref": "#/definitions/policy_schema_parameter"}
+ }
+ },
+ "required": [
+ "name",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ "parameter-constraints": {
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "equal": {
+ "description": "Constrains a property or parameter to a value equal to (‘=’) the value declared."
+ },
+ "greater_than": {
+ "description": "Constrains a property or parameter to a value greater than (‘>’) the value declared.",
+ "type": "number"
+ },
+ "greater_or_equal": {
+ "description": "Constrains a property or parameter to a value greater than or equal to (‘>=’) the value declared.",
+ "type": "number"
+ },
+ "less_than": {
+ "description": "Constrains a property or parameter to a value less than (‘<’) the value declared.",
+ "type": "number"
+ },
+ "less_or_equal": {
+ "description": "Constrains a property or parameter to a value less than or equal to (‘<=’) the value declared.",
+ "type": "number"
+ },
+ "valid_values": {
+ "description": "Constrains a property or parameter to a value that is in the list of declared values.",
+ "type": "array"
+ },
+ "length": {
+ "description": "Constrains the property or parameter to a value of a given length.",
+ "type": "number"
+ },
+ "min_length": {
+ "description": "Constrains the property or parameter to a value to a minimum length.",
+ "type": "number"
+ },
+ "max_length": {
+ "description": "Constrains the property or parameter to a value to a maximum length.",
+ "type": "number"
+ }
+ }
+ },
+ "stream_message_router": {
+ "type": "object",
+ "properties": {
+ "format": {
+ "$ref": "#/definitions/name"
+ },
+ "version": {
+ "$ref": "#/definitions/version"
+ },
+ "config_key": {
+ "type": "string"
+ },
+ "type": {
+ "description": "Type of stream to be used",
+ "type": "string",
+ "enum": [
+ "message router", "message_router"
+ ]
+ }
+ },
+ "required": [
+ "format",
+ "version",
+ "config_key",
+ "type"
+ ]
+ },
+ "publisher_http": {
+ "type": "object",
+ "properties": {
+ "format": {
+ "$ref": "#/definitions/name"
+ },
+ "version": {
+ "$ref": "#/definitions/version"
+ },
+ "config_key": {
+ "type": "string"
+ },
+ "type": {
+ "description": "Type of stream to be used",
+ "type": "string",
+ "enum": [
+ "http",
+ "https"
+ ]
+ }
+ },
+ "required": [
+ "format",
+ "version",
+ "config_key",
+ "type"
+ ]
+ },
+ "publisher_message_router": {
+ "$ref": "#/definitions/stream_message_router"
+ },
+ "publisher_data_router": {
+ "type": "object",
+ "properties": {
+ "format": {
+ "$ref": "#/definitions/name"
+ },
+ "version": {
+ "$ref": "#/definitions/version"
+ },
+ "config_key": {
+ "type": "string"
+ },
+ "type": {
+ "description": "Type of stream to be used",
+ "type": "string",
+ "enum": [
+ "data router", "data_router"
+ ]
+ }
+ },
+ "required": [
+ "format",
+ "version",
+ "config_key",
+ "type"
+ ]
+ },
+ "subscriber_http": {
+ "type": "object",
+ "properties": {
+ "format": {
+ "$ref": "#/definitions/name"
+ },
+ "version": {
+ "$ref": "#/definitions/version"
+ },
+ "route": {
+ "type": "string"
+ },
+ "type": {
+ "description": "Type of stream to be used",
+ "type": "string",
+ "enum": [
+ "http",
+ "https"
+ ]
+ }
+ },
+ "required": [
+ "format",
+ "version",
+ "route",
+ "type"
+ ]
+ },
+ "subscriber_message_router": {
+ "$ref": "#/definitions/stream_message_router"
+ },
+ "subscriber_data_router": {
+ "type": "object",
+ "properties": {
+ "format": {
+ "$ref": "#/definitions/name"
+ },
+ "version": {
+ "$ref": "#/definitions/version"
+ },
+ "route": {
+ "type": "string"
+ },
+ "type": {
+ "description": "Type of stream to be used",
+ "type": "string",
+ "enum": [
+ "data router", "data_router"
+ ]
+ },
+ "config_key": {
+ "description": "Data router subscribers require config info to setup their endpoints to handle requests. For example, needs username and password",
+ "type": "string"
+ }
+ },
+ "required": [
+ "format",
+ "version",
+ "route",
+ "type",
+ "config_key"
+ ]
+ },
+ "provider" : {
+ "oneOf" : [
+ {"$ref": "#/definitions/docker-provider"},
+ {"$ref": "#/definitions/cdap-provider"}
+ ]
+ },
+ "cdap-provider" : {
+ "type": "object",
+ "properties" : {
+ "request": {
+ "$ref": "#/definitions/formatPair"
+ },
+ "response": {
+ "$ref": "#/definitions/formatPair"
+ },
+ "service_name" : {
+ "type" : "string"
+ },
+ "service_endpoint" : {
+ "type" : "string"
+ },
+ "verb" : {
+ "type": "string",
+ "enum": ["GET", "PUT", "POST", "DELETE"]
+ }
+ },
+ "required" : [
+ "request",
+ "response",
+ "service_name",
+ "service_endpoint",
+ "verb"
+ ]
+ },
+ "docker-provider": {
+ "type": "object",
+ "properties": {
+ "request": {
+ "$ref": "#/definitions/formatPair"
+ },
+ "response": {
+ "$ref": "#/definitions/formatPair"
+ },
+ "route": {
+ "type": "string"
+ },
+ "verb": {
+ "type": "string",
+ "enum": ["GET", "PUT", "POST", "DELETE"]
+ }
+ },
+ "required": [
+ "request",
+ "response",
+ "route"
+ ]
+ },
+ "caller": {
+ "type": "object",
+ "properties": {
+ "request": {
+ "$ref": "#/definitions/formatPair"
+ },
+ "response": {
+ "$ref": "#/definitions/formatPair"
+ },
+ "config_key": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "request",
+ "response",
+ "config_key"
+ ]
+ },
+ "formatPair": {
+ "type": "object",
+ "properties": {
+ "format": {
+ "$ref": "#/definitions/name"
+ },
+ "version": {
+ "$ref": "#/definitions/version"
+ }
+ }
+ },
+ "name": {
+ "type": "string"
+ },
+ "version": {
+ "type": "string",
+ "pattern": "^(\\d+\\.)(\\d+\\.)(\\*|\\d+)$"
+ },
+ "artifact": {
+ "type": "object",
+ "description": "Component artifact object",
+ "properties": {
+ "uri": {
+ "type": "string",
+ "description": "Uri to artifact"
+ },
+ "type": {
+ "type": "string",
+ "enum": ["jar", "docker image"]
+ }
+ },
+ "required": ["uri", "type"]
+ },
+
+ "auxilary_cdap": {
+ "title": "cdap component specification schema",
+ "type": "object",
+ "properties": {
+ "streamname": {
+ "type": "string"
+ },
+ "artifact_name" : {
+ "type": "string"
+ },
+ "artifact_version" : {
+ "type": "string",
+ "pattern": "^(\\d+\\.)(\\d+\\.)(\\*|\\d+)$"
+ },
+ "namespace":{
+ "type": "string",
+ "description" : "optional"
+ },
+ "programs": {
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "$ref": "#/definitions/cdap_program"
+ }
+ }
+ },
+ "required": [
+ "streamname",
+ "programs",
+ "artifact_name",
+ "artifact_version"
+ ]
+ },
+ "cdap_program_type": {
+ "type": "string",
+ "enum": ["flows","mapreduce","schedules","spark","workflows","workers","services"]
+ },
+ "cdap_program": {
+ "type": "object",
+ "properties": {
+ "program_type": {
+ "$ref": "#/definitions/cdap_program_type"
+ },
+ "program_id": {
+ "type": "string"
+ }
+ },
+ "required": ["program_type", "program_id"]
+ },
+
+ "auxilary_docker": {
+ "title": "Docker component specification schema",
+ "type": "object",
+ "properties": {
+ "healthcheck": {
+ "description": "Define the health check that Consul should perfom for this component",
+ "type": "object",
+ "oneOf": [
+ { "$ref": "#/definitions/docker_healthcheck_http" },
+ { "$ref": "#/definitions/docker_healthcheck_script" }
+ ]
+ },
+ "ports": {
+ "description": "Port mapping to be used for Docker containers. Each entry is of the format <container port>:<host port>.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ },
+ "required": [
+ "healthcheck"
+ ],
+ "additionalProperties": false
+ },
+ "docker_healthcheck_http": {
+ "properties": {
+ "type": {
+ "description": "Consul health check type",
+ "type": "string",
+ "enum": [
+ "http",
+ "https"
+ ]
+ },
+ "interval": {
+ "description": "Interval duration in seconds i.e. 10s",
+ "default": "15s",
+ "type": "string"
+ },
+ "timeout": {
+ "description": "Timeout in seconds i.e. 10s",
+ "default": "1s",
+ "type": "string"
+ },
+ "endpoint": {
+ "description": "Relative endpoint used by Consul to check health by making periodic HTTP GET calls",
+ "type": "string"
+ }
+ },
+ "required": [
+ "type",
+ "endpoint"
+ ]
+ },
+ "docker_healthcheck_script": {
+ "properties": {
+ "type": {
+ "description": "Consul health check type",
+ "type": "string",
+ "enum": [
+ "script",
+ "docker"
+ ]
+ },
+ "interval": {
+ "description": "Interval duration in seconds i.e. 10s",
+ "default": "15s",
+ "type": "string"
+ },
+ "timeout": {
+ "description": "Timeout in seconds i.e. 10s",
+ "default": "1s",
+ "type": "string"
+ },
+ "script": {
+ "description": "Script command that will be executed by Consul to check health",
+ "type": "string"
+ }
+ },
+ "required": [
+ "type",
+ "script"
+ ]
+ }
+ }
+}
diff --git a/component-json-schemas/data-format-schema.json b/component-json-schemas/data-format-schema.json
new file mode 100644
index 0000000..be15682
--- /dev/null
+++ b/component-json-schemas/data-format-schema.json
@@ -0,0 +1,205 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Data format specification schema Version 1.0",
+ "type": "object",
+ "oneOf": [{
+ "properties": {
+ "self": {
+ "$ref": "#/definitions/self"
+ },
+ "dataformatversion": {
+ "$ref": "#/definitions/dataformatversion"
+ },
+ "reference": {
+
+ "type": "object",
+ "description": "A reference to an external schema - name/version is used to access the artifact",
+ "properties": {
+ "name": {
+ "$ref": "#/definitions/name"
+ },
+ "version": {
+ "$ref": "#/definitions/version"
+ },
+ "format": {
+ "$ref": "#/definitions/format"
+ }
+ },
+ "required": [
+ "name",
+ "version",
+ "format"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": ["self", "dataformatversion", "reference"],
+ "additionalProperties": false
+ }, {
+ "properties": {
+ "self": {
+ "$ref": "#/definitions/self"
+ },
+ "dataformatversion": {
+ "$ref": "#/definitions/dataformatversion"
+ },
+ "jsonschema": {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "description": "The actual JSON schema for this data format"
+ }
+
+ },
+ "required": ["self", "dataformatversion", "jsonschema"],
+ "additionalProperties": false
+ }, {
+ "properties": {
+ "self": {
+ "$ref": "#/definitions/self"
+ },
+ "dataformatversion": {
+ "$ref": "#/definitions/dataformatversion"
+ },
+ "delimitedschema": {
+ "type": "object",
+ "description": "A JSON schema for delimited files",
+ "properties": {
+ "delimiter": {
+ "enum": [",", "|", "\t"]
+ },
+ "fields": {
+ "type": "array",
+ "description": "Array of field descriptions",
+ "items": {
+ "$ref": "#/definitions/field"
+ }
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": ["self", "dataformatversion", "delimitedschema"],
+ "additionalProperties": false
+ }, {
+ "properties": {
+ "self": {
+ "$ref": "#/definitions/self"
+ },
+ "dataformatversion": {
+ "$ref": "#/definitions/dataformatversion"
+ },
+ "unstructured": {
+ "type": "object",
+ "description": "A JSON schema for unstructured text",
+ "properties": {
+ "encoding": {
+ "type": "string",
+ "enum": ["ASCII", "UTF-8", "UTF-16", "UTF-32"]
+ }
+ },
+ "additionalProperties": false
+
+ }
+ },
+ "required": ["self", "dataformatversion", "unstructured"],
+ "additionalProperties": false
+ }],
+ "definitions": {
+ "name": {
+ "type": "string"
+ },
+ "version": {
+ "type": "string",
+ "pattern": "^(\\d+\\.)(\\d+\\.)(\\*|\\d+)$"
+ },
+ "self": {
+ "description": "Identifying Information for the Data Format - name/version can be used to access the artifact",
+ "type": "object",
+ "properties": {
+ "name": {
+ "$ref": "#/definitions/name"
+ },
+ "version": {
+ "$ref": "#/definitions/version"
+ },
+ "description": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "name",
+ "version"
+ ],
+ "additionalProperties": false
+ },
+ "format": {
+ "description": "Reference schema type",
+ "type": "string",
+ "enum": [
+ "JSON",
+ "Delimited Format",
+ "XML",
+ "Unstructured"
+ ]
+ },
+ "field": {
+ "description": "A field definition for the delimited schema",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "fieldtype": {
+ "description": "the field type - from the XML schema types",
+ "type": "string",
+ "enum": ["string", "boolean",
+ "decimal", "float", "double",
+ "duration", "dateTime", "time",
+ "date", "gYearMonth", "gYear",
+ "gMonthDay", "gDay", "gMonth",
+ "hexBinary", "base64Binary",
+ "anyURI", "QName", "NOTATION",
+ "normalizedString", "token",
+ "language", "IDREFS", "ENTITIES",
+ "NMTOKEN", "NMTOKENS", "Name",
+ "NCName", "ID", "IDREF", "ENTITY",
+ "integer", "nonPositiveInteger",
+ "negativeInteger", "long", "int",
+ "short", "byte",
+ "nonNegativeInteger", "unsignedLong",
+ "unsignedInt", "unsignedShort",
+ "unsignedByte", "positiveInteger"
+
+ ]
+ },
+ "fieldPattern": {
+ "description": "Regular expression that defines the field format",
+ "type": "integer"
+ },
+ "fieldMaxLength": {
+ "description": "The maximum length of the field",
+ "type": "integer"
+ },
+ "fieldMinLength": {
+ "description": "The minimum length of the field",
+ "type": "integer"
+ },
+ "fieldMinimum": {
+ "description": "The minimum numeric value of the field",
+ "type": "integer"
+ },
+ "fieldMaximum": {
+ "description": "The maximum numeric value of the field",
+ "type": "integer"
+ }
+ },
+ "additionalProperties": false
+ },
+ "dataformatversion": {
+ "type": "string",
+ "enum": ["1.0.0"]
+ }
+ }
+}
diff --git a/component-json-schemas/tests/component-spec-cdap.json b/component-json-schemas/tests/component-spec-cdap.json
new file mode 100644
index 0000000..a8e3544
--- /dev/null
+++ b/component-json-schemas/tests/component-spec-cdap.json
@@ -0,0 +1,78 @@
+{
+ "self":{
+ "name":"cdap.helloworld.endnode",
+ "version":"0.8.0",
+ "description":"cdap test component",
+ "component_type":"cdap"
+ },
+ "streams":{
+ "subscribes": [
+ {
+ "format": "some.format",
+ "version": "5.0.0",
+ "route": "/yay",
+ "type": "http"
+ },
+ {
+ "format": "some.format",
+ "version": "5.0.0",
+ "config_key": "foo-sub",
+ "type": "message router"
+ }],
+ "publishes": [{
+ "format": "std.empty",
+ "version": "1.0.6",
+ "config_key": "stream_publish_example",
+ "type": "message_router"
+ }]
+ },
+ "services":{
+ "calls": [],
+ "provides":[
+ {
+ "request":{
+ "format":"std.empty",
+ "version":"1.0.6"
+ },
+ "response":{
+ "format":"std.empty",
+ "version":"1.0.6"
+ },
+ "service_name":"Greeting",
+ "service_endpoint":"greet",
+ "verb":"GET"
+ }
+ ]
+ },
+ "parameters": {
+ "app_config" : [
+ {"name" : "some_param",
+ "description" : "some desc",
+ "value" : "some_value",
+ "type": "string"}
+ ],
+ "app_preferences" : [
+ {"name" : "some_param2",
+ "description" : "some desc2",
+ "value" : true,
+ "type": "boolean"}
+ ],
+ "program_preferences" : [{"program_type" : "flows", "program_id" : "WhoFlow", "program_pref" : [{"name" : "some_param3","description" : "some desc3", "value" : "some_value3", "type": "number"}]}]
+ },
+ "auxilary": {
+ "streamname":"who",
+ "artifact_name" : "HelloWorld",
+ "artifact_version" : "3.4.3",
+ "programs" : [
+ {"program_type" : "flows", "program_id" : "WhoFlow"},
+ {"program_type" : "services", "program_id" : "Greeting"}
+ ],
+ "namespace" : "hw"
+ },
+ "artifacts": [
+ {
+ "uri": "some jar url",
+ "type": "jar"
+ }
+ ]
+}
diff --git a/component-json-schemas/tests/component-spec-docker.json b/component-json-schemas/tests/component-spec-docker.json
new file mode 100644
index 0000000..34458d5
--- /dev/null
+++ b/component-json-schemas/tests/component-spec-docker.json
@@ -0,0 +1,110 @@
+{
+ "self": {
+ "version": "0.5.0",
+ "name": "sandbox.platform.laika",
+ "description": "Web service used as a stand-alone test DCAE service component",
+ "component_type": "docker"
+ },
+ "streams": {
+ "subscribes": [],
+ "publishes": [
+ {
+ "format": "some.format",
+ "version": "1.0.0",
+ "config_key": "pub-foo",
+ "type": "message router"
+ },
+ {
+ "format": "some.format",
+ "version": "1.0.0",
+ "config_key": "pub-foo",
+ "type": "http"
+ }
+ ]
+ },
+ "services": {
+ "calls": [],
+ "provides": [
+ {
+ "route": "/rollcall",
+ "verb": "GET",
+ "request": {
+ "format": "sandbox.platform.any",
+ "version": "0.1.0"
+ },
+ "response": {
+ "format": "sandbox.platform.laika.rollcall.response",
+ "version": "0.1.0"
+ }
+ },
+ {
+ "route": "/identity",
+ "verb": "POST",
+ "request": {
+ "format": "sandbox.platform.laika.identity.request",
+ "version": "0.1.0"
+ },
+ "response": {
+ "format": "sandbox.platform.laika.identity.response",
+ "version": "0.1.0"
+ }
+ },
+ {
+ "route": "/health",
+ "verb": "GET",
+ "request": {
+ "format": "sandbox.platform.any",
+ "version": "0.1.0"
+ },
+ "response": {
+ "format": "sandbox.platform.laika.health",
+ "version": "0.1.0"
+ }
+ }
+ ]
+ },
+ "parameters": [
+ {
+ "name": "threshold",
+ "description": "Some fake threshold",
+ "type": "number",
+ "value": 2000
+ },
+ {
+ "name": "some-target-number",
+ "description": "Some fake target",
+ "type": "number",
+ "value": 10000,
+ "constraints": [
+ {
+ "greater_or_equal": 1
+ },
+ {
+ "less_than": 100000
+ }]
+ },
+ {
+ "name": "magic-word",
+ "description": "Some magic word",
+ "type": "string",
+ "value": "requirements",
+ "constraints": [
+ {
+ "valid_values": ["rally", "user story"]
+ }]
+ }
+ ],
+ "auxilary": {
+ "healthcheck": {
+ "type": "http",
+ "endpoint": "/foo"
+ },
+ "ports": ["8080:8080"]
+ },
+ "artifacts": [
+ {
+ "uri": "some docker image path",
+ "type": "docker image"
+ }
+ ]
+}