Revert "Renaming Files having BluePrint to have Blueprint"
[ccsdk/cds.git] / ms / blueprintsprocessor / modules / commons / ssh-lib / src / main / kotlin / org / onap / ccsdk / cds / blueprintsprocessor / ssh / SshPropertiesDSL.kt
index e63f2eb..a7702d4 100644 (file)
@@ -1,6 +1,8 @@
 /*
  * Copyright © 2018-2019 AT&T Intellectual Property.
  *
+ * Modifications Copyright © 2020 Bell Canada.
+ *
  * 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
@@ -24,10 +26,17 @@ import org.onap.ccsdk.cds.controllerblueprints.core.asJsonType
 import org.onap.ccsdk.cds.controllerblueprints.core.data.RelationshipType
 import org.onap.ccsdk.cds.controllerblueprints.core.dsl.PropertiesAssignmentBuilder
 import org.onap.ccsdk.cds.controllerblueprints.core.dsl.RelationshipTemplateBuilder
+import org.onap.ccsdk.cds.controllerblueprints.core.dsl.ServiceTemplateBuilder
 import org.onap.ccsdk.cds.controllerblueprints.core.dsl.TopologyTemplateBuilder
 import org.onap.ccsdk.cds.controllerblueprints.core.dsl.relationshipType
 
 /** Relationships Types DSL for Message Producer */
+fun ServiceTemplateBuilder.relationshipTypeConnectsToSshClient() {
+    val relationshipType = BluePrintTypes.relationshipTypeConnectsToSshClient()
+    if (this.relationshipTypes == null) this.relationshipTypes = hashMapOf()
+    this.relationshipTypes!![relationshipType.id!!] = relationshipType
+}
+
 fun BluePrintTypes.relationshipTypeConnectsToSshClient(): RelationshipType {
     return relationshipType(
         id = BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_SSH_CLIENT,
@@ -87,6 +96,10 @@ open class SshClientPropertiesAssignmentBuilder : PropertiesAssignmentBuilder()
     fun host(host: String) = host(host.asJsonPrimitive())
 
     fun host(host: JsonNode) = property(SshClientProperties::host.name, host)
+
+    fun logging(logging: Boolean) = logging(logging.asJsonPrimitive())
+
+    fun logging(logging: JsonNode) = property(SshClientProperties::logging.name, logging)
 }
 
 class BasicAuthSshClientPropertiesAssignmentBuilder : SshClientPropertiesAssignmentBuilder() {