Dcoument new VFC Actor
[policy/parent.git] / docs / development / actors / vfc / vfc.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 .. _vfc-label:
6
7 ##########
8 VFC Actor
9 ##########
10
11 .. contents::
12     :depth: 3
13
14 Overview of VFC Actor
15 ######################
16 ONAP Policy Framework enables VFC as one of the supported actors.
17
18 .. note::
19 There has not been any support given to the Policy Framework project for the VFC Actor
20 in several releases. Thus, the code and information provided is to the best of the
21 knowledge of the team. If there are any questions or problems, please consult the VFC
22 Project to help provide guidance.
23
24 VFC uses a REST-based
25 interface.  However, as requests may not complete right away, a REST-based polling
26 interface is used to check the status of the request.  The *jobId* is extracted
27 from each response and is appended to the *pathGet* configuration parameter to
28 generate the URL used to poll for completion.
29
30 Each operation supported by the actor is associated with its own java class, which is
31 responsible for populating the request structure appropriately and sending the request.
32 The operation-specific classes are all derived from the *VfcOperation* class, which is,
33 itself, derived from *HttpOperation*.  The following operations are currently supported:
34
35 - Restart
36
37
38 Request
39 #######
40
41 A number of nested structures are populated within the request.  Several of them are
42 populated from items found within the A&AI "enrichment" data provided by DCAE with
43 the ONSET event.  The following table lists the contents of some of the fields that
44 appear within these structures.
45
46 +----------------------------------+---------+----------------------------------------------------------------------+
47 | Field Name                       |  Type   |                         Description                                  |
48 +----------------------------------+---------+----------------------------------------------------------------------+
49 +----------------------------------+---------+----------------------------------------------------------------------+
50 | top level:                       |         |                                                                      |
51 +----------------------------------+---------+----------------------------------------------------------------------+
52 | *requestId*                      | string  |   Inserted by Policy. Maps to the UUID sent by DCAE i.e. the ID      |
53 |                                  |         |   used throughout the closed loop lifecycle to identify a request.   |
54 +----------------------------------+---------+----------------------------------------------------------------------+
55 | *nsInstanceId*                   | string  |   Set by Policy, using the                                           |
56 |                                  |         |   "service-instance.service-instance-id" property                    |
57 |                                  |         |   found within the enrichment data.                                  |
58 +----------------------------------+---------+----------------------------------------------------------------------+
59 +----------------------------------+---------+----------------------------------------------------------------------+
60 | healVnfData:                     |         |                                                                      |
61 +----------------------------------+---------+----------------------------------------------------------------------+
62 | *cause*                          | string  |   Set by Policy to the name of the operation.                        |
63 +----------------------------------+---------+----------------------------------------------------------------------+
64 | *vnfInstanceId*                  | string  |   Set by Policy, using the                                           |
65 |                                  |         |   "generic-vnf.vnf-id" property                                      |
66 |                                  |         |   found within the enrichment data.                                  |
67 +----------------------------------+---------+----------------------------------------------------------------------+
68 +----------------------------------+---------+----------------------------------------------------------------------+
69 | additionalParams:                |         |                                                                      |
70 +----------------------------------+---------+----------------------------------------------------------------------+
71 | *action*                         |         |   Set by Policy to the name of the operation.                        |
72 +----------------------------------+---------+----------------------------------------------------------------------+
73 +----------------------------------+---------+----------------------------------------------------------------------+
74 | actionvminfo:                    |         |                                                                      |
75 +----------------------------------+---------+----------------------------------------------------------------------+
76 | *vmid*                           | string  |   Set by Policy, using the                                           |
77 |                                  |         |   "vserver.vserver-id" property                                      |
78 |                                  |         |   found within the enrichment data.                                  |
79 +----------------------------------+---------+----------------------------------------------------------------------+
80 | *vmname*                         | string  |   Set by Policy, using the                                           |
81 |                                  |         |   "vserver.vserver-name" property                                    |
82 |                                  |         |   found within the enrichment data.                                  |
83 +----------------------------------+---------+----------------------------------------------------------------------+
84
85
86 Examples
87 ########
88
89 Suppose the *ControlLoopOperationParams* were populated as follows:
90
91 .. code-block:: bash
92
93         {
94             TBD
95         }
96
97 An example of a request constructed by the actor using the above parameters, sent to the
98 VFC REST server:
99
100 .. code-block:: bash
101
102         {
103             TBD
104         }
105
106 An example response received to the initial request, from the VFC REST service:
107
108 .. code-block:: bash
109
110         {
111             TBD
112         }
113
114 An example URL used for the "get" (i.e., poll) request subsequently sent to VFC:
115
116 .. code-block:: bash
117
118         TBD
119
120 An example response received to the poll request, when VFC has not completed the request:
121
122 .. code-block:: bash
123
124         {
125             TBD
126         }
127
128 An example response received to the poll request, when VFC has completed the request:
129
130 .. code-block:: bash
131
132         {
133             TBD
134         }
135
136
137 Configuration of the VFC Actor
138 ###############################
139
140 The following table specifies the fields that should be provided to configure the VFC
141 actor.
142
143 =============================== ====================    ==================================================================
144 Field name                         type                             Description
145 =============================== ====================    ==================================================================
146 clientName                        string                  Name of the HTTP client to use to send the request to the
147                                                           VFC REST server.
148 timeoutSec                        integer (optional)      Maximum time, in seconds, to wait for a response to be received
149                                                           from the REST server.  Defaults to 90s.
150 =============================== ====================    ==================================================================
151
152 The individual operations are configured using these same field names.  However, all
153 of them are optional, as they inherit their values from the
154 corresponding actor-level fields.  The following additional fields are specified at
155 the individual operation level.
156
157 =============================== ====================    ===================================================================
158 Field name                         type                             Description
159 =============================== ====================    ===================================================================
160 path                              string                  URI appended to the URL.  Note: this
161                                                           should not include a leading or trailing slash.
162 maxGets                           integer (optional)      Maximum number of get/poll requests to make to determine the
163                                                           final outcome of the request.  Defaults to 0 (i.e., no polling).
164 waitSecGet                        integer                 Time, in seconds, to wait between issuing "get" requests.
165                                                           Defaults to 20s.
166 pathGet                           string                  Path to use when polling (i.e., issuing "get" requests).
167                                                           Note: this should include a trailing slash, but no leading
168                                                           slash.
169 =============================== ====================    ===================================================================