Improve service template access through cache.
[ccsdk/cds.git] / ms / controllerblueprints / modules / 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("sample-blue-print", "1.0.0",
30                 "brindasanth@onap.com", "sample, blueprints") {
31             topologyTemplate {
32                 workflowNodeTemplate("activate", "component-resource-resolution", "") {
33                     operation("ResourceResolutionExecutor", "") {
34                         inputs {
35                             property("string-value", "sample")
36                         }
37                     }
38                 }
39             }
40         }
41     }
42
43     override fun loadOtherDefinitions() {
44         /** Sample Definitions */
45         val customDataType = dataType("custom-datatype", "1.0.0",
46                 BluePrintConstants.MODEL_TYPE_DATATYPES_ROOT, "") {
47             property("name", BluePrintConstants.DATA_TYPE_STRING, true, "")
48             property("value", BluePrintConstants.DATA_TYPE_STRING, true, "")
49         }
50         /** Loading to definitions */
51         addOtherDefinition("datatype-custom-datatype", customDataType)
52     }
53 }