### Sample API Call to Get Orphan Databases Source: https://github.com/netcracker/qubership-dbaas/blob/main/docs/rest-api.md Example of how to call the Get Orphan Databases API using curl. This demonstrates the request method, headers, and the JSON payload containing the namespaces. ```bash curl --location --request GET 'http://localhost:8080/api/bluegreen/v1/operation/orphans' \ --header 'Content-Type: application/json' \ --header 'Authorization: Basic Y2x1c3Rlci1kYmE6Qm5tcTU1NjdfUE8=' \ --data '{ "namespaces": [ "sosh-ns-1", "sosh-ns-2" ] }' ``` -------------------------------- ### Sample API Call for Debugging Rules Source: https://github.com/netcracker/qubership-dbaas/blob/main/docs/rest-api.md Example of how to call the microservice balancing rules debugging API using curl. ```bash curl --request POST 'http://localhost:8080/api/v3/dbaas/cloud-core-dev-1/physical_databases/rules/debug' \ --header 'Authorization: Basic Y2x1c3Rlci1kYmE6Qm5tcTU1NjdfUE8=' \ --header 'Content-Type: application/json' \ --data '{ \ "rules": [ \ { \ "microservices": [ \ "tenant-manager", \ "site-management" \ ], \ "rules": [ \ { \ "label": "core-postgresql_nalancing_rules=core-postgresql" \ } \ ], \ "type": "postgresql" \ } \ ], \ "microservices": ["tenant-manager", "site-management"] \ }' ``` -------------------------------- ### Sample Success Response Body Source: https://github.com/netcracker/qubership-dbaas/blob/main/docs/rest-api.md Example JSON response body for a successfully created or retrieved database. ```json { "id": "475ebd72-1409-4a06-8bd8-e408f21e3819", "classifier": { "microserviceName": "test-service", "namespace": "cloud-core-dev1", "scope": "service" }, "namespace": "cloud-core-dev1", "type": "postgresql", "name": "dbaas_c4245fb2989c48b38ded815c61a95e82", "externallyManageable": false, "timeDbCreation": "2023-03-07T08:08:09.631+00:00", "settings": null, "backupDisabled": false, "physicalDatabaseId": "core-postgresql", "connectionProperties": { "host": "pg-patroni.core-postgresql", "name": "dbaas_c4245fb2989c48b38ded815c61a95e82", "password": "126ccad16e05400fa03be2a3e1461e87", "port": 5432, "role": "admin", "url": "jdbc:postgresql://pg-patroni.core-postgresql:5432/dbaas_c4245fb2989c48b38ded815c61a95e82", "username": "dbaas_e54c65c92d464c2f885078d03354ade6" } } ``` -------------------------------- ### Sample cURL Request to Create Database Source: https://github.com/netcracker/qubership-dbaas/blob/main/docs/rest-api.md Example of how to use cURL to send a PUT request to create a new PostgreSQL database. ```bash curl -X PUT \ http://localhost:8080/api/v3/dbaas/cloud-core-dev1/databases \ -H 'Content-Type: application/json' \ -H 'Authorization: Basic Y2x1c3Rlci1kYmE6Qm5tcTU1NjdfUE8=' \ -d '{ \ "classifier":{ \ "microserviceName":"test-service", \ "scope":"service", "namespace":"cloud-core-dev1" \ }, \ "type":"postgresql", \ "originService":"test-service" \ }' ``` -------------------------------- ### Sample API Call to List Databases Source: https://github.com/netcracker/qubership-dbaas/blob/main/docs/rest-api.md Example of how to call the List Databases API using curl, including authorization headers and query parameters. ```bash curl -X GET \ http://localhost:8080/api/v3/dbaas/cloud-core-dev-1/databases/list?withResources=false \ -H 'Authorization: Basic Y2x1c3Rlci1kYmE6Qm5tcTU1NjdfUE8=' ``` -------------------------------- ### Classifier with Custom Key Example Source: https://github.com/netcracker/qubership-dbaas/blob/main/docs/rest-api.md An example illustrating how to use custom keys within a classifier to uniquely identify a database for a second service, using 'logicalDbId' as an example custom key. ```text "classifier":{ "tenantId": id, //mandatory if you use tenant scope "microserviceName": "name", //mandatory "scope": "tenant"|"service", //mandatory "namespace": "namespace" //mandatory "logicalDbId": "second-service-db" } ``` -------------------------------- ### Sample Database Response Source: https://github.com/netcracker/qubership-dbaas/blob/main/docs/rest-api.md Example JSON response body for the List Databases API, showing the structure of database information. ```json [ { "id": "475ebd72-1409-4a06-8bd8-e408f21e3819", "classifier": { "microserviceName": "test-service", "namespace": "cloud-core-dev1", "scope": "service" }, "namespace": "cloud-core-dev1", "type": "postgresql", "name": "dbaas_c4245fb2989c48b38ded815c61a95e82", "externallyManageable": false, "timeDbCreation": "2023-03-07T08:08:09.631+00:00", "settings": null, "backupDisabled": false, "physicalDatabaseId": "core-postgresql", "connectionProperties": [ { "host": "pg-patroni.core-postgresql", "name": "dbaas_c4245fb2989c48b38ded815c61a95e82", "encryptedPassword": "{v2c}{AES}{DEFAULT_KEY}{4llOhNokx+N2tHiM1ryv0A==}", "port": 5432, "role": "admin", "url": "jdbc:postgresql://pg-patroni.core-postgresql:5432/dbaas_c4245fb2989c48b38ded815c61a95e82", "username": "dbaas_e54c65c92d464c2f885078d03354ade6" } ] }, {} ] ``` -------------------------------- ### Get All Backups of Namespace Source: https://github.com/netcracker/qubership-dbaas/blob/main/docs/rest-api.md Lists all backups prepared for a specified namespace. Requires 'backup-daemon' role for authorization. ```APIDOC GET {dbaas_host}/api/v3/dbaas/{namespace}/backups Parameters: namespace (Path, required): The namespace for which to list backups. Authorization: Basic type with credentials with `backup-daemon` role. Success Response: 200: Successfully returned backups. Schema: < [NamespaceBackup](#namespacebackup) > array Sample Call: Request: curl --request GET 'http://localhost:8080/api/v3/dbaas/test-database/backups' \ --header 'Authorization: Basic YmFja3VwLWRhZW1vbjpoZmZfZTM0X0pmcnQ=' Response: OK 200 ``` -------------------------------- ### Sample cURL Request to Get Database Source: https://github.com/netcracker/qubership-dbaas/blob/main/docs/rest-api.md Demonstrates how to call the 'Get database by classifier' API endpoint using cURL. Includes setting the authorization header, content type, and the request body with classifier information. ```bash curl -X POST \ http://localhost:8080/api/v3/dbaas/cloud-core-dev1/databases/get-by-classifier/postgresql \ -H "Authorization: Basic Y2x1c3Rlci1kYmE6Qm5tcTU1NjdfUE8=" \ -H 'Content-Type: application/json' \ -d '{ "classifier": { "microserviceName": "test-service", "namespace": "cloud-core-dev1", "scope": "service" }, "originService":"test-service" }' ``` -------------------------------- ### Sample Curl Request Source: https://github.com/netcracker/qubership-dbaas/blob/main/docs/rest-api.md Example of how to call the extended process status API using curl. It demonstrates setting the HTTP method, URI, and authorization header. ```bash curl --location --request GET 'http://localhost:8080/api/declarations/v1/operation/{trackingId}/extendedTroubleshootingInfo' \ --header 'Authorization: Basic Y2x1c3Rlci1kYmE6Qm5tcTU1NjdfUE8=' ``` -------------------------------- ### Sample Success Response for Debugging Rules Source: https://github.com/netcracker/qubership-dbaas/blob/main/docs/rest-api.md Example JSON response when the microservice balancing rules debugging API call is successful. ```json { "tenant-manager": { "postgresql": { "labels": { "core-postgresql_nalancing_rules": "core-postgresql" }, "physicalDbIdentifier": "core-postgresql", "appliedRuleInfo": "Microservice balancing rule was applied." } }, "site-management": { "postgresql": { "labels": { "core-postgresql_nalancing_rules": "core-postgresql" }, "physicalDbIdentifier": "core-postgresql", "appliedRuleInfo": "Microservice balancing rule was applied." } } } ``` -------------------------------- ### Sample cURL Request for Recreate Database Source: https://github.com/netcracker/qubership-dbaas/blob/main/docs/rest-api.md Example of how to call the 'Recreate database' API endpoint using cURL. It demonstrates the correct method, URL, headers, and request body format. ```bash curl -X POST \ http://localhost:8080/api/v3/dbaas/namespaces/test-namespace/databases/recreate \ -H "Authorization: Basic ZGJhYXMtZGItZWRpdG9yOjllUm1fUTU1ZmU=" \ -H 'Content-Type: application/json' \ -d '[ { "classifier":{ "microserviceName":"test-service", "scope":"service", "namespace":"test-namespace" }, "physicalDatabaseId": "phys-db-id-123", "type": "postgresql" } ]' ``` -------------------------------- ### Create or Get Database Source: https://github.com/netcracker/qubership-dbaas/blob/main/docs/rest-api.md Creates a new database or retrieves an existing one with its connection information. Supports asynchronous creation via the 'async' query parameter. ```APIDOC PUT {dbaas_host}/api/v3/dbaas/{namespace}/databases Headers: Content-Type: application/json Authorization: Basic type with credentials with `dba_client` role. Specified as `DBAAS_CLUSTER_DBA_CREDENTIALS_USERNAME` and `DBAAS_CLUSTER_DBA_CREDENTIALS_PASSWORD` Parameters: namespace (string, required): Namespace for the database. async (boolean, optional): If true, returns 202 immediately for asynchronous creation. Request Body: createRequest (object, required): Database creation request payload. classifier (object): microserviceName (string) scope (string) namespace (string) type (string): Type of database (e.g., 'postgresql'). originService (string) Success Responses: 200: Database already exists. Returns DatabaseResponse. 201: Database created successfully. Returns DatabaseResponse. 202: Database creation in progress. Returns DatabaseResponse. Error Responses: 400: No suitable adapter for the database type. 401: Insufficient role privileges. 403: Access denied for the namespace. 500: Internal DBaaS error. DatabaseResponse Schema: id (string) classifier (object) namespace (string) type (string) name (string) externallyManageable (boolean) timeDbCreation (string, format: date-time) settings (any) backupDisabled (boolean) physicalDatabaseId (string) connectionProperties (object): host (string) name (string) password (string) port (integer) role (string) url (string) username (string) ``` -------------------------------- ### Sample Success Response Body Source: https://github.com/netcracker/qubership-dbaas/blob/main/docs/rest-api.md Example of a successful response body when recreating a database. It includes details of the successfully recreated database, including its new ID and classifier. ```json { "successfully":[ { "classifier":{ "microserviceName":"test-service", "scope":"service", "namespace":"test-namespace" }, "type":"postgresql", "newDb":{ "id":"8a8af799-47c2-4b3d-a7ff-db8ba4bd6f09", "classifier":{ "microserviceName":"test-service", "scope":"service", "namespace":"test-namespace" }, "connectionProperties":{ ... }, "resources":[ ... ] } } ] } ``` -------------------------------- ### Sample DBaaS API Response Body Source: https://github.com/netcracker/qubership-dbaas/blob/main/docs/rest-api.md Provides an example of a successful JSON response body when querying DBaaS entities, detailing the structure and content of a logical database entry. ```json [ { "namespace": "dbaas-autotests", "microservice": "dbaas-declarative-service", "tenantId": "ce22b065-1e61-4076-99b1-e397b6da741b", "logicalDbName": "configs", "bgVersion": "2", "type": "opensearch", "roles": [ "admin", "streaming", "rw", "ro" ], "name": "dbaas-declarative-service_dbaas-autotests_175104799071124", "physicalDbId": "postgresql-dev:postgres", "physicalDbAdapterUrl": "http://dbaas-postgres-adapter.postgresql-dev:8080", "declaration": { "id": "4cb9e41a-e4b2-4529-98fc-392c72873c75", "settings": null, "lazy": false, "instantiationApproach": "new", "versioningApproach": "new", "versioningType": "static", "classifier": { "custom_keys": { "logicalDBName": "configs" }, "microserviceName": "dbaas-declarative-service", "namespace": "dbaas-autotests", "scope": "service" }, "type": "postgresql", "namePrefix": null, "namespace": "dbaas-autotests" } } ] ``` -------------------------------- ### Sample cURL Request to Register Databases Source: https://github.com/netcracker/qubership-dbaas/blob/main/docs/rest-api.md A sample cURL command demonstrating how to call the Register Databases API. It includes the necessary headers, authorization token, and a JSON payload representing the database to be registered. ```bash curl --request PUT 'http://localhost:8080/api/v3/dbaas/migration/databases' \ --header 'Authorization: Basic Y2x1c3Rlci1kYmE6Qm5tcTU1NjdfUE8=' \ --header 'Content-Type: application/json' \ --data '[\ {\ "adapterId": "uuid-adapter-id",\ "backupDisabled": true,\ "classifier":{\ "microserviceName":"test-service",\ "scope":"service", \ "namespace":"test-namespace"\ },\ "connectionProperties": [\ {\ "password":"test-pwd",\ "role":"admin",\ "port":5432,\ "host":"pg-patroni.core-postgresql",\ "name":"dbaas_db_name",\ "url":"jdbc:postgresql://pg-patroni.core-postgresql:5432/dbaas_db_name",\ "username":"dbaas_user_name"\ } ],\ "name": "dbaas_db_name",\ "namespace": "test-namespace",\ "physicalDatabaseId": "core-postgresql",\ "resources": [\ {\ "kind": "user",\ "name": "pg_admin_user"\ } ],\ "type": "postgresql"\ } ]' ``` -------------------------------- ### Password Change Response Example Source: https://github.com/netcracker/qubership-dbaas/blob/main/docs/rest-api.md Example JSON response body indicating successful password changes and any failures. ```json { "changed":[ { "classifier":{ "microserviceName":"test-service", "scope":"service", "namespace":"test-namespace" }, "connection":{ "password":"763cc8be6f0a4756b6b48f50e6a63ed8", "role":"admin", "port":5432, "host":"pg-patroni.core-postgresql", "name":"dbaas_autotests_677188448d914e67b1818d637a995184", "url":"jdbc:postgresql://pg-patroni.core-postgresql:5432/dbaas_autotests_677188448d914e67b1818d637a995184", "username":"dbaas_49e7c0c76765454f9ce8bf0ceea0b923" } } ], "failed":[] } ``` -------------------------------- ### Get Orphan Databases API Source: https://github.com/netcracker/qubership-dbaas/blob/main/docs/rest-api.md Retrieves a list of orphan databases by specifying a list of namespaces. The API supports GET requests and requires specific authorization headers. The response includes a list of databases with their details or an error message. ```APIDOC GET /api/bluegreen/v1/operation/orphans Headers: Content-Type: application/json Authorization: Basic type with credentials with `dba_client` role. Request Body: namespaces (List, required): List of namespaces for collecting orphan databases. Success Response: 200: List of databases (List) Error Response: 400: Bad request (String) 500: Internal processing error (String) ``` -------------------------------- ### Get Backup Information Source: https://github.com/netcracker/qubership-dbaas/blob/main/docs/rest-api.md Retrieves restoration information for a specific backup process. Requires authentication with the 'backup-daemon' role. ```APIDOC GET {dbaas_host}/api/v3/dbaas/{namespace}/backups/{backupId} Parameters: - backupId (Path, required, string (uuid)): Identifier of backup process. - namespace (Path, required, string): Namespace where backup was made. Headers: - Authorization: Basic type with credentials with `backup-daemon` role. Success Response: - 200: Backup info was successfully collected. Schema: [NamespaceBackup](#namespacebackup) Error Response: - 404: Selected backup or restoration not found. No Content. ``` ```bash curl --request GET 'http://localhost:8080/api/v3/dbaas/dbaas-autotests/backups/00175878-a80f-43e4-990c-2036df499297' \ --header 'Authorization: Basic YmFja3VwLWRhZW1vbjpoZmZfZTM0X0pmcnQ=' Response: OK 200 ``` -------------------------------- ### Sample cURL Request to Register Physical Database Source: https://github.com/netcracker/qubership-dbaas/blob/main/docs/rest-api.md A sample cURL command demonstrating how to register a PostgreSQL physical database. It includes the necessary headers, authorization token, and a JSON payload with adapter details, credentials, labels, metadata, and status. ```bash curl --request PUT 'https://localhost:8080/api/v3/dbaas/postgresql/physical_databases/postgresql-core-tls' \ --header 'Authorization: Basic Y2x1c3Rlci1kYmE6Qm5tcTU1NjdfUE8=' \ --header 'Content-Type: application/json' \ --data '{ \ "adapterAddress":"https://dbaas-postgres-adapter.postgresql-core-tls:8080", \ "httpBasicCredentials":{ \ "password":"dbaas-aggregator", \ "username":"dbaas-aggregator" \ }, \ "lables":{ \ "clusterName":"common" \ }, \ "metadata":{ \ "apiVersion":"v2", \ "supportedRoles":[ \ "admin" \ ], \ "features":{ \ "multiusers":false, \ "tls":true \ } \ }, \ "status":"run" \ }' ``` -------------------------------- ### Sample API Call for DBaaS Entities Source: https://github.com/netcracker/qubership-dbaas/blob/main/docs/rest-api.md Demonstrates a sample curl request to the DBaaS API, including query parameters for filtering and headers for authorization and content negotiation. ```bash curl --location --request GET 'http://localhost:8080/api/v3/dbaas/debug/internal/databases?filter=namespace==dbaas-autotests; \ microservice==dbaas-declarative-service; \ logicalDbName==configs; \ type!=clickhouse; \ roles=in=("ro","rw"); \ physicalDbId==postgresql-dev:postgres; \ physicalDbAdapterUrl==http://dbaas-postgres-adapter.postgresql-dev:8080' \ -H 'Authorization: Basic Y2x1c3Rlci1kYmE6Qm5tcTU1NjdfUE8=' \ -H 'Accept: application/json' ``` -------------------------------- ### DBaaS Aggregator API Overview Source: https://github.com/netcracker/qubership-dbaas/blob/main/README.md This section provides an overview of the DBaaS Aggregator API, its purpose as a database management aggregator, and its reliance on adapters and classifiers for routing and identification. It also links to installation notes and further API documentation. ```APIDOC DBaaS Aggregator API Overview This documentation presents the REST API for the “Database as a Service” (DBaaS) component. DBaaS acts as an aggregator for all adapters. It is designed to collect requests for managed databases and route them to the appropriate adapter. DBaaS stores information about all databases used in a cloud project. These databases are isolated by namespace. DBaaS uses a Classifier to identify databases within a cloud namespace. The Classifier includes service-related information such as scope, microservice name, tenant ID, and namespace. * Installation notes: [installation note.md](./docs/installation/installation.md) * List of supported APIs: [rest-api docs](./docs/rest-api.md) * Information about DBaaS features: https://perch.qubership.org/display/CLOUDCORE/DbaaS+Features ``` -------------------------------- ### Sample API Response - Debugging Rules Source: https://github.com/netcracker/qubership-dbaas/blob/main/docs/rest-api.md Example JSON response from the microservice balancing rules debugging API. It shows the mapping of microservices to their assigned physical databases and the applied rule labels. ```json { "tenant-manager": { "postgresql": { "labels": { "core-postgresql_nalancing_rules": "core-postgresql" }, "physicalDbIdentifier": "core-postgresql", "appliedRuleInfo": "Microservice balancing rule was applied." } }, "site-management": { "postgresql": { "labels": { "core-postgresql_nalancing_rules": "core-postgresql" }, "physicalDbIdentifier": "core-postgresql", "appliedRuleInfo": "Microservice balancing rule was applied." } } } ``` -------------------------------- ### Get Database Statuses Source: https://github.com/netcracker/qubership-dbaas/blob/main/docs/rest-api.md Retrieves a list of all databases, categorized by their status (ghost, lost, deleting) and adapter type. This endpoint is deprecated. ```APIDOC GET {dbaas_host}/api/v3/dbaas/{namespace}/databases/statuses Headers: not required Authorization: Basic type with credentials with `dba_client` role. Specified as `DBAAS_CLUSTER_DBA_CREDENTIALS_USERNAME` and `DBAAS_CLUSTER_DBA_CREDENTIALS_PASSWORD`. Request body: | Type | Name | Description | |----------|---------------------------------------|--------------------------------------------------------------------------| | **Path** | **namespace**
*required* | Project namespace in which the base is used | Success Response: | HTTP Code | Description | Schema | |-----------|------------------------------------|---------------------------------| | **200** | List of ghosts and lost databases. | [DatabasesInfo](#databasesinfo) | Error Response: | HTTP Code | Description | |-----------|-------------------------------------------------------------------------| | **500** | Requested role is not allowed | ``` ```bash curl -X GET \ http://localhost:8080/api/v3/dbaas/test-dbaas/databases/statuses \ -H "Authorization: Basic Y2x1c3Rlci1kYmE6Qm5tcTU1NjdfUE8=" ``` -------------------------------- ### Sample API Call - Debugging Rules Source: https://github.com/netcracker/qubership-dbaas/blob/main/docs/rest-api.md Example cURL command to send a POST request to the microservice balancing rules debugging API. It includes the authorization header, content type, and a JSON payload with rules and microservices for debugging. ```bash curl --request POST 'http://localhost:8080/api/v3/dbaas/cloud-core-dev-1/physical_databases/rules/debug' \ --header 'Authorization: Basic Y2x1c3Rlci1kYmE6Qm5tcTU1NjdfUE8=' \ --header 'Content-Type: application/json' \ --data '{ \ "rules": [ \ { \ "microservices": [ \ "tenant-manager", \ "site-management" \ ], \ "rules": [ \ { \ "label": "core-postgresql_nalancing_rules=core-postgresql" \ } \ ], \ "type": "postgresql" \ } \ ], \ "microservices": ["tenant-manager", "site-management"] \ }' ``` -------------------------------- ### Get Ghost Databases API Source: https://github.com/netcracker/qubership-dbaas/blob/main/docs/rest-api.md Retrieves a list of databases that exist in the adapter but are not registered in DBaaS. Requires basic authentication with the 'dba_client' role. ```APIDOC GET {dbaas_host}/api/v3/dbaas/debug/internal/ghost Headers: Not required Authorization: Basic type with credentials with `dba_client` role. Specified as `DBAAS_CLUSTER_DBA_CREDENTIALS_USERNAME` and `DBAAS_CLUSTER_DBA_CREDENTIALS_PASSWORD`. Request body: No Success Response: 200: List of databases with name (array of GhostDatabasesResponse) Error Response: 500: Internal error (No Content) Sample call: Request: curl -X GET \ http://localhost:8080/api/v3/dbaas/debug/internal/ghost \ -H 'Authorization: Basic Y2x1c3Rlci1kYmE6Qm5tcTU1NjdfUE8=' Response body: [ { "physicalDatabaseId": "redis-dev", "dbNames": [], "errorMessage": null }, { "physicalDatabaseId": "postgresql-dev:postgres", "dbNames": [ "dbaas_autotests_b3a63ae3795", "template0", "dbaas_autotests_990c9ea8317", "template1", "dbaas_dev", "dbaas-test-service_candidate-test-namespace_120530154311024", "dbaas-declarative-service_dbaas-autotests_143622345041124", "dbaas-test-service_active-test-namespace_081927841021124", "dbaas-test-service_dbaas-autotests_143628563041124", "postgres" ], "errorMessage": null } ] ``` ```bash curl -X GET \ http://localhost:8080/api/v3/dbaas/debug/internal/ghost \ -H 'Authorization: Basic Y2x1c3Rlci1kYmE6Qm5tcTU1NjdfUE8=' ``` ```json [ { "physicalDatabaseId": "redis-dev", "dbNames": [], "errorMessage": null }, { "physicalDatabaseId": "postgresql-dev:postgres", "dbNames": [ "dbaas_autotests_b3a63ae3795", "template0", "dbaas_autotests_990c9ea8317", "template1", "dbaas_dev", "dbaas-test-service_candidate-test-namespace_120530154311024", "dbaas-declarative-service_dbaas-autotests_143622345041124", "dbaas-test-service_active-test-namespace_081927841021124", "dbaas-test-service_dbaas-autotests_143628563041124", "postgres" ], "errorMessage": null } ] ``` -------------------------------- ### Sample cURL Request for User Restore Source: https://github.com/netcracker/qubership-dbaas/blob/main/docs/rest-api.md Example of how to call the user restore API using cURL. It includes the necessary headers for authorization and content type, along with a sample JSON payload specifying the database type and classifier details. ```bash curl --request POST 'http://localhost:8080/api/v3/dbaas/users/restore' \ --header 'Authorization: Basic Y2x1c3Rlci1kYmE6Qm5tcTU1NjdfUE8=' \ --header 'Content-Type: application/json' \ --data '{ \ "classifier":{ \ "microserviceName":"test-service", \ "scope":"service", "namespace":"test-namespace" \ }, "type": "postgresql" \ }' ``` -------------------------------- ### Bulk Get Restoration Info Source: https://github.com/netcracker/qubership-dbaas/blob/main/docs/rest-api.md Retrieves the status and details of a specific database restoration process. Requires basic authentication with the 'backup-daemon' role. ```APIDOC GET {dbaas_host}/api/v3/dbaas/backups/{backupId}/restorations/{restorationId} Headers: Not Required Authorization: Basic type with credentials with `backup-daemon` role. Path Parameters: - backupId (string, uuid, required): Identifier of backup process - restorationId (string, uuid, required): Identifier of restore process Success Responses: - 200: Backup validated and can be restored (returns NamespaceBackup schema) Error Responses: - 404: Selected backup or restoration not found ``` ```bash curl --request GET 'http://localhost:8080/api/v3/dbaas/backups/0b53eb7c-a0bb-419a-a81c-27bc3f716b2a/restorations/0888888-restore-id' \ --header 'Authorization: Basic YmFja3VwLWRhZW1vbjpoZmZfZTM0X0pmcnQ=' Response: OK 200 ``` -------------------------------- ### Sample Success Response Body for Orphan Databases Source: https://github.com/netcracker/qubership-dbaas/blob/main/docs/rest-api.md Example JSON response body when successfully retrieving a list of orphan databases. It includes details such as database name, classifier information, type, namespace, creation time, and background version. ```json [ { "name": "dbaas_e68bf9e03fc443cd852494ed811acbda", "classifier": { "MARKED_FOR_DROP": "MARKED_FOR_DROP", "customKeys": { "logicalDbName": "configs" }, "microserviceName": "dbaas-spring-service", "namespace": "sosh-ns-2", "scope": "service" }, "type": "postgresql", "namespace": "sosh-ns-2", "dbCreationTime": "2023-12-12T09:44:48.591+00:00", "physicalDbId": "core-postgresql", "bgVersion": "v4" }, { "name": "dbaas_88c3df2f31954b0d88420e37b9885340", "classifier": { "MARKED_FOR_DROP": "MARKED_FOR_DROP", "microserviceName": "test-service", "namespace": "sosh-ns-2", "scope": "service" }, "type": "postgresql", "namespace": "sosh-ns-2", "dbCreationTime": "2023-12-12T09:46:50.991+00:00", "physicalDbId": "core-postgresql", "bgVersion": null } ] ``` -------------------------------- ### Get Permanent Namespace Balancing Rules Source: https://github.com/netcracker/qubership-dbaas/blob/main/docs/rest-api.md Retrieves a list of applied permanent balancing rules for a given namespace. Supports filtering by namespace. ```APIDOC GET {dbaas_host}/api/v3/dbaas/balancing/rules/permanent Headers: Not required Authorization: - Basic type with credentials with `dbaas-db-editor` role. - Basic type with credentials with `dba_client` role. Request body: | Type | Name | Description | |----------|-------------|------------------------------| | **Query**| **namespace**
*optional* | Namespace for which the rules will be searched | Success Response: | HTTP Code | Description | |-----------|----------------------| | **200** | Return founded rules | Error Response: | HTTP Code | Description | |-----------|-----------------| | **400** | Rules not found | Sample call: Request: ```bash curl 'http://localhost:8080/api/v3/dbaas/balancing/rules/permanent' \ --header 'Authorization: Basic Y2x1c3Rlci1kYmE6Qm5tcTU1NjdfUE8=' ``` Response body: ```json [ { "dbType":"postgresql", "physicalDatabaseId":"core-postgresql-1", "namespaces": [ "test-namespace-3", "test-namespace-2" ] }, { "dbType":"mongodb", "physicalDatabaseId":"core-mongodb", "namespaces": [ "test-namespace-3", "test-namespace-4" ] } ] ``` ``` ```bash curl 'http://localhost:8080/api/v3/dbaas/balancing/rules/permanent' \ --header 'Authorization: Basic Y2x1c3Rlci1kYmE6Qm5tcTU1NjdfUE8=' ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.