diff options
Diffstat (limited to 'components')
11 files changed, 194 insertions, 23 deletions
diff --git a/components/model-catalog/blueprint-model/test-blueprint/remote_scripts/Definitions/artifact_types.json b/components/model-catalog/blueprint-model/test-blueprint/remote_scripts/Definitions/artifact_types.json new file mode 100644 index 000000000..445236354 --- /dev/null +++ b/components/model-catalog/blueprint-model/test-blueprint/remote_scripts/Definitions/artifact_types.json @@ -0,0 +1,12 @@ +{ + "artifact_types": { + "artifact-script-python": { + "description": "Python Script file", + "version": "1.0.0", + "derived_from": "tosca.artifacts.Implementation", + "file_ext": [ + "py" + ] + } + } +}
\ No newline at end of file diff --git a/components/model-catalog/blueprint-model/test-blueprint/remote_scripts/Definitions/data_types.json b/components/model-catalog/blueprint-model/test-blueprint/remote_scripts/Definitions/data_types.json new file mode 100644 index 000000000..b22e30d00 --- /dev/null +++ b/components/model-catalog/blueprint-model/test-blueprint/remote_scripts/Definitions/data_types.json @@ -0,0 +1,3 @@ +{ + "data_types": {} +}
\ No newline at end of file diff --git a/components/model-catalog/blueprint-model/test-blueprint/remote_scripts/Definitions/node_types.json b/components/model-catalog/blueprint-model/test-blueprint/remote_scripts/Definitions/node_types.json new file mode 100644 index 000000000..cd63f0091 --- /dev/null +++ b/components/model-catalog/blueprint-model/test-blueprint/remote_scripts/Definitions/node_types.json @@ -0,0 +1,51 @@ +{ + "node_types": { + "component-remote-python-executor": { + "description": "This is Remote Python Execution Component.", + "version": "1.0.0", + "attributes": { + "execution-logs": { + "required": true, + "type": "string" + } + }, + "capabilities": { + "component-node": { + "type": "tosca.capabilities.Node" + } + }, + "interfaces": { + "ComponentRemotePythonExecutor": { + "operations": { + "process": { + "inputs": { + "endpoint-selector": { + "description": "Remote Container or Server selector name.", + "required": false, + "type": "string", + "default": "remote-python" + }, + "dynamic-properties": { + "description": "Dynamic Json Content or DSL Json reference.", + "required": false, + "type": "json" + }, + "command": { + "description": "Command to execute.", + "required": true, + "type": "string" + } + } + } + } + } + }, + "derived_from": "tosca.nodes.Component" + }, + "tosca.nodes.Component": { + "description": "This is default Component Node", + "version": "1.0.0", + "derived_from": "tosca.nodes.Root" + } + } +}
\ No newline at end of file diff --git a/components/model-catalog/blueprint-model/test-blueprint/remote_scripts/Definitions/policy_types.json b/components/model-catalog/blueprint-model/test-blueprint/remote_scripts/Definitions/policy_types.json new file mode 100644 index 000000000..2442ce877 --- /dev/null +++ b/components/model-catalog/blueprint-model/test-blueprint/remote_scripts/Definitions/policy_types.json @@ -0,0 +1,3 @@ +{ + "policy_types": {} +}
\ No newline at end of file diff --git a/components/model-catalog/blueprint-model/test-blueprint/remote_scripts/Definitions/relationship_types.json b/components/model-catalog/blueprint-model/test-blueprint/remote_scripts/Definitions/relationship_types.json new file mode 100644 index 000000000..097a30afd --- /dev/null +++ b/components/model-catalog/blueprint-model/test-blueprint/remote_scripts/Definitions/relationship_types.json @@ -0,0 +1,3 @@ +{ + "relationship_types": {} +}
\ No newline at end of file diff --git a/components/model-catalog/blueprint-model/test-blueprint/remote_scripts/Definitions/remote_scripts.json b/components/model-catalog/blueprint-model/test-blueprint/remote_scripts/Definitions/remote_scripts.json new file mode 100644 index 000000000..464911478 --- /dev/null +++ b/components/model-catalog/blueprint-model/test-blueprint/remote_scripts/Definitions/remote_scripts.json @@ -0,0 +1,85 @@ +{ + "tosca_definitions_version": "controller_blueprint_1_0_0", + "metadata": { + "template_author": "Brinda Santh Muthuramalingam", + "author-email": "brindasanth@in.ibm.com", + "user-groups": "ADMIN, OPERATION", + "template_name": "remote_scripts", + "template_version": "1.0.0", + "template_tags": "brinda, tosca" + }, + "imports": [ + { + "file": "Definitions/data_types.json" + }, + { + "file": "Definitions/relationship_types.json" + }, + { + "file": "Definitions/artifact_types.json" + }, + { + "file": "Definitions/node_types.json" + }, + { + "file": "Definitions/policy_types.json" + } + ], + "topology_template": { + "workflows": { + "execute-remote-python": { + "steps": { + "execute-script": { + "description": "Execute Remote Python Script", + "target": "execute-remote-python", + "activities": [ + { + "call_operation": "" + } + ] + } + }, + "inputs": {}, + "outputs": { + "logs": { + "type": "json", + "value": { + "get_attribute": [ + "execute-remote-python", + "execution-logs" + ] + } + } + } + } + }, + "node_templates": { + "execute-remote-python": { + "type": "component-remote-python-executor", + "interfaces": { + "ComponentRemotePythonExecutor": { + "operations": { + "process": { + "implementation": { + "primary": "component-script", + "dependencies": [ + "pyaml" + ] + }, + "inputs": { + "command": "python SamplePython.py blah" + } + } + } + } + }, + "artifacts": { + "component-script": { + "type": "artifact-script-python", + "file": "Scripts/python/SamplePython.py" + } + } + } + } + } +}
\ No newline at end of file diff --git a/components/model-catalog/blueprint-model/test-blueprint/remote_scripts/Definitions/resources_definition_types.json b/components/model-catalog/blueprint-model/test-blueprint/remote_scripts/Definitions/resources_definition_types.json new file mode 100644 index 000000000..9e26dfeeb --- /dev/null +++ b/components/model-catalog/blueprint-model/test-blueprint/remote_scripts/Definitions/resources_definition_types.json @@ -0,0 +1 @@ +{}
\ No newline at end of file diff --git a/components/model-catalog/blueprint-model/test-blueprint/remote_scripts/Scripts/python/SamplePython.py b/components/model-catalog/blueprint-model/test-blueprint/remote_scripts/Scripts/python/SamplePython.py new file mode 100644 index 000000000..5e20e2291 --- /dev/null +++ b/components/model-catalog/blueprint-model/test-blueprint/remote_scripts/Scripts/python/SamplePython.py @@ -0,0 +1,5 @@ +#!/usr/bin/python + +import sys + +print(sys.argv[1])
\ No newline at end of file diff --git a/components/model-catalog/blueprint-model/test-blueprint/remote_scripts/TOSCA-Metadata/TOSCA.meta b/components/model-catalog/blueprint-model/test-blueprint/remote_scripts/TOSCA-Metadata/TOSCA.meta new file mode 100644 index 000000000..5ca8aa031 --- /dev/null +++ b/components/model-catalog/blueprint-model/test-blueprint/remote_scripts/TOSCA-Metadata/TOSCA.meta @@ -0,0 +1,5 @@ +TOSCA-Meta-File-Version: 1.0.0 +CSAR-Version: 1.0 +Created-By: Brinda Santh <brindasanth@in.ibm.com> +Entry-Definitions: Definitions/remote_scripts.json +Template-Tags: Brinda Santh, remote_scripts
\ No newline at end of file diff --git a/components/model-catalog/definition-type/starter-type/node_type/component-remote-python-executor.json b/components/model-catalog/definition-type/starter-type/node_type/component-remote-python-executor.json index df2095c7c..99a4dd8dc 100644 --- a/components/model-catalog/definition-type/starter-type/node_type/component-remote-python-executor.json +++ b/components/model-catalog/definition-type/starter-type/node_type/component-remote-python-executor.json @@ -1,6 +1,12 @@ { - "description": "This is Jython Execution Component.", + "description": "This is Remote Python Execution Component.", "version": "1.0.0", + "attributes": { + "execution-logs": { + "required": true, + "type": "string" + } + }, "capabilities": { "component-node": { "type": "tosca.capabilities.Node" @@ -14,22 +20,16 @@ "endpoint-selector": { "description": "Remote Container or Server selector name.", "required": false, - "type": "string" + "type": "string", + "default": "remote-python" }, "dynamic-properties": { "description": "Dynamic Json Content or DSL Json reference.", "required": false, "type": "json" - } - }, - "outputs": { - "response-data": { - "description": "Execution Response Data in JSON format.", - "required": false, - "type": "json" }, - "status": { - "description": "Status of the Component Execution ( success or failure )", + "command": { + "description": "Command to execute.", "required": true, "type": "string" } diff --git a/components/model-catalog/proto-definition/proto/CommandExecutor.proto b/components/model-catalog/proto-definition/proto/CommandExecutor.proto index e95e55521..f488cc1b4 100644 --- a/components/model-catalog/proto-definition/proto/CommandExecutor.proto +++ b/components/model-catalog/proto-definition/proto/CommandExecutor.proto @@ -6,27 +6,30 @@ package org.onap.ccsdk.cds.controllerblueprints.command.api; message ExecutionInput { string requestId = 1; + // Optional Id used to correlate multiple requests so that it can identify previous request information. + string correlationId = 2; // Optional Blueprint Information used to identify CBA content information in shared file structure environment. - Identifiers identifiers = 2; - ScriptType scriptType = 3; + Identifiers identifiers = 3; + ScriptType scriptType = 4; // Actual Command to Execute in Scripting Environment - string command = 4; - int32 timeOut = 5; + string command = 5; + int32 timeOut = 6; // Extra Dynamic Properties for Command processing in JSON format - google.protobuf.Struct properties = 6; + google.protobuf.Struct properties = 7; // Request Time Stamp - google.protobuf.Timestamp timestamp = 7; + google.protobuf.Timestamp timestamp = 8; } message PrepareEnvInput { Identifiers identifiers = 1; + string requestId = 2; // Optional Id used to correlate multiple requests so that it can identify previous request information. - string correlationId = 2; - ScriptType scriptType = 3; - repeated string packages = 4; - int32 timeOut = 5; - google.protobuf.Struct properties = 6; - google.protobuf.Timestamp timestamp = 7; + string correlationId = 3; + ScriptType scriptType = 4; + repeated string packages = 5; + int32 timeOut = 6; + google.protobuf.Struct properties = 7; + google.protobuf.Timestamp timestamp = 8; } message Identifiers { |