Add documentation for SDNC actor
[policy/parent.git] / docs / development / actors / sdnc / sdnc.rst
1 .. This work is licensed under a
2 .. Creative Commons Attribution 4.0 International License.
3 .. http://creativecommons.org/licenses/by/4.0
4
5 .. _sdnc-label:
6
7 ##########
8 SDNC Actor
9 ##########
10
11 .. contents::
12     :depth: 3
13
14 Overview of SDNC Actor
15 ######################
16 ONAP Policy Framework enables SDNC as one of the supported actors.
17 SDNC uses a REST-based interface, and supports the following operations:
18 *BandwidthOnDemand*, *Reroute*.
19
20 Each operation supported by the actor is associated with its own java class, which is
21 responsible for populating the request structure appropriately.  The operation-specific
22 classes are all derived from the *SdncOperation* class, which is, itself, derived from
23 *HttpOperation*.  Each operation class implements its own *makeRequest()* method to
24 construct a request appropriate to the operation.
25
26
27 Request
28 #######
29
30 A number of nested structures are populated within the request.  The following table
31 lists the contents of some of the fields that appear within these structures.
32
33 +----------------------------------+---------+----------------------------------------------------------------------+
34 | Field Name                       |  Type   |                         Description                                  |
35 +----------------------------------+---------+----------------------------------------------------------------------+
36 +----------------------------------+---------+----------------------------------------------------------------------+
37 | top level:                       |         |                                                                      |
38 +----------------------------------+---------+----------------------------------------------------------------------+
39 | *requestId*                      | string  |   Inserted by Policy. Maps to the UUID sent by DCAE i.e. the ID      |
40 |                                  |         |   used throughout the closed loop lifecycle to identify a request.   |
41 +----------------------------------+---------+----------------------------------------------------------------------+
42 +----------------------------------+---------+----------------------------------------------------------------------+
43 | sdnc-request-header:             |         |                                                                      |
44 +----------------------------------+---------+----------------------------------------------------------------------+
45 | *svc-action*                     | string  |   Set by Policy, based on the operation.                             |
46 +----------------------------------+---------+----------------------------------------------------------------------+
47 | *svc-request-id*                 | string  |   Generated by Policy. Is a UUID.                                    |
48 +----------------------------------+---------+----------------------------------------------------------------------+
49 +----------------------------------+---------+----------------------------------------------------------------------+
50 | request-information:             |         |                                                                      |
51 +----------------------------------+---------+----------------------------------------------------------------------+
52 | *request-action*                 | string  |   Set by Policy, based on the operation.                             |
53 +----------------------------------+---------+----------------------------------------------------------------------+
54 +----------------------------------+---------+----------------------------------------------------------------------+
55 | network-information:             |         |   Applicable to *Reroute*.                                           |
56 +----------------------------------+---------+----------------------------------------------------------------------+
57 | *network-id*                     | string  |   Set by Policy, using the                                           |
58 |                                  |         |   "network-information.network-id" property                          |
59 |                                  |         |   found within the enrichment data provided by DCAE                  |
60 |                                  |         |   with the ONSET event.                                              |
61 +----------------------------------+---------+----------------------------------------------------------------------+
62 +----------------------------------+---------+----------------------------------------------------------------------+
63 | vnf-information:                 |         |   Applicable to *BandwidthOnDemand*.                                 |
64 +----------------------------------+---------+----------------------------------------------------------------------+
65 | *vnf-id*                         | string  |   Set by Policy, using the                                           |
66 |                                  |         |   "vnfId" property                                                   |
67 |                                  |         |   found within the enrichment data provided by DCAE                  |
68 |                                  |         |   with the ONSET event.                                              |
69 +----------------------------------+---------+----------------------------------------------------------------------+
70 +----------------------------------+---------+----------------------------------------------------------------------+
71 | vf-module-input-parameters:      |         |   Applicable to *BandwidthOnDemand*.                                 |
72 +----------------------------------+---------+----------------------------------------------------------------------+
73 | *param[0]*                       | string  |   Set by Policy, using the                                           |
74 |                                  |         |   "bandwidth" property                                               |
75 |                                  |         |   found within the enrichment data provided by DCAE                  |
76 |                                  |         |   with the ONSET event.                                              |
77 +----------------------------------+---------+----------------------------------------------------------------------+
78 | *param[1]*                       | string  |   Set by Policy, using the                                           |
79 |                                  |         |   "bandwidth-change-time" property                                   |
80 |                                  |         |   found within the enrichment data provided by DCAE                  |
81 |                                  |         |   with the ONSET event.                                              |
82 +----------------------------------+---------+----------------------------------------------------------------------+
83 +----------------------------------+---------+----------------------------------------------------------------------+
84 | vf-module-information:           |         |   Applicable to *BandwidthOnDemand*.                                 |
85 +----------------------------------+---------+----------------------------------------------------------------------+
86 | *vf-module-id*                   | string  |   Set by Policy to "".                                               |
87 +----------------------------------+---------+----------------------------------------------------------------------+
88
89
90 Examples
91 ########
92
93 Suppose the *ControlLoopOperationParams* were populated as follows:
94
95 .. code-block:: bash
96
97         {
98             "actor": "SDNC",
99             "operation": "Reroute",
100             "context": {
101                 "enrichment": {
102                     "service-instance.service-instance-id": "c7c6a4aa-bb61-4a15-b831-ba1472dd4a65",
103                     "network-information.network-id": "2246ebc9-9b9f-42d0-a5e4-0248324fb884"
104                 }
105             }
106         }
107
108 An example of a request constructed by the actor using the above parameters, sent to the
109 SDNC REST server:
110
111 .. code-block:: bash
112
113         {
114             "input": {
115                 "sdnc-request-header": {
116                     "svc-request-id": "2612653e-d946-423b-96d9-a8d5e8e39618",
117                     "svc-action": "reoptimize"
118                 },
119                 "request-information": {
120                     "request-action": "ReoptimizeSOTNInstance"
121                 },
122                 "service-information": {
123                     "service-instance-id": "c7c6a4aa-bb61-4a15-b831-ba1472dd4a65"
124                 },
125                 "network-information": {
126                     "network-id": "2246ebc9-9b9f-42d0-a5e4-0248324fb884"
127                 }
128             }
129         }
130
131
132 An example response received from the SDNC REST service:
133
134 .. code-block:: bash
135
136         {
137           "output": {
138             "svc-request-id": "2612653e-d946-423b-96d9-a8d5e8e39618",
139             "response-code": "200",
140             "ack-final-indicator": "Y"
141           }
142         }
143
144
145 Configuration of the SDNC Actor
146 ###############################
147
148 The following table specifies the fields that should be provided to configure the SDNC
149 actor.
150
151 =============================== ====================    ==================================================================
152 Field name                         type                             Description
153 =============================== ====================    ==================================================================
154 clientName                        string                  Name of the HTTP client to use to send the request to the
155                                                           SDNC REST server.
156 timeoutSec                        integer (optional)      Maximum time, in seconds, to wait for a response to be received
157                                                           from the REST server.  Defaults to 90s.
158 path                              string                  URI appended to the URL.  This field only applies to individual
159                                                           operations; it does not apply at the actor level.  Note: the
160                                                           *path* should not include a leading or trailing slash.
161 =============================== ====================    ==================================================================
162
163 The individual operations are configured using these same field names.  However, all
164 of them, except the *path*, are optional, as they inherit their values from the
165 corresponding actor-level fields.