services -> domains
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import type {
|
||||
Status,
|
||||
GlobalConfig,
|
||||
GlobalConfigResponse,
|
||||
CentralState,
|
||||
CentralStateResponse,
|
||||
HealthResponse,
|
||||
StatusResponse,
|
||||
NetworkInfo,
|
||||
@@ -51,35 +51,35 @@ class ApiService {
|
||||
|
||||
// ========================================
|
||||
// Global Config APIs (Wild Central level)
|
||||
// Endpoint: /api/v1/config
|
||||
// Endpoint: /api/v1/state
|
||||
// ========================================
|
||||
|
||||
async getConfig(): Promise<GlobalConfigResponse> {
|
||||
return this.request<GlobalConfigResponse>('/api/v1/config');
|
||||
async getConfig(): Promise<CentralStateResponse> {
|
||||
return this.request<CentralStateResponse>('/api/v1/state');
|
||||
}
|
||||
|
||||
async getConfigYaml(): Promise<string> {
|
||||
return this.requestText('/api/v1/config/yaml');
|
||||
return this.requestText('/api/v1/state/yaml');
|
||||
}
|
||||
|
||||
async updateConfigYaml(yamlContent: string): Promise<StatusResponse> {
|
||||
return this.request<StatusResponse>('/api/v1/config/yaml', {
|
||||
return this.request<StatusResponse>('/api/v1/state/yaml', {
|
||||
method: 'PUT',
|
||||
headers: { 'Content-Type': 'text/plain' },
|
||||
body: yamlContent
|
||||
});
|
||||
}
|
||||
|
||||
async createConfig(config: GlobalConfig): Promise<StatusResponse> {
|
||||
return this.request<StatusResponse>('/api/v1/config', {
|
||||
async createConfig(config: CentralState): Promise<StatusResponse> {
|
||||
return this.request<StatusResponse>('/api/v1/state', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(config)
|
||||
});
|
||||
}
|
||||
|
||||
async updateConfig(config: GlobalConfig): Promise<StatusResponse> {
|
||||
return this.request<StatusResponse>('/api/v1/config', {
|
||||
async updateConfig(config: CentralState): Promise<StatusResponse> {
|
||||
return this.request<StatusResponse>('/api/v1/state', {
|
||||
method: 'PUT',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(config)
|
||||
|
||||
Reference in New Issue
Block a user