File: murano-repository.rst

package info (click to toggle)
murano 1%3A6.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 10,644 kB
  • sloc: python: 34,127; sh: 717; pascal: 269; makefile: 83
file content (606 lines) | stat: -rw-r--r-- 22,117 bytes parent folder | download | duplicates (3)
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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
Application catalog API
=======================

Manage application definitions in the Application Catalog.
You can browse, edit and upload new application packages (.zip.package archive with all data that required for a service deployment).

Packages
========

Methods for application package management

**Package Properties**

- ``id``: guid of a package (``fully_qualified_name`` can also be used for some API functions)
- ``fully_qualified_name``: fully qualified domain name -  domain name that specifies exact application location
- ``name``: user-friendly name
- ``type``: package type, "library" or "application"
- ``description``: text information about application
- ``author``: name of application author
- ``tags``: list of short names, connected with the package, which allows to search applications easily
- ``categories``: list of application categories
- ``class_definition``: list of class names used by a package
- ``is_public``: determines whether the package is shared for other projects
- ``enabled``: determines whether the package is browsed in the Application Catalog
- ``owner_id``: id of a project that owns the package

.. note::

    It is possible to use ``in`` operator for properties ``id``, ``category`` and ``tag``.
    For example to get packages with ``id1, id2, id3`` use ``id=in:id1,id2,id3``.

List packages
-------------

`/v1/catalog/packages?{marker}{limit}{order_by}{type}{category}{fqn}{owned}{id}{catalog}{class_name}{name} [GET]`

This is the compound request to list and search through application catalog.
If there are no search parameters all packages that is_public, enabled and belong to the user's project will be listed.
Default order is by 'created' field.
For an admin role all packages are available.

**Parameters**

+---------------------+--------+---------------------------------------------+
| Attribute           | Type   | Description                                 |
+=====================+========+=============================================+
| ``catalog``         | bool   | If false (default) - search packages, that  |
|                     |        | current user can edit (own for non-admin,   |
|                     |        | all for admin)                              |
|                     |        | If true - search packages, that current user|
|                     |        | can deploy (i.e. his own + public)          |
+---------------------+--------+---------------------------------------------+
| ``marker``          | string | A package identifier marker may be          |
|                     |        | specified. When present only packages which |
|                     |        | occur after the identifier ID will be listed|
+---------------------+--------+---------------------------------------------+
| ``limit``           | string | When present the maximum number of results  |
|                     |        | returned will not exceed the specified      |
|                     |        | value. The typical pattern of limit and     |
|                     |        | marker is to make an initial limited request|
|                     |        | and then to use the ID of the last package  |
|                     |        | from the response as the marker parameter in|
|                     |        | a subsequent limited request.               |
+---------------------+--------+---------------------------------------------+
| ``order_by``        | string | Allows to sort packages by: `fqn`, `name`,  |
|                     |        | `created`. Created is default value.        |
+---------------------+--------+---------------------------------------------+
| ``type``            | string | Allows to point a type of package:          |
|                     |        | `application`, `library`                    |
+---------------------+--------+---------------------------------------------+
| ``category``        | string | Allows to point a categories for a search   |
+---------------------+--------+---------------------------------------------+
| ``fqn``             | string | Allows to point a fully qualified package   |
|                     |        | name for a search                           |
+---------------------+--------+---------------------------------------------+
| ``owned``           | bool   | Search only from packages owned by current  |
|                     |        | project                                     |
+---------------------+--------+---------------------------------------------+
| ``id``              | string | Allows to point an id for a search          |
+---------------------+--------+---------------------------------------------+
| ``include_disabled``| bool   | Include disabled packages in a the result   |
+---------------------+--------+---------------------------------------------+
| ``search``          | string | Gives opportunity to search specified data  |
|                     |        | by all the package parameters and order     |
|                     |        | packages                                    |
+---------------------+--------+---------------------------------------------+
| ``class_name``      | string | Search only for packages, that use specified|
|                     |        | class                                       |
+---------------------+--------+---------------------------------------------+
| ``name``            | string | Allows to point a package name for a search |
+---------------------+--------+---------------------------------------------+

**Response 200 (application/json)**

