27 Commits

Author SHA1 Message Date
Sean Dague
8835198b8d Update api-guide and api-ref to be clear about forced-down
Closes-Bug: #1691871
Related-Bug: #1784826

Change-Id: Ifc6f1549d88a1b7d9f6e25c962c8a15dd8e180fb
2018-08-17 01:41:31 +00:00
Matt Riedemann
42f62f1ed2 Block deleting compute services which are hosting instances
This change makes "DELETE /os-services/{service_id}" fail
with a 409 response when attempting to delete a nova-compute
service which is still hosting instances.

Deleting a compute service also results in deleting the
related compute_nodes table entry for that service host.
The compute node resource provider in placement is tied
to the compute node via the UUID, and if we allow deleting
the compute service and node then the resource provider for
that node is effectively orphaned in Placement, along with
the instances which have allocations against that resource
provider.

Furthermore, restarting the compute service will create a
new service and compute_nodes record, and the compute node
would have a new UUID and resource provider. This will
affect scheduling for that host since Placement will be
reporting it as having available capacity which in reality
is not accurate.

A release note is included for the (justified) behavior
change in the API. A new microversion should not be required
for this since admins should not have to opt out of broken
behavior. Since this API did not previously expect to return
a 409 response, the "expected_errors" decorator is updated
and again, should not require a microversion per the
guidelines:

https://docs.openstack.org/nova/latest/contributor/microversions.html#when-a-microversion-is-not-needed

Change-Id: I0bd63b655ad3d3d39af8d15c781ce0a45efc8e3a
Closes-Bug: #1763183
2018-04-18 19:16:00 -04:00
Matt Riedemann
e0c43ac7a7 api-ref: add a note in DELETE /os-services about deleting computes
As seen in I2717274bb1bd370870acbf58c03dc59cee30cc5e, if an
operator deletes a nova-compute service via the API but fails
to stop the actual nova-compute process, the API will delete the
services table and compute_nodes table records, but the nova-compute
process will hit the 'update_available_resource' periodic task and
re-create the compute node record, which at that point is orphaned
since it does not have an associated nova-compute service.

Restarting the nova-compute service _should_ recreate the service
table record for that host and then the user could attempt to
delete the service and compute node record again via this API, but
it's better to not have to find this out the hard way.

So this change adds a simple reminder that the nova-compute process
on the host should be stopped before deleting the compute service.

While in here, the link to the install guide about the various
compute services is also fixed.

Change-Id: I68f2074814c3ae890888a5c75fd2870bb99f0e08
Related-Bug: #1646255
2018-03-16 13:54:26 -04:00
Jenkins
d3e6b94eb9 Merge "Use uuid for id in os-services API" 2017-07-20 01:02:42 +00:00
ghanshyam
1503eff452 Correct the description of 'disable-log-reason' api-ref
'disable-log-reason' API action disable the compute service and
log the disabled reason. But api-ref statement sounds like this API
only log the disable reason.

Correcting description to convey the clear behavior of API.
Closes-Bug: #1702310

Change-Id: I5e1b97ed482d62477d87c96c9914e6f88c041b8b
2017-07-19 04:53:02 +00:00
Dan Peschman
2f7bf29d47 Use uuid for id in os-services API
This patch introduces a new microversion to identify services by uuid
instead of id, to ensure uniqueness across cells. GET /os-services
returns uuid in the id field, and uuid must be provided to delete a
service with DELETE /os-services/{service_uuid}.

