...
Code Block |
---|
language | bash |
---|
title | Response example |
---|
collapse | true |
---|
|
{
"service": {
"name": "vFW service instance",
"uuid": "7d518257-49bd-40ac-8d17-017a726ec12a",
"dataQuality": {
"status": "ok"
},
"attributeList": []
},
"dataQuality": {
"status": "ok"
},
"attributeList": [],
"vfList": [
{
"name": "zdyh3bsflb0001v_01",
"type": "vShaken_DNS_ns592n/vSHAKEN_IST_09042018 0",
"invariantUUID": "null",
"uuid": "null",
"dataQuality": {
"status": "ok"
},
"attributeList": [],
"vfModuleList": [
{
"uuid": "2c3f8902-f278-4ee3-93cf-9d2364cbafca",
"maxInstances": 1,
"minInstances": 0,
"dataQuality": {
"status": "ok"
},
"attributeList": [],
"vmList": [],
"networkList": []
}
],
"vnfcList": [
{
"name": "dyh3bsflb0001vm001",
"invariantUUID": "null",
"uuid": "null",
"type": "alb",
"dataQuality": {
"status": "ok"
},
"attributeList": []
},
{
"name": "dyh3bsflb0001vm002",
"invariantUUID": "null",
"uuid": "null",
"type": "alb",
"dataQuality": {
"status": "ok"
},
"attributeList": []
}
]
}
]
} |
API Configuration
Configuration of the API (currently only GENERIC-RESOURCE-API and VNF-API) is done through the following configuration files.
config/dynamic/conf/api-handlers.xml
Code Block |
---|
language | xml |
---|
title | api-handlers.xml |
---|
collapse | true |
---|
|
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="vnfApiHandler" class="org.onap.pomba.contextbuilder.sdnc.handlers.VnfApiHandler" >
</bean>
<bean id="genericResourceApiHandler" class="org.onap.pomba.contextbuilder.sdnc.handlers.GenericResourceApiHandler" >
</bean>
</beans> |
config/dynamic/routes/sdnc-api.route
Code Block |
---|
language | xml |
---|
title | sdnc-api.route |
---|
collapse | true |
---|
|
<route xmlns="http://camel.apache.org/schema/spring" trace="true" id="apiMapperRoute">
<from uri="direct:startRoutingProcess" />
<choice>
<when>
<simple>${in.body.apiName} == 'VNF-API'</simple>
<log message="Processing ${in.body.apiName} by Camel Routing Context"/>
<to uri="bean:vnfApiHandler?method=process"/>
</when>
<when>
<simple>${in.body.apiName} == 'GENERIC-RESOURCE-API'</simple>
<log message="Processing ${in.body.apiName} by Camel Routing Context"/>
<to uri="bean:genericResourceApiHandler?method=process"/>
</when>
</choice>
</route>
|
config/rules/api-mapping-rules.drl
Code Block |
---|
language | groovy |
---|
title | api-mapping-rules.drl |
---|
collapse | true |
---|
|
/*
* ============LICENSE_START===================================================
* Copyright (c) 2018 Amdocs
* ============================================================================
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ============LICENSE_END=====================================================
*/
package org.onap.pomba.contextbuilder.sdnc.rules;
import org.onap.pomba.contextbuilder.sdnc.model.ServiceEntity;
rule "ApiMapping-1"
no-loop true
lock-on-active true
when
$s : ServiceEntity( serviceType not contains "vFW" )
then
$s.setApiName("GENERIC-RESOURCE-API");
end
rule "ApiMapping-2"
no-loop true
lock-on-active true
when
$s : ServiceEntity( serviceType contains "vFW" )
then
$s.setApiName("VNF-API");
end
|
Error Code
Error Code | Description | Resolution |
---|
400 | missing AppId from the header | Provide AppId in the header and re-send the request |
401 | missing basic auth from the header | Provide basic authorization in the header and re-send the request |
|
|
|