@@ -181,6 +181,13 @@ export declare namespace service {
|
||||
RollbackConfig: RollbackConfig;
|
||||
}
|
||||
|
||||
export interface UpdateStatus {
|
||||
State: string;
|
||||
StartedAt: string;
|
||||
CompletedAt: string;
|
||||
Message: string;
|
||||
}
|
||||
|
||||
export interface Service {
|
||||
ID: string;
|
||||
Version: Version;
|
||||
@@ -189,7 +196,7 @@ export declare namespace service {
|
||||
Spec: Spec;
|
||||
Endpoint: Endpoint;
|
||||
PreviousSpec: PreviousSpec;
|
||||
UpdateStatus: UpdateStatus;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,9 @@ export namespace service {
|
||||
|
||||
}
|
||||
export async function inspect(id: string, query: { insertDefaults: boolean } = { insertDefaults: false }) {
|
||||
return await api.get<any>(`/services/${id}`, query);
|
||||
return await api.get<types.service.Service>(`/services/${id}`, query);
|
||||
}
|
||||
export async function update(id: string, query: { version: number, registryAuthFrom?: string, rollback?: string }, data: any) {
|
||||
return await api.post<any>(api.getUri(`/services/${id}/update`, query), data)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,13 @@ export async function stream<T = http.ServerResponse>(path: string, data?: objec
|
||||
return await handle<T>("GET", path, { params: data, responseType: "stream" });
|
||||
}
|
||||
|
||||
export function getUri(path: string, data?: object) {
|
||||
return api.getUri({
|
||||
url: path,
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
async function handle<T>(method: Method, path: string, reqConfig?: AxiosRequestConfig): Promise<T> {
|
||||
let config: AxiosRequestConfig = {
|
||||
method,
|
||||
|
||||
Reference in New Issue
Block a user