Add packages to api-ref

This patch add the packages api to api-ref

Change-Id: I1693d444f1bc8bd15e1e1d1eda81d018733771e6
Partially-Implements: blueprint murano-api-ref
This commit is contained in:
zhurong 2017-04-06 17:29:52 +08:00
parent cafb0d598e
commit 2f27932027
7 changed files with 775 additions and 0 deletions

View File

@ -0,0 +1,380 @@
.. -*- rst -*-
========
Packages
========
List Packages
=============
.. rest_method:: GET /v1/catalog/packages
Get a list of packages
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 200
.. rest_status_code:: error status.yaml
- 400
- 401
- 500
Request Parameters
------------------
.. rest_parameters:: parameters.yaml
- catalog: catalog
- marker: marker
- limit: limit
- order_by: order_by
- type: pkg_type_query
- category: category
- fqn: fqn
- owned: owned
- id: pkg_id_query
- include_disabled: include_disabled
- search: search
- class_name: class_name
- name: pkg_name_query
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- X-Openstack-Request-Id: request_id
- packages: packages
- updated: updated
- class_definitions: class_definitions
- id: pkg_id
- fully_qualified_name: fully_qualified_name
- is_public: is_public
- name: pkg_name
- type: pkg_type
- supplier: pkg_supplier
- description: description
- author: author
- created: created
- enabled: enabled
- tags: tags
- categories: categories
- owner_id: owner_id
Response Example
----------------
.. literalinclude:: samples/packages-list-response.json
:language: javascript
Upload package
==============
.. rest_method:: POST /v1/catalog/packages
Create a package.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 200
.. rest_status_code:: error status.yaml
- 400
- 401
- 409
Request Parameters
------------------
.. rest_parameters:: parameters.yaml
- categories: categories
- is_public: is_public
- file: pkg_file
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- X-Openstack-Request-Id: request_id
- updated: updated
- class_definitions: class_definitions
- id: pkg_id
- fully_qualified_name: fully_qualified_name
- is_public: is_public
- name: pkg_name
- type: pkg_type
- supplier: pkg_supplier
- description: description
- author: author
- created: created
- enabled: enabled
- tags: tags
- categories: categories
- owner_id: owner_id
Response Example
----------------
.. literalinclude:: samples/package-create-response.json
:language: javascript
Show package details
====================
.. rest_method:: GET /v1/catalog/packages/{id}
Shows details for a package.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 200
.. rest_status_code:: error status.yaml
- 400
- 401
- 404
- 500
Request Parameters
------------------
.. rest_parameters:: parameters.yaml
- id: pkg_id_url
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- X-Openstack-Request-Id: request_id
- updated: updated
- class_definitions: class_definitions
- id: pkg_id
- fully_qualified_name: fully_qualified_name
- is_public: is_public
- name: pkg_name
- type: pkg_type
- supplier: pkg_supplier
- description: description
- author: author
- created: created
- enabled: enabled
- tags: tags
- categories: categories
- owner_id: owner_id
Response Example
----------------
.. literalinclude:: samples/package-show-response.json
:language: javascript
Update package
==============
.. rest_method:: PATCH /v1/catalog/packages/{id}
Update a package.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 202
.. rest_status_code:: error status.yaml
- 400
- 403
- 404
- 409
- 500
Request Parameters
------------------
.. rest_parameters:: parameters.yaml
- id: pkg_id_url
Request Example
---------------
.. literalinclude:: samples/package-update-request.json
:language: javascript
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- X-Openstack-Request-Id: request_id
- updated: updated
- class_definitions: class_definitions
- id: pkg_id
- fully_qualified_name: fully_qualified_name
- is_public: is_public
- name: pkg_name
- type: pkg_type
- supplier: pkg_supplier
- description: description
- author: author
- created: created
- enabled: enabled
- tags: tags
- categories: categories
- owner_id: owner_id
Response Example
----------------
.. literalinclude:: samples/package-update-response.json
Delete package
==============
.. rest_method:: DELETE /v1/catalog/packages/{id}
Remove specified Environment.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 200
.. rest_status_code:: error status.yaml
- 403
- 404
- 500
Request Parameters
------------------
.. rest_parameters:: parameters.yaml
- id: pkg_id_url
Response Parameters
-------------------
This request does not return anything in the response body.
:language: javascript
Download package
================
.. rest_method:: GET /v1/catalog/packages/{id}/download
Download a package.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 200
.. rest_status_code:: error status.yaml
- 400
- 401
- 500
Request Parameters
------------------
.. rest_parameters:: parameters.yaml
- id: pkg_id_url
Response Parameters
-------------------
This request does not return anything in the response body.
:language: javascript
Get UI definition
=================
.. rest_method:: GET /v1/catalog/packages/{id}/ui
Retrieve UI definition for a application.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 200
.. rest_status_code:: error status.yaml
- 400
- 401
- 500
Request Parameters
------------------
.. rest_parameters:: parameters.yaml
- id: pkg_id_url
Response Parameters
-------------------
This request does not return anything in the response body.
:language: javascript
Get logo
========
.. rest_method:: GET /v1/catalog/packages/{id}/logo
Retrieve application logo.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 200
.. rest_status_code:: error status.yaml
- 400
- 401
- 500
Request Parameters
------------------
.. rest_parameters:: parameters.yaml
- id: pkg_id_url
Response Parameters
-------------------
This request does not return anything in the response body.
:language: javascript

