Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Commit

Permalink
Add parameter to openpai k8s apis
Browse files Browse the repository at this point in the history
  • Loading branch information
yiyione committed Aug 6, 2020
1 parent 335f914 commit b0a96fb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/api/v2/clients/kubernetesClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,22 @@ export class KubernetesClient extends OpenPAIBaseClient {
/**
* Get kubernetes node list. Need administrator permission.
*/
public async getK8sNodes(namespace?: string): Promise<any> {
public async getK8sNodes(query?: object): Promise<any> {
const url: string = Util.fixUrl(
`${this.cluster.rest_server_uri}/api/v2/kubernetes/nodes`,
this.cluster.https
);
return await this.httpClient.get(url, undefined, undefined, namespace ? { namespace } : undefined);
return await this.httpClient.get(url, undefined, undefined, query);
}

/**
* Get kubernetes pod list.
*/
public async getK8sPods(): Promise<any> {
public async getK8sPods(query?: object): Promise<any> {
const url: string = Util.fixUrl(
`${this.cluster.rest_server_uri}/api/v2/kubernetes/pods`,
this.cluster.https
);
return await this.httpClient.get(url);
return await this.httpClient.get(url, undefined, undefined, query);
}
}

0 comments on commit b0a96fb

Please sign in to comment.