Commit Graph

26 Commits

Author SHA1 Message Date
Pierre Riteau 352b13b21d Update configuration for compatibility with Sphinx 5
Change-Id: I8a3ee4d774451d8211d0d7f2a5db7a42d51b288d
2022-06-06 20:11:32 +02:00
Mark Powers f5e6d24826 Add resource properties discovery API
This allows users to query for resource properties of hosts,
allowing them to be used in creating leases more effectively. Two new
API endpoints are added for hosts, ``/properties`` and
``/properties/<property_name>``, which allow for listing available
properties, and updating a property respectively. Properties can be
listed with detail, showing possible values and visibility. Admins can
list public and private properties.

A new database table is added ``resource_properties``, which stores
property names and resource types. Resource specific property tables
(e.g. ``computehost_extra_capabilities``) entries store a foreign key to
``resource_properties``, rather than the capability name.

Implements blueprint resource-properties-discovery-api

Change-Id: Ib9f1140c44c5e4fbef6e019c48a842869368cb21
2022-02-10 17:23:15 +00:00
Mark Powers bf38e16ec3 Update list_allocations in hosts plugin to expose start and end dates
This change modifies the DB utility to fetch reservation allocations so
that a list of reservations is returned with host_ids as an attribute to
each reservation.

This allows the host plugin to include more information when listing
allocations, namely start and end dates. This can be used to see when
resources are available, and for the creation of a reservation calendar
(blueprint calendar-view).

Change-Id: I464898bdeda6b55a028c8a14a54eb137c92a83c1
2022-01-27 15:03:24 +01:00
wu.shiming e81bbc72b7 remove unicode from code
Change-Id: I2e6e9c3b3d934e1ba60b07d239e970137c32a48f
2021-01-13 09:26:38 +08:00
Andreas Jaeger b489995c8b Switch to newer openstackdocstheme and reno versions
Switch to openstackdocstheme 2.2.1 and reno 3.1.0 versions. Using
these versions will allow especially:
* Linking from HTML to PDF document
* Allow parallel building of documents
* Fix some rendering problems

Update Sphinx version as well.

Set openstackdocs_pdf_link to link to PDF file. Note that
the link to the published document only works on docs.openstack.org
where the PDF file is placed in the top-level html directory. The
site-preview places the PDF in a pdf directory.

Change pygments_style to 'native' since old theme version always used
'native' and the theme now respects the setting and using 'sphinx' can
lead to some strange rendering.

openstackdocstheme renames some variables, so follow the renames
before the next release removes them. A couple of variables are also
not needed anymore, remove them.

See also
http://lists.openstack.org/pipermail/openstack-discuss/2020-May/014971.html

Change-Id: Ib2fc9304a6db9f01eb6d0eb82363906fd322612f
2020-05-21 16:12:27 +02:00
Zuul 6a5fd8b08a Merge "Lease creation/updation should fail for invalid affinity" 2019-09-16 17:12:58 +00:00
Zuul 98135a2f5f Merge "Lease creation/update should fail if amount is 0" 2019-09-16 17:12:57 +00:00
asmita singh 563e4a8da2 Send global_request_id for tracing calls
This patch adds global_request_id to the constructor for nova client,
keystone client, neutron client and placement client which will pass the
global_request_id to these respective services on all API calls.
Supporting global_request_id makes debugging easier when requests reach
many different OpenStack services. The blazar global_request_id will be
sent to these services in the request header like below and it will be
available with context.global_request_id:

  -H "X-OpenStack-Request-ID: req-1a9b7b24-02ed-4400-bcc3-cc1bcbb59147"

Sample log output of neutron service for ``POST v1/floatingips`` API
which logs global request ID `req-e19f8f4f-40e7-441e-b776-7b43ed15c7dd`
is shown at: http://paste.openstack.org/show/753807

Oslo spec I65de8261746b25d45e105394f4eeb95b9cb3bd42
Change-Id: I5bb3631c4fb178293ee8eefbe1aa8b819a196a9f
2019-09-06 11:15:18 +02:00
openstack 438585e3d7 Add request_id middleware support
'x-openstack-request-id' is the common header name for request ID
which is implemented in most of the OpenStack services. Using the
oslo middleware `request_id` middleware is a convenient way to
generate request ID and also include it in the response.

The request ID will be generated by the oslo middleware and is
inserted into the request environment. On the response end, the
middleware is again used, this time to attach the
'x-openstack-request-id' header, using the value of the generated
request ID.

Sample log output of blazar-api service for ``GET v1/os-hosts`` API
which logs local request ID `req-de45521c-2a04-4e7d-809a-960e782eb1e7`
is shown below:
  http://paste.openstack.org/show/753805/

Note: For v2 apis, the request_id is not returned in response header
but it will be logged in logs.

APIImpact:
responses of the API will include 'x-openstack-request-id' header.

Implements: blueprint oslo-middleware-request-id
Change-Id: I437f783787514ff1add2d7f0059cb27addd12c3e
2019-09-05 14:39:00 +00:00
zhangyangyang a501624684 Bump the openstackdocstheme extension to 1.20
Some options are now automatically configured by the version 1.20:
- project
- html_last_updated_fmt
- latex_engine
- latex_elements
- version
- release.

Change-Id: Ia4386840658666079f4902fc72bd6772b42f00dc
2019-07-19 17:37:41 +08:00
asmita singh 0ce6c7f6c0 Lease creation/updation should fail for invalid affinity
If user passes invalid affinity values (abc, 2), the lease is getting
created/updated successfully.

This patch will return 400 error if user passes invalid affinity values
to lease create and update APIs.

