File tree Expand file tree Collapse file tree 3 files changed +34
-0
lines changed Expand file tree Collapse file tree 3 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -2894,6 +2894,10 @@ const translations: Catalog = {
28942894 description :
28952895 'Show a list of all the named connections for this instance from the Connection Registry.' ,
28962896 } ,
2897+ listWorkspaceDefaults : {
2898+ description :
2899+ 'Show the default tier and maxTierSize for the stream processor workspace.' ,
2900+ } ,
28972901 } ,
28982902 } ,
28992903 } ,
Original file line number Diff line number Diff line change @@ -312,4 +312,22 @@ describe('Streams', function () {
312312 ) . to . be . true ;
313313 } ) ;
314314 } ) ;
315+
316+ describe ( 'listWorkspaceDefaults' , function ( ) {
317+ it ( 'returns tier and maxTierSize' , async function ( ) {
318+ const runCmdStub = sinon
319+ . stub ( mongo . _serviceProvider , 'runCommand' )
320+ . resolves ( { ok : 1 , defaultTierSize : 'SP2' , maxTierSize : 'SP30' } ) ;
321+
322+ const result = await streams . listWorkspaceDefaults ( ) ;
323+ expect ( result ) . to . eql ( {
324+ ok : 1 ,
325+ defaultTierSize : 'SP2' ,
326+ maxTierSize : 'SP30' ,
327+ } ) ;
328+
329+ const cmd = { listWorkspaceDefaults : 1 } ;
330+ expect ( runCmdStub . calledOnceWithExactly ( 'admin' , cmd , { } ) ) . to . be . true ;
331+ } ) ;
332+ } ) ;
315333} ) ;
Original file line number Diff line number Diff line change @@ -13,6 +13,11 @@ import type Mongo from './mongo';
1313import type { GenericDatabaseSchema , GenericServerSideSchema } from './helpers' ;
1414import type { MQLPipeline } from './mql-types' ;
1515
16+ type WorkspaceDefaults = {
17+ defaultTierSize : string ;
18+ maxTierSize : string ;
19+ } ;
20+
1621@shellApiClassDefault
1722export class Streams <
1823 M extends GenericServerSideSchema = GenericServerSideSchema ,
@@ -162,6 +167,13 @@ export class Streams<
162167 } ) ;
163168 }
164169
170+ @returnsPromise
171+ async listWorkspaceDefaults ( ) : Promise < WorkspaceDefaults > {
172+ return ( await this . _runStreamCommand ( {
173+ listWorkspaceDefaults : 1 ,
174+ } ) ) as WorkspaceDefaults ;
175+ }
176+
165177 async _runStreamCommand ( cmd : Document , options : Document = { } ) {
166178 return this . _mongo . _serviceProvider . runCommand ( ADMIN_DB , cmd , options ) ; // run cmd
167179 }
You can’t perform that action at this time.
0 commit comments