2 * Copyright © 2019 IBM.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package cba.resource.audit
19 import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.resourceDefinitions
20 import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants
21 import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes
23 const val SOURCE_SDNO = "SDN-O"
24 const val SOURCE_SDNC = "SDNC"
25 const val SOURCE_AAI = "AAI"
27 val deviceResourceDefinitions = BluePrintTypes.resourceDefinitions {
28 // Port Speed Definitions
29 resourceDefinition(name = "port-speed", description = "Port Speed") {
30 property(type = "string", required = true)
32 sourceCapability(id = SOURCE_SDNO, description = "SDN-O Source") {
34 type(BluePrintConstants.SCRIPT_KOTLIN)
35 scriptClassReference("cba.resource.audit.processor.PortSpeedRAProcessor")
36 keyDependencies(arrayListOf("device-id"))
39 sourceDb(id = SOURCE_SDNC, description = "SDNC Controller") {
41 endpointSelector("processor-db")
42 query("SELECT PORT_SPEED FROM XXXX WHERE DEVICE_ID = :device_id")
44 map("device_id", "\$device-id")
46 keyDependencies(arrayListOf("device-id"))
49 sourceRest(id = SOURCE_AAI, description = "AAI Source") {
51 endpointSelector("aai")
52 urlPath("/vnf/\$device_id")
55 map("device_id", "\$device-id")
57 keyDependencies(arrayListOf("device-id"))