aboutsummaryrefslogtreecommitdiffstats
path: root/components/model-catalog/blueprint-model/test-blueprint/capability_cli/Scripts
diff options
context:
space:
mode:
authorBrinda Santh <bs2796@att.com>2019-12-26 16:26:25 -0500
committerKAPIL SINGAL <ks220y@att.com>2019-12-30 18:18:38 +0000
commit41712e142c8d2b2bff9bc9e094f45306a60d7cb9 (patch)
tree1a6578a40b45235c8486a179b84b2e5932d164cf /components/model-catalog/blueprint-model/test-blueprint/capability_cli/Scripts
parent730c940a84b9056fed993ccef08dc5ec4053db21 (diff)
Relationship Type and Templates models
Enrichment Support for Relationship Types and Templates. Relationship DSL support for ConnectTo connections ( RestClient, SshClient, MessageProducer, MessageConsume, Nats) Moved datatype map from collection to complex type Issue-ID: CCSDK-1054 Signed-off-by: Brinda Santh <bs2796@att.com> Change-Id: I0f18db2cb52e1e93dfab04498b8298587cba2540
Diffstat (limited to 'components/model-catalog/blueprint-model/test-blueprint/capability_cli/Scripts')
-rw-r--r--components/model-catalog/blueprint-model/test-blueprint/capability_cli/Scripts/kotlin/cba/capability/cli/CapabilityCliDefinitions.kt89
1 files changed, 49 insertions, 40 deletions
diff --git a/components/model-catalog/blueprint-model/test-blueprint/capability_cli/Scripts/kotlin/cba/capability/cli/CapabilityCliDefinitions.kt b/components/model-catalog/blueprint-model/test-blueprint/capability_cli/Scripts/kotlin/cba/capability/cli/CapabilityCliDefinitions.kt
index 2d35e262c..3700a0bad 100644
--- a/components/model-catalog/blueprint-model/test-blueprint/capability_cli/Scripts/kotlin/cba/capability/cli/CapabilityCliDefinitions.kt
+++ b/components/model-catalog/blueprint-model/test-blueprint/capability_cli/Scripts/kotlin/cba/capability/cli/CapabilityCliDefinitions.kt
@@ -18,11 +18,14 @@ package cba.capability.cli
import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.nodeTemplateComponentScriptExecutor
import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.nodeTypeComponentScriptExecutor
+import org.onap.ccsdk.cds.blueprintsprocessor.ssh.basicAuthSshProperties
import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes
import org.onap.ccsdk.cds.controllerblueprints.core.data.ServiceTemplate
import org.onap.ccsdk.cds.controllerblueprints.core.dsl.artifactTypeTemplateVelocity
import org.onap.ccsdk.cds.controllerblueprints.core.dsl.getAttribute
+import org.onap.ccsdk.cds.controllerblueprints.core.dsl.getInput
import org.onap.ccsdk.cds.controllerblueprints.core.dsl.nodeTypeComponent
+import org.onap.ccsdk.cds.controllerblueprints.core.dsl.relationshipTypeConnectsTo
import org.onap.ccsdk.cds.controllerblueprints.core.dsl.serviceTemplate
import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.AbstractBluePrintDefinitions
@@ -34,54 +37,60 @@ class CapabilityCliDefinitions : AbstractBluePrintDefinitions() {
}
fun CapabilityCliDefinitions.defaultServiceTemplate() =
- serviceTemplate(name = "capability-cli",
- version = "1.0.0",
- author = "Brinda Santh Muthuramalingam",
- tags = "brinda, tosca") {
+ serviceTemplate(
+ name = "capability-cli",
+ version = "1.0.0",
+ author = "Brinda Santh Muthuramalingam",
+ tags = "brinda, tosca"
+ ) {
- dsl("device-properties", """{
- "type": "basic-auth",
- "host": { "get_input": "hostname" },
- "username": { "get_input": "username" },
- "password": { "get_input": "password" }
- }""".trimIndent())
+ dsl("device-properties", BluePrintTypes.basicAuthSshProperties {
+ host(getInput("hostname"))
+ password(getInput("password"))
+ username(getInput("username"))
+ })
- topologyTemplate {
+ topologyTemplate {
+ workflow(id = "check", description = "CLI Check Workflow") {
+ inputs {
+ property(id = "hostname", type = "string", required = true, description = "")
+ property(id = "username", type = "string", required = true, description = "")
+ property(id = "password", type = "string", required = true, description = "")
+ property(id = "data", type = "json", required = true, description = "")
+ }
+ outputs {
+ property(id = "status", required = true, type = "string", description = "") {
+ value("success")
+ }
+ }
+ step(id = "check", target = "check", description = "Calling check script node")
+ }
- workflow(id = "check", description = "CLI Check Workflow") {
+ val checkComponent = BluePrintTypes.nodeTemplateComponentScriptExecutor(id = "check", description = "") {
+ definedOperation(description = "") {
inputs {
- property(id = "hostname", type = "string", required = true, description = "")
- property(id = "username", type = "string", required = true, description = "")
- property(id = "password", type = "string", required = true, description = "")
- property(id = "data", type = "json", required = true, description = "")
+ type("kotlin")
+ scriptClassReference("cba.capability.cli.Check")
}
outputs {
- property(id = "status", required = true, type = "string", description = "") {
- value("success")
- }
+ status(getAttribute("status"))
+ responseData("""{ "data" : "Here I am "}""")
}
- step(id = "check", target = "check", description = "Calling check script node")
}
-
- val checkComponent = BluePrintTypes.nodeTemplateComponentScriptExecutor(id = "check", description = "") {
- definedOperation(description = "") {
- inputs {
- type("kotlin")
- scriptClassReference("cba.capability.cli.Check")
- }
- outputs {
- status(getAttribute("status"))
- responseData("""{ "data" : "Here I am "}""")
- }
- }
- artifact(id = "command-template", type = "artifact-template-velocity",
- file = "Templates/check-command-template.vtl")
- }
- nodeTemplate(checkComponent)
+ artifact(
+ id = "command-template", type = "artifact-template-velocity",
+ file = "Templates/check-command-template.vtl"
+ )
}
+ nodeTemplate(checkComponent)
+ }
- artifactType(BluePrintTypes.artifactTypeTemplateVelocity())
- nodeType(BluePrintTypes.nodeTypeComponent())
- nodeType(BluePrintTypes.nodeTypeComponentScriptExecutor())
+ /** Artifact Types */
+ artifactType(BluePrintTypes.artifactTypeTemplateVelocity())
+ /** Node Types */
+ nodeType(BluePrintTypes.nodeTypeComponent())
+ nodeType(BluePrintTypes.nodeTypeComponentScriptExecutor())
+ /** Relationship Types */
+ relationshipType(BluePrintTypes.relationshipTypeConnectsTo())
- } \ No newline at end of file
+ }