Overview
Network Discovery Context Builder (NDCTX Builder) is a MicroService (MS) responsible to aggregate information for network resources which is gathered from primary sources (e,g, openStack , A&AI, ...). The NorthBound for the MS is POMBA Context Aggregaotr and in the southbound it works with 2 MSs:
- Service Decomposition (SD) MS
- Network Discovery (ND) MS
Service Decomposition (SD) MS
A query (GetContext) is sent to NDCTX builder from Context Aggregator with a serviceInstanceId. Then SD MS acts to discover different resources of that service. Because a service could be tied to several resources, SD MS runs one query against each resources type. Supported list of the resource types are defined in configuration files for NDCTX MS and SD MS.
SD MS does a lookup to A&AI with serviceInstanceId to discover resources and finds number of relationships for the supported resource types. Consequently, for each relationship, SD MS send a query to A&AI to find more details. The results are then passed to NDCTX builder.
Network Discovery (ND) MS
Next step is to send APIs to ND MS. The GET APIs from NDCTX builder to ND MS includes combination of "resource type" and its "resource Id(s)".
Info |
---|
The Network Discovery Micro-service is implemented under the SDNC APPS project. Documentation can be found here: Network Discovery Microservice (Dublin release) |
a) If the API received by ND MS meets the requirements (includes mandatory headers and a valid resource type), it first responses with 200 OK and ackFinalIndicator=false. This means there will be second response upon completion of query from southbound. The second response is asynchronous. As it may take a while to get results from southbound (Enricher MS). (Enriched MS where it sends queries "source of truth" (e.g. openstack or A&AI , ...) to find actual network resources consumed by the resource.)it will respond with 200 OK .
b) If the API received by ND MS does not meets the requirements (e.g. missing mandatory header, unsupported resource type), it will be rejected with ackFinalIndicator=true with a with a proper response code (see Interface/API section below for more details on response codes). This will be the end of it and there will not be any query to southbound.
Configuration
Each of 3 MSs has a configuration file (application.properties), which is loaded during MS startup.
Note |
---|
Post any changes on application.properties , the corresponding MS need to be restarted. |
MS | Config file | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
NDCTX Builder |
| |||||||||||||||||
SD |
ND
| |||||||||||||||||
ND collapse | true | spring.jersey.type=filter
spring.mvc.urls=swagger,docs,prometheus,auditevents,info,heapdump,autoconfig,beans,loggers,dump,env,trace,health,configprops,mappings,metrics,webjars
server.contextPath=/network-discovery
spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
#This property is used to set the Tomcat connector attributes.developers can define multiple attributes separated by comma
#tomcat.connector.attributes=allowTrace-true
#The max number of active threads in this pool
server.tomcat.max-threads=200
#The minimum number of threads always kept alive
server.tomcat.min-Spare-Threads=25
#The number of milliseconds before an idle thread shutsdown, unless the number of active threads are less or equal to minSpareThreads server.tomcat.max-idle-time=60000
context parameters
#context parameter with p-name as key and value as value.
Basic Authentication
http:// d2enrichment:9505 enricher.connectionTimeout=5000 enricher.readTimeout=60000 enricher.keyStorePath=config/auth/enricher-client-cert.p12 enricher.keyStorePassword=OBF:1i9a1u2a1unz1lr61wn51wn11lss1unz1u301i6o enricher.types = vserver, l3-network enricher10.69.36.11:5000/v3/auth/tokens = http://10.69.36.11:8774/v2.1/servers/{0} ?sot=!aai enricher
= http:/ enricher/v11/network/l3-networks/l3-network/{0}?sot=!aai # Mapping from Enricher Attribute name to POMBA Attribute name in the format # <Enricher Attribute Name>:<Pomba Attribute Name>; and separated by semicolon ";" # for example, # vserser-id:id; # means Attribute name "vserer-id" from Enricher will be converted to "id" in POMBA. enricher.attributeNameMappingList=Id:id;id:id;vserver-id:id;name:name;locked:inMaintenance; \ hostname:hostname;status:status;vm_state:vmState;vm-state:vmState;admin_state_up:AdminState; \ favor.disk:flavorDisk;flavor.ephemeral:flavorEphemoral;flavor.extra_specs.hw.cpu_model:flavorHwCpuModel; \ flavor.extra_specs.hw.cpu_policy:flavorHwCpuPolicy;flavor.extra_specs.hw.mem_page_size:flavorHwMemPageSize; \ flavor.original_name:flavorOriginalName;flavor.ram:flavorRam;flavor.swap:flavorSwag;flavorvcpus:flavorVcpus; \ image.id:imageId;hostId:hostId;host:host;host_status:hostStatus;security_group.name:securityGroupName; \ serverName:serverName;metadata.myservername:otherServerName;shared:sharedNetwork;subnets:subnets; \ userId:userId;tenant_id:tenantId/10.69.36.11:9696/v2.0/networks/{0} |
Interfaces/API
GET request at url = httphttps://<NDCTX-Builder>:<port>/network-discovery/service/context/<serviceInstanceId>
include headers: a) X-ONAP-PartnerName , b) X-ONAP-RequestId
Microservice | response code | details |
---|---|---|
ND | 200 | Request has completed and no more information is forthcoming |
202 | Request has been accepted and more information will be posted to notificationURL | |
400 | Missing mandatory field in the request or HTTP header | |
404 | Requested resource was not found | |
500 | Request failed due to internal error | |
SD | 200 | OK |
400 | Bad Request | |
404 | Service not available | |
500 | Unexpected Runtime error | |
NDCTX builder | 200 | OK |
404 | Service not available | |
500 | Unexpected Runtime error |