Add an API reference

This patch adds an API reference which follows the API documentation
guide[1].

[1] https://docs.openstack.org/doc-contrib-guide/api-guides.html

Partial-Bug: #1721489
Partial-Bug: #1703268
Change-Id: Iddcc2e2d40874895cedaca68b8ce9cafa6228deb
This commit is contained in:
Hiroaki Kobayashi 2017-12-25 15:41:09 +09:00 committed by Masahito Muroi
parent 3c4f0644bd
commit 5b32c729e7
14 changed files with 1447 additions and 1 deletions

133
api-ref/source/conf.py Normal file
View File

@ -0,0 +1,133 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Blazar API reference build configuration file, created by
# sphinx-quickstart on Mon Oct 2 14:47:19 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
extensions = [
'os_api_ref',
'openstackdocstheme'
]
html_theme = 'openstackdocs'
html_theme_options = {
"sidebar_mode": "toc",
}
html_context = {'bug_project': 'blazar', 'bug_tag': 'api-ref'}
# Must set this variable to include year, month, day, hours, and minutes.
html_last_updated_fmt = '%Y-%m-%d %H:%M'
# -- General configuration ------------------------------------------------
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = u'Reservation API Reference'
copyright = u'2017-present, OpenStack Foundation'
author = u'OpenStack Foundation'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = []
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False
# -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
# html_theme = 'alabaster'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
# html_static_path = ['_static']
# -- Options for HTMLHelp output ------------------------------------------
# Output file base name for HTML help builder.
htmlhelp_basename = 'blazardoc'
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'ReservationAPIReference.tex', u'OpenStack Reservation API Reference Documentation',
u'OpenStack Foundation', 'manual'),
]

7
api-ref/source/index.rst Normal file
View File

@ -0,0 +1,7 @@
Reservation API Reference
=========================
.. toctree::
:maxdepth: 2
v1/index

View File

@ -0,0 +1,7 @@
.. -*- rst -*-
=====
Hosts
=====
TBD

View File

@ -0,0 +1,11 @@
:tocdepth: 2
==================
Reservation API V1
==================
This is a reference for the OpenStack Reservation API which is provided by the
Blazar project.
.. include:: leases.inc
.. include:: hosts.inc

View File

