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
This commit is contained in:
Sean Dague 2016-04-20 11:20:05 -04:00
parent db06f9aa61
commit 1555736e3c
9 changed files with 71 additions and 28 deletions

View File

@ -141,10 +141,17 @@ class RestParametersDirective(Table):
if ref in lookup: if ref in lookup:
new_content.append((name, lookup[ref])) new_content.append((name, lookup[ref]))
else: else:
# TODO(sdague): this provides a kind of confusing
# error message because env.warn isn't meant to be
# used this way, however it does provide a way to
# track down where the parameters list is that is
# wrong. So it's good enough for now.
self.env.warn( self.env.warn(
self.env.docname, "%s:%s " % (
"No field definition for %s found in %s. Skipping." % self.state_machine.node.source,
(ref, fpath)) self.state_machine.node.line),
("No field definition for ``%s`` found in ``%s``. "
" Skipping." % (ref, fpath)))
# self.app.info("New content %s" % new_content) # self.app.info("New content %s" % new_content)
self.yaml = new_content self.yaml = new_content

View File

@ -70,7 +70,7 @@ Response
:language: javascript :language: javascript
List Images With Details List Images With Details
================== ========================
.. rest_method:: GET //v2.1/{tenant_id}/images/detail .. rest_method:: GET //v2.1/{tenant_id}/images/detail

View File

@ -29,7 +29,7 @@ Request
.. rest_parameters:: parameters.yaml .. rest_parameters:: parameters.yaml
- tenant_id: tenant_id - tenant_id: tenant_id
- hypervisor: hypervisor - hypervisor: hypervisor_type
- architecture: architecture - architecture: architecture
- os: os - os: os
- url: url - url: url
@ -46,7 +46,7 @@ Response
.. rest_parameters:: parameters.yaml .. rest_parameters:: parameters.yaml
- hypervisor: hypervisor - hypervisor: hypervisor_type
- architecture: architecture - architecture: architecture
- os: os - os: os
- url: url - url: url
@ -79,7 +79,7 @@ Request
- tenant_id: tenant_id - tenant_id: tenant_id
- agent_id: agent_id - agent_id: agent_id
- architecture: architecture - architecture: architecture
- hypervisor: hypervisor - hypervisor: hypervisor_type
- url: url - url: url
- md5hash: md5hash - md5hash: md5hash
- version: version - version: version
@ -156,4 +156,3 @@ Response
.. literalinclude:: ../../doc/api_samples/os-agents/agent-update-put-resp.json .. literalinclude:: ../../doc/api_samples/os-agents/agent-update-put-resp.json
:language: javascript :language: javascript

View File

@ -42,11 +42,11 @@ Response
- binary: binary - binary: binary
- disabled_reason: disabled_reason - disabled_reason: disabled_reason
- host: host - host: host
- state: state - state: service_state
- status: status - status: status
- updated_at: updated_at - updated_at: updated
- forced_down: forced_down - forced_down: forced_down
- zone: zone - zone: OS-EXT-AZ:availability_zone
**Example List Compute Services: JSON response** **Example List Compute Services: JSON response**
@ -202,7 +202,7 @@ Request
.. rest_parameters:: parameters.yaml .. rest_parameters:: parameters.yaml
- tenant_id: tenant_id - tenant_id: tenant_id
- service_id: service_id - service_id: service_id_path
Response Response
-------- --------

View File

@ -64,12 +64,6 @@ attachment_id:
in: path in: path
required: true required: true
type: string type: string
binary:
description: |
The binary name of the service.
in: path
required: true
type: string
cell_id: cell_id:
description: | description: |
The UUID of the cell. The UUID of the cell.
@ -238,6 +232,12 @@ server_id_path:
in: path in: path
required: true required: true
type: string type: string
service_id_path:
in: path
required: true
type: int
description: |
The id of the service
snapshot_id_2: snapshot_id_2:
description: | description: |
The UUID of the snapshot. The UUID of the snapshot.
@ -686,6 +686,12 @@ availability_zone:
in: body in: body
required: false required: false
type: string type: string
binary:
description: |
The binary name of the service.
in: body
required: true
type: string
block_device_mapping_v2: block_device_mapping_v2:
description: | description: |
Enables fine grained control of the block device mapping for an instance. This Enables fine grained control of the block device mapping for an instance. This
@ -976,6 +982,14 @@ force:
in: body in: body
required: false required: false
type: boolean type: boolean
forced_down:
in: body
required: true
type: boolean
description: |
Whether or not this service was forced down manually by an
adminstrator. This value is useful to know that some 3rd party has
verified the service should be marked down.
forceDelete: forceDelete:
description: | description: |
The action. The action.
@ -1048,6 +1062,12 @@ host_status:
in: body in: body
required: true required: true
type: string type: string
hypervisor_type:
in: body
required: true
type: string
description: |
The hypervisor type for the agent. Currently only ``xen`` is supported.
id: id:
description: | description: |
The security group name or UUID. The security group name or UUID.
@ -1891,6 +1911,24 @@ servers:
in: body in: body
required: true required: true
type: array type: array
service:
in: body
required: true
type: object
description: |
Object representing a compute service
services:
in: body
required: true
type: array
description: |
An array of service objects
service_state:
in: body
required: true
type: string
description: |
The state of the service. One of ``up`` or ``down``.
shelve: shelve:
description: | description: |
The action. The action.