::

         {"packages": [
                      {
                        "id": "fed57567c9fa42c192dcbe0566f8ea33",
                         "fully_qualified_name" : "com.example.murano.services.linux.telnet",
                         "is_public": false,
                         "name": "Telnet",
                         "type": "linux",
                         "description": "Installs Telnet service",
                         "author": "OpenStack, Inc.",
                         "created": "2014-04-02T14:31:55",
                         "enabled": true,
                         "tags": ["linux", "telnet"],
                         "categories": ["Utility"],
                         "owner_id": "fed57567c9fa42c192dcbe0566f8ea40"
                      },
                      {
                        "id": "fed57567c9fa42c192dcbe0566f8ea31",
                        "fully_qualified_name": "com.example.murano.services.windows.WebServer",
                        "is_public": true,
                        "name": "Internet Information Services",
                        "type": "windows",
                        "description": "The  Internet Information Service sets up an IIS server and joins it into an existing domain",
                        "author": "OpenStack, Inc.",
                        "created": "2014-04-02T14:31:55",
                        "enabled": true,
                        "tags": ["windows", "web"],
                        "categories": ["Web"],
                        "owner_id": "fed57567c9fa42c192dcbe0566f8ea40"
                      }]
          }



Upload a new package[POST]
--------------------------

`/v1/catalog/packages`

See the example of multipart/form-data request, It should contain two parts - text (JSON string) and file object

**Request (multipart/form-data)**

.. code-block:: none

    Content-type: multipart/form-data, boundary=AaB03x
    Content-Length: $requestlen

    --AaB03x
    content-disposition: form-data; name="submit-name"

    --AaB03x
    Content-Disposition: form-data; name="JsonString"
    Content-Type: application/json

    {"categories":["web"] , "tags": ["windows"], "is_public": false, "enabled": false}
    `categories` - array, required
    `tags` - array, optional
    `name` - string, optional
    `description` - string, optional
    `is_public` - bool, optional
    `enabled` - bool, optional

    --AaB03x
    content-disposition: file; name="file"; filename="test.tar"
    Content-Type: targz
    Content-Transfer-Encoding: binary

    $binarydata
    --AaB03x--


**Response 200 (application/json)**

.. code-block:: json

    {
        "updated": "2014-04-03T13:00:13",
        "description": "A domain service hosted in Windows environment by using Active Directory Role",
        "tags": ["windows"],
        "is_public": true,
        "id": "8f4f09bd6bcb47fb968afd29aacc0dc9",
        "categories": ["test1"],
        "name": "Active Directory",
        "author": "Mirantis, Inc",
        "created": "2014-04-03T13:00:13",
        "enabled": true,
        "class_definition": [
            "com.mirantis.murano.windows.activeDirectory.ActiveDirectory",
            "com.mirantis.murano.windows.activeDirectory.SecondaryController",
            "com.mirantis.murano.windows.activeDirectory.Controller",
            "com.mirantis.murano.windows.activeDirectory.PrimaryController"
        ],
        "fully_qualified_name": "com.mirantis.murano.windows.activeDirectory.ActiveDirectory",
        "type": "Application",
        "owner_id": "fed57567c9fa42c192dcbe0566f8ea40"
    }

Get package details
-------------------

`/v1/catalog/packages/{id} [GET]`

Display details for a package.

**Parameters**

``id`` (required)  Hexadecimal `id` (or fully qualified name) of the package

**Response 200 (application/json)**

::

    {
        "updated": "2014-04-03T13:00:13",
        "description": "A domain service hosted in Windows environment by using Active Directory Role",
        "tags": ["windows"],
        "is_public": true,
        "id": "8f4f09bd6bcb47fb968afd29aacc0dc9",
        "categories": ["test1"],
        "name": "Active Directory",
        "author": "Mirantis, Inc",
        "created": "2014-04-03T13:00:13",
        "enabled": true,
        "class_definition": [
            "com.mirantis.murano.windows.activeDirectory.ActiveDirectory",
            "com.mirantis.murano.windows.activeDirectory.SecondaryController",
            "com.mirantis.murano.windows.activeDirectory.Controller",
            "com.mirantis.murano.windows.activeDirectory.PrimaryController"
        ],
        "fully_qualified_name": "com.mirantis.murano.windows.activeDirectory.ActiveDirectory",
        "type": "Application",
        "owner_id": "fed57567c9fa42c192dcbe0566f8ea40"
    }

**Response 403**

*  In attempt to get a non-public package by a user whose project is not an owner of this package.

**Response 404**

*  In case the specified package id doesn't exist.

Update a package
================

`/v1/catalog/packages/{id} [PATCH]`

Allows to edit mutable fields (categories, tags, name, description, is_public, enabled).
See the full specification `here <http://tools.ietf.org/html/rfc6902>`_.

