datacenter_hosts
Creates, updates, deletes, gets or lists a datacenter_hosts resource.
Overview​
| Name | datacenter_hosts |
| Type | Resource |
| Id | ovh.dedicated_cloud.datacenter_hosts |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
name | string | Name of the host (IP address) |
host_id | integer | Id of the host (wire: hostId) |
parent_host_id | integer | Id of the parent host (if any) (wire: parentHostId) |
cluster_name | string | Cluster of the host (wire: clusterName) |
resource_name | string | Resource name (wire: resourceName) |
billing_type | string | Billing type of the host (freeSpare, hourly, monthly, undefined) (wire: billingType) |
connection_state | string | Connection state of the host (connected, disconnected, notResponding) (wire: connectionState) |
cpu | object | CPU total frenquency |
cpu_max | integer | The maximum speed of the cpu, in Mhz (wire: cpuMax) |
cpu_max_core | integer | The speed of the CPU cores. This is an average value if there are multiple speeds. in Mhz (wire: cpuMaxCore) |
cpu_num | integer | Number of physical CPU cores on the host. (wire: cpuNum) |
cpu_used | integer | Current cpu utilization, in Mhz (wire: cpuUsed) |
in_maintenance | boolean | Host is in maintenance mode (wire: inMaintenance) |
memory_used | number | Amount of used memory. Sum of the memory used by all powered on virtual machines and vSphere services on the host. in MB (wire: memoryUsed) |
profile | string | Host profile in a commercial range |
profile_code | string | Host profile code (wire: profileCode) |
rack | string | Rack of the host |
ram | object | Total RAM quantity |
state | string | State of the host (adding, delivered, error, removing, unknown) |
uptime | integer | Host uptime in second |
vm_total | integer | Number of Virtual Machine on the host (wire: vmTotal) |
vm_vcpu_total | integer | Number of Vcpu use by virtual machines on the host (wire: vmVcpuTotal) |
Host
| Name | Datatype | Description |
|---|---|---|
name | string | Name of the host (IP address) |
host_id | integer | Id of the host (wire: hostId) |
parent_host_id | integer | Id of the parent host (if any) (wire: parentHostId) |
cluster_name | string | Cluster of the host (wire: clusterName) |
resource_name | string | Resource name (wire: resourceName) |
billing_type | string | Billing type of the host (freeSpare, hourly, monthly, undefined) (wire: billingType) |
connection_state | string | Connection state of the host (connected, disconnected, notResponding) (wire: connectionState) |
cpu | object | CPU total frenquency |
cpu_max | integer | The maximum speed of the cpu, in Mhz (wire: cpuMax) |
cpu_max_core | integer | The speed of the CPU cores. This is an average value if there are multiple speeds. in Mhz (wire: cpuMaxCore) |
cpu_num | integer | Number of physical CPU cores on the host. (wire: cpuNum) |
cpu_used | integer | Current cpu utilization, in Mhz (wire: cpuUsed) |
in_maintenance | boolean | Host is in maintenance mode (wire: inMaintenance) |
memory_used | number | Amount of used memory. Sum of the memory used by all powered on virtual machines and vSphere services on the host. in MB (wire: memoryUsed) |
profile | string | Host profile in a commercial range |
profile_code | string | Host profile code (wire: profileCode) |
rack | string | Rack of the host |
ram | object | Total RAM quantity |
state | string | State of the host (adding, delivered, error, removing, unknown) |
uptime | integer | Host uptime in second |
vm_total | integer | Number of Virtual Machine on the host (wire: vmTotal) |
vm_vcpu_total | integer | Number of Vcpu use by virtual machines on the host (wire: vmVcpuTotal) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | datacenter_id, host_id, service_name | Get a host. Returns the host: profile, state, connection state, cluster, CPU and memory usage, and number of virtual machines. | |
list | select | datacenter_id, service_name | x_pagination_mode | List hosts |
add_host_spare | exec | datacenterId, hostId, serviceName, reason | Request a host replacement. Asks for a spare host to replace this host. A reason is required. Returns a task to track progress. | |
remove | exec | datacenterId, hostId, serviceName | Remove a host |
Parameters​
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
api_host | string | The OVHcloud API host. Selected by OVH_ENDPOINT (ovh-eu, ovh-ca or ovh-us; default ovh-eu). (default: api.eu.ovhcloud.com, x-stackQL-envVarSelector: {"envVar":"OVH_ENDPOINT","default":"ovh-eu","values":{"ovh-eu":"api.eu.ovhcloud.com","ovh-ca":"api.ca.ovhcloud.com","ovh-us":"api.us.ovhcloud.com"}}) |
datacenterId | integer | Id of the Datacenter |
datacenter_id | integer | Id of the Datacenter (wire: datacenterId) |
hostId | integer | Id of the host |
host_id | integer | Id of the host (wire: hostId) |
serviceName | string | Domain of the service |
service_name | string | Domain of the service (wire: serviceName) |
x_pagination_mode | string | Sent as CachedObjectList-Pages by default so the list returns the full objects rather than their identifiers. (wire: X-Pagination-Mode) |
SELECT examples​
- get
- list
Get a host. Returns the host: profile, state, connection state, cluster, CPU and memory usage, and number of virtual machines.
SELECT
name,
host_id,
parent_host_id,
cluster_name,
resource_name,
billing_type,
connection_state,
cpu,
cpu_max,
cpu_max_core,
cpu_num,
cpu_used,
in_maintenance,
memory_used,
profile,
profile_code,
rack,
ram,
state,
uptime,
vm_total,
vm_vcpu_total
FROM ovh.dedicated_cloud.datacenter_hosts
WHERE datacenter_id = '{{ datacenter_id }}' -- required
AND host_id = '{{ host_id }}' -- required
AND service_name = '{{ service_name }}' -- required
;
List hosts
SELECT
name,
host_id,
parent_host_id,
cluster_name,
resource_name,
billing_type,
connection_state,
cpu,
cpu_max,
cpu_max_core,
cpu_num,
cpu_used,
in_maintenance,
memory_used,
profile,
profile_code,
rack,
ram,
state,
uptime,
vm_total,
vm_vcpu_total
FROM ovh.dedicated_cloud.datacenter_hosts
WHERE datacenter_id = '{{ datacenter_id }}' -- required
AND service_name = '{{ service_name }}' -- required
AND x_pagination_mode = '{{ x_pagination_mode }}'
;
Lifecycle Methods​
EXEC variables use wire (API) names.
- add_host_spare
- remove
Request a host replacement. Asks for a spare host to replace this host. A reason is required. Returns a task to track progress.
EXEC ovh.dedicated_cloud.datacenter_hosts.add_host_spare
@datacenterId='{{ datacenterId }}' --required,
@hostId='{{ hostId }}' --required,
@serviceName='{{ serviceName }}' --required
@@json=
'{
"reason": "{{ reason }}"
}'
;
Remove a host
EXEC ovh.dedicated_cloud.datacenter_hosts.remove
@datacenterId='{{ datacenterId }}' --required,
@hostId='{{ hostId }}' --required,
@serviceName='{{ serviceName }}' --required
;