Skip to content

Commit a74f820

Browse files
committed
List Collections
1 parent efbbbe4 commit a74f820

File tree

2 files changed

+33
-2
lines changed

2 files changed

+33
-2
lines changed

services/discovery/v2-project-manager.html

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,13 @@
4242
<option value="getProject">Retrieve project details</option>
4343
<option value="updateProject">Update project</option>
4444
<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>
4652
</select>
4753
</div>
4854

@@ -152,6 +158,22 @@
152158
</ul>
153159
</li>
154160

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+
155177
</ul>
156178

157179
<p>For more information about the Discovery service,
@@ -187,6 +209,7 @@
187209
switch (method) {
188210
case 'getProject':
189211
case 'deleteProject':
212+
case 'listCollections':
190213
fields.push('#node-input-projectId');
191214
break;
192215
case 'createProject':

services/discovery/v2-project-manager.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,21 @@ module.exports = function (RED) {
3232
'getProject' : executeDiscoveryMethod,
3333
'createProject' : executeDiscoveryMethod,
3434
'updateProject' : executeDiscoveryMethod,
35-
'deleteProject' : executeDiscoveryMethod
35+
'deleteProject' : executeDiscoveryMethod,
36+
37+
'listCollections' : executeListCollections
3638
};
3739

3840
function executeListProjects(fields) {
3941
fields.response = "projects";
4042
return executeListMethod(fields)
4143
}
4244

45+
function executeListCollections(fields) {
46+
fields.response = "collections";
47+
return executeListMethod(fields)
48+
}
49+
4350
function executeListMethod(fields) {
4451
var p = new Promise(function resolver(resolve, reject){
4552
fields.discovery[fields.method](fields.params)
@@ -92,6 +99,7 @@ module.exports = function (RED) {
9299
switch (method) {
93100
case 'getProject':
94101
case 'deleteProject':
102+
case 'listCollections':
95103
response = discoveryutils.paramProjectCheck(params);
96104
break;
97105

0 commit comments

Comments
 (0)