**Parameters**

``id`` (required)  Hexadecimal `id` (or fully qualified name) of the package

**Content type**

application/murano-packages-json-patch

Allowed operations:

::

    [
        { "op": "add", "path": "/tags", "value": [ "foo", "bar" ] },
        { "op": "add", "path": "/categories", "value": [ "foo", "bar" ] },
        { "op": "remove", "path": "/tags", ["foo"] },
        { "op": "remove", "path": "/categories", ["foo"] },
        { "op": "replace", "path": "/tags", "value": [] },
        { "op": "replace", "path": "/categories", "value": ["bar"] },
        { "op": "replace", "path": "/is_public", "value": true },
        { "op": "replace", "path": "/enabled", "value": true },
        { "op": "replace", "path": "/description", "value":"New description" },
        { "op": "replace", "path": "/name", "value": "New name" }
    ]

**Request 200 (application/murano-packages-json-patch)**

::

    [
     { "op": "add", "path": "/tags", "value": [ "windows", "directory"] },
     { "op": "add", "path": "/categories", "value": [ "Directory" ] }
    ]

**Response 200 (application/json)**

::

    {
        "updated": "2014-04-03T13:00:13",
        "description": "A domain service hosted in Windows environment by using Active Directory Role",
        "tags": ["windows", "directory"],
        "is_public": true,
        "id": "8f4f09bd6bcb47fb968afd29aacc0dc9",
        "categories": ["test1"],
        "name": "Active Directory",
        "author": "Mirantis, Inc",
        "created": "2014-04-03T13:00:13",
        "enabled": true,
        "class_definition": [
            "com.mirantis.murano.windows.activeDirectory.ActiveDirectory",
            "com.mirantis.murano.windows.activeDirectory.SecondaryController",
            "com.mirantis.murano.windows.activeDirectory.Controller",
            "com.mirantis.murano.windows.activeDirectory.PrimaryController"
        ],
        "fully_qualified_name": "com.mirantis.murano.windows.activeDirectory.ActiveDirectory",
        "type": "Application",
        "owner_id": "fed57567c9fa42c192dcbe0566f8ea40"
    }

**Response 403**

*  An attempt to update immutable fields
*  An attempt to perform operation that is not allowed on the specified path
*  An attempt to update non-public package by user whose project is not an owner of this package

**Response 404**

* An attempt to update package that doesn't exist


Delete application definition from the catalog
----------------------------------------------

`/v1/catalog/packages/{id} [DELETE]`

**Parameters**

* ``id`` (required)  Hexadecimal `id` (or fully qualified name) of the package to delete

**Response 404**

* An attempt to delete package that doesn't exist


Get application package
-----------------------

`/v1/catalog/packages/{id}/download [GET]`

Get application definition package

**Parameters**

* ``id`` (required)  Hexadecimal `id` (or fully qualified name) of the package

**Response 200 (application/octet-stream)**

The sequence of bytes representing package content

**Response 404**

Specified package id doesn't exist


Get UI definition
-----------------

`/v1/catalog/packages/{id}/ui [GET]`

Retrieve UI definition for an application which described in a package with provided id

**Parameters**

* ``id`` (required)  Hexadecimal `id` (or fully qualified name) of the package

**Response 200 (application/octet-stream)**

The sequence of bytes representing UI definition

**Response 404**

Specified package id doesn't exist

**Response 403**

Specified package is not public and not owned by user project, performing the request

**Response 404**

* Specified package id doesn't exist


Get logo
--------

Retrieve application logo which described in a package with provided id

`/v1/catalog/packages/{id}/logo [GET]`

**Parameters**

``id`` (required)  Hexadecimal `id` (or fully qualified name) of the package

**Response 200 (application/octet-stream)**

The sequence of bytes representing application logo

**Response 403**

Specified package is not public and not owned by user project,
performing the request

**Response 404**

Specified package is not public and not owned by user project,
performing the request

Categories
==========

Provides category management. Categories are used in the Application Catalog
to group application for easy browsing and search.

List categories
---------------

* `/v1/catalog/packages/categories [GET]`

 !DEPRECATED (Plan to remove in L release) Retrieve list of all available application categories

 **Response 200 (application/json)**

 A list, containing category names

 *Content-Type*
  application/json

 ::

        {
            "categories": ["Web service", "Directory", "Database", "Storage"]
        }


