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
cpu(List of Object) vCPU cores. (see below for nested schema)floating_ips(List of Object) Floating IP addresses. (see below for nested schema)id(String) The ID of this resource.ram(List of Object) Memory in GiB. (see below for nested schema)storage_space(List of Object) Storage usage per volume type. (see below for nested schema)vm_status(List of Object) The project's VMs counted by state. (see below for nested schema)
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_progresscounts machines with a pending task, whatever their nominal status. A machine in the middle of a resize is counted there rather than underrunningorstopped.- The region is part of the request path for this endpoint, unlike every other call in the
provider. That is why
region_idis an argument here; it falls back to the provider's region.