From 5909126f575cabe716723ed7770492118dd01882 Mon Sep 17 00:00:00 2001 From: elajkat Date: Mon, 16 Jan 2023 15:19:07 +0100 Subject: [PATCH] api-ref: Add dragent scheduler api-ref Change-Id: I469b3793b3f265b30a6f5537745954cc10ad067a --- api-ref/source/v2/bgp_dragent_scheduler.inc | 97 +++++++++++++++++++ api-ref/source/v2/index.rst | 1 + api-ref/source/v2/parameters.yaml | 6 ++ .../bgp/dragent_add_speaker-request.json | 3 + ..._list_agents_hosting_speaker-response.json | 25 +++++ .../bgp/dragent_list_speakers-response.json | 17 ++++ 6 files changed, 149 insertions(+) create mode 100644 api-ref/source/v2/bgp_dragent_scheduler.inc create mode 100644 api-ref/source/v2/samples/bgp/dragent_add_speaker-request.json create mode 100644 api-ref/source/v2/samples/bgp/dragent_list_agents_hosting_speaker-response.json create mode 100644 api-ref/source/v2/samples/bgp/dragent_list_speakers-response.json diff --git a/api-ref/source/v2/bgp_dragent_scheduler.inc b/api-ref/source/v2/bgp_dragent_scheduler.inc new file mode 100644 index 000000000..dad883711 --- /dev/null +++ b/api-ref/source/v2/bgp_dragent_scheduler.inc @@ -0,0 +1,97 @@ +.. -*- rst -*- + +================================================= +BGP Speaker and Dynamic Routing Agent interaction +================================================= + +Add BGP Speaker to a Dynamic Routing Agent +========================================== + +.. rest_method:: POST /v2.0/agents/{bgp-agent-id}/bgp-drinstances + +Issue a ``POST`` request to ``/v2.0/agents/{bgp-agent-id}/bgp-drinstances`` to +add a BGP Speaker to the specified dynamic routing agent. + +Normal response codes: 201 + +Request +------- + +.. rest_parameters:: parameters.yaml + + - bgp_speaker_id: bgp_speaker-id-body + +Request Example +--------------- + +.. literalinclude:: samples/bgp/dragent_add_speaker-request.json + :language: javascript + +Response +-------- + +There is no body content for the response of a successful add +BGP Speaker to a Dynamic Routing Agent. + +List BGP speakers hosted by a Dynamic Routing Agent +=================================================== + +.. rest_method:: GET /v2.0/agents/{bgp-dragent-id}/bgp-drinstances + +Issue a ``GET`` request to ``/v2.0/agents/{bgp-dragent-id}/bgp-drinstances`` to +list all BGP Seakers hosted on the specified dynamic routing agent. + +Normal response codes: 200 + +Request +------- + +.. rest_parameters:: parameters.yaml + + - bgp-dragent-id: bgp_dragent_id-path + +Response Parameters +------------------- + +.. rest_parameters:: parameters.yaml + + - bgp_speakers: bgp_speakers + - id: bgp_speaker-id-body + - peers: bgp_peers + - name: bgp_speaker-name-body + - ip_version: bgp_speaker_ip_version-body + - advertise_floating_ip_host_routes: bgp_speaker_advertise_fip_host_routes-body + - advertise_tenant_networks: bgp_speaker_advertise_tenant_net-body + - local_as: bgp_speaker_local_as_body + - networks: bgp_speaker-networks-body + - project_id: project_id + +Response Example +---------------- + +.. literalinclude:: samples/bgp/dragent_list_speakers-response.json + :language: javascript + +Delete BGP Speaker from a Dynamic Routing Agent +=============================================== + +.. rest_method:: DELETE /v2.0/agents/{bgp-agent-id}/bgp-drinstances/{bgp-speaker-id} + +Issue a ``DELETE`` request to ``/v2.0/agents/{bgp-agent-id}/bgp-drinstances/{bgp-speaker-id}`` +to delete the BGP Speaker hosted by the specified dynamic routing agent. + +Normal response codes: 204 + +Request +------- + +.. rest_parameters:: parameters.yaml + + - bgp-speaker-id: bgp_speaker_id-path + - bgp-dragent-id: bgp_dragent_id-path + +Response +-------- + +There is no body content for the response of a successful DELETE request. + diff --git a/api-ref/source/v2/index.rst b/api-ref/source/v2/index.rst index 3a502926a..39d8684c1 100644 --- a/api-ref/source/v2/index.rst +++ b/api-ref/source/v2/index.rst @@ -98,6 +98,7 @@ BGP Dynamic Routing ################### .. include:: bgp_speaker.inc .. include:: bgp_peer.inc +.. include:: bgp_dragent_scheduler.inc ####### Logging ####### diff --git a/api-ref/source/v2/parameters.yaml b/api-ref/source/v2/parameters.yaml index 8ac8723a0..0434d50f5 100644 --- a/api-ref/source/v2/parameters.yaml +++ b/api-ref/source/v2/parameters.yaml @@ -19,6 +19,12 @@ agent_id-path: in: path required: true type: string +bgp_dragent_id-path: + description: | + The ID of the dynamic routing agent. + in: path + required: true + type: string bgp_speaker_id-path: description: | The ID of the BGP Speaker. diff --git a/api-ref/source/v2/samples/bgp/dragent_add_speaker-request.json b/api-ref/source/v2/samples/bgp/dragent_add_speaker-request.json new file mode 100644 index 000000000..7f6d4016d --- /dev/null +++ b/api-ref/source/v2/samples/bgp/dragent_add_speaker-request.json @@ -0,0 +1,3 @@ +{ + "bgp_speaker_id": "5639072c-49eb-480a-9f11-953386589bc8" +} \ No newline at end of file diff --git a/api-ref/source/v2/samples/bgp/dragent_list_agents_hosting_speaker-response.json b/api-ref/source/v2/samples/bgp/dragent_list_agents_hosting_speaker-response.json new file mode 100644 index 000000000..40946d97b --- /dev/null +++ b/api-ref/source/v2/samples/bgp/dragent_list_agents_hosting_speaker-response.json @@ -0,0 +1,25 @@ +{ + "agents":[ + { + "binary":"neutron-bgp-dragent", + "description":null, + "admin_state_up":true, + "heartbeat_timestamp":"2016-05-17 03:05:12", + "availability_zone":null, + "alive":true, + "topic":"bgp_dragent", + "host":"yangyubj-virtual-machine", + "agent_type":"BGP dynamic routing agent", + "resource_versions":{ + }, + "created_at":"2016-05-09 07:38:00", + "started_at":"2016-05-11 09:06:13", + "id":"af216618-29d3-4ee7-acab-725bdc90e614", + "configurations":{ + "advertise_routes":0, + "bgp_peers":0, + "bgp_speakers":1 + } + } + ] +} \ No newline at end of file diff --git a/api-ref/source/v2/samples/bgp/dragent_list_speakers-response.json b/api-ref/source/v2/samples/bgp/dragent_list_speakers-response.json new file mode 100644 index 000000000..6001b4dac --- /dev/null +++ b/api-ref/source/v2/samples/bgp/dragent_list_speakers-response.json @@ -0,0 +1,17 @@ +{ + "bgp_speakers":[ + { + "peers":[ + ], + "name":"bgp-speaker", + "tenant_id":"34a6e17a48cf414ebc890367bf42266b", + "local_as":1000, + "advertise_tenant_networks":true, + "networks":[ + ], + "ip_version":4, + "advertise_floating_ip_host_routes":true, + "id":"b759b2a1-27f4-4a6b-bb61-f2c9a22c9902" + } + ] +} \ No newline at end of file