* `/v1/catalog/categories [GET]`

 +----------+------------------------------+---------------------------------+
 | Method   | URI                          | Description                     |
 +==========+==============================+=================================+
 | GET      | /catalog/categories          | Get list of existing categories |
 +----------+------------------------------+---------------------------------+

 Retrieve list of all available application categories

 **Response 200 (application/json)**

 A list, containing detailed information about each category

 *Content-Type*
  application/json

 ::

        {"categories": [
            {
                "id": "0420045dce7445fabae7e5e61fff9e2f",
                "updated": "2014-12-26T13:57:04",
                "name": "Web",
                "created": "2014-12-26T13:57:04",
                "package_count": 1
            },
            {
                "id": "3dd486b1e26f40ac8f35416b63f52042",
                "updated": "2014-12-26T13:57:04",
                "name": "Databases",
                "created": "2014-12-26T13:57:04",
                "package_count": 0
            }]
        }



Get category details
--------------------

`/catalog/categories/<category_id> [GET]`

 Return detailed information for a provided category

*Request*

+----------+-----------------------------------+-----------------------------+
| Method   | URI                               | Description                 |
+==========+===================================+=============================+
| GET      | /catalog/categories/<category_id> | Get category detail         |
+----------+-----------------------------------+-----------------------------+

*Parameters*

* ``category_id`` - required, category ID, required

*Response*

 *Content-Type*
   application/json

::

    {
        "id": "b308f7fa8a2f4a5eb419970c827f4466",
        "updated": "2015-01-28T17:00:19",
        "packages": [
            {
                "fully_qualified_name": "io.murano.apps.ZabbixServer",
                "id": "4dfb566e69e6445fbd4aea5099fe95e9",
                "name": "Zabbix Server"
            }
        ],
        "name": "Web",
        "created": "2015-01-28T17:00:19",
        "package_count": 1
    }

+----------------+-----------------------------------------------------------+
| Code           | Description                                               |
+================+===========================================================+
| 200            | OK. Category deleted successfully                         |
+----------------+-----------------------------------------------------------+
| 401            | User is not authorized to access this session             |
+----------------+-----------------------------------------------------------+
| 404            | Not found. Specified category doesn`t exist               |
+----------------+-----------------------------------------------------------+

Add new category
----------------

`/catalog/categories [POST]`

 Add new category to the Application Catalog

*Parameters*

+----------------------+------------+----------------------------------------+
| Attribute            | Type       | Description                            |
+======================+============+========================================+
| name                 | string     | Environment name; only alphanumeric    |
|                      |            | characters and '-'                     |
+----------------------+------------+----------------------------------------+

*Request*

+----------+----------------------------------+------------------------------+
| Method   | URI                              | Description                  |
+==========+==================================+==============================+
| POST     | /catalog/categories              | Create new category          |
+----------+----------------------------------+------------------------------+

 *Content-Type*
  application/json

 *Example*
  {"name": "category_name"}

*Response*

::

    {
        "id": "ce373a477f211e187a55404a662f968",
        "name": "category_name",
        "created": "2013-11-30T03:23:42Z",
        "updated": "2013-11-30T03:23:44Z",
        "package_count": 0
    }


+----------------+-----------------------------------------------------------+
| Code           | Description                                               |
+================+===========================================================+
| 200            | OK. Category created successfully                         |
+----------------+-----------------------------------------------------------+
| 401            | User is not authorized to access this session             |
+----------------+-----------------------------------------------------------+
| 409            | Conflict. Category with specified name already exist      |
+----------------+-----------------------------------------------------------+


Delete category
---------------

`/catalog/categories [DELETE]`

*Request*

+----------+-----------------------------------+-----------------------------+
| Method   | URI                               | Description                 |
+==========+===================================+=============================+
| DELETE   | /catalog/categories/<category_id> | Delete category with        |
|          |                                   | specified ID                |
+----------+-----------------------------------+-----------------------------+

*Parameters:*

* ``category_id`` - required, category ID, required

*Response*

+----------------+-----------------------------------------------------------+
| Code           | Description                                               |
+================+===========================================================+
| 200            | OK. Category deleted successfully                         |
+----------------+-----------------------------------------------------------+
| 401            | User is not authorized to access this session             |
+----------------+-----------------------------------------------------------+
| 404            | Not found. Specified category doesn`t exist               |
+----------------+-----------------------------------------------------------+
| 403            | Forbidden. Category with specified name is assigned to    |
|                | the package, presented in the catalog                     |
+----------------+-----------------------------------------------------------+