@ -0,0 +1,523 @@
.. -*- rst -*-
======
Leases
======
A date and time format for *\*_date* parameters is ``CCYY-MM-DD hh:mm``.
For example, ``2017-12-26 12:00``.
List Leases
===========
.. rest_method:: GET v1/leases
List leases.
**Response codes**
Normal response code: 200
Error response codes: Bad Request(400), Unauthorized(401), Forbidden(403),
Internal Server Error(500)
Request
-------
No body content, path, nor query option.
Response
--------
General Parameters
^^^^^^^^^^^^^^^^^^
.. rest_parameters:: parameters.yaml
- leases: leases
- id: lease_id
- name: lease_name
- start_date: lease_start_date_resp
- end_date: lease_end_date
- status: lease_status
- degraded: lease_degraded
- user_id: lease_user_id
- project_id: lease_project_id
- trust_id: lease_trust_id
- created_at: created_at
- updated_at: updated_at
- reservations: reservations
- reservation.id: reservation_id
- reservation.lease_id: reservation_lease_id
- reservation.status: reservation_status
- reservation.missing_resources: reservation_missing_resources
- reservation.resources_changed: reservation_resources_changed
- reservation.resource_id: reservation_resource_id
- reservation.resource_type: reservation_resource_type
- reservation.created_at: created_at
- reservation.updated_at: updated_at
- events: events
- event.id: event_id
- event.lease_id: event_lease_id
- event.status: event_status
- event.event_type: event_type
- event.time: event_time
- event.created_at: created_at
- event_updated_at: updated_at
Parameters for Host Reservation
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The following parameters are returned for host reservation. All parameters
are in the ``reservation`` object.
.. rest_parameters:: parameters.yaml
- reservation.min: reservation_min
- reservation.max: reservation_max
- reservation.hypervisor_properties: reservation_hypervisor_properties
- reservation.resource_properties: reservation_resource_properties
- reservation.before_end: reservation_before_end
Parameters for Instance Reservation
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The following parameters are returned for instance reservation. All parameters
are in the ``reservation`` object.
.. rest_parameters:: parameters.yaml
- reservation.amount: reservation_amount
- reservation.vcpus: reservation_vcpus
- reservation.memory_mb: reservation_memory_mb
- reservation.disk_gb: reservation_disk_gb
- reservation.affinity : reservation_affinity
- reservation.flavor_id: reservation_flavor_id
- reservation.server_group_id: reservation_server_group_id
- reservation.aggregate_id: reservation_aggregate_id
**Example of List Leases Response**
.. literalinclude:: ../../../doc/api_samples/leases/lease-list-resp.json
:language: javascript
Create Lease
============
.. rest_method:: POST v1/leases
Create a lease.
**Response codes**
Normal response code: 200
Error response codes: Bad Request(400), Unauthorized(401), Forbidden(403),
Conflict(409), Internal Server Error(500)
Request
-------
General Parameters
^^^^^^^^^^^^^^^^^^
.. rest_parameters:: parameters.yaml
- name: lease_name
- start_date: lease_start_date
- end_date: lease_end_date
- before_end_date: lease_before_end_date_optional
- reservations: reservations
- reservation.resource_type: reservation_resource_type
- events: events_optional
Parameters for Host Reservation
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The following parameters are required for host reservation. All parameters
are in the ``reservation`` object.
.. rest_parameters:: parameters.yaml
- reservation.min: reservation_min
- reservation.max: reservation_max
- reservation.hypervisor_properties: reservation_hypervisor_properties
- reservation.resource_properties: reservation_resource_properties
- reservation.before_end: reservation_before_end_optional
Parameters for Instance Reservation
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The following parameters are required for instance reservation. All parameters
are in the ``reservation`` object.
.. rest_parameters:: parameters.yaml
- reservation.amount: reservation_amount
- reservation.vcpus: reservation_vcpus
- reservation.memory_mb: reservation_memory_mb
- reservation.disk_gb: reservation_disk_gb
- reservation.affinity : reservation_affinity
**Example of Create Lease Request**
.. literalinclude:: ../../../doc/api_samples/leases/lease-create-req.json
:language: javascript
Response
--------
General Parameters
^^^^^^^^^^^^^^^^^^
.. rest_parameters:: parameters.yaml
- lease: lease
- id: lease_id
- name: lease_name
- start_date: lease_start_date_resp
- end_date: lease_end_date
- status: lease_status
- degraded: lease_degraded
- user_id: lease_user_id
- project_id: lease_project_id
- trust_id: lease_trust_id
- created_at: created_at
- updated_at: updated_at
- reservations: reservations
- reservation.id: reservation_id
- reservation.lease_id: reservation_lease_id
- reservation.status: reservation_status
- reservation.missing_resources: reservation_missing_resources
- reservation.resources_changed: reservation_resources_changed
- reservation.resource_id: reservation_resource_id
- reservation.resource_type: reservation_resource_type
- reservation.created_at: created_at
- reservation.updated_at: updated_at
- events: events
- event.id: event_id
- event.lease_id: event_lease_id
- event.status: event_status
- event.event_type: event_type
- event.time: event_time
- event.created_at: created_at
- event_updated_at: updated_at
Parameters for Host Reservation
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The following parameters are returned for host reservation. All parameters
are in the ``reservation`` object.
.. rest_parameters:: parameters.yaml
- reservation.min: reservation_min
- reservation.max: reservation_max
- reservation.hypervisor_properties: reservation_hypervisor_properties
- reservation.resource_properties: reservation_resource_properties
- reservation.before_end: reservation_before_end
Parameters for Instance Reservation
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The following parameters are returned for instance reservation. All parameters
are in the ``reservation`` object.
.. rest_parameters:: parameters.yaml
- reservation.amount: reservation_amount
- reservation.vcpus: reservation_vcpus
- reservation.memory_mb: reservation_memory_mb
- reservation.disk_gb: reservation_disk_gb
- reservation.affinity : reservation_affinity
- reservation.flavor_id: reservation_flavor_id
- reservation.server_group_id: reservation_server_group_id
- reservation.aggregate_id: reservation_aggregate_id
**Example of Create Lease Response**
.. literalinclude:: ../../../doc/api_samples/leases/lease-create-resp.json
:language: javascript
Show Lease Details
==================
.. rest_method:: GET v1/leases/{lease_id}
Show details of a lease.
**Preconditions**
The lease must exist.
**Response codes**
Normal response code: 200
Error response codes: Bad Request(400), Unauthorized(401), Forbidden(403),
Not Found(404), Internal Server Error(500)
Request
-------
.. rest_parameters:: parameters.yaml
- lease_id: lease_id_path
Response
--------
General Parameters
^^^^^^^^^^^^^^^^^^
.. rest_parameters:: parameters.yaml
- lease: lease
- id: lease_id
- name: lease_name
- start_date: lease_start_date_resp
- end_date: lease_end_date
- status: lease_status
- degraded: lease_degraded
- user_id: lease_user_id
- project_id: lease_project_id
- trust_id: lease_trust_id
- created_at: created_at
- updated_at: updated_at
- reservations: reservations
- reservation.id: reservation_id
- reservation.lease_id: reservation_lease_id
- reservation.status: reservation_status
- reservation.missing_resources: reservation_missing_resources
- reservation.resources_changed: reservation_resources_changed
- reservation.resource_id: reservation_resource_id
- reservation.resource_type: reservation_resource_type
- reservation.created_at: created_at
- reservation.updated_at: updated_at
- events: events
- event.id: event_id
- event.lease_id: event_lease_id
- event.status: event_status
- event.event_type: event_type
- event.time: event_time
- event.created_at: created_at
- event_updated_at: updated_at
Parameters for Host Reservation
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The following parameters are returned for host reservation. All parameters
are in the ``reservation`` object.
.. rest_parameters:: parameters.yaml
- reservation.min: reservation_min
- reservation.max: reservation_max
- reservation.hypervisor_properties: reservation_hypervisor_properties
- reservation.resource_properties: reservation_resource_properties
- reservation.before_end: reservation_before_end
Parameters for Instance Reservation
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The following parameters are returned for instance reservation. All parameters
are in the ``reservation`` object.
.. rest_parameters:: parameters.yaml
- reservation.amount: reservation_amount
- reservation.vcpus: reservation_vcpus
- reservation.memory_mb: reservation_memory_mb
- reservation.disk_gb: reservation_disk_gb
- reservation.affinity : reservation_affinity
- reservation.flavor_id: reservation_flavor_id
- reservation.server_group_id: reservation_server_group_id
- reservation.aggregate_id: reservation_aggregate_id
**Example of Show Lease Details Response**
.. literalinclude:: ../../../doc/api_samples/leases/lease-details-resp.json
:language: javascript
Update Lease
============
.. rest_method:: PUT v1/leases/{lease_id}
Update a lease.
**Preconditions**
The lease must exist.
**Response codes**
Normal response codes: 200
Error response codes: Bad Request(400), Unauthorized(401), Forbidden(403), Not Found(404),
Conflict(409), Internal Server Error(500)
Request
-------
General Parameters
^^^^^^^^^^^^^^^^^^
.. rest_parameters:: parameters.yaml
- lease_id: lease_id_path
- name: lease_name_optional
- start_date: lease_start_date_optional
- end_date: lease_end_date_optional
- before_end_date: lease_before_end_date_optional
- reservations: reservations_optional
- reservation.id: reservation_id
Parameters for Host Reservation
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The following parameters are required for host reservation. All parameters
are in the ``reservation`` object.
.. rest_parameters:: parameters.yaml
- reservation.min: reservation_min_optional
- reservation.max: reservation_max_optional
- reservation.hypervisor_properties: reservation_hypervisor_properties_optional
- reservation.resource_properties: reservation_resource_properties_optional
- reservation.before_end: reservation_before_end_optional
Parameters for Instance Reservation
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The following parameters are required for instance reservation. All parameters
are in the ``reservation`` object.
.. rest_parameters:: parameters.yaml
- reservation.amount: reservation_amount_optional
- reservation.vcpus: reservation_vcpus_optional
- reservation.memory_mb: reservation_memory_mb_optional
- reservation.disk_gb: reservation_disk_gb_optional
- reservation.affinity : reservation_affinity_optional
**Example of Update Lease Request**
.. literalinclude:: ../../../doc/api_samples/leases/lease-update-req.json
:language: javascript
Response
--------
General Parameters
^^^^^^^^^^^^^^^^^^
.. rest_parameters:: parameters.yaml
- lease: lease
- id: lease_id
- name: lease_name
- start_date: lease_start_date_resp
- end_date: lease_end_date
- status: lease_status
- degraded: lease_degraded
- user_id: lease_user_id
- project_id: lease_project_id
- trust_id: lease_trust_id
- created_at: created_at
- updated_at: updated_at
- reservations: reservations
- reservation.id: reservation_id
- reservation.lease_id: reservation_lease_id
- reservation.status: reservation_status
- reservation.missing_resources: reservation_missing_resources
- reservation.resources_changed: reservation_resources_changed
- reservation.resource_id: reservation_resource_id
- reservation.resource_type: reservation_resource_type
- reservation.created_at: created_at
- reservation.updated_at: updated_at
- events: events
- event.id: event_id
- event.lease_id: event_lease_id
- event.status: event_status
- event.event_type: event_type
- event.time: event_time
- event.created_at: created_at
- event_updated_at: updated_at
Parameters for Host Reservation
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The following parameters are returned for host reservation. All parameters
are in the ``reservation`` object.
.. rest_parameters:: parameters.yaml
- reservation.min: reservation_min
- reservation.max: reservation_max
- reservation.hypervisor_properties: reservation_hypervisor_properties
- reservation.resource_properties: reservation_resource_properties
- reservation.before_end: reservation_before_end
Parameters for Instance Reservation
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The following parameters are returned for instance reservation. All parameters
are in the ``reservation`` object.
.. rest_parameters:: parameters.yaml
- reservation.amount: reservation_amount
- reservation.vcpus: reservation_vcpus
- reservation.memory_mb: reservation_memory_mb
- reservation.disk_gb: reservation_disk_gb
- reservation.affinity : reservation_affinity
- reservation.flavor_id: reservation_flavor_id
- reservation.server_group_id: reservation_server_group_id
- reservation.aggregate_id: reservation_aggregate_id
**Example of Update Lease Response**
.. literalinclude:: ../../../doc/api_samples/leases/lease-update-resp.json
:language: javascript
Delete Lease
============
.. rest_method:: DELETE v1/leases/{lease_id}
Delete a lease.
**Preconditions**
The lease must exist.
**Response codes**
Normal response codes: 200
Error response codes: Bad Request(400), Unauthorized(401), Forbidden(403), Not Found(404),
Conflict(409), Internal Server Error(500)
Request
-------
.. rest_parameters:: parameters.yaml
- lease_id: lease_id_path
Response
--------
No body content is returned on a successful DELETE.

