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 +--------------+------------+---------------+--------------------------------------------------+
20 1. .. rubric:: Introduction
23 1. .. rubric:: Target Audience
24 :name: target-audience
26 This document is for an advanced technical audience, which includes
27 engineers and technicians. Document revisions occur with the release
28 of new software versions.
33 For additional information, see the ONAP Application Controller
36 The following sections describe the conventions this document uses,
37 including notices, text conventions, and command-line conventions.
39 Command-line Conventions
40 ========================
42 The following table lists possible elements in a command-line path.
44 +------------------+--------------------------------------------------------------------------------------------------------+
45 | **Convention** | **Description** |
46 +==================+========================================================================================================+
47 | Brackets [ ] | This is used for optional items. |
48 +------------------+--------------------------------------------------------------------------------------------------------+
49 | Braces { } | This indicates choices separated by pipe (\|) for sets from which only one is selected. For example: |
52 +------------------+--------------------------------------------------------------------------------------------------------+
53 | Blue text | This indicates a link in this document online. |
54 +------------------+--------------------------------------------------------------------------------------------------------+
59 The following table lists text conventions in this document.
61 +------------------------------------+----------------------------------------------------------------------------+
62 | **Convention** | **Description** |
63 +====================================+============================================================================+
64 | Monospace font with blue shading | This font indicates sample codes, screenshots, or elements. For example: |
68 | | "contactType": "USER", |
69 | | "source": "appl", |
72 +------------------------------------+----------------------------------------------------------------------------+
73 | *Italics* | Emphasizes a point or denotes new terms defined in the text. |
75 | | Indicates an external book title reference. |
76 +------------------------------------+----------------------------------------------------------------------------+
77 | Numeric | A number composed of digits 0 through 9. |
78 +------------------------------------+----------------------------------------------------------------------------+
79 | Text | Any combination of alphanumeric characters. |
81 | | New items in RED |
82 +------------------------------------+----------------------------------------------------------------------------+
84 Authors and Contributors
85 ------------------------
87 The following table lists the persons who are authors and
88 contributors to this document.
90 +--------------------+----------------------+
91 | **Contributors** | |
92 +====================+======================+
93 | Borislav Glozman | Margrethe Fossberg |
94 +--------------------+----------------------+
95 | Paul Mellor | John Buja |
96 +--------------------+----------------------+
97 +--------------------+----------------------+
102 The following table defines terms and acronyms used in this document.
104 +-----------------------+--------------------------------------------------------------+
105 | **Term or Acronym** | **Definition** |
106 +=======================+==============================================================+
107 | AAI | Active and Available Inventory |
108 +-----------------------+--------------------------------------------------------------+
109 | AAF | Authentication & Authorization Framework |
110 +-----------------------+--------------------------------------------------------------+
111 | AJSC | AT&T Java Service Container |
112 +-----------------------+--------------------------------------------------------------+
113 | API | Application Programming Interface |
114 +-----------------------+--------------------------------------------------------------+
115 | APPC | Application Controller |
116 +-----------------------+--------------------------------------------------------------+
117 | SDC | Service Design and Creation |
118 +-----------------------+--------------------------------------------------------------+
119 | DCAE | Data Collection Analytics and Events |
120 +-----------------------+--------------------------------------------------------------+
121 | DG | Directed Graph |
122 +-----------------------+--------------------------------------------------------------+
123 | DNS | Domain Name System |
124 +-----------------------+--------------------------------------------------------------+
125 | EELF | Event and Error Logging Framework |
126 +-----------------------+--------------------------------------------------------------+
127 | HDFS | Hadoop Distributed File System |
128 +-----------------------+--------------------------------------------------------------+
129 | HTTP | Hypertext Transfer Protocol |
130 +-----------------------+--------------------------------------------------------------+
131 | IAAS | Infrastructure As A Service |
132 +-----------------------+--------------------------------------------------------------+
133 | I/O | Input/Output |
134 +-----------------------+--------------------------------------------------------------+
135 | JMS | Java Messaging Service |
136 +-----------------------+--------------------------------------------------------------+
137 | JSON | JavaScript Object Notation |
138 +-----------------------+--------------------------------------------------------------+
139 | LAN | Local Area Network |
140 +-----------------------+--------------------------------------------------------------+
141 | LRM | Local Resource Monitor |
142 +-----------------------+--------------------------------------------------------------+
143 | SO | Service Orchestrator |
144 +-----------------------+--------------------------------------------------------------+
145 | NOD | Network on Demand |
146 +-----------------------+--------------------------------------------------------------+
147 | ODL | OpenDaylight |
148 +-----------------------+--------------------------------------------------------------+
149 | ONAP | Open Network Application Platform |
150 +-----------------------+--------------------------------------------------------------+
151 | OS | Operating System |
152 +-----------------------+--------------------------------------------------------------+
153 | PO | Platform Orchestrator |
154 +-----------------------+--------------------------------------------------------------+
155 | RCT | Reference Connection Tool |
156 +-----------------------+--------------------------------------------------------------+
157 | RO | Resource Orchestrator |
158 +-----------------------+--------------------------------------------------------------+
159 | SDN-C | Software Defined Network - Controller |
160 +-----------------------+--------------------------------------------------------------+
161 | SDN-GP | Software Defined Network - Global Platform |
162 +-----------------------+--------------------------------------------------------------+
163 | SME | Subject Matter Expert |
164 +-----------------------+--------------------------------------------------------------+
165 | SNMP | Simple Network Management Protocol |
166 +-----------------------+--------------------------------------------------------------+
167 | SMTP | Simple Mail Transfer Protocol |
168 +-----------------------+--------------------------------------------------------------+
169 | SOT | Source Of Truth (ext. system where data object originates) |
170 +-----------------------+--------------------------------------------------------------+
171 | SSH | Secure Shell |
172 +-----------------------+--------------------------------------------------------------+
173 | TCP | Transmission Control Protocol |
174 +-----------------------+--------------------------------------------------------------+
175 | TPS | Transactions per Second |
176 +-----------------------+--------------------------------------------------------------+
177 | UEB | Universal Event Broker |
178 +-----------------------+--------------------------------------------------------------+
179 | vCE | virtual CE (Customer Edge) router |
180 +-----------------------+--------------------------------------------------------------+
181 | vPE | virtual PE (Provider Edge) router |
182 +-----------------------+--------------------------------------------------------------+
183 | VLAN | Virtual Local Area Network |
184 +-----------------------+--------------------------------------------------------------+
185 | VM | Virtual Machine |
186 +-----------------------+--------------------------------------------------------------+
187 | VNF | Virtual Network Function |
188 +-----------------------+--------------------------------------------------------------+
189 | VNFC | Virtual Network Function Component |
190 +-----------------------+--------------------------------------------------------------+
191 | vSCP | Virtualized Service Control Point |
192 +-----------------------+--------------------------------------------------------------+
193 | WAN | Wide Area Network |
194 +-----------------------+--------------------------------------------------------------+
195 | WUI | Web User Interface |
196 +-----------------------+--------------------------------------------------------------+
197 | XML | Extensible Markup Language |
198 +-----------------------+--------------------------------------------------------------+
199 | YAML | YAML Ain't Markup Language |
200 +-----------------------+--------------------------------------------------------------+
202 Client Library Background
203 -------------------------
205 This guide discusses the Application Controller (APPC) Client
206 Library and how to use it.
208 About the Client Library
209 ------------------------
211 The APPC client library provides consumers of APPC capabilities with
212 a strongly-typed Java interface and encapsulates the actual
213 interaction with the APPC component over an asynchronous messaging
219 The client application that consumes APPC's capability for VNF
220 lifecycle management (the APPC client library) can be implemented
221 against the lightweight and strongly-typed Java API exposed by the
222 APPC client library. The library does not try to impose
223 architectural constraints upon clients, but instead provides support
224 for different options and styles of API. It is the responsibility of
225 the client application to select the most suitable paradigm to use;
226 for example, a client may choose to use blocking calls as opposed to
227 asynchronous notifications.
229 VNF Lifecycle Management API
230 ----------------------------
232 The API represents a relatively thin layer that consists mainly of
233 business interfaces with strongly-typed APIs and a data object model
234 created for the convenience of the consumer application.Â
236 The original YANG schema used by the APPC component and the
237 underlying MD-SAL layer on the server-side generates these
240 APP-C Client Library Flow
241 -------------------------
248 - The APPC Client Library is called using an asynchronous API using a
249 full command object, which is mapped to a JSON representation.
251 - The APPC client calls the UEB client and sends the JSON command to a
254 - The APPC client pulls response messages from the configured topic.
256 - On receiving the response for the command, the APPC client runs the
257 relevant callback method of the consumer ResponseHandler.
259 1. .. rubric:: Synchronous Flow
260 :name: synchronous-flow
262 - The APPC Client Library is called using a synchronous API using a
263 full command object, which is mapped to a JSON representation.
265 - The APPC client calls the UEB client and sends the JSON command to a
268 - The APPC client pulls response messages from the configured topic.
270 - On receiving the **final** response for the command, the APPC client
271 returns the response object with a final status.
273 1. .. rubric:: Client Library Usage
274 :name: client-library-usage
276 1. .. rubric:: Jar Files
279 The Java application that runs the APPC client kit uses the
282 - com.att.appc.client.client-kit
284 - com.att.appc.client.client-lib
286 The client library JAR files are located in the repository under
287 /gerrit.onap.org/r/p/appc.git/appc-client.
292 Initialize the client by calling the following method:
294 AppcClientServiceFactoryProvider.getFactory(AppcLifeCycleManagerServiceFactory.class).createLifeCycleManagerStateful()
296 Specify the following configuration properties as method parameters:
300 - "topic.read.timeout"
314 - "client.response.timeout"
316 - "client.graceful.shutdown.timeout"
321 Shutdown the client by calling the following method:
323 void shutdownLifeCycleManager(boolean isForceShutdown)
325 If the isForceShutdown flag is set to false, the client shuts down as
326 soon as all responses for pending requests are received, or upon
327 configurable timeout. (client.graceful.shutdown.timeout).
329 If the isForceShutdown flag is set to true, the client shuts down
332 Invoking LCM Commands
333 ---------------------
335 Invoke the LCM commands by:
337 - Creating input objects, such as AuditInput, LiveUpgradeInput, with
338 relevant command information.
340 - Executing commands asynchronously, for example:
342 void liveUpgrade(LiveUpgradeInput liveUpgradeInput,
343 ResponseHandler<LiveUpgradeOutput> listener) throws
344 AppcClientException;)
346 In this case, client should implement the ResponseHandler<T> interface.
348 - Executing commands synchronously, for example:
350 LiveUpgradeOutput liveUpgrade(LiveUpgradeInput liveUpgradeInput) throws
351 AppcClientException;)
356 After initializing the client, a returned Object of type
357 LifeCycleManagerStateful defines all the Life Cycle Management APIs
360 The interface contains two definitions for each RPC: one for
361 Asynchronous call mode, and one for Synchronous.
363 In Asynchronous mode, client consumer should provide a callback
366 ResponseHandler<RPC-NAMEOutput>
368 where RPC-NAME is the command name, such as Audit or Snapshot.
370 There may be multiple calls to the ResponseHandler for each response
371 returned by APPC. For example, first 100 'accept' is returned, then
374 LifeCycleManagerStateful Interface
375 ----------------------------------
377 Generated from the APPC Yang model, this interface defines the
378 services and request/response requirements for the ECOMP APPC
379 component. For example, for LCM Command Audit, the following is
382 @RPC(name="audit", outputType=AuditOutput.class)
384 AuditOutput audit(AuditInput auditInput) throws AppcClientException;
386 For a Synchronous call to Audit, the consumer thread is blocked
387 until a response is received or a timeout exception is thrown.
389 @RPC(name="audit", outputType=AuditOutput.class)
391 void audit(AuditInput auditInput, ResponseHandler<AuditOutput>
392 listener) throws AppcClientException;
394 For an Asynchronous call to Audit, a callback should be provided so
395 that when a response is received the listener is called.
400 The API documentation is also available as a swagger page generated
401 from files at /client-kit/target/resources.
406 This defines the services and request/response requirements for the APPC
412 The methods should match the actions described in the LCM API Guide. For
417 This API call consumes the following media types using the
418 **Content-Type** request header:
424 The request body is the action name followed by Input (e.g., AuditInput)
428 The return type is the action name followed by Output (e.g.,
433 This API call produces the following media types according to the
434 **Accept** request header; the **Content-Type** response header conveys
441 200 Successful operation
445 500 Internal server error
447 .. |image0| image:: image2.png