Skip to content

Commit

Permalink
With new nodes_list SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
François Leurent committed Mar 22, 2024
1 parent 531b78d commit 01756ec
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions stack.js
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,19 @@ class StackSDK {
return JSON.parse(body);
}

async nodes_list({id} = {}) {
const filters = {};
if(id)
filters.id = [id];

const res = await this.request("GET", {path : '/nodes', qs : {filters : JSON.stringify(filters)}});
const body = await drain(res);
if(res.statusCode !== 200)
throw `Unable to get nodes ${res.statusCode}, ${body.toString('utf8')}`;

let response = JSON.parse(body);
return response;
}

async services_list({namespace, name} = {}) {
const filters = {};
Expand Down

0 comments on commit 01756ec

Please sign in to comment.