View File

@ -0,0 +1,391 @@
# variables in path
lease_id_path:
description: |
The UUID of the lease.
in: path
required: true
type: string
# variables in body
created_at:
description: |
The date and time when the object was created.
in: body
required: true
type: string
event:
description: |
An ``event`` object.
in: body
required: true
type: object
event_id:
description: |
The UUID of the event.
in: body
required: true
type: string
event_lease_id:
description: |
The UUID of the lease to which the event belongs.
in: body
required: true
type: string
event_status:
description: |
The status of the event.
in: body
required: true
type: string
event_time:
description: |
The date and time of the event.
in: body
required: true
type: string
event_type:
description: |
The type of the event.
in: body
required: true
type: string
events:
description: |
A list of ``event`` objects.
in: body
required: true
type: array
events_optional:
description: |
A list of ``event`` objects.
in: body
required: false
type: array
lease:
description: |
A ``lease`` object.
in: body
required: true
type: object
lease_before_end_date:
description: |
The date and time for the before-end-action of the lease.
in: body
required: true
type: string
lease_before_end_date_optional:
description: |
The date and time for the before-end-action of the lease.
in: body
required: false
type: string
lease_degraded:
description: |
The flag for reserved resources of the lease.
This is set True while *missing_resources* or *resources_changed* of
reservations is set True.
in: body
required: true
type: boolean
lease_end_date:
description: |
The end date and time of the lease.
in: body
required: true
type: string
lease_end_date_optional:
description: |
The end date and time of the lease.
in: body
required: false
type: string
lease_id:
description: |
The UUID of the lease.
in: body
required: true
type: string
lease_name:
description: |
The name of the lease.
in: body
required: true
type: string
lease_name_optional:
description: |
The name of the lease.
in: body
required: false
type: string
lease_project_id:
description: |
The UUID the project which owns the lease.
in: body
required: true
type: string
lease_start_date:
description: |
The start date and time of the lease.
.. note:: If ``now`` is specified, the lease starts immediately.
in: body
required: true
type: string
lease_start_date_optional:
description: |
The start date and time of the lease.
.. note:: If ``now`` is specified, the lease starts immediately.
in: body
required: false
type: string
lease_start_date_resp:
description: |
The start date and time of the lease.
in: body
required: true
type: string
lease_status:
description: |
The status of the lease.
in: body
required: true
type: string
lease_trust_id:
description: |
The UUID of the trust of the lease owner.
in: body
required: true
type: string
lease_user_id:
description: |
The UUID of the lease owner.
in: body
required: true
type: string
leases:
description: |
A list of ``lease`` objects.
in: body
required: true
type: array
reservation:
description: |
A ``reservation`` object.
in: body
required: true
type: object
reservation_affinity:
description: |
The affinity of instances to reserve.
in: body
required: true
type: boolean
reservation_affinity_optional:
description: |
The affinity of instances to reserve.
in: body
required: false
type: boolean
reservation_aggregate_id:
description: |
The aggregate ID of the the reservation.
in: body
required: true
type: integer
reservation_amount:
description: |
The amount of instances to reserve.
in: body
required: true
type: integer
reservation_amount_optional:
description: |
The amount of instances to reserve.
in: body
required: false
type: integer
reservation_before_end:
description: |
The before-end-action of the reservation.
.. note:: ``default`` and ``snapshot`` actions are supported.
in: body
required: true
type: string
reservation_before_end_optional:
description: |
The before-end-action of the reservation.
.. note:: ``default`` and ``snapshot`` actions are supported.
in: body
required: false
type: string
reservation_disk_gb:
description: |
Gigabytes of the local disk per the instance.
in: body
required: true
type: string
reservation_disk_gb_optional:
description: |
Gigabytes of the local disk per the instance.
in: body
required: false
type: string
reservation_flavor_id:
description: |
The flavor ID used for launching instances on reserved resources.
in: body
required: true
type: string
reservation_hypervisor_properties:
description: |
Properties of the hypervisor to reserve.
in: body
required: true
type: string
reservation_hypervisor_properties_optional:
description: |
Properties of the hypervisor to reserve.
in: body
required: true
type: string
reservation_id:
description: |
The UUID of the reservation.
in: body
required: true
type: string
reservation_lease_id:
description: |
The UUID of the lease to which the reservation belongs.
in: body
required: true
type: string
reservation_max:
description: |
The maximum number of hosts to reserve.
in: body
required: true
type: integer
reservation_max_optional:
description: |
The maximum number of hosts to reserve.
in: body
required: false
type: integer
reservation_memory_mb:
description: |
Megabytes of memory per the instance.
in: body
required: true
type: integer
reservation_memory_mb_optional:
description: |
Megabytes of memory per the instance.
in: body
required: false
type: integer
reservation_min:
description: |
The minimum number of hosts to reserve.
in: body
required: true
type: integer
reservation_min_optional:
description: |
The minimum number of hosts to reserve.
in: body
required: false
type: integer
reservation_missing_resources:
description: |
The flag for the capacity of reserved resources.
It is set True while the amount of reserved resources is less than the
request.
in: body
required: true
type: boolean
reservation_resource_id:
description: |
The ID of the resource object of the reservation.
in: body
required: true
type: string
reservation_resource_properties:
description: |
Properties of the resource to reserve.
in: body
required: true
type: string
reservation_resource_properties_optional:
description: |
Properties of the resource to reserve.
in: body
required: false
type: string
reservation_resource_type:
description: |
The type of the resource to reserve.
.. note:: ``physical:host`` and ``virtual:instance`` types are supported.
in: body
required: true
type: string
reservation_resource_type_resp:
description: |
The type of the resource to reserve.
in: body
required: true
type: string
reservation_resources_changed:
description: |
The flag for changes of reserved resources.
If it is set True if reserved resources were changed after the lease
started.
in: body
required: true
type: boolean
reservation_server_group_id:
description: |
The server group ID specified when launch instances on reserved resources.
in: body
required: true
type: string
reservation_status:
description: |
The status of the reservation.
in: body
required: true
type: string
reservation_vcpus:
description: |
The number of VCPUs per the instance.
in: body
required: true
type: integer
reservation_vcpus_optional:
description: |
The number of VCPUs per the instance.
in: body
required: false
type: integer
reservations:
description: |
A list of ``reservation`` objects.
in: body
required: true
type: array
reservations_optional:
description: |
A list of ``reservation`` objects.
in: body
required: false
type: array
updated_at:
description: |
The date and time when the object was updated.
in: body
required: true
type: string