View File

@ -35,6 +35,12 @@ env_name_update:
in: path
required: true
type: string
pkg_id_url:
description: |
The UUID of the package.
in: path
required: true
type: string
all_tenants:
description: |
Indicates whether environments from all projects are listed.
@ -45,6 +51,114 @@ all_tenants:
required: false
default: false
type: boolean
catalog:
description: |
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).
in: query
required: false
default: false
type: boolean
category:
description: |
Allows to filter by categories.
in: query
required: false
type: string
class_name:
description: |
Search only for packages, that use specified class.
in: query
required: false
type: string
fqn:
description: |
Allows to filter by fully qualified name.
in: query
required: false
type: string
include_disabled:
description: |
Include disabled packages in the result.
in: query
required: false
default: false
type: boolean
limit:
description: |
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.
in: query
required: false
type: string
marker:
description: |
A package identifier marker may be specified. When present only
packages which occur after the identifier ID will be listed
in: query
required: false
type: string
order_by:
description: |
Allows to sort packages by ``fqn``, ``name``, ``created``.
Created is default value.
in: query
required: false
type: string
owned:
description: |
Search only from packages owned by current project.
in: query
required: false
default: false
type: boolean
pkg_id_query:
description: |
Allows to filter by package id.
in: query
required: false
type: string
pkg_name_query:
description: |
Allows to filter by package name.
in: query
required: false
type: string
pkg_type_query:
description: |
Allows to filter package by type, e.g. ``application``, ``library``.
in: query
required: false
type: string
search:
description: |
Gives opportunity to search specified data by all the
package parameters and order packages.
in: query
required: false
type: string
author:
description: |
The author of the package.
in: body
required: true
type: string
categories:
description: |
The categories of the package.
in: body
required: true
type: array
class_definitions:
description: |
The class_definitions of the package.
in: body
required: true
type: array
created:
description: |
The date and time when the resource was created. The date and time stamp
@ -61,6 +175,18 @@ created:
in: body
required: true
type: string
description:
description: |
The description of the package.
in: body
required: true
type: string
enabled:
description: |
Whether the package is browsed in the Application Catalog.
in: body
required: true
type: boolean
env_default_networks:
description: |
The default networks of the environment.
@ -117,6 +243,18 @@ environments:
in: body
required: true
type: array
fully_qualified_name:
description: |
The fqn of the package.
in: body
required: true
type: string
is_public:
description: |
Whether the package is shared for other projects.
in: body
required: true
type: boolean
last_status_uuid:
description: |
A list of environment last status object.
@ -129,6 +267,48 @@ networking:
in: body
required: true
type: string
owner_id:
description: |
The owner id of the package.
in: body
required: true
type: string
packages:
description: |
A list of ``package`` object.
in: body
required: true
type: array
pkg_file:
description: |
The upload package file.
in: body
required: true
type: object
pkg_id:
description: |
The UUID of the package.
in: body
required: true
type: string
pkg_name:
description: |
The name of the package.
in: body
required: true
type: string
pkg_supplier:
description: |
The supplier info of the package.
in: body
required: true
type: object
pkg_type:
description: |
The type of the package.
in: body
required: true
type: string
regions:
description: |
The regions detail of the cloud.
@ -141,6 +321,12 @@ services:
in: body
required: true
type: array
tags:
description: |
The tags of the package.
in: body
required: true
type: array
tenant_id:
description: |
The UUID of the tenant. A tenant is also known as

