File tree Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -99,6 +99,15 @@ describe('Cynosdb', () => {
9999 ip : expect . any ( String ) ,
100100 port : 3306 ,
101101 } ,
102+ instances : [
103+ {
104+ id : expect . stringContaining ( 'cynosdbmysql-ins-' ) ,
105+ name : expect . stringContaining ( 'cynosdbmysql-ins-' ) ,
106+ role : 'master' ,
107+ type : 'rw' ,
108+ status : 'running' ,
109+ } ,
110+ ] ,
102111 } ) ;
103112
104113 ( { clusterId } = res ) ;
@@ -128,6 +137,15 @@ describe('Cynosdb', () => {
128137 ip : expect . any ( String ) ,
129138 port : expect . any ( Number ) ,
130139 } ,
140+ instances : [
141+ {
142+ id : expect . stringContaining ( 'cynosdbmysql-ins-' ) ,
143+ name : expect . stringContaining ( 'cynosdbmysql-ins-' ) ,
144+ role : 'master' ,
145+ type : 'rw' ,
146+ status : 'running' ,
147+ } ,
148+ ] ,
131149 } ) ;
132150 } ) ;
133151
@@ -149,6 +167,15 @@ describe('Cynosdb', () => {
149167 ip : expect . any ( String ) ,
150168 port : 3306 ,
151169 } ,
170+ instances : [
171+ {
172+ id : expect . stringContaining ( 'cynosdbmysql-ins-' ) ,
173+ name : expect . stringContaining ( 'cynosdbmysql-ins-' ) ,
174+ role : 'master' ,
175+ type : 'rw' ,
176+ status : 'running' ,
177+ } ,
178+ ] ,
152179 } ) ;
153180 inputs . clusterId = undefined ;
154181 } ) ;
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ const { Capi } = require('@tencent-sdk/capi');
22const {
33 createCluster,
44 getClusterDetail,
5+ getClusterInstances,
56 isolateCluster,
67 generatePwd,
78 formatConnectOutput,
@@ -136,6 +137,15 @@ class Cynosdb {
136137 await closePublicAccess ( this . capi , outputs . clusterId ) ;
137138 }
138139
140+ const clusterInstances = await getClusterInstances ( this . capi , outputs . clusterId ) ;
141+ outputs . instances = clusterInstances . map ( ( item ) => ( {
142+ id : item . InstanceId ,
143+ name : item . InstanceName ,
144+ role : item . InstanceRole ,
145+ type : item . InstanceType ,
146+ status : item . Status ,
147+ } ) ) ;
148+
139149 return outputs ;
140150 }
141151
You can’t perform that action at this time.
0 commit comments