Merge "BFD api def"
This commit is contained in:
commit
8c4c5d0b6a
310
api-ref/source/v2/bfd_monitors.inc
Normal file
310
api-ref/source/v2/bfd_monitors.inc
Normal file
@ -0,0 +1,310 @@
|
|||||||
|
.. -*- rst -*-
|
||||||
|
|
||||||
|
============
|
||||||
|
BFD monitors
|
||||||
|
============
|
||||||
|
|
||||||
|
A new BFD (Bidirectional Forwarding Detection) resource is introduced.
|
||||||
|
|
||||||
|
.. warning::
|
||||||
|
|
||||||
|
This API extension was merged as experimental to enable parallel
|
||||||
|
development of multiple backends. At the moment this API does not have
|
||||||
|
a reference implementation and should not be considered final. The
|
||||||
|
removal of this warning will mark when the reference implementation
|
||||||
|
gets merged and the feauture is ready to be consumed.
|
||||||
|
|
||||||
|
List BFD monitors
|
||||||
|
=================
|
||||||
|
|
||||||
|
.. rest_method:: GET /v2.0/bfd_monitors
|
||||||
|
|
||||||
|
Lists BFD monitors to which the project has access.
|
||||||
|
|
||||||
|
Normal response codes: 200
|
||||||
|
|
||||||
|
Error response codes: 400, 401, 403
|
||||||
|
|
||||||
|
Request
|
||||||
|
--------
|
||||||
|
|
||||||
|
.. rest_parameters:: parameters.yaml
|
||||||
|
|
||||||
|
- id: id-query
|
||||||
|
- project_id: project_id-query
|
||||||
|
- name: name-query
|
||||||
|
- description: description-query
|
||||||
|
- fields: fields
|
||||||
|
|
||||||
|
Response Parameters
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
.. rest_parameters:: parameters.yaml
|
||||||
|
|
||||||
|
- bfd_monitors: bfd_monitor-obj
|
||||||
|
- description: description
|
||||||
|
- project_id: project_id
|
||||||
|
- name: name
|
||||||
|
- id: bfd_monitor_id
|
||||||
|
- mode: bfd_monitor_mode
|
||||||
|
- dst_ip: bfd_monitor_dst_ip
|
||||||
|
- src_ip: bfd_monitor_src_ip
|
||||||
|
- min_rx: bfd_monitor_min_rx
|
||||||
|
- min_tx: bfd_monitor_min_tx
|
||||||
|
- multiplier: bfd_monitor_multiplier
|
||||||
|
- status: bfd_monitor_status
|
||||||
|
- auth_type: bfd_monitor_auth_type
|
||||||
|
- auth_key: bfd_monitor_auth_key
|
||||||
|
|
||||||
|
Response Example
|
||||||
|
----------------
|
||||||
|
|
||||||
|
.. literalinclude:: samples/bfd/bfd_monitor-list-response.json
|
||||||
|
:language: javascript
|
||||||
|
|
||||||
|
Create BFD monitor
|
||||||
|
==================
|
||||||
|
|
||||||
|
.. rest_method:: POST /v2.0/bfd_monitors
|
||||||
|
|
||||||
|
Creates a BFD monitor.
|
||||||
|
|
||||||
|
Normal response codes: 201
|
||||||
|
|
||||||
|
Error response codes: 401, 403, 404, 409
|
||||||
|
|
||||||
|
Request
|
||||||
|
--------
|
||||||
|
|
||||||
|
.. rest_parameters:: parameters.yaml
|
||||||
|
|
||||||
|
- name: name
|
||||||
|
- description: description
|
||||||
|
- project_id: project_id
|
||||||
|
- mode: bfd_monitor_mode
|
||||||
|
- dst_ip: bfd_monitor_dst_ip
|
||||||
|
- src_ip: bfd_monitor_src_ip
|
||||||
|
- min_rx: bfd_monitor_min_rx
|
||||||
|
- min_tx: bfd_monitor_min_tx
|
||||||
|
- multiplier: bfd_monitor_multiplier
|
||||||
|
- auth_type: bfd_monitor_auth_type
|
||||||
|
- auth_key: bfd_monitor_auth_key
|
||||||
|
|
||||||
|
Request Example
|
||||||
|
---------------
|
||||||
|
|
||||||
|
.. literalinclude:: samples/bfd/bfd_monitor-create-request.json
|
||||||
|
:language: javascript
|
||||||
|
|
||||||
|
Response Parameters
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
.. rest_parameters:: parameters.yaml
|
||||||
|
|
||||||
|
- bfd_monitors: bfd_monitor-obj
|
||||||
|
- description: description
|
||||||
|
- project_id: project_id
|
||||||
|
- name: name
|
||||||
|
- id: bfd_monitor_id
|
||||||
|
- mode: bfd_monitor_mode
|
||||||
|
- dst_ip: bfd_monitor_dst_ip
|
||||||
|
- src_ip: bfd_monitor_src_ip
|
||||||
|
- min_rx: bfd_monitor_min_rx
|
||||||
|
- min_tx: bfd_monitor_min_tx
|
||||||
|
- multiplier: bfd_monitor_multiplier
|
||||||
|
- status: bfd_monitor_status
|
||||||
|
- auth_type: bfd_monitor_auth_type
|
||||||
|
- auth_key: bfd_monitor_auth_key
|
||||||
|
|
||||||
|
Response Example
|
||||||
|
----------------
|
||||||
|
|
||||||
|
.. literalinclude:: samples/bfd/bfd_monitor-create-response.json
|
||||||
|
:language: javascript
|
||||||
|
|
||||||
|
Show BFD monitor details
|
||||||
|
========================
|
||||||
|
|
||||||
|
.. rest_method:: GET /v2.0/bfd_monitors/{monitor_id}
|
||||||
|
|
||||||
|
Shows details for a BFD monitor.
|
||||||
|
|
||||||
|
Normal response codes: 200
|
||||||
|
|
||||||
|
Error response codes: 401, 404
|
||||||
|
|
||||||
|
Request
|
||||||
|
-------
|
||||||
|
|
||||||
|
.. rest_parameters:: parameters.yaml
|
||||||
|
|
||||||
|
- monitor_id: bfd_monitor_id-path
|
||||||
|
|
||||||
|
Response Parameters
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
.. rest_parameters:: parameters.yaml
|
||||||
|
|
||||||
|
- bfd_monitors: bfd_monitor-obj
|
||||||
|
- description: description
|
||||||
|
- project_id: project_id
|
||||||
|
- name: name
|
||||||
|
- id: bfd_monitor_id
|
||||||
|
- mode: bfd_monitor_mode
|
||||||
|
- dst_ip: bfd_monitor_dst_ip
|
||||||
|
- src_ip: bfd_monitor_src_ip
|
||||||
|
- min_rx: bfd_monitor_min_rx
|
||||||
|
- min_tx: bfd_monitor_min_tx
|
||||||
|
- multiplier: bfd_monitor_multiplier
|
||||||
|
- status: bfd_monitor_status
|
||||||
|
- auth_type: bfd_monitor_auth_type
|
||||||
|
- auth_key: bfd_monitor_auth_key
|
||||||
|
|
||||||
|
Response Example
|
||||||
|
----------------
|
||||||
|
|
||||||
|
.. literalinclude:: samples/bfd/bfd_monitor-show-response.json
|
||||||
|
:language: javascript
|
||||||
|
|
||||||
|
Update BFD monitor
|
||||||
|
==================
|
||||||
|
|
||||||
|
.. rest_method:: PUT /v2.0/bfd_monitors/{monitor_id}
|
||||||
|
|
||||||
|
Updates a BFD monitor.
|
||||||
|
|
||||||
|
If the request is valid, the service returns the ``Accepted (202)``
|
||||||
|
response code.
|
||||||
|
|
||||||
|
Normal response codes: 202
|
||||||
|
|
||||||
|
Error response codes: 400, 401, 404, 412
|
||||||
|
|
||||||
|
Request
|
||||||
|
-------
|
||||||
|
|
||||||
|
.. rest_parameters:: parameters.yaml
|
||||||
|
|
||||||
|
- monitor_id: bfd_monitor_id-path
|
||||||
|
- name: name
|
||||||
|
- description: description
|
||||||
|
- min_rx: bfd_monitor_min_rx
|
||||||
|
- min_tx: bfd_monitor_min_tx
|
||||||
|
- multiplier: bfd_monitor_multiplier
|
||||||
|
|
||||||
|
Request Example
|
||||||
|
---------------
|
||||||
|
|
||||||
|
.. literalinclude:: samples/bfd/bfd_monitor-update-request.json
|
||||||
|
:language: javascript
|
||||||
|
|
||||||
|
Response Parameters
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
.. rest_parameters:: parameters.yaml
|
||||||
|
|
||||||
|
- bfd_monitors: bfd_monitor-obj
|
||||||
|
- description: description
|
||||||
|
- project_id: project_id
|
||||||
|
- name: name
|
||||||
|
- id: bfd_monitor_id
|
||||||
|
- mode: bfd_monitor_mode
|
||||||
|
- dst_ip: bfd_monitor_dst_ip
|
||||||
|
- src_ip: bfd_monitor_src_ip
|
||||||
|
- min_rx: bfd_monitor_min_rx
|
||||||
|
- min_tx: bfd_monitor_min_tx
|
||||||
|
- multiplier: bfd_monitor_multiplier
|
||||||
|
- status: bfd_monitor_status
|
||||||
|
- auth_type: bfd_monitor_auth_type
|
||||||
|
- auth_key: bfd_monitor_auth_key
|
||||||
|
|
||||||
|
Response Example
|
||||||
|
----------------
|
||||||
|
|
||||||
|
.. literalinclude:: samples/bfd/bfd_monitor-update-response.json
|
||||||
|
:language: javascript
|
||||||
|
|
||||||
|
Delete BFD monitor
|
||||||
|
==================
|
||||||
|
|
||||||
|
.. rest_method:: DELETE /v2.0/bfd_monitors/{monitor_id}
|
||||||
|
|
||||||
|
Deletes a BFD monitor.
|
||||||
|
|
||||||
|
Normal response codes: 204
|
||||||
|
|
||||||
|
Error response codes: 400, 401, 404, 412
|
||||||
|
|
||||||
|
Request
|
||||||
|
-------
|
||||||
|
|
||||||
|
.. rest_parameters:: parameters.yaml
|
||||||
|
|
||||||
|
- monitor_id: bfd_monitor_id-path
|
||||||
|
|
||||||
|
Response
|
||||||
|
--------
|
||||||
|
|
||||||
|
There is no body content for the response of a successful DELETE request.
|
||||||
|
|
||||||
|
Get BFD monitor session status
|
||||||
|
==============================
|
||||||
|
|
||||||
|
.. rest_method:: GET /v2.0/bfd_monitors/{monitor_id}/get_bfd_session_status
|
||||||
|
|
||||||
|
Shows BFD monitor's session status.
|
||||||
|
|
||||||
|
Normal response codes: 200
|
||||||
|
|
||||||
|
Error response codes: 401, 404
|
||||||
|
|
||||||
|
Request
|
||||||
|
-------
|
||||||
|
|
||||||
|
.. rest_parameters:: parameters.yaml
|
||||||
|
|
||||||
|
- monitor_id: bfd_monitor_id-path
|
||||||
|
|
||||||
|
Response Parameters
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
.. rest_parameters:: parameters.yaml
|
||||||
|
|
||||||
|
- remotes: bfd_monitor_status_remotes
|
||||||
|
|
||||||
|
Response Example
|
||||||
|
----------------
|
||||||
|
|
||||||
|
.. literalinclude:: samples/bfd/bfd_monitor_session_status-response.json
|
||||||
|
:language: javascript
|
||||||
|
|
||||||
|
Get BFD monitor associations
|
||||||
|
============================
|
||||||
|
|
||||||
|
.. rest_method:: GET /v2.0/bfd_monitors/{monitor_id}/get_bfd_monitor_associations
|
||||||
|
|
||||||
|
Shows BFD monitor's associations.
|
||||||
|
|
||||||
|
Normal response codes: 200
|
||||||
|
|
||||||
|
Error response codes: 401, 404
|
||||||
|
|
||||||
|
Request
|
||||||
|
-------
|
||||||
|
|
||||||
|
.. rest_parameters:: parameters.yaml
|
||||||
|
|
||||||
|
- monitor_id: bfd_monitor_id-path
|
||||||
|
|
||||||
|
Response Parameters
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
.. rest_parameters:: parameters.yaml
|
||||||
|
|
||||||
|
- remotes: bfd_monitor_associations_remotes
|
||||||
|
|
||||||
|
Response Example
|
||||||
|
----------------
|
||||||
|
|
||||||
|
.. literalinclude:: samples/bfd/bfd_monitor_association-response.json
|
||||||
|
:language: javascript
|
@ -34,6 +34,7 @@ Layer 3 Networking
|
|||||||
.. include:: subnetpools.inc
|
.. include:: subnetpools.inc
|
||||||
.. include:: subnetpool_prefix_ops.inc
|
.. include:: subnetpool_prefix_ops.inc
|
||||||
.. include:: subnets.inc
|
.. include:: subnets.inc
|
||||||
|
.. include:: bfd_monitors.inc
|
||||||
########
|
########
|
||||||
Security
|
Security
|
||||||
########
|
########
|
||||||
|
@ -19,6 +19,12 @@ agent_id-path:
|
|||||||
in: path
|
in: path
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
|
bfd_monitor_id-path:
|
||||||
|
description: |
|
||||||
|
The ID of the BFD monitor.
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
bgp_speaker_id-path:
|
bgp_speaker_id-path:
|
||||||
description: |
|
description: |
|
||||||
The ID of the BGP Speaker.
|
The ID of the BGP Speaker.
|
||||||
@ -1781,6 +1787,119 @@ bandwidth_limit_rules:
|
|||||||
in: body
|
in: body
|
||||||
required: true
|
required: true
|
||||||
type: array
|
type: array
|
||||||
|
bfd_monitor-obj:
|
||||||
|
description: |
|
||||||
|
A list of ``bfd_monitor`` objects.
|
||||||
|
in: body
|
||||||
|
required: true
|
||||||
|
type: object
|
||||||
|
bfd_monitor_associations_remotes:
|
||||||
|
description: |
|
||||||
|
List of dictionaries to list the routes details associated with
|
||||||
|
the BFD monitor:
|
||||||
|
|
||||||
|
* ``type`` for now it can be ``extra_route``.
|
||||||
|
* ``router`` is the uuid of the ``router`` of which ``route`` the
|
||||||
|
monitor is associated with.
|
||||||
|
* ``extra_route`` is a dict containing the ``destination`` , ``nexthop``
|
||||||
|
information.
|
||||||
|
* ``src_ip`` is the source ip address used as source for transmitted
|
||||||
|
BFD packets.
|
||||||
|
in: body
|
||||||
|
required: false
|
||||||
|
type: array
|
||||||
|
bfd_monitor_auth_key:
|
||||||
|
description: |
|
||||||
|
A dictionary of authentication key chain in which key is
|
||||||
|
an integer of ``Auth Key ID`` and value is a string of
|
||||||
|
``Password`` or ``Auth Key``.
|
||||||
|
in: body
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
bfd_monitor_auth_type:
|
||||||
|
description: |
|
||||||
|
The Authentication Type, which can be ``password``, ``MD5``,
|
||||||
|
``MeticulousMD5``, ``SHA1``, ``MeticulousSHA1``, if empty no
|
||||||
|
authentication is used.
|
||||||
|
in: body
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
bfd_monitor_dst_ip:
|
||||||
|
description: |
|
||||||
|
The destination IP address to be monitored.
|
||||||
|
in: body
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
bfd_monitor_id:
|
||||||
|
description: |
|
||||||
|
The ID of the BFD monitor.
|
||||||
|
in: body
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
bfd_monitor_min_rx:
|
||||||
|
description: |
|
||||||
|
The shortest interval, in milliseconds, at which this BFD session
|
||||||
|
offers to receive BFD control messages. At least 1. Default
|
||||||
|
is 1000.
|
||||||
|
in: body
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
bfd_monitor_min_tx:
|
||||||
|
description: |
|
||||||
|
The shortest interval, in milliseconds, at which this BFD session is
|
||||||
|
willing to transmit BFD control messages. At least 1. Default
|
||||||
|
is 100.
|
||||||
|
in: body
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
bfd_monitor_mode:
|
||||||
|
description: |
|
||||||
|
Can be ``asynchronous`` (default common echo mode of BFD) or
|
||||||
|
``demand`` (some other mechanism is used to detect link state)
|
||||||
|
or ``one_arm_echo`` and can accept future modes.
|
||||||
|
in: body
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
bfd_monitor_multiplier:
|
||||||
|
description: |
|
||||||
|
The BFD detection multiplier, An endpoint signals a connectivity
|
||||||
|
fault if the given number of consecutive BFD control messages fail
|
||||||
|
to arrive. Default is 3.
|
||||||
|
in: body
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
bfd_monitor_src_ip:
|
||||||
|
description: |
|
||||||
|
IP address used as source for transmitted BFD packets. If empty
|
||||||
|
then it will be the address of the router interface port.
|
||||||
|
in: body
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
bfd_monitor_status:
|
||||||
|
description: |
|
||||||
|
Shows if the BFD monitor was succesfully created in the backend,
|
||||||
|
but nothing about the session status, for that the
|
||||||
|
session_status API endpoint can be used.
|
||||||
|
in: body
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
bfd_monitor_status_remotes:
|
||||||
|
description: |
|
||||||
|
List of dictionaries with the following fields:
|
||||||
|
|
||||||
|
* ``type`` for now it can be``extra_route``.
|
||||||
|
* ``router`` is the uuid of the ``router`` of which ``route`` the
|
||||||
|
monitor is associated with.
|
||||||
|
* ``extra_route`` is a dict containing the ``destination`` , ``nexthop``
|
||||||
|
information.
|
||||||
|
* ``src_ip`` is the source ip address used as source for transmitted
|
||||||
|
BFD packets.
|
||||||
|
* ``status`` is a dict containing the following keys: ``SessionState``
|
||||||
|
and ``RemoteSessionState``, ``LocalDiagnostic`` and ``RemoteDiagnostic``
|
||||||
|
``LocalDiscriminator`` and ``RemoteDiscriminator``, ``Forwarding``.
|
||||||
|
in: body
|
||||||
|
required: false
|
||||||
|
type: array
|
||||||
bgp_peer_auth_type_body:
|
bgp_peer_auth_type_body:
|
||||||
description: |
|
description: |
|
||||||
The authentication type for the BGP Peer, can be ``none`` or ``md5``.
|
The authentication type for the BGP Peer, can be ``none`` or ``md5``.
|
||||||
|
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"bfd_monitor": {
|
||||||
|
"name": "bfd_monitor_1",
|
||||||
|
"description": "My BFD monitor",
|
||||||
|
"dst_ip": "192.168.100.12",
|
||||||
|
"src_ip": "169.254.112.144"
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"bfd_monitor": {
|
||||||
|
"project_id": "8d4c70a21fed4aeba121a1a429ba0d04",
|
||||||
|
"tenant_id": "8d4c70a21fed4aeba121a1a429ba0d04",
|
||||||
|
"id": "46ebaec0-0570-43ac-82f6-60d2b03168c4",
|
||||||
|
"name": "bfd_monitor_1",
|
||||||
|
"description": "My BFD monitor",
|
||||||
|
"mode": "asynchronous",
|
||||||
|
"dst_ip": "192.168.100.12",
|
||||||
|
"src_ip": "172.24.4.6",
|
||||||
|
"min_rx": "1000",
|
||||||
|
"min_tx": "100",
|
||||||
|
"multiplier": "3",
|
||||||
|
"status": "DOWN",
|
||||||
|
"auth_key": "None",
|
||||||
|
"auth_type": "None"
|
||||||
|
}
|
||||||
|
}
|
20
api-ref/source/v2/samples/bfd/bfd_monitor-list-response.json
Normal file
20
api-ref/source/v2/samples/bfd/bfd_monitor-list-response.json
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"bfd_monitors": [
|
||||||
|
{
|
||||||
|
"project_id": "8d4c70a21fed4aeba121a1a429ba0d04",
|
||||||
|
"tenant_id": "8d4c70a21fed4aeba121a1a429ba0d04",
|
||||||
|
"id": "46ebaec0-0570-43ac-82f6-60d2b03168c4",
|
||||||
|
"name": "bfd_monitor_1",
|
||||||
|
"description": "My BFD monitor",
|
||||||
|
"mode": "asynchronous",
|
||||||
|
"dst_ip": "192.168.100.12",
|
||||||
|
"src_ip": "172.24.4.6",
|
||||||
|
"min_rx": "1000",
|
||||||
|
"min_tx": "100",
|
||||||
|
"multiplier": "3",
|
||||||
|
"status": "UP",
|
||||||
|
"auth_key": "None",
|
||||||
|
"auth_type": "None"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
18
api-ref/source/v2/samples/bfd/bfd_monitor-show-response.json
Normal file
18
api-ref/source/v2/samples/bfd/bfd_monitor-show-response.json
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"bfd_monitor": {
|
||||||
|
"project_id": "8d4c70a21fed4aeba121a1a429ba0d04",
|
||||||
|
"tenant_id": "8d4c70a21fed4aeba121a1a429ba0d04",
|
||||||
|
"id": "46ebaec0-0570-43ac-82f6-60d2b03168c4",
|
||||||
|
"name": "bfd_monitor_1",
|
||||||
|
"description": "My BFD monitor",
|
||||||
|
"mode": "asynchronous",
|
||||||
|
"dst_ip": "192.168.100.12",
|
||||||
|
"src_ip": "172.24.4.6",
|
||||||
|
"min_rx": "1000",
|
||||||
|
"min_tx": "100",
|
||||||
|
"multiplier": "3",
|
||||||
|
"status": "ACTIVE",
|
||||||
|
"auth_key": "None",
|
||||||
|
"auth_type": "None"
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"bfd_monitor": {
|
||||||
|
"name": "bfd_monitor_1",
|
||||||
|
"description": "My BFD monitor",
|
||||||
|
"min_rx": "2000",
|
||||||
|
"min_tx": "1000",
|
||||||
|
"multiplier": 4
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"bfd_monitor": {
|
||||||
|
"project_id": "8d4c70a21fed4aeba121a1a429ba0d04",
|
||||||
|
"tenant_id": "8d4c70a21fed4aeba121a1a429ba0d04",
|
||||||
|
"id": "46ebaec0-0570-43ac-82f6-60d2b03168c4",
|
||||||
|
"name": "bfd_monitor_1",
|
||||||
|
"description": "My BFD monitor",
|
||||||
|
"mode": "asynchronous",
|
||||||
|
"dst_ip": "192.168.100.12",
|
||||||
|
"src_ip": "172.24.4.6",
|
||||||
|
"min_rx": "1000",
|
||||||
|
"min_tx": "100",
|
||||||
|
"multiplier": "3",
|
||||||
|
"status": "DOWN",
|
||||||
|
"auth_key": "None",
|
||||||
|
"auth_type": "None"
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"bfd_monitor_associations": {
|
||||||
|
"remotes": [{
|
||||||
|
"type": "extra_route",
|
||||||
|
"router": "60dc31ed-9dfc-4294-80b1-6b7876183631",
|
||||||
|
"extra_route": {
|
||||||
|
"destination": "10.0.3.0/24",
|
||||||
|
"nexthop": "10.0.0.1"
|
||||||
|
},
|
||||||
|
"src_ip": "169.254.112.144",
|
||||||
|
"dst_ip": "192.168.100.12",
|
||||||
|
"status": {
|
||||||
|
"SessionState": "Up",
|
||||||
|
"RemoteSessionState": "Up",
|
||||||
|
"LocalDiagnostic": "",
|
||||||
|
"RemoteDiagnostic": "",
|
||||||
|
"LocalDiscriminator": "0x524f0c0f",
|
||||||
|
"RemoteDiscriminator": "0xc2b5c555",
|
||||||
|
"Forwarding": "True"
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"bfd_session_status": {
|
||||||
|
"remotes": [{
|
||||||
|
"type": "extra_route",
|
||||||
|
"router": "60dc31ed-9dfc-4294-80b1-6b7876183631",
|
||||||
|
"extra_route": {
|
||||||
|
"destination": "10.0.3.0/24",
|
||||||
|
"nexthop": "10.0.0.1"
|
||||||
|
},
|
||||||
|
"src_ip": "169.254.112.144"
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
}
|
@ -19,6 +19,7 @@ from neutron_lib.api.definitions import allowedaddresspairs
|
|||||||
from neutron_lib.api.definitions import auto_allocated_topology
|
from neutron_lib.api.definitions import auto_allocated_topology
|
||||||
from neutron_lib.api.definitions import availability_zone
|
from neutron_lib.api.definitions import availability_zone
|
||||||
from neutron_lib.api.definitions import availability_zone_filter
|
from neutron_lib.api.definitions import availability_zone_filter
|
||||||
|
from neutron_lib.api.definitions import bfd_monitor
|
||||||
from neutron_lib.api.definitions import bgp
|
from neutron_lib.api.definitions import bgp
|
||||||
from neutron_lib.api.definitions import bgp_4byte_asn
|
from neutron_lib.api.definitions import bgp_4byte_asn
|
||||||
from neutron_lib.api.definitions import bgp_dragentscheduler
|
from neutron_lib.api.definitions import bgp_dragentscheduler
|
||||||
@ -150,6 +151,7 @@ _ALL_API_DEFINITIONS = {
|
|||||||
auto_allocated_topology,
|
auto_allocated_topology,
|
||||||
availability_zone,
|
availability_zone,
|
||||||
availability_zone_filter,
|
availability_zone_filter,
|
||||||
|
bfd_monitor,
|
||||||
bgp,
|
bgp,
|
||||||
bgp_4byte_asn,
|
bgp_4byte_asn,
|
||||||
bgp_dragentscheduler,
|
bgp_dragentscheduler,
|
||||||
|
@ -15,6 +15,8 @@ from neutron_lib import constants
|
|||||||
|
|
||||||
KNOWN_ATTRIBUTES = (
|
KNOWN_ATTRIBUTES = (
|
||||||
'admin_state_up',
|
'admin_state_up',
|
||||||
|
'auth_key',
|
||||||
|
'auth_type',
|
||||||
'allocation_pools',
|
'allocation_pools',
|
||||||
'cidr',
|
'cidr',
|
||||||
'default_prefixlen',
|
'default_prefixlen',
|
||||||
@ -23,6 +25,7 @@ KNOWN_ATTRIBUTES = (
|
|||||||
'device_id',
|
'device_id',
|
||||||
'device_owner',
|
'device_owner',
|
||||||
'dns_nameservers',
|
'dns_nameservers',
|
||||||
|
'dst_ip',
|
||||||
'enable_dhcp',
|
'enable_dhcp',
|
||||||
'enable_ndp_proxy',
|
'enable_ndp_proxy',
|
||||||
'external_gateways',
|
'external_gateways',
|
||||||
@ -37,6 +40,10 @@ KNOWN_ATTRIBUTES = (
|
|||||||
'mac_address',
|
'mac_address',
|
||||||
'max_prefixlen',
|
'max_prefixlen',
|
||||||
'min_prefixlen',
|
'min_prefixlen',
|
||||||
|
'min_rx',
|
||||||
|
'min_tx',
|
||||||
|
'mode',
|
||||||
|
'multiplier',
|
||||||
'name',
|
'name',
|
||||||
'network_id',
|
'network_id',
|
||||||
'port_id',
|
'port_id',
|
||||||
@ -46,10 +53,12 @@ KNOWN_ATTRIBUTES = (
|
|||||||
'qos_policy_id',
|
'qos_policy_id',
|
||||||
'service_types',
|
'service_types',
|
||||||
constants.SHARED,
|
constants.SHARED,
|
||||||
|
'src_ip',
|
||||||
'status',
|
'status',
|
||||||
'subnets',
|
'subnets',
|
||||||
'subnetpool_id',
|
'subnetpool_id',
|
||||||
'tenant_id'
|
'tenant_id',
|
||||||
|
'type'
|
||||||
)
|
)
|
||||||
|
|
||||||
KNOWN_RESOURCES = (
|
KNOWN_RESOURCES = (
|
||||||
|
106
neutron_lib/api/definitions/bfd_monitor.py
Normal file
106
neutron_lib/api/definitions/bfd_monitor.py
Normal file
@ -0,0 +1,106 @@
|
|||||||
|
# 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.
|
||||||
|
|
||||||
|
from neutron_lib.api import converters
|
||||||
|
from neutron_lib.api.definitions import l3
|
||||||
|
from neutron_lib import constants
|
||||||
|
from neutron_lib.db import constants as db_const
|
||||||
|
|
||||||
|
|
||||||
|
ALIAS = 'bfd-monitor'
|
||||||
|
IS_SHIM_EXTENSION = False
|
||||||
|
IS_STANDARD_ATTR_EXTENSION = False
|
||||||
|
NAME = 'BFD monitors for Neutron'
|
||||||
|
DESCRIPTION = "Provides support for BFD monitors"
|
||||||
|
UPDATED_TIMESTAMP = "2021-07-26T11:00:00-00:00"
|
||||||
|
BFD_MONITOR = 'bfd_monitor'
|
||||||
|
BFD_MONITORS = 'bfd_monitors'
|
||||||
|
BFD_SESSION_STATUS = 'bfd_session_status'
|
||||||
|
|
||||||
|
BFD_MODE_ASYNC = 'asynchronous'
|
||||||
|
BFD_MODE_DEMAND = 'demand'
|
||||||
|
BFD_MODE_ONE_ARM = 'one_arm_echo'
|
||||||
|
|
||||||
|
RESOURCE_ATTRIBUTE_MAP = {
|
||||||
|
BFD_MONITORS: {
|
||||||
|
'id': {'allow_post': False, 'allow_put': False,
|
||||||
|
'validate': {'type:uuid': None},
|
||||||
|
'is_visible': True,
|
||||||
|
'primary_key': True,
|
||||||
|
'enforce_policy': True},
|
||||||
|
'name': {'allow_post': True, 'allow_put': True,
|
||||||
|
'validate': {'type:string': db_const.NAME_FIELD_SIZE},
|
||||||
|
'default': '', 'is_filter': True, 'is_sort_key': True,
|
||||||
|
'is_visible': True},
|
||||||
|
'description': {'allow_post': True, 'allow_put': True,
|
||||||
|
'is_visible': True, 'default': '',
|
||||||
|
'validate': {
|
||||||
|
'type:string': db_const.DESCRIPTION_FIELD_SIZE}},
|
||||||
|
'project_id': {'allow_post': True, 'allow_put': False,
|
||||||
|
'validate': {
|
||||||
|
'type:string': db_const.PROJECT_ID_FIELD_SIZE},
|
||||||
|
'required_by_policy': True,
|
||||||
|
'is_visible': True, 'enforce_policy': True},
|
||||||
|
'mode': {'allow_post': True, 'allow_put': False,
|
||||||
|
'validate': {'type:string': db_const.STATUS_FIELD_SIZE},
|
||||||
|
'default': BFD_MODE_ASYNC, 'is_filter': True,
|
||||||
|
'is_sort_key': True, 'is_visible': True},
|
||||||
|
'dst_ip': {'allow_post': True, 'allow_put': False,
|
||||||
|
'validate': {'type:ip_address': None},
|
||||||
|
'is_sort_key': True, 'is_filter': True,
|
||||||
|
'is_visible': True, 'default': None,
|
||||||
|
'enforce_policy': True},
|
||||||
|
'src_ip': {'allow_post': True, 'allow_put': False,
|
||||||
|
'validate': {'type:ip_address_or_none': None},
|
||||||
|
'is_sort_key': True, 'is_filter': True,
|
||||||
|
'is_visible': True, 'default': None,
|
||||||
|
'enforce_policy': True},
|
||||||
|
'min_rx': {'allow_post': True, 'allow_put': True,
|
||||||
|
'validate': {'type:non_negative': None},
|
||||||
|
'convert_to': converters.convert_to_int,
|
||||||
|
'default': 1000,
|
||||||
|
'is_visible': True, 'enforce_policy': True},
|
||||||
|
'min_tx': {'allow_post': True, 'allow_put': True,
|
||||||
|
'validate': {'type:non_negative': None},
|
||||||
|
'convert_to': converters.convert_to_int,
|
||||||
|
'default': 100,
|
||||||
|
'is_visible': True, 'enforce_policy': True},
|
||||||
|
'multiplier': {'allow_post': True, 'allow_put': True,
|
||||||
|
'validate': {'type:non_negative': None},
|
||||||
|
'convert_to': converters.convert_to_int,
|
||||||
|
'default': 3,
|
||||||
|
'is_visible': True, 'enforce_policy': True},
|
||||||
|
'status': {'allow_post': False, 'allow_put': False,
|
||||||
|
'is_filter': True, 'is_sort_key': True,
|
||||||
|
'is_visible': True},
|
||||||
|
'auth_type': {'allow_post': True, 'allow_put': False,
|
||||||
|
'validate': {'type:string_or_none':
|
||||||
|
db_const.NAME_FIELD_SIZE},
|
||||||
|
'default': constants.ATTR_NOT_SPECIFIED,
|
||||||
|
'is_visible': True},
|
||||||
|
'auth_key': {'allow_post': True, 'allow_put': False,
|
||||||
|
'validate': {'type:dict_or_none': None},
|
||||||
|
'default': constants.ATTR_NOT_SPECIFIED,
|
||||||
|
'is_visible': True},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
SUB_RESOURCE_ATTRIBUTE_MAP = {}
|
||||||
|
ACTION_MAP = {
|
||||||
|
BFD_MONITOR: {
|
||||||
|
'get_bfd_session_status': 'GET',
|
||||||
|
'get_bfd_monitor_associations': 'GET',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ACTION_STATUS = {}
|
||||||
|
REQUIRED_EXTENSIONS = [l3.ALIAS]
|
||||||
|
OPTIONAL_EXTENSIONS = []
|
19
neutron_lib/tests/unit/api/definitions/test_bfd.py
Normal file
19
neutron_lib/tests/unit/api/definitions/test_bfd.py
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# 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.
|
||||||
|
|
||||||
|
from neutron_lib.api.definitions import bfd_monitor
|
||||||
|
from neutron_lib.tests.unit.api.definitions import base
|
||||||
|
|
||||||
|
|
||||||
|
class BFDDefinitionTestCase(base.DefinitionBaseTestCase):
|
||||||
|
extension_module = bfd_monitor
|
||||||
|
extension_resources = (bfd_monitor.BFD_MONITORS,)
|
@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- New extension ``bfd-monitor`` to allow creation of bfd_monitor instances,
|
||||||
|
and managing them. The API definition defines also ``bfd_session_status``
|
||||||
|
and ``bfd_monitor_associations`` actions to make possible checking the
|
||||||
|
session status of the bfd_monitor and its asscociated routes, and listing
|
||||||
|
the routes associated with the bfd_monitor.
|
||||||
|
(``Note`` that this API extension was merged as experimental to enable
|
||||||
|
parallel development of multiple backends. At the moment this API does
|
||||||
|
not have a reference implementation and should not be considered final.
|
||||||
|
A later release note will mark when the reference implementation gets
|
||||||
|
merged and the feauture is ready to be consumed.)
|
Loading…
Reference in New Issue
Block a user