1 NAP Application Controller (APPC) Client Library Guide
3 +-----------------+------------------+
4 +-----------------+------------------+
5 | Revision | Version 1.0.0 |
6 +-----------------+------------------+
7 | Revision Date | 22 August 2017 |
8 +-----------------+------------------+
10 +--------------+------------+---------------+--------------------------------------------------+
11 | Date | Revision | Author | Changes |
12 +--------------+------------+---------------+--------------------------------------------------+
13 | 2017-08-22 | 1.0.0 | Paul Miller | First draft consistent with AT&T Release 17.10 |
14 +--------------+------------+---------------+--------------------------------------------------+
15 +--------------+------------+---------------+--------------------------------------------------+
22 1. .. rubric:: Introduction
25 1. .. rubric:: Target Audience
26 :name: target-audience
28 This document is for an advanced technical audience, which includes
29 engineers and technicians. Document revisions occur with the release
30 of new software versions.
35 For additional information, see the ONAP Application Controller
38 The following sections describe the conventions this document uses,
39 including notices, text conventions, and command-line conventions.
41 Command-line Conventions
42 ========================
44 The following table lists possible elements in a command-line path.
46 +------------------+--------------------------------------------------------------------------------------------------------+
47 | **Convention** | **Description** |
48 +==================+========================================================================================================+
49 | Brackets [ ] | This is used for optional items. |
50 +------------------+--------------------------------------------------------------------------------------------------------+
51 | Braces { } | This indicates choices separated by pipe (\|) for sets from which only one is selected. For example: |
54 +------------------+--------------------------------------------------------------------------------------------------------+
55 | Blue text | This indicates a link in this document online. |
56 +------------------+--------------------------------------------------------------------------------------------------------+
61 The following table lists text conventions in this document.
63 +------------------------------------+----------------------------------------------------------------------------+
64 | **Convention** | **Description** |
65 +====================================+============================================================================+
66 | Monospace font with blue shading | This font indicates sample codes, screenshots, or elements. For example: |
70 | | "contactType": "USER", |
71 | | "source": "appl", |
74 +------------------------------------+----------------------------------------------------------------------------+
75 | *Italics* | Emphasizes a point or denotes new terms defined in the text. |
77 | | Indicates an external book title reference. |
78 +------------------------------------+----------------------------------------------------------------------------+
79 | Numeric | A number composed of digits 0 through 9. |
80 +------------------------------------+----------------------------------------------------------------------------+
81 | Text | Any combination of alphanumeric characters. |
83 | | New items in RED |
84 +------------------------------------+----------------------------------------------------------------------------+
86 Authors and Contributors
87 ------------------------
89 The following table lists the persons who are authors and
90 contributors to this document.
92 +--------------------+----------------------+
94 +====================+======================+
95 | Borislav Glozman | Margrethe Fossberg |
96 +--------------------+----------------------+
97 | Paul Mellor | John Buja |
98 +--------------------+----------------------+
99 +--------------------+----------------------+
104 The following table defines terms and acronyms used in this document.
106 +-----------------------+--------------------------------------------------------------+
107 | **Term or Acronym** | **Definition** |
108 +=======================+==============================================================+
109 | AAI | Active and Available Inventory |
110 +-----------------------+--------------------------------------------------------------+
111 | AAF | Authentication & Authorization Framework |
112 +-----------------------+--------------------------------------------------------------+
113 | AJSC | AT&T Java Service Container |
114 +-----------------------+--------------------------------------------------------------+
115 | API | Application Programming Interface |
116 +-----------------------+--------------------------------------------------------------+
117 | APPC | Application Controller |
118 +-----------------------+--------------------------------------------------------------+
119 | SDC | Service Design and Creation |
120 +-----------------------+--------------------------------------------------------------+
121 | DCAE | Data Collection Analytics and Events |
122 +-----------------------+--------------------------------------------------------------+
123 | DG | Directed Graph |
124 +-----------------------+--------------------------------------------------------------+
125 | DNS | Domain Name System |
126 +-----------------------+--------------------------------------------------------------+
127 | EELF | Event and Error Logging Framework |
128 +-----------------------+--------------------------------------------------------------+
129 | HDFS | Hadoop Distributed File System |
130 +-----------------------+--------------------------------------------------------------+
131 | HTTP | Hypertext Transfer Protocol |
132 +-----------------------+--------------------------------------------------------------+
133 | IAAS | Infrastructure As A Service |
134 +-----------------------+--------------------------------------------------------------+
135 | I/O | Input/Output |
136 +-----------------------+--------------------------------------------------------------+
137 | JMS | Java Messaging Service |
138 +-----------------------+--------------------------------------------------------------+
139 | JSON | JavaScript Object Notation |
140 +-----------------------+--------------------------------------------------------------+
141 | LAN | Local Area Network |
142 +-----------------------+--------------------------------------------------------------+
143 | LRM | Local Resource Monitor |
144 +-----------------------+--------------------------------------------------------------+
145 | SO | Service Orchestrator |
146 +-----------------------+--------------------------------------------------------------+
147 | NOD | Network on Demand |
148 +-----------------------+--------------------------------------------------------------+
149 | ODL | OpenDaylight |
150 +-----------------------+--------------------------------------------------------------+
151 | ONAP | Open Network Application Platform |
152 +-----------------------+--------------------------------------------------------------+
153 | OS | Operating System |
154 +-----------------------+--------------------------------------------------------------+
155 | PO | Platform Orchestrator |
156 +-----------------------+--------------------------------------------------------------+
157 | RCT | Reference Connection Tool |
158 +-----------------------+--------------------------------------------------------------+
159 | RO | Resource Orchestrator |
160 +-----------------------+--------------------------------------------------------------+
161 | SDN-C | Software Defined Network - Controller |
162 +-----------------------+--------------------------------------------------------------+
163 | SDN-GP | Software Defined Network - Global Platform |
164 +-----------------------+--------------------------------------------------------------+
165 | SME | Subject Matter Expert |
166 +-----------------------+--------------------------------------------------------------+
167 | SNMP | Simple Network Management Protocol |
168 +-----------------------+--------------------------------------------------------------+
169 | SMTP | Simple Mail Transfer Protocol |
170 +-----------------------+--------------------------------------------------------------+
171 | SOT | Source Of Truth (ext. system where data object originates) |
172 +-----------------------+--------------------------------------------------------------+
173 | SSH | Secure Shell |
174 +-----------------------+--------------------------------------------------------------+
175 | TCP | Transmission Control Protocol |
176 +-----------------------+--------------------------------------------------------------+
177 | TPS | Transactions per Second |
178 +-----------------------+--------------------------------------------------------------+
179 | UEB | Universal Event Broker |
180 +-----------------------+--------------------------------------------------------------+
181 | vCE | virtual CE (Customer Edge) router |
182 +-----------------------+--------------------------------------------------------------+
183 | vPE | virtual PE (Provider Edge) router |
184 +-----------------------+--------------------------------------------------------------+
185 | VLAN | Virtual Local Area Network |
186 +-----------------------+--------------------------------------------------------------+
187 | VM | Virtual Machine |
188 +-----------------------+--------------------------------------------------------------+
189 | VNF | Virtual Network Function |
190 +-----------------------+--------------------------------------------------------------+
191 | VNFC | Virtual Network Function Component |
192 +-----------------------+--------------------------------------------------------------+
193 | vSCP | Virtualized Service Control Point |
194 +-----------------------+--------------------------------------------------------------+
195 | WAN | Wide Area Network |
196 +-----------------------+--------------------------------------------------------------+
197 | WUI | Web User Interface |
198 +-----------------------+--------------------------------------------------------------+
199 | XML | Extensible Markup Language |
200 +-----------------------+--------------------------------------------------------------+
201 | YAML | YAML Ain't Markup Language |
202 +-----------------------+--------------------------------------------------------------+
204 Client Library Background
205 -------------------------
207 This guide discusses the Application Controller (APPC) Client
208 Library and how to use it.
210 About the Client Library
211 ------------------------
213 The APPC client library provides consumers of APPC capabilities with
214 a strongly-typed Java interface and encapsulates the actual
215 interaction with the APPC component over an asynchronous messaging
221 The client application that consumes APPC's capability for VNF
222 lifecycle management (the APPC client library) can be implemented
223 against the lightweight and strongly-typed Java API exposed by the
224 APPC client library. The library does not try to impose
225 architectural constraints upon clients, but instead provides support
226 for different options and styles of API. It is the responsibility of
227 the client application to select the most suitable paradigm to use;
228 for example, a client may choose to use blocking calls as opposed to
229 asynchronous notifications.
231 VNF Lifecycle Management API
232 ----------------------------
234 The API represents a relatively thin layer that consists mainly of
235 business interfaces with strongly-typed APIs and a data object model
236 created for the convenience of the consumer application.Â
238 The original YANG schema used by the APPC component and the
239 underlying MD-SAL layer on the server-side generates these
242 APP-C Client Library Flow
243 -------------------------
250 - The APPC Client Library is called using an asynchronous API using a
251 full command object, which is mapped to a JSON representation.
253 - The APPC client calls the UEB client and sends the JSON command to a
256 - The APPC client pulls response messages from the configured topic.
258 - On receiving the response for the command, the APPC client runs the
259 relevant callback method of the consumer ResponseHandler.
261 1. .. rubric:: Synchronous Flow
262 :name: synchronous-flow
264 - The APPC Client Library is called using a synchronous API using a
265 full command object, which is mapped to a JSON representation.
267 - The APPC client calls the UEB client and sends the JSON command to a
270 - The APPC client pulls response messages from the configured topic.
272 - On receiving the **final** response for the command, the APPC client
273 returns the response object with a final status.
275 1. .. rubric:: Client Library Usage
276 :name: client-library-usage
278 1. .. rubric:: Jar Files
281 The Java application that runs the APPC client kit uses the
284 - com.att.appc.client.client-kit
286 - com.att.appc.client.client-lib
288 The client library JAR files are located in the repository under
289 /gerrit.onap.org/r/p/appc.git/appc-client.
294 Initialize the client by calling the following method:
296 AppcClientServiceFactoryProvider.getFactory(AppcLifeCycleManagerServiceFactory.class).createLifeCycleManagerStateful()
298 Specify the following configuration properties as method parameters:
302 - "topic.read.timeout"
316 - "client.response.timeout"
318 - "client.graceful.shutdown.timeout"
323 Shutdown the client by calling the following method:
325 void shutdownLifeCycleManager(boolean isForceShutdown)
327 If the isForceShutdown flag is set to false, the client shuts down as
328 soon as all responses for pending requests are received, or upon
329 configurable timeout. (client.graceful.shutdown.timeout).
331 If the isForceShutdown flag is set to true, the client shuts down
334 Invoking LCM Commands
335 ~~~~~~~~~~~~~~~~~~~~~
337 Invoke the LCM commands by:
339 - Creating input objects, such as AuditInput, LiveUpgradeInput, with
340 relevant command information.
342 - Executing commands asynchronously, for example:
344 void liveUpgrade(LiveUpgradeInput liveUpgradeInput,
345 ResponseHandler<LiveUpgradeOutput> listener) throws
346 AppcClientException;)
348 In this case, client should implement the ResponseHandler<T> interface.
350 - Executing commands synchronously, for example:
352 LiveUpgradeOutput liveUpgrade(LiveUpgradeInput liveUpgradeInput) throws
353 AppcClientException;)
358 After initializing the client, a returned Object of type
359 LifeCycleManagerStateful defines all the Life Cycle Management APIs
362 The interface contains two definitions for each RPC: one for
363 Asynchronous call mode, and one for Synchronous.
365 In Asynchronous mode, client consumer should provide a callback
368 ResponseHandler<RPC-NAMEOutput>
370 where RPC-NAME is the command name, such as Audit or Snapshot.
372 There may be multiple calls to the ResponseHandler for each response
373 returned by APPC. For example, first 100 'accept' is returned, then
376 LifeCycleManagerStateful Interface
377 ----------------------------------
379 Generated from the APPC Yang model, this interface defines the
380 services and request/response requirements for the ECOMP APPC
381 component. For example, for LCM Command Audit, the following is
384 @RPC(name="audit", outputType=AuditOutput.class)
386 AuditOutput audit(AuditInput auditInput) throws AppcClientException;
388 For a Synchronous call to Audit, the consumer thread is blocked
389 until a response is received or a timeout exception is thrown.
391 @RPC(name="audit", outputType=AuditOutput.class)
393 void audit(AuditInput auditInput, ResponseHandler<AuditOutput>
394 listener) throws AppcClientException;
396 For an Asynchronous call to Audit, a callback should be provided so
397 that when a response is received the listener is called.
402 The API documentation is also available as a swagger page generated
403 from files at /client-kit/target/resources.
408 This defines the services and request/response requirements for the APPC
414 The methods should match the actions described in the LCM API Guide. For
419 This API call consumes the following media types using the
420 **Content-Type** request header:
426 The request body is the action name followed by Input (e.g., AuditInput)
430 The return type is the action name followed by Output (e.g.,
435 This API call produces the following media types according to the
436 **Accept** request header; the **Content-Type** response header conveys
443 200 Successful operation
447 500 Internal server error
449 .. |image0| image:: image2.png