Database API Reference
Detailed API specifications for querying and monitoring database assets registered on the GIIP platform.
📋 Overview
The Database API allows you to programmatically retrieve information about instances such as MariaDB, Azure SQL, and MySQL managed by GIIP. All requests require the AK/SK issued in the [API Reference Overview].
🔍 Key Endpoints
1. Retrieve Database List
Fetches basic information for all registered DB instances.
- URL:
GET /database/list - Key Parameters:
csn(Integer): Filter by Customer Numberprj_isn(Integer): Filter by specific Project
- Response Example:
{ "RstVal": 1, "Data": [ { "isn": 101, "db_name": "Prod_DB", "engine": "AzureSQL", "status": "Running" } ] }
2. Query DB Performance Metrics
Retrieves real-time or historical performance data for a specific database.
- URL:
GET /database/metrics - Required Parameter:
db_isn(Unique DB Number) - Response Data: CPU utilization, Data IOPS, Free space, etc.
3. Retrieve Current Connection Sessions
Fetches a list of real-time sessions currently connected to the DB.
- URL:
GET /database/sessions - Purpose: Verify if excessive connections are originating from a specific IP.
🛠️ Usage Example (Python)
import requests
headers = {"x-giip-ak": "YOUR_AK"}
response = requests.get("https://api.giip.io/v3/database/list", headers=headers)
db_list = response.json()["Data"]
for db in db_list:
print(f"DB: {db['db_name']} | Status: {db['status']}")
🛡️ Using Sk3 (High-fidelity Logging)
To ensure the integrity of database asset data transmission and to maintain a detailed call history, we recommend using the giipApiSk3 endpoint.
- Endpoint:
https://giipfaw.azurewebsites.net/api/giipApiSk3 - Advantages: Automatic detection of agent errors, automatic recording of caller IP and session information, and optimized delivery of complex database query parameters.
- Usage Tip: By using the
textcommand in combination withjsondata, you can safely transmit database list queries or performance metrics collection with many filtering conditions without data loss.
Troubleshooting
| Symptom | Cause | Resolution |
|---|---|---|
| 401 authentication error returned | Missing or invalid x-giip-ak (AK/SK) header | Verify a valid issued AK/SK is included in the request header. |
/database/metrics returns empty data | Required parameter db_isn is missing | Always pass the unique DB number (db_isn). |
RstVal returned as a value other than 1 | Wrong csn/prj_isn format or insufficient permission | Send parameters as integers and check the API Result Codes Guide. |
jsondata parsing fails on Sk3 calls | JSON escaping/encoding error | Escape jsondata as valid JSON before sending. |
Version: 1.1
Last Updated: 2026-04-10
Source: giipv3/public/help/api-database.en.md
Related Documents: