Refactor system API (#13958)

### What problem does this PR solve?

- ping
- token
- log level

### Type of change

- [x] Refactoring


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Refactor**
* System endpoints consolidated under /api/v1/system: ping, health
check, and token management moved to the centralized API surface.
* Token management unified at /api/v1/system/tokens with
list/create/delete behavior.

* **Documentation**
  * API reference updated to reflect the new /api/v1/system paths.

* **Tests**
* Client fixtures and test utilities updated to use
/api/v1/system/tokens; one unit test for health/oceanbase status
removed.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
Jin Hai
2026-04-08 15:26:18 +08:00
committed by GitHub
parent ad789f5c43
commit fa75aee3b9
11 changed files with 241 additions and 328 deletions

View File

@@ -45,7 +45,7 @@ def login_user(client: HttpClient, email: str, password_enc: str) -> str:
def create_api_token(client: HttpClient, login_token: str, token_name: Optional[str] = None) -> str:
client.login_token = login_token
params = {"name": token_name} if token_name else None
res = client.request_json("POST", "/system/new_token", use_api_base=False, auth_kind="login", params=params)
res = client.request_json("POST", "/system/tokens", use_api_base=False, auth_kind="login", params=params)
if res.get("code") != 0:
raise AuthError(f"API token creation failed: {res.get('message')}")
token = res.get("data", {}).get("token")