Skip to content
betterstack-alchemyUnofficial

Incidents.CatalogRecord

Kind ResourceType id BetterStack.Incidents.CatalogRecordSource src/Incidents/CatalogRecord.tsLive test gated Lifecycle test runs against the offline mock; a live run exists but is gated behind BETTERSTACK_TEST_CATALOG=1 because the catalog needs a paid plan (test/Incidents/CatalogRecord.test.ts).

A Better Stack catalog record: one row of a CatalogRelation, with values for its attributes. Each entry of attributes names a column (by name or id) and its values: Strings, or references to catalog items such as an EscalationPolicy, OnCallSchedule, User or Team by itemId.

attributes updates in place and replaces every value of the record; catalogRelationId (the parent) and teamId replace the record.

Route a service to its escalation policy

const policy = yield* BetterStack.Incidents.EscalationPolicy("payments", {
name: "Payments on-call",
steps: [{ type: "escalation", waitBefore: 0, stepMembers: [{ type: "current_on_call" }] }],
});
const routing = yield* BetterStack.Incidents.CatalogRelation("routing", {
name: "Service routing",
attributes: [{ name: "Service", primary: true }, { name: "Escalation policy" }],
});
yield* BetterStack.Incidents.CatalogRecord("payments-api", {
catalogRelationId: routing.id,
attributes: [
{ attribute: { name: "Service" }, values: [{ type: "String", value: "payments-api" }] },
{
attribute: { name: "Escalation policy" },
values: [{ type: "EscalationPolicy", itemId: policy.id }],
},
],
});

By relation and id

const row = BetterStack.Incidents.CatalogRecord.lookup({ catalogRelationId: "123", id: "456" });

attributes CreateCatalogRecordRequestAttributesItem[] required

The record's values, one entry per attribute that has values. Each entry sets one catalog attribute, by ID or name, to one or more values. Required on create and update, and an update replaces all of them.

catalogRelationId string required

teamId string

Team that owns the resource, such as t123. Defaults to the credentials' team (BETTERSTACK_TEAM_ID, or the profile's team). Changing it replaces the resource.

catalogRelationId string always set

The catalog relation the record belongs to.

id string always set

The catalog_record's id.

attributes CatalogRecordAttributesItem[]

The record's values, one entry per attribute that has values. Each entry sets one catalog attribute, by ID or name, to one or more values. Required on create and update, and an update replaces all of them.

CatalogRecord.lookup(props) reads an object this stack does not manage. It is never created, updated or deleted.

catalogRelationId string required

The catalog relation's id.

id string required

The record's id.

teamId string

Team whose token selects the organization, such as t123. Defaults to the credentials' team.