File tree Expand file tree Collapse file tree 2 files changed +33
-2
lines changed Expand file tree Collapse file tree 2 files changed +33
-2
lines changed Original file line number Diff line number Diff line change 42
42
< option value = "getProject" > Retrieve project details</ option >
43
43
< option value = "updateProject" > Update project</ option >
44
44
< option value = "deleteProject" > Delete project</ option >
45
- < option disabled > ______________</ option >
45
+ < option disabled > ______________</ option >
46
+ < option value = "listCollections" > List existing collections</ option >
47
+ < option value = "createCollection" > Create new collection</ option >
48
+ < option value = "getCollection" > Retrieve collection details</ option >
49
+ < option value = "updateCollection" > Update collection</ option >
50
+ < option value = "deleteCollection" > Delete collection</ option >
51
+ < option disabled > ______________</ option >
46
52
</ select >
47
53
</ div >
48
54
152
158
</ ul >
153
159
</ li >
154
160
161
+
162
+ < br />
163
+
164
+ < li >
165
+ < p > < b > List Collections</ b > < p >
166
+ < p > For this method the node needs project Id as input.
167
+ </ p >
168
+ < p > The project Id can be overridden by specifying
169
+ the search id in < code > msg.discoveryparams.projectId</ code >
170
+ </ p >
171
+ < p > Node output : </ p >
172
+ < ul >
173
+ < li > < code > msg.collections</ code > : List of collections in the project.</ li >
174
+ </ ul >
175
+ </ li >
176
+
155
177
</ ul >
156
178
157
179
< p > For more information about the Discovery service,
187
209
switch ( method ) {
188
210
case 'getProject' :
189
211
case 'deleteProject' :
212
+ case 'listCollections' :
190
213
fields . push ( '#node-input-projectId' ) ;
191
214
break ;
192
215
case 'createProject' :
Original file line number Diff line number Diff line change @@ -32,14 +32,21 @@ module.exports = function (RED) {
32
32
'getProject' : executeDiscoveryMethod ,
33
33
'createProject' : executeDiscoveryMethod ,
34
34
'updateProject' : executeDiscoveryMethod ,
35
- 'deleteProject' : executeDiscoveryMethod
35
+ 'deleteProject' : executeDiscoveryMethod ,
36
+
37
+ 'listCollections' : executeListCollections
36
38
} ;
37
39
38
40
function executeListProjects ( fields ) {
39
41
fields . response = "projects" ;
40
42
return executeListMethod ( fields )
41
43
}
42
44
45
+ function executeListCollections ( fields ) {
46
+ fields . response = "collections" ;
47
+ return executeListMethod ( fields )
48
+ }
49
+
43
50
function executeListMethod ( fields ) {
44
51
var p = new Promise ( function resolver ( resolve , reject ) {
45
52
fields . discovery [ fields . method ] ( fields . params )
@@ -92,6 +99,7 @@ module.exports = function (RED) {
92
99
switch ( method ) {
93
100
case 'getProject' :
94
101
case 'deleteProject' :
102
+ case 'listCollections' :
95
103
response = discoveryutils . paramProjectCheck ( params ) ;
96
104
break ;
97
105
You can’t perform that action at this time.
0 commit comments