View File

@ -0,0 +1,25 @@
{
"name": "lease_foo",
"start_date": "2017-12-26 12:00",
"end_date": "2017-12-27 12:00",
"before_end_date": "2017-12-27 11:00",
"reservations": [
{
"resource_type": "physical:host",
"min": 4,
"max": 6,
"hypervisor_properties": "[\">=\", \"$vcpus\", \"4\"]",
"resource_properties": "",
"before_end": "default"
},
{
"resource_type": "virtual:instance",
"amount": 4,
"vcpus": 2,
"memory_mb": 4096,
"disk_gb": 100,
"affinity": false
}
],
"events": []
}

View File

@ -0,0 +1,81 @@
{
"lease": {
"id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
"name": "lease_foo",
"start_date": "2017-12-26T12:00:00.000000",
"end_date": "2017-12-27T12:00:00.000000",
"status":"PENDING",
"degraded": false,
"user_id": "5434f637520d4c17bbf254af034b0320",
"project_id": "aa45f56901ef45ee95e3d211097c0ea3",
"trust_id": "b442a580b9504ababf305bf2b4c49512",
"created_at": "2017-12-27 10:00:00",
"updated_at": null,
"reservations": [
{
"id": "087bc740-6d2d-410b-9d47-c7b2b55a9d36",
"lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
"status": "pending",
"missing_resources": false,
"resources_changed": false,
"resource_id": "5e6c0e6e-f1e6-490b-baaf-50deacbbe371",
"resource_type": "physical:host",
"min": 4,
"max": 6,
"hypervisor_properties": "[\">=\", \"$vcpus\", \"4\"]",
"resource_properties": "",
"before_end": "default",
"created_at": "2017-12-27 10:00:00",
"updated_at": null
},
{
"id": "ddc45423-f863-4e4e-8e7a-51d27cfec962",
"lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
"status": "pending",
"missing_resources": false,
"resources_changed": false,
"resource_id": "0b901727-cca2-43ed-bcc8-c21b0982dcb1",
"resource_type": "virtual:instance",
"amount": 4,
"vcpus": 2,
"memory_mb": 4096,
"disk_gb": 100,
"affinity": false,
"flavor_id": "ddc45423-f863-4e4e-8e7a-51d27cfec962",
"server_group_id": "33cdfc42-5a04-4fcc-b190-1abebaa056bb",
"aggregate_id": 11,
"created_at": "2017-12-27 10:00:00",
"updated_at": null
}
],
"events": [
{
"id": "188a8584-f832-4df9-9a4a-51e6364420ff"
"lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
"status": "UNDONE",
"event_type": "start_lease",
"time": "2017-12-26T12:00:00.000000",
"created_at": "2017-12-27 10:00:00",
"updated_at": null
},
{
"id": "277d6436-dfcb-4eae-ae5e-ac7fa9c2fd56",
"lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
"status": "UNDONE",
"event_type": "end_lease",
"time": "2017-12-27T12:00:00.000000",
"created_at": "2017-12-27 10:00:00",
"updated_at": null
},
{
"id": "f583af71-ca21-4b66-87de-52211d118029"
"lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
"status": "UNDONE",
"time": "2017-12-27T11:00:00.000000",
"event_type": "before_end_lease",
"created_at": "2017-12-27 10:00:00",
"updated_at": null
}
]
}
}

