Files
distcloud/distributedcloud/dcmanager/api
Andre Carneiro fe50d060c8 Add check to prevent concurrent backup operations
This commit adds semantic check to avoid concurrent backup and
restore operations on the same subcloud. This check is used twice:
- By the API, to return an error if all the subclouds, specified using
either --subcloud or --group options, have an ongoing backup and
restore operation.
- By the backend, to filter out any subclouds where backup and
restore operations are in progress so that concurrent
operations aren't triggered.

Test Plan:
1. PASS - Validate that concurrent backup create operations can't be
triggered on a subcloud using the --subcloud option.
2. PASS - Validate that the API returns an error if all the subclouds
specified have an ongoing backup create operation.
3. PASS - Validate that concurrent backup operations aren't started on
any subclouds when using the --group option.
4. PASS - Validate that concurrent backup restore operations can't be
triggered on a subcloud using the --subcloud option.
5. PASS - Validate that the API returns an error if all the subclouds
specified have an ongoing backup restore operation.
6. PASS - Validate that concurrent backup restore operations aren't
started on any subclouds when using the --group option.

Closes-Bug: 1998500

Signed-off-by: Andre Carneiro <Andre.DexheimerCarneiro@windriver.com>
Change-Id: Ic11de20d7a323c400070cc41131b81dc5e3ddd56
2022-12-06 15:27:29 -03:00
..
2022-02-24 21:01:00 +00:00
2022-09-22 18:26:35 -03:00

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