aboutsummaryrefslogtreecommitdiffstats
path: root/docs/release/userguide/feature.userguide.rst
blob: 6187a228a1ff35e138575be55dd0d344c35680f5 (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
.. This work is licensed under a Creative Commons Attribution 4.0 International License.
.. http://creativecommons.org/licenses/by/4.0

========================================
Domino API Usage Guidelines and Examples
========================================

Using domino-cli Client
=======================

Prerequisites:

1. Make sure that domino-cli.py is in +x mode.

2. Change directory to where domino-cli.py, DominoClient.py and DominoServer.py are located or include file path in the PATH environment variable.

3. Start the Domino Server:

.. code-block:: bash

  ./DominoServer.py --log=debug

4. Start the Domino Client:

.. code-block:: bash

  ./DominoClient.py -p <portnumber> --cliport <cli-portnumber> --log=debug

Note1: The default log level is WARNING and omitting --log option will lead to minimal/no logging on the console

Note2: domino_conf.py file includes most of the default values

* Registration Command

Command line input:

.. code-block:: bash

  ./domino-cli.py <cli-portnumber> register

This message has the following fields that are automatically filled in.

.. code-block:: bash

  Message Type (= REGISTER)
  DESIRED UDID (= if not allocated, this will be assigned as Unique Domino ID)
  Sequence Number (=incremented after each RPC call)
  IP ADDR (= IP address of DOMINO Client to be used by DOMINO Server for future RPC Calls to this client)
  TCP PORT (= TCP port of DOMINO Client to be used by DOMINO Server for future RPC Calls to this client)
  Supported Templates (= Null, this field not used currently)

* Heart Beat Command

Command line input:

.. code-block:: bash

  ./domino-cli.py <cli-portnumber> heartbeat

This message has the following fields that are automatically filled in.

.. code-block:: bash

  Message Type (= HEART_BEAT)
  UDID (= Unique Domino ID assigned during registration)
  Sequence Number (=incremented after each RPC call)

* Label and Template Type Subscription Command

.. code-block:: bash

  ./domino-cli.py <cli-portnumber> subscribe -l <labelname> -t <templatetype>

Note that -l can be substituted by --label and -t can be substituted by --ttype.

More than one label or template type can be subscribed within the same command line as comma separated labels or template types

.. code-block:: bash

  ./domino-cli.py <cli-portnumber> subscribe -l <label1>,<label2>,<labeln> -t <ttype1>,<ttype2>,<ttypen>

To subscribe more than one label or template type, one can also repeat the options -l and -t, e.g.:

.. code-block:: bash

  ./domino-cli.py <cli-portnumber> subscribe -l <label1> -l <label2> -l <labeln> -t <ttype1> -t <ttype2> -t <ttypen>

It is safe to call subscribe command multiple times with duplicate labels.

This message has the following fields that are automatically filled in.

.. code-block:: bash

  Message Type (= SUBSCRIBE)
  UDID (= Unique Domino ID assigned during registration)
  Sequence Number (=incremented after each RPC call)
  Template Operation (= APPEND)
  Label Operation (= APPEND)

The following fields are filled in based on arguments passed on via -l/--label and -t/--ttype flags

Subscribe RPC also supports options for label using
  --lop=APPEND/DELETE/OVERWRITE
and for supported template types using
  --top=APPEND/DELETE/OVERWRITE.
When unspecified, the default is APPEND.
DELETE deletes existing labels (template types) specified in the current call via key -l/--label (-t/--ttype).
OVERWRITE removes the current set of labels (template types) and sets it to the new set of values passed in the same RPC call.

By default, no translation service is provided. Currently, only TOSCA to Heat
Orchestration Template (HOT) translation is supported using OpenStack
heat-translator library. A domain that requires HOT files must subscribe HOT
template type using

.. code-block:: bash

  ./domino-cli.py <cli-portnumber> subscribe -t hot

* Template Publishing Command

.. code-block:: bash

  ./domino-cli.py <cli-portnumber> publish -t <toscafile>

Note that -t can be substituted with --tosca-file.

If -t or --tosca-file flag is used multiple times, the last tosca file passed as input will be used. This usage is not recommended as undefined/unintended results may emerge as the Domino client will continue to publish.

This message has the following fields that are automatically filled in.

.. code-block:: bash

  Message Type (= PUBLISH)
  UDID (= Unique Domino ID assigned during registration)
  Sequence Number (=incremented after each RPC call)
  Template Type (= TOSCA)
  Template File

Since Danube release, Domino Server supports stateful updates for template publishing. The following command can be used to update the service template for an existing Template Unique ID (TUID):

.. code-block:: bash

  ./domino-cli.py <cli-portnumber> publish -t <toscafile> -k <TUID>

Note that -k can be substituted with --tuid. When Domino Server receives this command, it verifies whether
the client previously published the provided TUID. If such TUID does not exist, then Domino Server returns
FAILED response back to the client. If such TUID exists, Domino Server recomputes which resources are
mapped onto which domains and updates each domain with the new VNF and NS descriptors. If a previously
utilized domain is no longer targeted, it is updated with a null descriptor.

* Template Listing Command

.. code-block:: bash

  ./domino-cli.py <cli-portnumber> list-tuids

Queries all the Template Unique IDs (TUIDs) published by the Domino Client from the Domino Server.

Interactive CLI mode
--------------------

To enter this mode, start Domino Client with interactive console option set as true, i.e., --iac=true:

.. code-block:: bash

  ./DominoClient -p <portnumber> --iax=true --log=DEBUG

The rest of the API calls are the same as in the case of using domino-cli.py except that at the prompt there is no need to write "domino-cli.py <cli-portnumber>, e.g.,:

.. code-block:: bash

  >>register
  >>heartbeat
  >>subscribe -l <label1> -t <ttype1>
  >>publish -t <toscafile>

The interactive CLI mode is mainly supported for manual testing.