aboutsummaryrefslogtreecommitdiffstats
path: root/docs/development/actors/sdnr/sdnr.rst
blob: 13d91940a90abaecc5234fd77b0c5c75c02acfe1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
.. This work is licensed under a
.. Creative Commons Attribution 4.0 International License.
.. http://creativecommons.org/licenses/by/4.0

.. _sdnr-label:

##########
SDNR Actor
##########

.. contents::
    :depth: 3

Overview of SDNR Actor
######################
ONAP Policy Framework enables SDNR as one of the supported actors.  SDNR uses two
DMaaP topics, one to which requests are published, and another from which responses
are received.  SDNR may generate more than one response for a particular request,
the first response simply indicating that the request was accepted, while the second
response indicates completion of the request.  For each request, a unique sub-request
ID is generated.  This is used to match the received responses with the published
requests.

When an SDNR request completes, whether successfully or unsuccessfully, the actor
populates the *controlLoopResponse* within the *OperationOutcome*.  The application
will typically publish this to a notification topic so that downstream systems can
take appropriate action.

All SDNR operations are currently supported by a single java class,
*SdnrOperation*, which is responsible for populating the request structure
appropriately.  This class is derived from *BidirectionalTopicOperation*.


Request
#######

CommonHeader
************

The "CommonHeader" field in the request is built by policy.

=============================== =========== ==================================================================
   "CommonHeader" field name       type                             Description
=============================== =========== ==================================================================
SubRequestID                      string      Generated by Policy. Is a UUID and used internally by policy
                                              to match the response with the request.
RequestID                         string      Inserted by Policy. Maps to the UUID sent by DCAE i.e. the ID
                                              used throughout the closed loop lifecycle to identify a request.
=============================== =========== ==================================================================


Action
******

The "action" field uniquely identifies the operation to perform.  Operation names are
not validated.  Instead, they are passed to SDNR, untouched.


RPC Name
********

The "rpc-name" field is the same as the "action" field, with everything mapped to lower
case.


Payload
*******

The "payload" field is populated with the *payload* text that is provided within the
ONSET event; no additional transformation is applied.


Examples
########

Suppose the *ControlLoopOperationParams* were populated as follows:

.. code-block:: bash

        {
            "actor": "SDNR",
            "operation": "ModifyConfig",
            "context": {
                "event": {
                    "requestId": "664be3d2-6c12-4f4b-a3e7-c349acced200",
                    "payload": "some text"
                }
            }
        }

An example of a request constructed by the actor using the above parameters, published
to the SDNR request topic:

.. code-block:: bash

        {
          "body": {
            "input": {
              "CommonHeader": {
                "TimeStamp": "2020-05-18T14:43:58.550499700Z",
                "APIVer": "1.0",
                "RequestID": "664be3d2-6c12-4f4b-a3e7-c349acced200",
                "SubRequestID": "848bfd15-b189-43a1-bdea-80982b41fa24",
                "RequestTrack": {},
                "Flags": {}
              },
              "Action": "ModifyConfig",
              "Payload": "some text"
            }
          },
          "version": "1.0",
          "rpc-name": "modifyconfig",
          "correlation-id": "664be3d2-6c12-4f4b-a3e7-c349acced200-848bfd15-b189-43a1-bdea-80982b41fa24",
          "type": "request"
        }


An example initial response received from the SDNR response topic:

.. code-block:: bash

        {
            "body": {
                "output": {
                    "CommonHeader": {
                        "TimeStamp": "2020-05-18T14:44:10.000Z",
                        "APIver": "1.0",
                        "RequestID": "664be3d2-6c12-4f4b-a3e7-c349acced200",
                        "SubRequestID": "848bfd15-b189-43a1-bdea-80982b41fa24",
                        "RequestTrack": [],
                        "Flags": []
                    },
                    "Status": {
                        "Code": 100,
                        "Value": "ACCEPTED"
                    }
                }
            },
            "version": "1.0",
            "rpc-name": "modifyconfig",
            "correlation-id": "664be3d2-6c12-4f4b-a3e7-c349acced200-848bfd15-b189-43a1-bdea-80982b41fa24",
            "type": "response"
        }


An example final response received from the SDNR on the same response topic:

.. code-block:: bash

        {
            "body": {
                "output": {
                    "CommonHeader": {
                        "TimeStamp": "2020-05-18T14:44:20.000Z",
                        "APIver": "1.0",
                        "RequestID": "664be3d2-6c12-4f4b-a3e7-c349acced200",
                        "SubRequestID": "848bfd15-b189-43a1-bdea-80982b41fa24",
                        "RequestTrack": [],
                        "Flags": []
                    },
                    "Status": {
                        "Code": 200,
                        "Value": "SUCCESS"
                    },
                    "Payload": "{ \"Configurations\":[ { \"Status\": { \"Code\": 200, \"Value\": \"SUCCESS\" }, \"data\":{\"FAPService\":{\"alias\":\"Chn0330\",\"X0005b9Lte\":{\"phyCellIdInUse\":6,\"pnfName\":\"ncserver23\"},\"CellConfig\":{\"LTE\":{\"RAN\":{\"Common\":{\"CellIdentity\":\"Chn0330\"}}}}}} } ] }"
                }
            },
            "version": "1.0",
            "rpc-name": "modifyconfig",
            "correlation-id": "664be3d2-6c12-4f4b-a3e7-c349acced200-848bfd15-b189-43a1-bdea-80982b41fa24",
            "type": "response"
        }


Configuration of the SDNR Actor
###############################

The following table specifies the fields that should be provided to configure the SNDR
actor.

=============================== ====================    ==================================================================
Field name                         type                             Description
=============================== ====================    ==================================================================
sinkTopic                         string                  Name of the topic to which the request should be published.
sourceTopic                       string                  Name of the topic from which the response should be read.
                                                          This must not be the same as the *sinkTopic*.
timeoutSec                        integer (optional)      Maximum time, in seconds, to wait for a response to be received
                                                          on the topic.
=============================== ====================    ==================================================================

The individual operations are configured using these same field names.  However, all
of them are optional, as they inherit their values from the corresponding actor-level
fields.