Assets
The Assets domain tracks two types of infrastructure: PhysicalAsset (hardware your organisation owns or manages — laptops, servers, networking gear) and CloudResource (cloud-provisioned resources — VMs, buckets, databases, functions). Both entities can be linked to owners, assignees, and compliance controls via the Relationships domain.
PhysicalAsset Schema
| Field | Type | Required | Description |
|---|---|---|---|
id | string | auto | Prefixed ID: phy-{ulid} |
name | string | yes | Display name or hostname |
type | enum | yes | laptop | desktop | server | network | mobile | other |
serialNumber | string | no | Manufacturer serial number |
manufacturer | string | no | e.g. “Apple”, “Dell” |
model | string | no | e.g. “MacBook Pro 16 M3” |
status | enum | auto | active | retired | lost | deleted |
assigneeId | string | no | Person ID of current assignee |
location | string | no | Physical location or office |
purchasedAt | string | no | ISO 8601 date |
warrantyExpiresAt | string | no | ISO 8601 date |
tags | string[] | no | Free-form tags |
createdAt | string | auto | ISO 8601 UTC |
CloudResource Schema
| Field | Type | Required | Description |
|---|---|---|---|
id | string | auto | Prefixed ID: cld-{ulid} |
name | string | yes | Resource name or ARN-style identifier |
provider | enum | yes | aws | gcp | azure | other |
resourceType | string | yes | Provider-specific type (e.g. ec2, s3, bigquery) |
region | string | no | Cloud region (e.g. us-east-1) |
accountId | string | no | Cloud account or project ID |
status | enum | auto | running | stopped | terminated | deleted |
ownerId | string | no | Person ID of the resource owner |
tags | string[] | no | Free-form tags |
syncedAt | string | auto | Last cloud sync timestamp |
createdAt | string | auto | ISO 8601 UTC |
Physical Assets — CRUD
import { CpodClient } from '@cpod/sdk'
const sdk = CpodClient.fromEnv()
// List laptops assigned to a specific person
const result = await sdk.assets.physical.list({
type: 'laptop',
assigneeId: 'per-abc123',
})
// Get one
const asset = await sdk.assets.physical.get('phy-abc123')
// Create
const created = await sdk.assets.physical.create({
name: 'MBP-ENG-042',
type: 'laptop',
manufacturer: 'Apple',
model: 'MacBook Pro 16 M3',
serialNumber: 'C02ZW1234567',
assigneeId: 'per-abc123',
purchasedAt: '2024-01-15',
warrantyExpiresAt: '2027-01-15',
})
// Reassign
await sdk.assets.physical.update('phy-abc123', { assigneeId: 'per-xyz789' })
// Retire
await sdk.assets.physical.update('phy-abc123', { status: 'retired' })
await sdk.assets.physical.delete('phy-abc123')Cloud Resources — CRUD
// List all S3 buckets in AWS
const buckets = await sdk.assets.cloud.list({
provider: 'aws',
resourceType: 's3',
})
const resource = await sdk.assets.cloud.get('cld-abc123')
const created = await sdk.assets.cloud.create({
name: 'acme-prod-logs',
provider: 'aws',
resourceType: 's3',
region: 'us-east-1',
accountId: '123456789012',
ownerId: 'per-abc123',
})
await sdk.assets.cloud.update('cld-abc123', { status: 'stopped' })
await sdk.assets.cloud.delete('cld-abc123')Cloud Sync
Trigger a sync to pull the latest state of cloud resources from AWS, GCP, or Azure into the EDM. Sync runs asynchronously; poll for completion.
Cloud sync requires a configured Data Source with provider credentials. See the Data Sources domain for setup.
// Trigger sync for all AWS resources in an account
const job = await sdk.assets.cloud.sync({
provider: 'aws',
accountId: '123456789012',
dataSourceId: 'ds-abc123',
})
// job.id → "job-01HXYZ..."
// job.status → "queued"
// Poll for completion via the Jobs service
const result = await sdk.jobs.wait(job.id)
// result.status → "completed"
// result.output → { created: 12, updated: 45, deleted: 3 }