@@ -13,15 +13,19 @@ import type {AxiosOptions} from './base';
13
13
import { BaseYdbAPI } from './base' ;
14
14
15
15
export class MetaAPI extends BaseYdbAPI {
16
+ getPath ( path : string ) {
17
+ return `${ META_BACKEND ?? '' } ${ path } ` ;
18
+ }
19
+
16
20
getClustersList ( _ ?: never , { signal} : { signal ?: AbortSignal } = { } ) {
17
- return this . get < MetaClusters > ( ` ${ META_BACKEND || '' } /meta/clusters` , null , {
21
+ return this . get < MetaClusters > ( this . getPath ( ' /meta/clusters' ) , null , {
18
22
requestConfig : { signal} ,
19
23
} ) ;
20
24
}
21
25
22
26
getClusterInfo ( clusterName ?: string , { signal} : AxiosOptions = { } ) {
23
27
return this . get < MetaCluster > (
24
- ` ${ META_BACKEND || '' } /meta/cluster` ,
28
+ this . getPath ( ' /meta/cluster' ) ,
25
29
{
26
30
name : clusterName ,
27
31
} ,
@@ -31,7 +35,7 @@ export class MetaAPI extends BaseYdbAPI {
31
35
32
36
getTenants ( clusterName ?: string , { signal} : AxiosOptions = { } ) {
33
37
return this . get < MetaTenants > (
34
- ` ${ META_BACKEND || '' } /meta/cp_databases` ,
38
+ this . getPath ( ' /meta/cp_databases' ) ,
35
39
{
36
40
cluster_name : clusterName ,
37
41
} ,
@@ -44,7 +48,7 @@ export class MetaAPI extends BaseYdbAPI {
44
48
{ concurrentId, signal} : AxiosOptions = { } ,
45
49
) : Promise < MetaBaseClusterInfo > {
46
50
return this . get < MetaBaseClusters > (
47
- ` ${ META_BACKEND || '' } /meta/db_clusters` ,
51
+ this . getPath ( ' /meta/db_clusters' ) ,
48
52
{
49
53
name : clusterName ,
50
54
} ,
0 commit comments