APIImpact:
1)Return 400 instead of 201 when lease is created with invalid affinity
for resource_type 'virtual:instance'.
2)Return 400 instead of 200 when lease is updated with invalid affinity
for resource_type 'virtual:instance'.

Change-Id: I3170a0957de43fd2b7bcd32eca375da2d1f17360
Closes-Bug: #1821576
2019-06-06 07:52:38 +00:00
asmita singh fa6bb0b5b2 Lease creation/update should fail if amount is 0
Lease is getting created and updated for resource_type virtual:instance
with amount=0.
This patch doesn't allow creation and update of lease with amount=0, it
will raise 400 BadRequest.

Lease creation for resource_type physical:host with min=0 or max=0
raises 500 Internal Server Error and lease is updated for resource_type
physical:host with min=0 or max=0.
This patch doesn't allow creation and update of lease with min=0 or
max=0, it will raise 400 BadRequest.

APIImpact:
1)Return 400 instead of 201 when lease is created with amount=0 for
resource_type 'virtual:instance'.
2)Return 400 instead of 500 when lease is created with min=0 or max=0
for resource_type 'physical:host'.
3)Return 400 instead of 200 when lease is updated with amount=0 for
resource_type 'virtual:instance'.
4)Return 400 instead of 200 when lease is updated with min=0 or max=0
for resource_type 'physical:host'.

Closes-Bug: #1807101

Change-Id: I70e35ac7a524afb04077da5978c7563dec120639
2019-06-06 07:35:35 +00:00
Masahito Muroi 59b0968ea1 Expose floatingip APIs and virtual:floatingip resources
Partially Implements: blueprint floatingip-reservation
Change-Id: Idc2571027ebd24ca1af73941203411990172eb45
2019-03-19 09:59:53 +00:00
Masahito Muroi a3aff12f3e Support reservation_id parameter in List and Get Allocation API
The List and Get Allocation API allows cloud admin to query with
reservation_id in their request. When the parameter is specified in API
requests, the API returns allocations related to the reservation.

Partially Implements: blueprint resource-allocation-api
Change-Id: I87ed410c23f04a17f6c1deeb9ad1e4ab0756a549
2019-01-08 12:32:30 +00:00
Masahito Muroi 7a491b8a79 Support lease_id parameter in List and Get Allocations API
The List and Get Allocations API allows admins to query with lease_id.
When the query key is specified in API requests, the two APIs only
returns allocations related to the lease ID.

Partially Implements: blueprint resource-allocation-api
Change-Id: Ibf2c92d42dbe3fb055a78028967e202327cfee34
2019-01-08 12:32:30 +00:00
Masahito Muroi 5dd2fd1044 Expose List/Get Allocations API
This patch exposes List and Get Reservation Allocations API to cloud
admins by default.

Partially Implements: blueprint resource-allocation-api
Change-Id: Ib8aa479b2b297b4564f734d07a25ca2637a56f49
2019-01-08 12:32:30 +00:00
Tetsuro Nakamura 9da871ac59 Fix POST and PUT status codes and update API Reference
Blazar returned 202 (Accepted) for POST and PUT methods. However, the
POST method should return 201 (Created) because Blazar ensures that a
new host or a new lease is created before responding. Similarly, the PUT
method should return 200 (OK) since Blazar ensures that the resource is
updated properly.

This patch also fixes the status code documented in the API Reference
for DELETE requests, which was wrongly described as 200 (OK) instead of
204 (No Content). The release note is submitted in a separate patch.

Change-Id: Ia5afd12552e4c9169ebe35324d5a5b4495359b63
2018-07-18 00:43:26 +00:00
wanghui c1c7768cfb Change html_context options to openstackdocstheme options
Change-Id: I4980d5842c6156daa1a536c4dbafdb90fac7539d
2018-06-07 08:10:34 +00:00
Masahito Muroi c175f2b42c Support resource_properties key in instance reservation
This patch adds a 'resource_properties' key for instance reservation as
a required parameter. If a user specifies the key when they create
instance reservations, Blazar picks up hypervisors that match the key
for the reservation.

Partially Implements: blueprint flavors-extra-specs
Change-Id: Ia8877c667116739d75381776555f91e529c1c21d
2018-05-08 16:09:02 +09:00
Hiroaki Kobayashi b11e8f248f Correct API URLs
Change-Id: I0ddc1fd95216264b7f6e36e17781d54a24b5ba46
2018-04-17 16:10:10 +09:00
Hiroaki Kobayashi 7f2aa906d4 Update links to API reference
Change-Id: Ib7b184693ae0c15ff073f1759549244dbca9794a
Closes-Bug: #1703268
2018-02-19 14:40:02 +09:00
Zuul d0cc699a9a Merge "Delete unnecessary new lines in API reference" 2018-02-19 05:00:29 +00:00
gaofei dd8d245ccc Fix typos
Change-Id: Ib39a22d361d82d8aab2f9b881cbb5e846b98e6dc
2018-02-08 15:15:46 +00:00
Hiroaki Kobayashi 7262564a1a Delete unnecessary new lines in API reference
Change-Id: I682cdc255ef74c40ede39bdad609e8baf4c6e4a9
2018-02-06 13:51:58 +09:00
Hiroaki Kobayashi e7c93fb5e7 Add hosts operations to the API reference
Change-Id: Ied65258a8db6c5c2109a288ede647b25138cc9bc
Partial-Bug: #1721489
Partial-Bug: #1703268
2018-02-05 15:29:57 +09:00
Hiroaki Kobayashi 5b32c729e7 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
2018-02-02 02:17:18 +00:00