Skip to main content

dtcloud_project_quotas (Data Source)

Reports what a project is using against what it is allowed.

This is the console's summary view: a handful of headline figures with usage and quota side by side. For every limit the platform tracks, use dtcloud_project_limits.

Example Usage​

data "dtcloud_projects" "all" {}

# Usage against allowance, as the console shows it.
data "dtcloud_project_quotas" "current" {
project_id = data.dtcloud_projects.all.active_project_id
}

output "cpu" {
value = "${data.dtcloud_project_quotas.current.cpu[0].usage} of ${data.dtcloud_project_quotas.current.cpu[0].quota}"
}

Schema​

Required​

  • project_id (String) ID of the project, from dtcloud_projects.

Optional​

  • region_id (String) Region to report on. Defaults to the provider's configured region.

Read-Only​

Nested Schema for cpu​

Read-Only:

  • quota (Number)
  • usage (Number)

Nested Schema for floating_ips​

Read-Only:

  • quota (Number)
  • usage (Number)

Nested Schema for ram​

Read-Only:

  • quota (Number)
  • usage (Number)

Nested Schema for storage_space​

Read-Only:

  • name (String)
  • quota (Number)
  • usage (Number)

Nested Schema for vm_status​

Read-Only:

  • count (Number)
  • error (Number)
  • in_progress (Number)
  • running (Number)
  • stopped (Number)

Behaviour worth knowing​

warning

A quota of -1 means unlimited. It is passed through rather than translated, so that arithmetic on it stays honest; check for it before dividing.

  • in_progress counts machines with a pending task, whatever their nominal status. A machine in the middle of a resize is counted there rather than under running or stopped.
  • The region is part of the request path for this endpoint, unlike every other call in the provider. That is why region_id is an argument here; it falls back to the provider's region.