View File

@ -0,0 +1,81 @@
{
"lease": {
"id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
"name": "lease_foo",
"start_date": "2017-12-26T12:00:00.000000",
"end_date": "2017-12-27T12:00:00.000000",
"status":"PENDING",
"degraded": false,
"user_id": "5434f637520d4c17bbf254af034b0320",
"project_id": "aa45f56901ef45ee95e3d211097c0ea3",
"trust_id": "b442a580b9504ababf305bf2b4c49512",
"created_at": "2017-12-27 10:00:00",
"updated_at": null,
"reservations": [
{
"id": "087bc740-6d2d-410b-9d47-c7b2b55a9d36",
"lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
"status": "pending",
"missing_resources": false,
"resources_changed": false,
"resource_id": "5e6c0e6e-f1e6-490b-baaf-50deacbbe371",
"resource_type": "physical:host",
"min": 4,
"max": 6,
"hypervisor_properties": "[\">=\", \"$vcpus\", \"4\"]",
"resource_properties": "",
"before_end": "default",
"created_at": "2017-12-27 10:00:00",
"updated_at": null
},
{
"id": "ddc45423-f863-4e4e-8e7a-51d27cfec962",
"lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
"status": "pending",
"missing_resources": false,
"resources_changed": false,
"resource_id": "0b901727-cca2-43ed-bcc8-c21b0982dcb1",
"resource_type": "virtual:instance",
"amount": 4,
"vcpus": 2,
"memory_mb": 4096,
"disk_gb": 100,
"affinity": false,
"flavor_id": "ddc45423-f863-4e4e-8e7a-51d27cfec962",
"server_group_id": "33cdfc42-5a04-4fcc-b190-1abebaa056bb",
"aggregate_id": 11,
"created_at": "2017-12-27 10:00:00",
"updated_at": null
}
],
"events": [
{
"id": "188a8584-f832-4df9-9a4a-51e6364420ff"
"lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
"status": "UNDONE",
"event_type": "start_lease",
"time": "2017-12-26T12:00:00.000000",
"created_at": "2017-12-27 10:00:00",
"updated_at": null
},
{
"id": "277d6436-dfcb-4eae-ae5e-ac7fa9c2fd56",
"lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
"status": "UNDONE",
"event_type": "end_lease",
"time": "2017-12-27T12:00:00.000000",
"created_at": "2017-12-27 10:00:00",
"updated_at": null
},
{
"id": "f583af71-ca21-4b66-87de-52211d118029"
"lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
"status": "UNDONE",
"time": "2017-12-27T11:00:00.000000",
"event_type": "before_end_lease",
"created_at": "2017-12-27 10:00:00",
"updated_at": null
}
]
}
}

