Skip to content

Instantly share code, notes, and snippets.

@mattoni
Created August 28, 2019 01:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattoni/07e76ff46e1a4aca421d08b04503abc6 to your computer and use it in GitHub Desktop.
Save mattoni/07e76ff46e1a4aca421d08b04503abc6 to your computer and use it in GitHub Desktop.
List Servers With Stats Cycle API
import { Infrastructure } from "@cycleplatform/cycle-api";
async function listServers() {
const resp = await Infrastructure.Servers.getCollection({
token:
"secret_W8cSxydUl4xPI42bYxG2tx3FGgk81eJolblnZiA3N7ZCY4u7Qx4uI4eaVKkJ",
hubId: "5a14ddd8b6393d0001976f44",
query: {
meta: ["stats"]
},
});
if (!resp.ok) {
console.error(resp.error.title);
return;
}
console.log(JSON.stringify(resp.value, null, 2));
}
listServers();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment