summaryrefslogtreecommitdiffstats
path: root/adapter/acumos/tests/fixtures
diff options
context:
space:
mode:
authorAndrew Gauld <agauld@att.com>2019-11-13 18:09:32 +0000
committerAndrew Gauld <agauld@att.com>2019-11-15 20:23:42 +0000
commit849da15d5b7ddc68e4c2b90b603fc8948d4b5e6d (patch)
treeb0d3d6e7dcd1551c007a7212dfdb369720707a22 /adapter/acumos/tests/fixtures
parent3f67c400813a60e4b8f9327e20eccc9033dc1b0b (diff)
Add acumos adapter project
Signed-off-by: Andrew Gauld <agauld@att.com> Issue-ID: DCAEGEN2-1860 Change-Id: Ib22fd2aa61fe7761bacf85e69540d11803c7acee Signed-off-by: Andrew Gauld <agauld@att.com>
Diffstat (limited to 'adapter/acumos/tests/fixtures')
-rw-r--r--adapter/acumos/tests/fixtures/README.md2
-rw-r--r--adapter/acumos/tests/fixtures/dataformat_101.json212
-rw-r--r--adapter/acumos/tests/fixtures/dcae-cli-v2_component-spec-schema.json860
-rw-r--r--adapter/acumos/tests/fixtures/jsdraft4schema.json149
-rw-r--r--adapter/acumos/tests/fixtures/models/ArgsList_1.0.0_dcae_data_format.json1
-rw-r--r--adapter/acumos/tests/fixtures/models/SumOut_1.0.0_dcae_data_format.json1
-rw-r--r--adapter/acumos/tests/fixtures/models/example-model-listofm/example_model.py41
-rw-r--r--adapter/acumos/tests/fixtures/models/example-model-listofm/metadata.json1
-rw-r--r--adapter/acumos/tests/fixtures/models/example-model-listofm/model.proto39
-rw-r--r--adapter/acumos/tests/fixtures/models/example-model/metadata.json35
-rw-r--r--adapter/acumos/tests/fixtures/models/example-model/model.proto35
11 files changed, 1376 insertions, 0 deletions
diff --git a/adapter/acumos/tests/fixtures/README.md b/adapter/acumos/tests/fixtures/README.md
new file mode 100644
index 0000000..1ec5b68
--- /dev/null
+++ b/adapter/acumos/tests/fixtures/README.md
@@ -0,0 +1,2 @@
+# Fixtures
+The test fixtures in here came from https://gerrit.acumos.org/r/admin/repos/python-dcae-model-runner in the example folder.
diff --git a/adapter/acumos/tests/fixtures/dataformat_101.json b/adapter/acumos/tests/fixtures/dataformat_101.json
new file mode 100644
index 0000000..66aa2ab
--- /dev/null
+++ b/adapter/acumos/tests/fixtures/dataformat_101.json
@@ -0,0 +1,212 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Data format specification schema Version 1.0.1",
+ "type": "object",
+ "oneOf": [{
+ "properties": {
+ "self": {
+ "$ref": "#/definitions/self"
+ },
+ "dataformatversion": {
+ "$ref": "#/definitions/dataformatversion"
+ },
+ "reference": {
+
+ "type": "object",
+ "description": "A reference to an external schema - name/version or url, if specified, is used to access the artifact",
+ "properties": {
+ "name": {
+ "$ref": "#/definitions/name"
+ },
+ "url": {
+ "$ref": "#/definitions/url"
+ },
+ "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": {
+ "url": {
+ "format": "uri"
+ },
+ "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",
+ "Protocol Buffer",
+ "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", "1.0.1"]
+ }
+ }
+}
diff --git a/adapter/acumos/tests/fixtures/dcae-cli-v2_component-spec-schema.json b/adapter/acumos/tests/fixtures/dcae-cli-v2_component-spec-schema.json
new file mode 100644
index 0000000..1f1f75e
--- /dev/null
+++ b/adapter/acumos/tests/fixtures/dcae-cli-v2_component-spec-schema.json
@@ -0,0 +1,860 @@
+{
+ "$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": {
+ "oneOf": [
+ {"$ref": "#/definitions/parameter-list"},
+ {"$ref": "#/definitions/parameter-other"}
+ ]
+ },
+ "parameter-list": {
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "value": {
+ "description": "Default value for the parameter"
+ },
+ "description": {
+ "description": "Description for the parameter.",
+ "type": "string"
+ },
+ "type": {
+ "description": "Only valid type is list, the entry_schema is required - which contains the type of the list element. All properties set for the parameter apply to all elements in the list at this time",
+ "type": "string",
+ "enum": ["list"]
+ },
+ "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 property used to declare the name of the Datatype definition for entries of certain types. entry_schema must be defined when the type is list. This is the only type it is currently supported for.",
+ "type": "object",
+ "uniqueItems": true,
+ "items": {"$ref": "#/definitions/list-parameter"}
+ },
+ "designer_editable": {
+ "description": "A required property that declares a parameter as editable by designer in SDC Tool (true) or not (false).",
+ "type": "boolean"
+ },
+ "sourced_at_deployment": {
+ "description": "A required property that declares that a parameter is assigned at deployment time (true) or not (false).",
+ "type": "boolean"
+ },
+ "policy_editable": {
+ "description": "A required property that declares a parameter as editable by DevOps in Policy UI (true) or not (false).",
+ "type": "boolean"
+ },
+ "policy_group": {
+ "description": "An optional property used to group policy_editable parameters into groups. Each group will become it's own policy model. Any parameters without this property will be grouped together to form their own policy model",
+ "type": "string"
+ },
+ "policy_schema" :{
+ "type": "array",
+ "uniqueItems": true,
+ "items": {"$ref": "#/definitions/policy_schema_parameter"}
+ }
+ },
+ "required": [
+ "name",
+ "value",
+ "description",
+ "designer_editable",
+ "policy_editable",
+ "sourced_at_deployment",
+ "entry_schema"
+ ],
+ "additionalProperties": false,
+ "dependencies": {
+ "policy_schema": ["policy_editable"]
+ }
+ },
+ "parameter-other": {
+ "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"
+ }
+ },
+ "designer_editable": {
+ "description": "A required property that declares a parameter as editable by designer in SDC Tool (true) or not (false).",
+ "type": "boolean"
+ },
+ "sourced_at_deployment": {
+ "description": "A required property that declares that a parameter is assigned at deployment time (true) or not (false).",
+ "type": "boolean"
+ },
+ "policy_editable": {
+ "description": "A required property that declares a parameter as editable in Policy UI (true) or not (false).",
+ "type": "boolean"
+ },
+ "policy_group": {
+ "description": "An optional property used to group policy_editable parameters into groups. Each group will become it's own policy model. Any parameters without this property will be grouped together to form their own policy model",
+ "type": "string"
+ },
+ "policy_schema" :{
+ "description": "An optional property used to define policy_editable parameters as lists or maps",
+ "type": "array",
+ "uniqueItems": true,
+ "items": {"$ref": "#/definitions/policy_schema_parameter"}
+ }
+ },
+ "required": [
+ "name",
+ "value",
+ "description",
+ "designer_editable",
+ "sourced_at_deployment",
+ "policy_editable"
+ ],
+ "additionalProperties": false,
+ "dependencies": {
+ "policy_schema": ["policy_editable"]
+ }
+ },
+ "list-parameter": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "description": "The required data type for each parameter in the list.",
+ "type": "string",
+ "enum": ["string", "number"]
+ }
+ },
+ "required": [
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ "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"
+ }
+ },
+ "logging": {
+ "description": "Component specific details for logging",
+ "type": "object",
+ "properties": {
+ "log_directory": {
+ "description": "The path in the container where the component writes its logs. If the component is following the EELF requirements, this would be the directory where the four EELF files are being written. (Other logs can be placed in the directory--if their names in '.log', they'll also be sent into ELK.)",
+ "type": "string"
+ },
+ "alternate_fb_path": {
+ "description": "By default, the log volume is mounted at /var/log/onap/<component_type> in the sidecar container's file system. 'alternate_fb_path' allows overriding the default. Will affect how the log data can be found in the ELK system.",
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "policy": {
+ "properties": {
+ "trigger_type": {
+ "description": "Only value of docker is supported at this time.",
+ "type": "string",
+ "enum": ["docker"]
+ },
+ "script_path": {
+ "description": "Script command that will be executed for policy reconfiguration",
+ "type": "string"
+ }
+ },
+ "required": [
+ "trigger_type","script_path"
+ ],
+ "additionalProperties": false
+ },
+ "volumes": {
+ "description": "Volume mapping to be used for Docker containers. Each entry is of the format below",
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "host":{
+ "type":"object",
+ "path": {"type": "string"}
+ },
+ "container":{
+ "type":"object",
+ "bind": { "type": "string"},
+ "mode": { "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/adapter/acumos/tests/fixtures/jsdraft4schema.json b/adapter/acumos/tests/fixtures/jsdraft4schema.json
new file mode 100644
index 0000000..bcbb847
--- /dev/null
+++ b/adapter/acumos/tests/fixtures/jsdraft4schema.json
@@ -0,0 +1,149 @@
+{
+ "id": "http://json-schema.org/draft-04/schema#",
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "description": "Core schema meta-schema",
+ "definitions": {
+ "schemaArray": {
+ "type": "array",
+ "minItems": 1,
+ "items": { "$ref": "#" }
+ },
+ "positiveInteger": {
+ "type": "integer",
+ "minimum": 0
+ },
+ "positiveIntegerDefault0": {
+ "allOf": [ { "$ref": "#/definitions/positiveInteger" }, { "default": 0 } ]
+ },
+ "simpleTypes": {
+ "enum": [ "array", "boolean", "integer", "null", "number", "object", "string" ]
+ },
+ "stringArray": {
+ "type": "array",
+ "items": { "type": "string" },
+ "minItems": 1,
+ "uniqueItems": true
+ }
+ },
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "$schema": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "default": {},
+ "multipleOf": {
+ "type": "number",
+ "minimum": 0,
+ "exclusiveMinimum": true
+ },
+ "maximum": {
+ "type": "number"
+ },
+ "exclusiveMaximum": {
+ "type": "boolean",
+ "default": false
+ },
+ "minimum": {
+ "type": "number"
+ },
+ "exclusiveMinimum": {
+ "type": "boolean",
+ "default": false
+ },
+ "maxLength": { "$ref": "#/definitions/positiveInteger" },
+ "minLength": { "$ref": "#/definitions/positiveIntegerDefault0" },
+ "pattern": {
+ "type": "string",
+ "format": "regex"
+ },
+ "additionalItems": {
+ "anyOf": [
+ { "type": "boolean" },
+ { "$ref": "#" }
+ ],
+ "default": {}
+ },
+ "items": {
+ "anyOf": [
+ { "$ref": "#" },
+ { "$ref": "#/definitions/schemaArray" }
+ ],
+ "default": {}
+ },
+ "maxItems": { "$ref": "#/definitions/positiveInteger" },
+ "minItems": { "$ref": "#/definitions/positiveIntegerDefault0" },
+ "uniqueItems": {
+ "type": "boolean",
+ "default": false
+ },
+ "maxProperties": { "$ref": "#/definitions/positiveInteger" },
+ "minProperties": { "$ref": "#/definitions/positiveIntegerDefault0" },
+ "required": { "$ref": "#/definitions/stringArray" },
+ "additionalProperties": {
+ "anyOf": [
+ { "type": "boolean" },
+ { "$ref": "#" }
+ ],
+ "default": {}
+ },
+ "definitions": {
+ "type": "object",
+ "additionalProperties": { "$ref": "#" },
+ "default": {}
+ },
+ "properties": {
+ "type": "object",
+ "additionalProperties": { "$ref": "#" },
+ "default": {}
+ },
+ "patternProperties": {
+ "type": "object",
+ "additionalProperties": { "$ref": "#" },
+ "default": {}
+ },
+ "dependencies": {
+ "type": "object",
+ "additionalProperties": {
+ "anyOf": [
+ { "$ref": "#" },
+ { "$ref": "#/definitions/stringArray" }
+ ]
+ }
+ },
+ "enum": {
+ "type": "array",
+ "minItems": 1,
+ "uniqueItems": true
+ },
+ "type": {
+ "anyOf": [
+ { "$ref": "#/definitions/simpleTypes" },
+ {
+ "type": "array",
+ "items": { "$ref": "#/definitions/simpleTypes" },
+ "minItems": 1,
+ "uniqueItems": true
+ }
+ ]
+ },
+ "format": { "type": "string" },
+ "allOf": { "$ref": "#/definitions/schemaArray" },
+ "anyOf": { "$ref": "#/definitions/schemaArray" },
+ "oneOf": { "$ref": "#/definitions/schemaArray" },
+ "not": { "$ref": "#" }
+ },
+ "dependencies": {
+ "exclusiveMaximum": [ "maximum" ],
+ "exclusiveMinimum": [ "minimum" ]
+ },
+ "default": {}
+}
diff --git a/adapter/acumos/tests/fixtures/models/ArgsList_1.0.0_dcae_data_format.json b/adapter/acumos/tests/fixtures/models/ArgsList_1.0.0_dcae_data_format.json
new file mode 100644
index 0000000..56b6e6e
--- /dev/null
+++ b/adapter/acumos/tests/fixtures/models/ArgsList_1.0.0_dcae_data_format.json
@@ -0,0 +1 @@
+{"self": {"name": "ArgsList", "version": "1.0.0"}, "dataformatversion": "1.0.1", "jsonschema": {"title": "ArgsList", "type": "object", "properties": {"args": {"type": "array", "items": {"$ref": "#/definitions/Args"}}}, "$schema": "http://json-schema.org/draft-04/schema#", "definitions": {"Args": {"title": "Args", "type": "object", "properties": {"x": {"type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991}, "y": {"type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991}}}}}} \ No newline at end of file
diff --git a/adapter/acumos/tests/fixtures/models/SumOut_1.0.0_dcae_data_format.json b/adapter/acumos/tests/fixtures/models/SumOut_1.0.0_dcae_data_format.json
new file mode 100644
index 0000000..3f7cdca
--- /dev/null
+++ b/adapter/acumos/tests/fixtures/models/SumOut_1.0.0_dcae_data_format.json
@@ -0,0 +1 @@
+{"self": {"name": "SumOut", "version": "1.0.0"}, "dataformatversion": "1.0.1", "jsonschema": {"title": "SumOut", "type": "object", "properties": {"value": {"type": "array", "items": {"type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991}}}, "$schema": "http://json-schema.org/draft-04/schema#", "definitions": {}}} \ No newline at end of file
diff --git a/adapter/acumos/tests/fixtures/models/example-model-listofm/example_model.py b/adapter/acumos/tests/fixtures/models/example-model-listofm/example_model.py
new file mode 100644
index 0000000..cff1acb
--- /dev/null
+++ b/adapter/acumos/tests/fixtures/models/example-model-listofm/example_model.py
@@ -0,0 +1,41 @@
+# ============LICENSE_START====================================================
+# org.onap.dcae
+# =============================================================================
+# Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+# =============================================================================
+# 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.
+# ============LICENSE_END======================================================
+
+from acumos.session import AcumosSession
+from acumos.modeling import Model, List, NamedTuple
+
+
+class Args(NamedTuple):
+ x: int
+ y: int
+
+
+class ArgsList(NamedTuple):
+ args: List[Args]
+
+
+def sum(args: ArgsList) -> List[int]:
+ return [arg.x + arg.y for arg in args]
+
+
+if __name__ == '__main__':
+ '''Main'''
+ model = Model(sum=sum)
+
+ session = AcumosSession()
+ session.dump(model, 'example-model', '.')
diff --git a/adapter/acumos/tests/fixtures/models/example-model-listofm/metadata.json b/adapter/acumos/tests/fixtures/models/example-model-listofm/metadata.json
new file mode 100644
index 0000000..e9df2bd
--- /dev/null
+++ b/adapter/acumos/tests/fixtures/models/example-model-listofm/metadata.json
@@ -0,0 +1 @@
+{"schema": "acumos.schema.model:0.4.0", "runtime": {"name": "python", "encoding": "protobuf", "version": "3.6.8", "dependencies": {"pip": {"indexes": [], "requirements": [{"name": "dill", "version": "0.3.0"}, {"name": "acumos", "version": "0.8.0"}]}, "conda": {"channels": [], "requirements": []}}}, "name": "example-model", "methods": {"sum": {"input": "ArgsList", "output": "SumOut", "description": ""}}} \ No newline at end of file
diff --git a/adapter/acumos/tests/fixtures/models/example-model-listofm/model.proto b/adapter/acumos/tests/fixtures/models/example-model-listofm/model.proto
new file mode 100644
index 0000000..ba40893
--- /dev/null
+++ b/adapter/acumos/tests/fixtures/models/example-model-listofm/model.proto
@@ -0,0 +1,39 @@
+/*-
+ * ===============LICENSE_START================================================
+ * org.onap.dcae
+ * ============================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ============================================================================
+ * This Acumos software file is distributed by AT&T and Tech Mahindra
+ * 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
+ *
+ * This file 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.
+ * ===============LICENSE_END==================================================
+ */
+
+syntax = "proto3";
+package QrPbKNxHnOMiIoWCyFplggLzzNUBisBm;
+
+service Model {
+ rpc sum (ArgsList) returns (SumOut);
+}
+
+message ArgsList {
+ repeated Args args = 1;
+}
+
+message Args {
+ int64 x = 1;
+ int64 y = 2;
+}
+
+message SumOut {
+ repeated int64 value = 1;
+}
diff --git a/adapter/acumos/tests/fixtures/models/example-model/metadata.json b/adapter/acumos/tests/fixtures/models/example-model/metadata.json
new file mode 100644
index 0000000..302b5f7
--- /dev/null
+++ b/adapter/acumos/tests/fixtures/models/example-model/metadata.json
@@ -0,0 +1,35 @@
+{
+ "schema": "acumos.schema.model:0.4.0",
+ "runtime": {
+ "name": "python",
+ "encoding": "protobuf",
+ "version": "3.6.8",
+ "dependencies": {
+ "pip": {
+ "indexes": [],
+ "requirements": [
+ {
+ "name": "dill",
+ "version": "0.3.0"
+ },
+ {
+ "name": "acumos",
+ "version": "0.8.0"
+ }
+ ]
+ },
+ "conda": {
+ "channels": [],
+ "requirements": []
+ }
+ }
+ },
+ "name": "example-model",
+ "methods": {
+ "add": {
+ "input": "NumbersIn",
+ "output": "NumberOut",
+ "description": "Adds two integers"
+ }
+ }
+}
diff --git a/adapter/acumos/tests/fixtures/models/example-model/model.proto b/adapter/acumos/tests/fixtures/models/example-model/model.proto
new file mode 100644
index 0000000..da03383
--- /dev/null
+++ b/adapter/acumos/tests/fixtures/models/example-model/model.proto
@@ -0,0 +1,35 @@
+/*-
+ * ===============LICENSE_START================================================
+ * org.onap.dcae
+ * ============================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ============================================================================
+ * This Acumos software file is distributed by AT&T and Tech Mahindra
+ * 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
+ *
+ * This file 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.
+ * ===============LICENSE_END==================================================
+ */
+
+syntax = "proto3";
+package geYBmFkDJtafXLpLFWhXwFWZekRqgaGs;
+
+service Model {
+ rpc add (NumbersIn) returns (NumberOut);
+}
+
+message NumbersIn {
+ int64 x = 1;
+ int64 y = 2;
+}
+
+message NumberOut {
+ int64 result = 1;
+}