Creating Backup of specific Indexes
External Elasticsearch contains multiple indexes, each used to store different types of data. To back up specific data, back up specific index or a set of indexes. To view the list of available indexes in the external Elasticsearch, use the following command:
GET _cat/indices
External Elasticsearch has the following indexes:
Index | Description |
gateway_tenant_assets | Specifies information related to all assets in API Gateway. It includes details about APIs, policies, and other required configurations. |
gateway_tenant_analytics | Specifies data related to API usage, performance, and metrics. It also provides information on traffic patterns, response times, and overall API health. |
gateway_tenant_audit_auditlogs | Specifies all significant events and actions within API Gateway. It includes details such as user access, policy enforcement, and security-related events. |
gateway_tenant_log | Specifies logs generated by API Gateway during its operation. These logs capture information about requests, responses, errors, and system events. |
gateway_tenant_cache_cachestatistics | Specifies cache-related statistics within the API Gateway. It provides insights into cache hits, misses, and efficiency. |
To take a backup of the required indexes
1. Ensure your external Elasticsearch cluster is up and running.
2. Create the backup using the external Elasticsearch API.
POST _snapshot/repo-name/backup-name?wait_for_completion={true/false}
{
"indices": "gateway_tenant_assets"
}
In the external Elasticsearch API:
Replace
repo-name with the name of the backup repository where the backup is stored.
Replace
backup-name with the name of the backup being created.
wait_for_completion is a query parameter indicating whether the request must wait for the backup to complete before responding. It can be set to either
true or
false. The default value is
false.
indices specifies the indices you want to include in the backup. In this example, it includes indices matching the pattern
gateway_tenant_assets to back up only the
API Gateway assets.
A sample command to create an entire API Gateway external Elasticsearch backup with default tenant is as follows:
curl -si -X POST -H "content-type:application/json" -d '{"indices": "gateway_default_assets"}' http://es-host:es-port/_snapshot/myrepo/api_data_store_backup?wait_for_completion=false
In this example:
The external Elasticsearch cluster is assumed to be running on
es-host with port
es-port.
The backup repository
myrepo creates a backup named
api_data_store_backup.
The backup includes indices matching the pattern
gateway_default_assets.
3. Verify the status of the backup operation using the following command:
GET _snapshot/repo-name/backup-name/_status
In this command, replace repo-name and backup-name with your repository and backup names, respectively.
A sample command to verify the backup status is as follows:
curl -s -X GET http://es-host:es-port/_snapshot/myrepo/api_data_store_backup/_status
In this example:
The external Elasticsearch cluster is assumed to be running on
es-host with port
es-port.
The command queries the status of the backup named
api_data_store_backup in the backup repository
myrepo.
The JSON response from the external Elasticsearch provides detailed information about the status of the backup.