View File

@ -0,0 +1,83 @@
{
"leases": [
{
"id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
"name": "lease_foo",
"start_date": "2017-12-26T12:00:00.000000",
"end_date": "2017-12-27T12:00:00.000000",
"status":"PENDING",
"degraded": false,
"user_id": "5434f637520d4c17bbf254af034b0320",
"project_id": "aa45f56901ef45ee95e3d211097c0ea3",
"trust_id": "b442a580b9504ababf305bf2b4c49512",
"created_at": "2017-12-27 10:00:00",
"updated_at": null,
"reservations": [
{
"id": "087bc740-6d2d-410b-9d47-c7b2b55a9d36",
"lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
"status": "pending",
"missing_resources": false,
"resources_changed": false,
"resource_id": "5e6c0e6e-f1e6-490b-baaf-50deacbbe371",
"resource_type": "physical:host",
"min": 4,
"max": 6,
"hypervisor_properties": "[\">=\", \"$vcpus\", \"4\"]",
"resource_properties": "",
"before_end": "default",
"created_at": "2017-12-27 10:00:00",
"updated_at": null
},
{
"id": "ddc45423-f863-4e4e-8e7a-51d27cfec962",
"lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
"status": "pending",
"missing_resources": false,
"resources_changed": false,
"resource_id": "0b901727-cca2-43ed-bcc8-c21b0982dcb1",
"resource_type": "virtual:instance",
"amount": 4,
"vcpus": 2,
"memory_mb": 4096,
"disk_gb": 100,
"affinity": false,
"flavor_id": "ddc45423-f863-4e4e-8e7a-51d27cfec962",
"server_group_id": "33cdfc42-5a04-4fcc-b190-1abebaa056bb",
"aggregate_id": 11,
"created_at": "2017-12-27 10:00:00",
"updated_at": null
}
],
"events": [
{
"id": "188a8584-f832-4df9-9a4a-51e6364420ff"
"lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
"status": "UNDONE",
"event_type": "start_lease",
"time": "2017-12-26T12:00:00.000000",
"created_at": "2017-12-27 10:00:00",
"updated_at": null
},
{
"id": "277d6436-dfcb-4eae-ae5e-ac7fa9c2fd56",
"lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
"status": "UNDONE",
"event_type": "end_lease",
"time": "2017-12-27T12:00:00.000000",
"created_at": "2017-12-27 10:00:00",
"updated_at": null
},
{
"id": "f583af71-ca21-4b66-87de-52211d118029"
"lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
"status": "UNDONE",
"time": "2017-12-27T11:00:00.000000",
"event_type": "before_end_lease",
"created_at": "2017-12-27 10:00:00",
"updated_at": null
}
]
}
]
}

