Skip to navigation

Quickstart

In this example, we’ll walk through IcePanel’s data model by listing landscapes, viewing model objects, and finding their model connections.

Prerequisites

Call the API

1

Set your API key

Go to Profile settings -> API keys -> Create API key and create a new key.

For future sessions, store it in a ~/.zshrc or ~/.bashrc

export ICEPANEL_API_KEY='your-api-key'

Then run source ~/.zshrc (or ~/.bashrc) to apply immediately.

2

List your organizations

This is the top-level model for access control. Landscapes and users belong to an organization.

import { IcePanelClient } from "@icepanel/sdk";
async function main() {
const client = new IcePanelClient({
apiKey: "your-api-key",
apiVersion: "v1",
});
const response = await client.organizations.list({});
console.log(response);
}
main();

Note the id field. This is your organizationId.

3

List your landscapes

A workspace within an organization (like a repository).

import { IcePanelClient } from "@icepanel/sdk";
async function main() {
const client = new IcePanelClient({
apiKey: "your-api-key",
apiVersion: "v1",
});
const response = await client.organizations.landscapes.list({
organizationId: "organizationId"
});
console.log(response);
}
main();

Note the id field. This is your landscapeId.

4

List model objects

An object within your landscape. It can be a system, app, component, store, actor, group, or root.

import { IcePanelClient } from "@icepanel/sdk";
async function main() {
const client = new IcePanelClient({
apiKey: "your-api-key",
apiVersion: "v1",
});
const response = await client.model.objects.list({
landscapeId: "landscapeId",
versionId: "latest"
});
console.log(response);
}
main();

Note the id of any object. This is your modelObjectId.

5

List model connections

A defined relationship between two model objects. We’ll list model connections where originId = modelObjectId.

import { IcePanelClient } from "@icepanel/sdk";
async function main() {
const client = new IcePanelClient({
apiKey: "your-api-key",
apiVersion: "v1",
});
const response = await client.model.connections.list({
landscapeId: "landscapeId",
versionId: "latest",
filter: { originId: "modelObjectId" }
});
console.log(response);
}
main();

Next steps