1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
\r
2 .. http://creativecommons.org/licenses/by/4.0
\r
4 .. _dcae_cli_commands:
\r
9 The dcae_cli tool has four command groups. Each has several
\r
15 The ``catalog`` command lists and shows resources (components and
\r
16 data_formats) in the ‘onboarding’ catalog (regardless of the owner). A
\r
17 resource can have a status of ``staged`` or ``published``. By default,
\r
18 only ``published`` resources are displayed. To see ``staged`` resources,
\r
19 add the –expanded argument.
\r
21 +------------------------------+----------------------------------------+
\r
22 | Catalog Status | Meaning |
\r
23 +==============================+========================================+
\r
24 | staged | resource has be added |
\r
25 | | (and validated), but |
\r
26 | | is under development |
\r
27 +------------------------------+----------------------------------------+
\r
28 | staged | data_formats can only be referenced in |
\r
29 | | their owners component specs |
\r
30 +------------------------------+----------------------------------------+
\r
31 | staged | components can only be deployed by |
\r
33 +------------------------------+----------------------------------------+
\r
34 | published | resource has been |
\r
35 | | tested and can be |
\r
37 +------------------------------+----------------------------------------+
\r
38 | | published data_formats can be used in |
\r
39 | | anyone's component spec |
\r
40 +------------------------------+----------------------------------------+
\r
41 | | published components and be deployed by|
\r
43 +------------------------------+----------------------------------------+
\r
47 $ dcae_cli catalog --help
\r
48 Usage: dcae_cli catalog [OPTIONS] COMMAND [ARGS]...
\r
51 --help Show this message and exit.
\r
54 list Lists resources in the onboarding catalog
\r
55 show Provides more information about resource
\r
57 List onboarding catalog contents
\r
58 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\r
62 $ dcae_cli catalog list
\r
64 +--------------------------------+---------+--------+---------------------------------------------------------------------+--------+-----------+------------+
\r
65 | Name | Version | Type | Description | Owner | Status | Published |
\r
66 +--------------------------------+---------+--------+---------------------------------------------------------------------+--------+-----------+------------+
\r
67 | DcaeSyslogCollector | 2.0.0 | docker | DCAE Control Plane Syslog Collector | sh1986 | published | 2017-08-04 |
\r
68 | cdap.dmaap.spec.example | 0.2.0 | cdap | dmaap spec example. Not a functioning application, only for showing | tc677g | published | 2017-07-24 |
\r
69 | | | | how to pub/sub dmaap. Pretend this is like MAP with VES in and ou.. | | | |
\r
70 | cdap.event.proc.enrich.app | 1.0.3 | cdap | CDAP Event Processing Enrich application | an4828 | published | 2017-09-20 |
\r
71 | cdap.event.proc.map.app | 1.0.3 | cdap | CDAP Event Processing Map application | an4828 | published | 2017-09-20 |
\r
76 +--------------------------------------------+---------+-----------------------------------------------------------------------+--------+-----------+------------+
\r
77 | Name | Version | Description | Owner | Status | Published |
\r
78 +--------------------------------------------+---------+-----------------------------------------------------------------------+--------+-----------+------------+
\r
79 | FOI_PM_VHSS_data_format | 1.0.0 | CSV pipe delimited data format for VHSS PM files | sr229c | published | 2017-09-05 |
\r
80 | Map_input | 1.0.0 | The input format for Mapper, that in 1707 is the UCSNMP Collector | an4828 | published | 2017-07-18 |
\r
81 | | | output format, but will support more formats later | | | |
\r
82 | Syslog Collector Parsed Json Message | 1.0.0 | Post processed/parsed collected syslog message | sh1986 | published | 2017-08-04 |
\r
83 | Syslog Collector Syslog Message Input | 1.0.0 | The input message for the DCAE syslog collector is free/unstructured | sh1986 | published | 2017-08-04 |
\r
85 | myapp Alert Definition | 1.0.0 | The format of the output event from myapp | an4828 | published | 2017-08-10 |
\r
86 | VES_specification | 5.28.4 | VES spec for 5.4 | vv770d | published | 2017-09-19 |
\r
90 Show the contents of an item in the catalog
\r
91 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\r
95 $ dcae_cli catalog show FOI_PM_VHSS_data_format
\r
100 "dataformatversion": "1.0.0",
\r
101 "delimitedschema": {
\r
105 "description": "System ID",
\r
106 "fieldtype": "string",
\r
110 "description": "Date",
\r
111 "fieldtype": "string",
\r
115 "description": "Time",
\r
116 "fieldtype": "string",
\r
122 .. _dcae_cli_component_commands:
\r
129 The ``component`` command is for validating (adding), listing, showing,
\r
130 verifying generated configuration, running, undeploying, and publishing
\r
131 components that YOU own.
\r
135 $ dcae_cli component --help
\r
136 Usage: dcae_cli component [OPTIONS] COMMAND [ARGS]...
\r
139 --help Show this message and exit.
\r
143 dev Set up component in development for...
\r
144 list Lists components in the onboarding catalog.
\r
145 publish Pushes COMPONENT to the onboarding catalog
\r
146 run Runs the latest version of COMPONENT.
\r
147 show Provides more information about COMPONENT
\r
148 undeploy Undeploys the latest version of COMPONENT.
\r
152 .. _dcae_cli_add_a_component:
\r
157 A component must be added to the onboarding catalog in order to be
\r
158 tested by the dcae_cli tool. The process of adding a component also
\r
159 validates it’s component specification. In order to add a component, the
\r
160 component docker image (or CDAP jar) must exist locally.
\r
162 Components in the onboarding catalog can be run by others, once they are
\r
163 ``published.`` ``Published`` components cannot be modified or deleted.
\r
164 Rather a new version can be created instead.
\r
166 Validated component specs are used later to generate Tosca models and
\r
167 Cloudify Blueprints for the component, which makes them available for
\r
168 use in the SDC Tool for creating services.
\r
172 $ dcae_cli component add --help
\r
173 Usage: dcae_cli component add [OPTIONS] COMPONENT-SPECIFICATION
\r
176 --update Updates a previously added component if it has not been already
\r
178 --help Show this message and exit.
\r
182 $ dcae_cli component add component-spec.json
\r
189 List components in the onboarding catalog that owned by YOUR userid..
\r
193 $ dcae_cli component list
\r
194 Active profile: solutioning
\r
195 +-------------------------+---------+--------+---------------------------------------------------------------+--------+----------------------------+-----------+
\r
196 | Name | Version | Type | Description | Status | Modified | #Deployed |
\r
197 +-------------------------+---------+--------+---------------------------------------------------------------+--------+----------------------------+-----------+
\r
198 | cdap.helloworld.endnode | 0.8.0 | cdap | cdap test component | staged | 2017-05-23 04:14:35.588075 | 0 |
\r
199 | sandbox.platform.yourapp| 0.5.0 | docker | Web service used as a stand-alone test DCAE service compone.. | staged | 2017-05-23 04:07:44.065610 | 0 |
\r
200 +-------------------------+---------+--------+---------------------------------------------------------------+--------+----------------------------+-----------+
\r
202 The fields ``Name``, ``Version``, ``Type``, ``Description`` are
\r
203 referenced from the component specification’s ``self`` JSON. Use the
\r
204 “–deployed” argument to see more details on deployed components
\r
208 .. _dcae_cli_run_a_component:
\r
213 The ``run`` operation is to be used for running your application in its
\r
214 container remotely on the activated environment. Docker containers have
\r
215 the additional option to run locally on your development machine. If the
\r
216 component uses Dmaap, you can specify the Dmaap Connection Object as
\r
217 well. Refer to :doc:`Dmaap Connection Object <../component-specification/dmaap-connection-objects>`.
\r
219 When you run a component via the dcae_cli Tool, remember the blueprint
\r
220 has not been created and is not used for deployment.
\r
222 In order to run the component, the data formats and component must have
\r
223 been added to the onboarding catalog.
\r
225 **DOCKER NOTE:** Make sure the Docker image has been uploaded to the
\r
228 A docker component can be run in either ``attached`` or ``unattached``
\r
229 mode. (Default is unattached).
\r
231 +------------------+---------------------------------------------------+
\r
232 | Mode | Description |
\r
233 +==================+===================================================+
\r
234 | attached | component is run in the ‘foreground’, container |
\r
235 | | logs are streamed to stdout. Ctrl-C is used to |
\r
236 | | terminate the dcae_cli session. |
\r
237 +------------------+---------------------------------------------------+
\r
238 | unattached | component is run in the ‘background’, container |
\r
239 | | logs are viewed via ``docker logs`` command, |
\r
240 | | container runs until undeployed with dcae_cli |
\r
241 | | ``undeploy`` command. |
\r
242 +------------------+---------------------------------------------------+
\r
244 Run a component in attached mode:
\r
245 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
\r
249 $ dcae_cli -v component run --attached sandbox.platform.yourapp:0.5.0
\r
251 DCAE.Docker | INFO | Running image 'registry.proto.server.com/dcae-rework/yourapp:0.4.0' as 'user1.b7287639-37f5-4f25-8d54-8a2087f4c8da.0-5-0.sandbox-platform-yourapp'
\r
252 DCAE.Docker.user1.b7287639-37f5-4f25-8d54-8a2087f4c8da.0-5-0.sandbox-platform-yourapp | INFO | Consul host: yourconsulhost.com
\r
254 DCAE.Docker.user1.b7287639-37f5-4f25-8d54-8a2087f4c8da.0-5-0.sandbox-platform-yourapp | INFO | service name: mh677g.b7287639-37f5-4f25-8d54-8a2087f4c8da.0-5-0.sandbox-platform-yourapp
\r
256 DCAE.Docker.user1.b7287639-37f5-4f25-8d54-8a2087f4c8da.0-5-0.sandbox-platform-yourapp | INFO | Generated config: {'multiplier': 3}
\r
258 DCAE.Docker.user1.b7287639-37f5-4f25-8d54-8a2087f4c8da.0-5-0.sandbox-platform-yourapp | INFO | * Running on http://0.0.0.0:8080/ (Press CTRL+C to quit)
\r
260 DCAE.Docker.user1.b7287639-37f5-4f25-8d54-8a2087f4c8da.0-5-0.sandbox-platform-yourapp | INFO | 127.0.0.1 - - [24/May/2017 03:37:57] "GET /health HTTP/1.1" 200 -
\r
262 DCAE.Docker.user1.b7287639-37f5-4f25-8d54-8a2087f4c8da.0-5-0.sandbox-platform-yourapp | INFO | 127.0.0.1 - - [24/May/2017 03:38:12] "GET /health HTTP/1.1" 200 -
\r
264 Hit Ctrl-C to terminate session.
\r
268 ^CDCAE.Docker | INFO | Stopping container 'user1.b7287639-37f5-4f25-8d54-8a2087f4c8da.0-5-0.sandbox-platform-yourapp' and cleaning up...
\r
270 Run a component in unattached mode:
\r
271 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
\r
275 $ dcae_cli -v component run sandbox.platform.yourapp:0.5.0
\r
276 DCAE.Docker | INFO | Running image 'registry.proto.server.com/dcae-rework/yourapp:0.4.0' as 'user1.4811da0e-08d5-429f-93bf-bf6814924577.0-5-0.sandbox-platform-yourapp'
\r
277 DCAE.Run | INFO | Deployed /user1.4811da0e-08d5-429f-93bf-bf6814924577.0-5-0.sandbox-platform-yourapp
\r
279 **NOTE** You must undeploy this component when finished testing. This is
\r
280 important to conserve resources in the environment.
\r
282 Run a component that subscribes to Dmaap MR or DR
\r
283 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
\r
287 $ dcae_cli -v component run --attached --dmaap-file $dmaap-connection-file sandbox.platform.yourapp:0.5.0
\r
291 Undeploy a Component
\r
292 ~~~~~~~~~~~~~~~~~~~~
\r
294 The ``undeploy`` command is used to undeploy any instance of a specified
\r
295 component/version that you have deployed. This includes cleaning up the
\r
300 $ dcae_cli component undeploy sandbox.platform.yourapp:0.5.0
\r
301 DCAE.Undeploy | WARNING | Undeploying components: 1
\r
302 DCAE.Undeploy | WARNING | Undeployed components: 1
\r
306 Publish a component
\r
307 ~~~~~~~~~~~~~~~~~~~
\r
309 | Once a component has been tested, it should be published in the
\r
310 onboarding catalog using the ``publish`` sub-command .
\r
311 | Publishing will change the status of the component (from ``staged`` to
\r
312 ``published``), indicating that it has been tested, and making it
\r
313 accessible for other developers to use.
\r
315 **Note** Before a component can be published, all data_formats that it
\r
316 references must be published.
\r
320 dcae_cli component publish sandbox.platform.yourapp:0.5.0
\r
327 This will print out the contents of a component and is useful to copy a
\r
332 $ dcae_cli component show
\r
336 .. _dcae-cli-run-the-dev-command:
\r
338 Run the ``dev`` command
\r
339 ~~~~~~~~~~~~~~~~~~~~~~~
\r
341 The ``dev`` command is used as part of a process to see the platform
\r
342 generated configuration. It established the environment variables and is
\r
344 :any:`here <dcae-cli-view-the-platform>`.
\r
348 $ dcae_cli component dev component-spec.json
\r
349 Ready for component development
\r
353 .. _dcae_cli_data_format:
\r
358 The ``data_format`` command is for validating (adding), listing,
\r
359 showing, publishing data_formats that YOU own. data_formats can also be
\r
360 generated with this command.
\r
364 $ dcae_cli data_format --help
\r
365 Usage: dcae_cli data_format [OPTIONS] COMMAND [ARGS]...
\r
368 --help Show this message and exit.
\r
371 add Tracks a data format file DATA_FORMAT-SPECIFICATION...
\r
372 generate Create schema from a file or directory...
\r
373 list Lists all your data formats
\r
374 publish Publishes data format to make available to others...
\r
375 show Provides more information about FORMAT
\r
379 .. _dcae_cli_add_a_data_format:
\r
384 A data_format must be in the onboarding catalog in order to be
\r
385 referenced in the component specification. The process of adding a
\r
386 data_format also validates it. Data_formats in the onboarding catalog
\r
387 can be run by others, once they are ``published.`` ``Published``
\r
388 data_formats cannot be modified or deleted. Rather a new version can be
\r
393 $ dcae_cli data_format add --help
\r
394 Usage: dcae_cli data_format add [OPTIONS] DATA_FORMAT-SPECIFICATION
\r
397 --update Updates a previously added data_format if it has not been already
\r
399 --help Show this message and exit.
\r
403 dcae_cli data_format add health.json
\r
410 Only data_formats owned by YOUR userid will be shown.
\r
414 $ dcae_cli data_format list
\r
416 Data formats for user1
\r
417 +---------------------------------+---------+-------------------------------------------+--------+----------------------------+
\r
418 | Name | Version | Description | Status | Modified |
\r
419 +---------------------------------+---------+-------------------------------------------+--------+----------------------------+
\r
420 | sandbox.platform.yourapp.health | 0.1.0 | Data format used for the /health endpoint | staged | 2017-05-23 04:02:38.952799 |
\r
421 +---------------------------------+---------+-------------------------------------------+--------+----------------------------+
\r
423 The fields ``name``, ``version``, ``description`` are referenced from
\r
424 the data format specification’s ``self`` JSON. ``Status`` represents the
\r
425 status of the data format in the catalog. See `Publish a Data
\r
426 Format <#publish-a-data-format>`__ for more info.
\r
433 This will print out the contents of a data_format and is useful for
\r
434 copying a data_format.
\r
438 $ dcae_cli data_format show
\r
442 Publish a Data Format
\r
443 ~~~~~~~~~~~~~~~~~~~~~
\r
445 | Once a data_format has been tested (by referencing it in a component
\r
446 spec that has been tested), it should be published in the onboarding
\r
447 catalog using the ``publish`` sub-command .
\r
448 | Publishing will change the status of the data_format (from ``staged``
\r
449 to ``published``), indicating that it has been tested, and making it
\r
450 accessible for other developers to use.
\r
454 $ dcae_cli data_format publish data_format.json
\r
458 Generate a Data Format
\r
459 ~~~~~~~~~~~~~~~~~~~~~~
\r
461 If you already have a valid input or output file, you can use the
\r
462 generate command to create the it’s data format specification.
\r
466 $ dcae_cli data_format generate name:version file-or-dir-path
\r
473 The\ ``profiles`` command is for creating, deleting, listing, showing,
\r
474 activating, and updating (set) profiles. The profile contains
\r
475 environment variables used to connect to different environments. This is
\r
476 used in the running and deployment of a component using the
\r
477 ``dcae_cli component run`` or ``dev`` command.
\r
481 $ dcae_cli profiles --help
\r
482 Usage: dcae_cli profiles [OPTIONS] COMMAND [ARGS]...
\r
485 --help Show this message and exit.
\r
488 activate Sets profile NAME as the active profile
\r
489 create Creates a new profile NAME initialized with...
\r
490 delete Deletes profile NAME
\r
491 list Lists available profiles
\r
492 set Updates profile NAME such that KEY=VALUE
\r
493 show Prints the profile dictionary
\r
497 List the available profiles
\r
498 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
\r
502 $ dcae_cli profiles list
\r
507 The \* identifies the active profile. ``dcae-cli`` is currently
\r
508 installed with profiles for the ``solutioning``, ``1710``, and ``1802``
\r
509 environments. They are intended for the following:
\r
511 +-----------------------------------+-----------------------------------+
\r
512 | Environment | Description |
\r
513 +===================================+===================================+
\r
514 | solutioning | default environment; used for |
\r
515 | | initial component developer |
\r
516 | | testing with the dcae_cli tool. |
\r
517 +-----------------------------------+-----------------------------------+
\r
518 | 1710 | FTL3 (Functional Testing Lab 3) |
\r
519 | | environment, which represents the |
\r
520 | | 1710 release. |
\r
521 +-----------------------------------+-----------------------------------+
\r
522 | 1802 | FTL3a (Functional Testing Lab 3a) |
\r
523 | | environment, which represents the |
\r
524 | | 1802 release. |
\r
525 +-----------------------------------+-----------------------------------+
\r
529 Show the details of a profile
\r
530 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\r
534 $ dcae_cli profiles show solutioning
\r
536 "cdap_broker": "cdap_broker",
\r
537 "config_binding_service": "config_binding_service",
\r
538 "consul_host": "yourconsulhost.com",
\r
539 "docker_host": "yourdockerhost.com:2376"
\r
544 .. _dcae_cli_activate_profile:
\r
549 To switch among profiles, use the activate sub-command. A subsequent
\r
550 ``list`` will reveal the change made.
\r
554 $ dcae_cli profiles activate test
\r
558 Create a new profile
\r
559 ~~~~~~~~~~~~~~~~~~~~
\r
561 If you want to work in a different environment using the dcae_cli tool,
\r
562 you can make your own profile. (The environment must be a working DCAE
\r
563 Platform environment).
\r
567 $ dcae_cli profiles create new-profile
\r
569 After creating you would assign the variables with the ``set``
\r
570 sub-command. Then activate it to use.
\r
574 Set variables in a profile
\r
575 ~~~~~~~~~~~~~~~~~~~~~~~~~~
\r
579 $ dcae_cli profiles set $profile $key $value
\r
588 $ dcae_cli profiles delete new-profile
\r