View File

@ -0,0 +1,15 @@
{
"end_date": "2017-12-28 12:00",
"reservations": [
{
"id": "087bc740-6d2d-410b-9d47-c7b2b55a9d36",
"min": 6,
"max": 8
},
{
"id": "ddc45423-f863-4e4e-8e7a-51d27cfec962",
"amount": 6
}
],
"events": []
}

View File

@ -0,0 +1,81 @@
{
"lease": {
"id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
"name": "lease_foo",
"start_date": "2017-12-26T12:00:00.000000",
"end_date": "2017-12-28T12:00:00.000000",
"status":"PENDING",
"degraded": false,
"user_id": "5434f637520d4c17bbf254af034b0320",
"project_id": "aa45f56901ef45ee95e3d211097c0ea3",
"trust_id": "b442a580b9504ababf305bf2b4c49512",
"created_at": "2017-12-27 10:00:00",
"updated_at": null,
"reservations": [
{
"id": "087bc740-6d2d-410b-9d47-c7b2b55a9d36",
"lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
"status": "pending",
"missing_resources": false,
"resources_changed": false,
"resource_id": "5e6c0e6e-f1e6-490b-baaf-50deacbbe371",
"resource_type": "physical:host",
"min": 6,
"max": 8,
"hypervisor_properties": "[\">=\", \"$vcpus\", \"4\"]",
"resource_properties": "",
"before_end": "default",
"created_at": "2017-12-27 10:00:00",
"updated_at": null
},
{
"id": "ddc45423-f863-4e4e-8e7a-51d27cfec962",
"lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
"status": "pending",
"missing_resources": false,
"resources_changed": false,
"resource_id": "0b901727-cca2-43ed-bcc8-c21b0982dcb1",
"resource_type": "virtual:instance",
"amount": 6,
"vcpus": 2,
"memory_mb": 4096,
"disk_gb": 100,
"affinity": false,
"flavor_id": "ddc45423-f863-4e4e-8e7a-51d27cfec962",
"server_group_id": "33cdfc42-5a04-4fcc-b190-1abebaa056bb",
"aggregate_id": 11,
"created_at": "2017-12-27 10:00:00",
"updated_at": null
}
],
"events": [
{
"id": "188a8584-f832-4df9-9a4a-51e6364420ff"
"lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
"status": "UNDONE",
"event_type": "start_lease",
"time": "2017-12-26T12:00:00.000000",
"created_at": "2017-12-27 10:00:00",
"updated_at": null
},
{
"id": "277d6436-dfcb-4eae-ae5e-ac7fa9c2fd56",
"lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
"status": "UNDONE",
"event_type": "end_lease",
"time": "2017-12-27T12:00:00.000000",
"created_at": "2017-12-27 10:00:00",
"updated_at": null
},
{
"id": "f583af71-ca21-4b66-87de-52211d118029"
"lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
"status": "UNDONE",
"time": "2017-12-27T11:00:00.000000",
"event_type": "before_end_lease",
"created_at": "2017-12-27 10:00:00",
"updated_at": null
}
]
}
}

View File

@ -18,3 +18,4 @@ oslo.context>=2.19.2 # Apache-2.0
reno>=2.5.0 # Apache-2.0
sphinx!=1.6.6,>=1.6.2 # BSD
openstackdocstheme>=1.18.1 # Apache-2.0
os-api-ref>=1.4.0 # Apache-2.0

View File

@ -39,7 +39,7 @@ commands = oslo-config-generator --config-file=etc/blazar/blazar-config-generato
[flake8]
show-source = true
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,tools
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,tools,api-ref
# NOTE(tonyb): Ignore a few errors/warnings that are now "on by default".
ignore=H105,H238,E123
# [H904] Delay string interpolations at logging calls.
@ -53,3 +53,10 @@ commands = pylint blazar
[testenv:releasenotes]
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:api-ref]
# This environment is called from CI scripts to test and publish
# the API Ref to developer.openstack.org.
commands =
rm -rf api-ref/build
sphinx-build -WE -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html