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

FieldTypeRequiredDescription
idstringautoPrefixed ID: phy-{ulid}
namestringyesDisplay name or hostname
typeenumyeslaptop | desktop | server | network | mobile | other
serialNumberstringnoManufacturer serial number
manufacturerstringnoe.g. “Apple”, “Dell”
modelstringnoe.g. “MacBook Pro 16 M3”
statusenumautoactive | retired | lost | deleted
assigneeIdstringnoPerson ID of current assignee
locationstringnoPhysical location or office
purchasedAtstringnoISO 8601 date
warrantyExpiresAtstringnoISO 8601 date
tagsstring[]noFree-form tags
createdAtstringautoISO 8601 UTC

CloudResource Schema

FieldTypeRequiredDescription
idstringautoPrefixed ID: cld-{ulid}
namestringyesResource name or ARN-style identifier
providerenumyesaws | gcp | azure | other
resourceTypestringyesProvider-specific type (e.g. ec2, s3, bigquery)
regionstringnoCloud region (e.g. us-east-1)
accountIdstringnoCloud account or project ID
statusenumautorunning | stopped | terminated | deleted
ownerIdstringnoPerson ID of the resource owner
tagsstring[]noFree-form tags
syncedAtstringautoLast cloud sync timestamp
createdAtstringautoISO 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 }