The old PUT /os-services/* APIs are now capped and replaced
with a new PUT /os-services/{service_uuid} which takes a uuid path
parameter to uniquely identify the service to update. It also restricts
updates to nova-compute services only, since disabling or forcing-down
a non-compute service like nova-scheduler doesn't make sense as it
doesn't do anything.

The new update() method in this microversion also avoids trying to
re-use the existing private action methods like _enable and _disable
since those are predicated on looking up the service by host/binary,
are confusing to follow for code flow, and just don't really make sense
with a pure PUT resource update method.

Part of blueprint service-hyper-uuid-in-api

Co-Authored-By: Matt Riedemann <mriedem.os@gmail.com>

Change-Id: I45494a4df7ee4454edb3ef8e7c5817d8c4e9e5ad
2017-07-18 15:39:57 -04:00
Matt Riedemann
a9ba1be7b7 api-ref: fix misleading description in PUT /os-services/disable
The PUT /os-services/disable API does not actually check the
request body for a reason why the service is being disabled.
That's what PUT /os-services/disable-log-reason is for.

This removes that incorrect part of the API description.

Closes-Bug: #1697787

Change-Id: I7a0bbdad842e5d420085777d4fe2f9e6d3e94360
2017-06-13 18:42:42 -04:00
Kevin_Zheng
ebb245edc2 Add missing query filter params for GET /os-services API
The GET /os-services API takes "host" and "binary" query filter
parameters:

3a5d592e60/nova/api/openstack/compute/services.py (L54-L58)

And novaclient exposes those filters:

https://docs.openstack.org/cli-reference/nova.html#nova-service-list

But they aren't documented in the API reference:

https://developer.openstack.org/api-ref/compute/?expanded=list-compute-services-detail#list-compute-services

Change-Id: I0ed35404d93475538326d3020754a6f97f25d08c
Closes-bug: #1697563
2017-06-13 08:19:31 +00:00
Takashi NATSUME
b68e25a0f0 api-ref: Fix parameter order in os-services.inc
The fields added in microversions should be at the end (*1).
So fix 'forced_down' parameter added in microversion 2.11.

*1: https://wiki.openstack.org/wiki/NovaAPIRef

TrivialFix
Change-Id: I060cfa2a114e8ce7538554c18095a83cfc2ced10
Implements: blueprint api-ref-in-rst-pike
2017-05-23 18:23:38 +09:00
Jenkins
f0743a23ed Merge "api-ref: Nova Update Compute services Link" 2017-04-25 21:16:17 +00:00
jichenjc
aad4be2e3d Deprecate os-hosts API
This patch deprecates os-hosts APIs including:

GET /os-hosts - list hosts
GET /os-hosts/{host_name} - show host details
PUT /os-hosts/{host_name} - update host status
GET /os-hosts/{host_name}/reboot - reboot host
GET /os-hosts/{host_name}/shutdown - shutdown host
GET /os-hosts/{host_name}/startup - start host

Much of the ``os-hosts`` API is duplicated with the ``os-services`` and
``os-hypervisors`` APIs. It's not a good idea to make nova have the
compute related API, so this patch deprecated them.

Implements blueprint deprecate-os-hosts

Co-Authored-By: Matt Riedemann <mriedem.os@gmail.com>

Change-Id: Ieb85653b85a1eff38a9fb0c9ff05e4cd39150ecc
2017-04-20 11:58:26 -04:00
YuYang
af5370f6f4 api-ref: Nova Update Compute services Link
update the os-service Link.

Change-Id: I4485156a0e19a400f1f7218345759bc92bb0e08e
2017-04-12 15:05:11 +08:00
Matt Riedemann
3f2a5fc23a api-ref: fix description in os-services
The services data model and API is not per-tenant, it's
per-region, so this change updates the docs to reflect that.

Change-Id: I45bc0bd5afcd05626f61be84c012e00f723f80eb
2017-03-16 18:00:13 -04:00
Karen Bradshaw
168a500570 API Ref: update server_id params
- Update server_id params to be of type path.
- Cleaned up os-getConsoleOutput action string.
- Made empty response body description more consistent.
  Review and change as needed.

Implements: bp/api-ref-in-rst-ocata

Change-Id: Ie1e299d2b93188240b18138eba9f5b908a1078a4
2016-11-11 14:01:51 -05:00
jichenjc
f81e32c9d1 Add more description when service delete
As service delete will affect host aggregate, add more info

Change-Id: I57b17f60228df83a033735c33cc74589dad30553
Implements: blueprint api-ref-in-rst-ocata
2016-09-21 20:18:18 +08:00
Chen Fan
377948b059 api-ref: unify the delete response infomation
part of bp:api-ref-in-rst

Change-Id: I924a632253b8b1c25f987c259d255cc6440f52f2
2016-07-07 10:23:34 +08:00
Karen Bradshaw
3cdb385dac api-ref, os-services.inc
Verified parameters, examples, body text.
Included v2.11 sample files for GET and PUT
os-services.

Part of: bp/api-ref-in-rst

Change-Id: Ice4fb525d62230b2e20f01789a0aec396835b56b
2016-06-21 11:39:30 -04:00
Sean Dague
c9f5ad3bcf remove /v2.1/{tenant_id} from all urls
As discussed at summit, the version part of the URL is not really
relevant, or a thing a user should be filling out themselves, this
should instead be set by the service catalog and extracted from the
token.

This removes it's reference in all documented REST urls, and adds a
new section describing how one gets the base URL for all calls.

Change-Id: I4306b8c3de0225e54f3909dd8a1fb293c4e5944c
2016-06-03 08:47:33 -04:00
Sean Dague
36c688f694 api-ref: finish validation for os-server-external-events.inc
This completes the validation for the admin event interface, including
detailing the codes we currently return in the parameter list.

Because os-service was incorrectly using the 'status' key, when I
renamed status => event_status I needed to also create a
service_status to make things compile. It's accurate enough to move
forward.

Because this is really a Neutron only API, this is moved towards the
bottom of the API list, to make it clear this isn't really designed to
be used by end user apps.

Part of bp:api-ref-in-rst

Change-Id: I3ed46eec1c33a63b7a89d6d6b5eeda574effdc56
2016-05-13 13:35:24 +00:00
jichenjc
ef2dfbf717 Complet Method Verification of os-services
This complete the Method Verification of os-services,
http://paste.openstack.org/show/495349/
has the method call and return sample value. also,
clean and correct some error return code.

Part of bp:api-ref-in-rst

Change-Id: Ie4662e033b3b2235e62fd95ea50291ae91362d21
2016-04-22 17:15:42 +08:00
Sean Dague
d929b9fc76 add tags to files for the content verification phase
This adds a set of tags in comments to the beginning of files so that
we can process them according to the documentation here:
https://wiki.openstack.org/wiki/NovaAPIRef

Part of bp:api-ref-in-rst

Change-Id: I17cf584dafb5bd969c12f51b7e7185d92365bf93
2016-04-20 16:21:58 -04:00
Sean Dague
1555736e3c Final warnings removals for api-ref
This removes the final warnings from the api-ref code base, and flips
the sphinx switch to enforce warnings as errors.

It also adds code to the rest_parameters extension to make it more
clear where a problem is when it comes to included parameters. This
puts us in a place where we can start doing the file per file look at
content.

Part of bp:api-ref-in-rst

Change-Id: Ic2c99d96d6addcafa00b9f16785c2fe59b1798d3
2016-04-20 11:25:30 -04:00
Sean Dague
4e415274f3 fix samples references in os-services
This fixes all the samples references in os-services to not throw
warnings.

Part of bp:api-ref-in-rst

Change-Id: I25b469352a4f99e34783eb31ea3b94e4d9971477
2016-04-19 14:08:33 -04:00
ghanshyam
6f8cda2f39 Fix json response example heading in api ref
Heading for json response example is wrong,
it is json request instead of json response.

Part of bp:api-ref-in-rst

Change-Id: I709b2bf19520eb76e0264c358a2146bb0dbcee2b
2016-04-19 17:56:20 +09:00
jichenjc
e9cb0aa036 Fix os-service related reference missing
"Delete a service " API returns 204 as success, 404 is error
Also some reference to doc it not correct

Part of bp:api-ref-in-rst

Change-Id: Ibf57167ae70acdaa2ad6f0abc3a975c91e797b87
2016-03-23 10:25:11 +08:00
Sean Dague
9526462326 move sphinx h3 to '-' instead of '^'
In the sphinx document h3 is supposed to be '-' not '^':

=, for sections
-, for subsections
^, for subsubsections

We have to enforce consistency here because we're processing included
files which all have to agree, otherwise it's a sphinx error.

Part of bp:api-ref-in-rst

Change-Id: Ic6eef5cacb07870f161b04b031e332f2b87aeedc
2016-04-15 07:43:06 -04:00
Sean Dague
d4e2771440 Import RST files for documentation
This is the results of the RST conversion from WADL. It creates a
single index plus a bunch of included files which represent sections
of the API document. This is the starting point for fixing the
documentation.

Change-Id: I7d561c2ecdcd864172dedb54a551f17ad3bdfe26
2016-04-13 07:34:45 -04:00