View File

@ -0,0 +1,25 @@
{
"class_definitions": [
"com.example.apache.ApacheHttpServer"
],
"description": "The Apache HTTP Server Project is an effort to develop and maintain an\nopen-source HTTP server for modern operating systems including UNIX and\nWindows NT. The goal of this project is to provide a secure, efficient and\nextensible server that provides HTTP services in sync with the current HTTP\nstandards.\nApache httpd has been the most popular web server on the Internet since\nApril 1996, and celebrated its 17th birthday as a project this February.\n",
"tags": [
"HTTP",
"Server",
"WebServer",
"HTML",
"Apache"
],
"updated": "2017-04-06T07:54:40",
"is_public": false,
"id": "10f3e349bca9432abd673319195eed2b",
"categories": [],
"name": "Apache HTTP Server",
"created": "2017-04-06T07:54:40",
"author": "Mirantis, Inc",
"enabled": true,
"supplier": {},
"fully_qualified_name": "com.example.apache.ApacheHttpServer",
"type": "Application",
"owner_id": "c0f6e4cf1bfc48aba587e709b58c9f28"
}

View File

@ -0,0 +1,25 @@
{
"updated": "2017-04-06T08:22:11",
"description": "The Apache HTTP Server Project is an effort to develop and maintain an\nopen-source HTTP server for modern operating systems including UNIX and\nWindows NT. The goal of this project is to provide a secure, efficient and\nextensible server that provides HTTP services in sync with the current HTTP\nstandards.\nApache httpd has been the most popular web server on the Internet since\nApril 1996, and celebrated its 17th birthday as a project this February.\n",
"tags": [
"HTTP",
"Server",
"WebServer",
"HTML",
"Apache"
],
"class_definitions": [
"com.example.apache.ApacheHttpServer"
],
"is_public": false,
"categories": [],
"name": "Apache HTTP Server",
"created": "2017-04-06T08:22:11",
"author": "Mirantis, Inc",
"enabled": true,
"id": "979637f39a7245cebeabc99e6aa01666",
"supplier": {},
"fully_qualified_name": "com.example.apache.ApacheHttpServer",
"type": "Application",
"owner_id": "c0f6e4cf1bfc48aba587e709b58c9f28"
}

View File

@ -0,0 +1,7 @@
[
{
"path": "/is_public",
"value": true,
"op": "replace"
}
]

View File

@ -0,0 +1,25 @@
{
"updated": "2017-04-06T08:28:22",
"description": "The Apache HTTP Server Project is an effort to develop and maintain an\nopen-source HTTP server for modern operating systems including UNIX and\nWindows NT. The goal of this project is to provide a secure, efficient and\nextensible server that provides HTTP services in sync with the current HTTP\nstandards.\nApache httpd has been the most popular web server on the Internet since\nApril 1996, and celebrated its 17th birthday as a project this February.\n",
"tags": [
"HTTP",
"Server",
"WebServer",
"HTML",
"Apache"
],
"class_definitions": [
"com.example.apache.ApacheHttpServer"
],
"is_public": true,
"categories": [],
"name": "Apache HTTP Server",
"created": "2017-04-06T08:22:11",
"author": "Mirantis, Inc",
"enabled": true,
"id": "979637f39a7245cebeabc99e6aa01666",
"supplier": {},
"fully_qualified_name": "com.example.apache.ApacheHttpServer",
"type": "Application",
"owner_id": "c0f6e4cf1bfc48aba587e709b58c9f28"
}

View File

