Revert "Renaming Files having BluePrint to have Blueprint"
[ccsdk/cds.git] / ms / blueprintsprocessor / modules / blueprints / blueprint-core / src / test / resources / compile / Scripts / kotlin / ActivateBlueprintDefinitions.kt
1 /*
2  *  Copyright © 2019 IBM.
3  *
4  *  Licensed under the Apache License, Version 2.0 (the "License");
5  *  you may not use this file except in compliance with the License.
6  *  You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  *  Unless required by applicable law or agreed to in writing, software
11  *  distributed under the License is distributed on an "AS IS" BASIS,
12  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *  See the License for the specific language governing permissions and
14  *  limitations under the License.
15  */
16
17 package cba.scripts
18
19 import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants
20 import org.onap.ccsdk.cds.controllerblueprints.core.data.ServiceTemplate
21 import org.onap.ccsdk.cds.controllerblueprints.core.dsl.dataType
22 import org.onap.ccsdk.cds.controllerblueprints.core.dsl.serviceTemplate
23 import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.AbstractBluePrintDefinitions
24
25 class ActivateBlueprintDefinitions : AbstractBluePrintDefinitions() {
26
27     override fun serviceTemplate(): ServiceTemplate {
28
29         return serviceTemplate(
30             "sample-blue-print", "1.0.0",
31             "brindasanth@onap.com", "sample, blueprints"
32         ) {
33             topologyTemplate {
34                 workflowNodeTemplate("activate", "component-resource-resolution", "") {
35                     operation("ResourceResolutionExecutor", "") {
36                         inputs {
37                             property("string-value", "sample")
38                         }
39                     }
40                 }
41             }
42         }
43     }
44
45     override fun loadOtherDefinitions() {
46         /** Sample Definitions */
47         val customDataType = dataType(
48             "custom-datatype", "1.0.0",
49             BluePrintConstants.MODEL_TYPE_DATATYPES_ROOT, ""
50         ) {
51             property("name", BluePrintConstants.DATA_TYPE_STRING, true, "")
52             property("value", BluePrintConstants.DATA_TYPE_STRING, true, "")
53         }
54         /** Loading to definitions */
55         addOtherDefinition("datatype-custom-datatype", customDataType)
56     }
57 }