View File

@ -25,7 +25,6 @@ Request
- tenant_id: tenant_id - tenant_id: tenant_id
- server_id: server_id - server_id: server_id
- trigger_crash_dump: trigger_crash_dump
**Example Trigger crash dump: JSON request** **Example Trigger crash dump: JSON request**
@ -34,4 +33,3 @@ Request
Response Response
-------- --------

View File

@ -56,10 +56,10 @@ Request
- fixed_address: fixed_address - fixed_address: fixed_address
.. TODO(gmann) Need to create the sample file for this action. .. TODO(gmann) Need to create the sample file for this action.
**Example Add (Associate) Floating Ip (Addfloatingip Action): JSON request** **Example Add (Associate) Floating Ip (Addfloatingip Action): JSON request**
.. literalinclude:: ../../doc/api_samples/os-floating-ips/floating-ips-create-resp.json .. literalinclude:: ../../doc/api_samples/os-floating-ips/floating-ips-create-resp.json
:language: javascript :language: javascript
Response Response
-------- --------

View File

@ -36,7 +36,7 @@ Request
- imageRef: imageRef - imageRef: imageRef
- flavorRef: flavorRef - flavorRef: flavorRef
- networks: networks - networks: networks
- uuid: uuid - uuid: network_uuid
- port: port - port: port
- fixed_ip: fixed_ip - fixed_ip: fixed_ip
- name: name - name: name
@ -104,7 +104,7 @@ Request
- imageRef: imageRef - imageRef: imageRef
- flavorRef: flavorRef - flavorRef: flavorRef
- networks: networks - networks: networks
- uuid: uuid - uuid: network_uuid
- port: port - port: port
- fixed_ip: fixed_ip - fixed_ip: fixed_ip
- name: name - name: name

View File

@ -86,12 +86,12 @@ commands = {posargs}
[testenv:docs] [testenv:docs]
commands = commands =
rm -rf doc/source/api doc/build api-guide/build rm -rf doc/source/api doc/build api-guide/build api-ref/build
python setup.py build_sphinx python setup.py build_sphinx
bash -c '! find doc/ -type f -name *.json | xargs -t -n1 python -m json.tool 2>&1 > /dev/null | grep -B1 -v ^python' bash -c '! find doc/ -type f -name *.json | xargs -t -n1 python -m json.tool 2>&1 > /dev/null | grep -B1 -v ^python'
oslo-config-generator --config-file=etc/nova/nova-config-generator.conf oslo-config-generator --config-file=etc/nova/nova-config-generator.conf
sphinx-build -W -b html api-guide/source api-guide/build/html sphinx-build -W -b html api-guide/source api-guide/build/html
sphinx-build -b html api-ref/source api-ref/build/html sphinx-build -W -b html api-ref/source api-ref/build/html
[testenv:api-guide] [testenv:api-guide]
# This environment is called from CI scripts to test and publish # This environment is called from CI scripts to test and publish
@ -115,7 +115,8 @@ commands =
# ignoring the duplicate stanzas warning. # ignoring the duplicate stanzas warning.
install_command = pip install -U --force-reinstall {opts} {packages} install_command = pip install -U --force-reinstall {opts} {packages}
commands = commands =
sphinx-build -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html rm -rf api-ref/build
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
[testenv:bandit] [testenv:bandit]
commands = bandit -c bandit.yaml -r nova -n 5 -ll commands = bandit -c bandit.yaml -r nova -n 5 -ll