@ -0,0 +1,127 @@
{
"packages": [
{
"updated": "2017-03-30T08:35:03",
"description": "Library of base class to develop scalable Applications with MuranoPL\n",
"tags": [],
"class_definitions": [
"io.murano.applications.tests.TestPoolReplicaProvider",
"io.murano.applications.SingleServerApplication",
"io.murano.applications.tests.TestSoftwareComponent",
"io.murano.applications.SoftwareComponent",
"io.murano.applications.tests.TestEvents",
"io.murano.applications.CloneReplicaProvider",
"io.murano.applications.PoolReplicaProvider",
"io.murano.applications.Event",
"io.murano.applications.SingleServerGroup",
"io.murano.applications.TemplateServerProvider",
"io.murano.applications.MultiServerApplication",
"io.murano.applications.ReplicationGroup",
"io.murano.applications.OpenStackSecurityConfigurable",
"io.murano.applications.Configurable",
"io.murano.applications.tests.TestMockedServerFactory",
"io.murano.applications.tests.TestCompositeReplicaProvider",
"io.murano.applications.tests.TestRoundrobinReplicaProvider",
"io.murano.applications.ServerReplicationGroup",
"io.murano.applications.CompositeReplicaProvider",
"io.murano.applications.tests.TestReplication",
"io.murano.applications.CompositeServerGroup",
"io.murano.applications.RoundrobinReplicaProvider",
"io.murano.applications.ServerGroup",
"io.murano.applications.ServerList",
"io.murano.applications.Installable",
"io.murano.applications.ReplicaProvider",
"io.murano.applications.MultiServerApplicationWithScaling"
],
"is_public": true,
"categories": [],
"name": "Application Development Library",
"created": "2017-03-30T08:35:03",
"author": "Mirantis, Inc.",
"enabled": true,
"id": "b0298c205235410fba047f4af8df0eb0",
"supplier": {},
"fully_qualified_name": "io.murano.applications",
"type": "Library",
"owner_id": "c0f6e4cf1bfc48aba587e709b58c9f28"
},
{
"updated": "2017-03-30T08:35:07",
"description": "Core MuranoPL library\n",
"tags": [
"MuranoPL"
],
"class_definitions": [
"io.murano.Exception",
"io.murano.system.MetadefBrowser",
"io.murano.metadata.forms.Hidden",
"io.murano.system.NeutronSecurityGroupManager",
"io.murano.system.AgentListener",
"io.murano.Environment",
"io.murano.system.SecurityGroupManager",
"io.murano.resources.ConfLangInstance",
"io.murano.resources.HeatSWConfigLinuxInstance",
"io.murano.test.TestFixture",
"io.murano.resources.MetadataAware",
"io.murano.SharedIp",
"io.murano.File",
"io.murano.resources.LinuxUDInstance",
"io.murano.configuration.Linux",
"io.murano.resources.ExistingNeutronNetwork",
"io.murano.resources.LinuxMuranoInstance",
"io.murano.Object",
"io.murano.system.Logger",
"io.murano.metadata.engine.Synchronize",
"io.murano.test.DummyNetwork",
"io.murano.resources.CinderVolume",
"io.murano.metadata.Title",
"io.murano.Project",
"io.murano.system.Resources",
"io.murano.metadata.forms.Section",
"io.murano.resources.Network",
"io.murano.system.MistralClient",
"io.murano.resources.CinderVolumeBackup",
"io.murano.system.NetworkExplorer",
"io.murano.system.DummySecurityGroupManager",
"io.murano.resources.WindowsInstance",
"io.murano.CloudResource",
"io.murano.CloudRegion",
"io.murano.system.Agent",
"io.murano.resources.Instance",
"io.murano.resources.Volume",
"io.murano.system.InstanceNotifier",
"io.murano.metadata.ModelBuilder",
"io.murano.system.HeatStack",
"io.murano.resources.LinuxInstance",
"io.murano.metadata.Description",
"io.murano.metadata.engine.Serialize",
"io.murano.resources.ExistingCinderVolume",
"io.murano.resources.HeatSWConfigInstance",
"io.murano.system.StatusReporter",
"io.murano.Application",
"io.murano.test.TestFixtureWithEnvironment",
"io.murano.system.AwsSecurityGroupManager",
"io.murano.StackTrace",
"io.murano.resources.NovaNetwork",
"io.murano.metadata.forms.Position",
"io.murano.metadata.HelpText",
"io.murano.resources.NeutronNetworkBase",
"io.murano.User",
"io.murano.resources.InstanceAffinityGroup",
"io.murano.resources.NeutronNetwork",
"io.murano.resources.CinderVolumeSnapshot"
],
"is_public": true,
"categories": [],
"name": "Core library",
"created": "2017-03-30T08:35:07",
"author": "murano.io",
"enabled": true,
"id": "5b6c8d7cd0694a7ebb7525ae62357740",
"supplier": {},
"fully_qualified_name": "io.murano",
"type": "Library",
"owner_id": "c0f6e4cf1bfc48aba587e709b58c9f28"
}
]
}