distcloud/distributedcloud/dcmanager/api
twang4 8196e7f946 Add Subcloud Peer group management
Group of the current managed subclouds which are supposed
to be duplicated in a peer site as secondary subclouds.

This commit add subcloud-peer-group APIs of
create/delete/update/show/list/
list-subclouds of a subcloud-peer-group

Update setting peer-group for subcloud, Using DB of subclouds'
'peer_group_id' Column.

Update subcloud update API, add peer_group parameter
Usage:
Add a subcloud to peer-group:
dcmanager subcloud update SUBCLOUD --peer-group PEER_GROUP
Remove a subcloud from peer-group:
dcmanager subcloud update SUBCLOUD --peer-group none

Test Plan:
1. PASS - Create a subcloud-peer-group
2. PASS - Update an existing subcloud's peer-group to a existing
              subcloud-peer-group successfully;
3. PASS - Verify subcloud-peer-group list-subclouds can get the expected
              Subcloud above successfully;
4. PASS - Update group_priority/group_state/max_subcloud_rehoming/
               system_leader_id/system_leader_name
              of a subcloud-peer-group successfully;
5. PASS - Check can get subcloud status of a subcloud-peer-group
               successfully;
6. PASS - Delete a subcloud-peer-group completes successfully.
7. PASS - Delete a subcloud-peer-group while it still has subclouds
               associated to it. the subclouds' peer-group-id is auto
               set to None successfully;
8. PASS - Add a subcloud, update the peer-group-id as a non-existing
              subcloud-peer-group, get error message successfully;
9. PASS - Update subcloud peer group with invalid
               group_priority/group_state/max_subcloud_rehoming/
               system_leader_id/system_leader_name

Story: 2010852
Task: 48485
Change-Id: I93d0808b8cf02eba0e6f687007df42e2d2ea1848
Signed-off-by: Wang Tao <tao.wang@windriver.com>
2023-09-08 15:43:31 +08:00
..
controllers Add Subcloud Peer group management 2023-09-08 15:43:31 +08:00
policies Add Subcloud Peer group management 2023-09-08 15:43:31 +08:00
README.rst Move content to subdir to support relocated packaging 2019-11-04 13:57:02 -05:00
__init__.py Move content to subdir to support relocated packaging 2019-11-04 13:57:02 -05:00
api_config.py Implement access control for DC API 2022-09-22 18:26:35 -03:00
app.py DC Manager API request audit logging 2022-02-24 21:01:00 +00:00
policy.py Implement access control for DC API 2022-09-22 18:26:35 -03:00

README.rst

api

DC Manager API is Web Server Gateway Interface (WSGI) application to receive and process API calls, including keystonemiddleware to do the authentication, parameter check and validation, convert API calls to job rpc message, and then send the job to DC Manager Manager through the queue. If the job will be processed by DC Manager Manager in synchronous way, the DC Manager API will wait for the response from the DC Manager Manager. Otherwise, the DC Manager API will send response to the API caller first, and then send the job to DC Manager Manager in asynchronous way.

Multiple DC Manager API could run in parallel, and also can work in multi-worker mode.

Multiple DC Manager API will be designed and run in stateless mode, persistent data will be accessed (read and write) from the DC Manager Database through the DAL module.

Setup and encapsulate the API WSGI app

app.py:

Setup and encapsulate the API WSGI app, including integrate the keystonemiddleware app

api_config.py:

API configuration loading and init

enforcer.py

Enforces policies on the version2 APIs