curl --request POST \
--url https://api.sfcompute.com/v2/capacities \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"workspace": "<string>",
"zones": [
"richmond"
],
"name": "my-resource-name",
"tags": {
"env": "prod",
"team": "infra"
}
}
'{
"id": "<string>",
"resource_path": "<string>",
"owner": "<string>",
"workspace": "<string>",
"name": "<string>",
"kind": "market",
"object": "capacity",
"zones": [
"richmond"
],
"allocation_schedule": {
"total": [
{
"effective_at": 1738972800,
"node_allocation": 123
}
],
"by_zone": {}
},
"created_at": 1738972800,
"procurements": [
"<string>"
],
"deployments": [
"<string>"
],
"tags": {
"env": "prod",
"team": "infra"
}
}Create a capacity to hold compute in specified zones.
curl --request POST \
--url https://api.sfcompute.com/v2/capacities \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"workspace": "<string>",
"zones": [
"richmond"
],
"name": "my-resource-name",
"tags": {
"env": "prod",
"team": "infra"
}
}
'{
"id": "<string>",
"resource_path": "<string>",
"owner": "<string>",
"workspace": "<string>",
"name": "<string>",
"kind": "market",
"object": "capacity",
"zones": [
"richmond"
],
"allocation_schedule": {
"total": [
{
"effective_at": 1738972800,
"node_allocation": 123
}
],
"by_zone": {}
},
"created_at": 1738972800,
"procurements": [
"<string>"
],
"deployments": [
"<string>"
],
"tags": {
"env": "prod",
"team": "infra"
}
}Create an API token using sf tokens create or at https://sfcompute.com/account/api-keys.
Workspace to create this capacity in.
(wksp_[0-9a-zA-Z_-]{1,21})|(sfc:workspace:[a-zA-Z0-9._-]+(:[a-zA-Z0-9._-]+){1,3})"wksp_k3R-nX9vLm7Qp2Yw5Jd8F"
Datacenter locations orders into this capacity can acquire compute from.
1["richmond"]Unique name for this capacity.
1 - 255[a-zA-Z0-9][a-zA-Z0-9._-]{0,254}"my-resource-name"
Optional metadata tags for this capacity.
Show child attributes
{ "env": "prod", "team": "infra" }Capacity created.
cap_[0-9a-zA-Z_-]{1,21}"cap_k3R-nX9vLm7Qp2Yw5Jd8F"
A resource path for a capacity resource. Format: sfc:capacity:
sfc:capacity:([a-zA-Z0-9._-]+:){2}[a-zA-Z0-9._-]+"sfc:capacity:<account_id>:<workspace>:<name>"
1 - 255[a-zA-Z0-9][a-zA-Z0-9._-]{0,254}"my-resource-name"
1 - 255[a-zA-Z0-9][a-zA-Z0-9._-]{0,254}"my-resource-name"
1 - 255[a-zA-Z0-9][a-zA-Z0-9._-]{0,254}"my-resource-name"
Capacity kind determines what operations are allowed on a capacity.
Market: User-created capacities. - Originating: Provider capacities for selling compute. Cannot add compute (buy orders/procurements). - ReadOnly: System-managed capacities used for legacy compute, bare metal contracts, and other. Cannot be modified through the API.market, originating, read_only "capacity"Datacenter locations orders into this capacity can acquire compute from.
1Allocation schedule of this capacity. Add to the schedule by placing buy orders into this capacity.
Show child attributes
Unix timestamp.
1738972800
Active procurements targeting this capacity. Returns IDs by default, or summaries when expand=procurements is set.
proc_[0-9a-zA-Z_-]{1,21}Active deployments targeting this capacity. Returns IDs by default, or summaries when expand=deployments is set.
depl_[0-9a-zA-Z_-]{1,21}Metadata tags attached to this capacity.
Show child attributes
{ "env": "prod", "team": "infra" }