giip

Database API Reference

Detailed API specifications for querying and monitoring database assets registered on the GIIP platform.

🔌 Go to Database Management Feature →

📋 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 Number
    • prj_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 text command in combination with jsondata, you can safely transmit database list queries or performance metrics collection with many filtering conditions without data loss.

Troubleshooting

SymptomCauseResolution
401 authentication error returnedMissing or invalid x-giip-ak (AK/SK) headerVerify a valid issued AK/SK is included in the request header.
/database/metrics returns empty dataRequired parameter db_isn is missingAlways pass the unique DB number (db_isn).
RstVal returned as a value other than 1Wrong csn/prj_isn format or insufficient permissionSend parameters as integers and check the API Result Codes Guide.
jsondata parsing fails on Sk3 callsJSON escaping/encoding errorEscape jsondata as valid JSON before sending.

Version: 1.1 Last Updated: 2026-04-10 Source: giipv3/public/help/api-database.en.md


Related Documents: