neutron-lib/api-ref/source/v2/agents.inc
Bence Romsics 5dcccd2c66 New agent attribute: resources_synced
Agents supporting the guaranteed minimum bandwidth feature need to share
their resource view with neutron-server and in turn with Placement too.
The resource information is synchronized to neutron-server via the
periodic agent heartbeat therefore transient synchronization errors are
fixed by the next heartbeat. But synchronization to Placement is not
done periodically, but on a (mostly) on demand basis. Therefore to fix
transient errors of the synchronization to Placement we must remember
the success/failure of the last synchronization attempt.

This change introduces a new boolean agent attribute: resources_synced

This attribute is:
* admin-only (just like the whole agent extension)
* read-only (it is only updated by the internal synchronization process)

If this attribute is not set then no synchronization to Placement ever
happened (which is the natural state of agents not tracking their
resources via Placement).

If it is False, then another successful synchronization is needed before
the contents of Placement can be considered up to date.

If it is True, then this agent's resources are up to date in Placement.

Change-Id: Ia3dea82fabe5e068192fbe931db8d341d3d37149
Needed-By: https://review.openstack.org/630999
Partial-Bug: #1578989
See-Also: https://review.openstack.org/502306 (nova spec)
See-Also: https://review.openstack.org/508149 (neutron spec)
2019-01-23 16:27:47 +01:00

206 lines
4.3 KiB
ReStructuredText

.. -*- rst -*-
======
Agents
======
Lists, shows details for, updates, and deletes agents.
Agent Resources Synced Extension
================================
The ``agent-resources-synced`` extension adds the ``resources_synced`` attribute
to agents.
Availability Zone Extension
===========================
The ``availability_zone`` extension adds the ``availability_zone`` attribute
to agents. ``availability_zone`` is the name of the availability zone that
the agent is running on.
List all agents
===============
.. rest_method:: GET /v2.0/agents
Shows details for an agent.
Use the ``fields`` query parameter to control which fields are
returned in the response body. For information, see `Filtering and
Column Selection <http://specs.openstack.org/openstack/neutron-
specs/specs/api/networking_general_api_information.html#filtering-
and-column-selection>`__.
Normal response codes: 200
Error response codes: 401
Request
-------
.. rest_parameters:: parameters.yaml
- admin_state_up: admin_state_up-query
- agent_type: agent_type-query
- alive: alive-query
- availability_zone: availability_zone-query
- binary: binary-query
- description: description-query
- host: host-query
- id: id-query
- topic: topic-query
- fields: fields
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- admin_state_up: admin_state_up
- agents: agents
- agent_type: agent_type
- alive: alive
- availability_zone: availability_zone
- binary: binary
- configurations: configurations
- created_at: created_at_resource
- description: description
- heartbeat_timestamp: heartbeat_timestamp
- host: host
- id: id
- resources_synced: agent_resources_synced
- started_at: started_at
- topic: topic
Response Example
----------------
.. literalinclude:: samples/agents/agents-list-response.json
:language: javascript
Show agent details
==================
.. rest_method:: GET /v2.0/agents/{agent_id}
Shows details for an agent.
Normal response codes: 200
Error response codes: 401, 404
Request
-------
.. rest_parameters:: parameters.yaml
- agent_id: agent_id-path
- fields: fields
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- admin_state_up: admin_state_up
- agent: agent
- agent_type: agent_type
- alive: alive
- availability_zone: availability_zone
- binary: binary
- configurations: configurations
- created_at: created_at_resource
- description: description
- heartbeat_timestamp: heartbeat_timestamp
- host: host
- id: id
- resources_synced: agent_resources_synced
- started_at: started_at
- topic: topic
Response Example
----------------
.. literalinclude:: samples/agents/agent-show-response.json
:language: javascript
Update agent
==============
.. rest_method:: PUT /v2.0/agents/{agent_id}
Updates an agent.
Normal response codes: 200
Error response codes: 400, 401, 403, 404
Request
-------
.. rest_parameters:: parameters.yaml
- agent_id: agent_id-path
- admin_state_up: admin_state_up-request
- description: description-request
Request Example
---------------
.. literalinclude:: samples/agents/agent-update-request.json
:language: javascript
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- admin_state_up: admin_state_up
- agent: agent
- agent_type: agent_type
- alive: alive
- availability_zone: availability_zone
- binary: binary
- configurations: configurations
- created_at: created_at_resource
- description: description
- heartbeat_timestamp: heartbeat_timestamp
- host: host
- id: id
- resources_synced: agent_resources_synced
- started_at: started_at
- topic: topic
Response Example
----------------
.. literalinclude:: samples/agents/agent-update-response.json
:language: javascript
Delete agent
============
.. rest_method:: DELETE /v2.0/agents/{agent_id}
Agents that won't be used anymore can be removed. Before deleting agents via
API, the agent should be stopped/disabled.
Normal response codes: 204
Error response codes: 401, 404, 409
Request
-------
.. rest_parameters:: parameters.yaml
- agent_id: agent_id-path
Response
--------
There is no body content for the response of a successful DELETE request.