servers
Creates, updates, deletes, gets or lists a servers resource.
Overview​
| Name | servers |
| Type | Resource |
| Id | ovh.dedicated_server_v2.servers |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
id | string | Service name of the dedicated server resource |
checksum | string | Checksum of the target spec (mutable params). Send it back on update. Rejected if another caller changed the target since your read. |
current_state | object | State observed on the server (wire: currentState) |
current_tasks | array | Asynchronous operations currently running. Omitted, never null, when no update is running, and always omitted from the server list. (wire: currentTasks) |
iam | object | IAM resource metadata |
resource_status | string | Reflects the readiness of the dedicated server resource. A new target specification request will be accepted only in READY status. (CREATING, CREATION_PLANNED, DELETING, ERROR, OUT_OF_SYNC, READY, SUSPENDED, UNKNOWN, UPDATING) (wire: resourceStatus) |
target_spec | object | Target specification last declared on the server (wire: targetSpec) |
Dedicated server resource
| Name | Datatype | Description |
|---|---|---|
id | string | Service name of the dedicated server resource |
checksum | string | Checksum of the target spec (mutable params). Send it back on update. Rejected if another caller changed the target since your read. |
current_state | object | State observed on the server (wire: currentState) |
current_tasks | array | Asynchronous operations currently running. Omitted, never null, when no update is running, and always omitted from the server list. (wire: currentTasks) |
iam | object | IAM resource metadata |
resource_status | string | Reflects the readiness of the dedicated server resource. A new target specification request will be accepted only in READY status. (CREATING, CREATION_PLANNED, DELETING, ERROR, OUT_OF_SYNC, READY, SUSPENDED, UNKNOWN, UPDATING) (wire: resourceStatus) |
target_spec | object | Target specification last declared on the server (wire: targetSpec) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | service_name | actions | Get the details of the dedicated server resource. (Beta version) |
list | select | iam_tags | Get the list of all my dedicated server resources. (Beta version) | |
log_url | exec | serviceName, kind | Generates a temporary URL to read the logs of one kind. The URL expires. (Beta version) |
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"}}) |
serviceName | string | Service name |
service_name | string | Service name (wire: serviceName) |
actions | boolean | Also report, under currentState.actions, whether the server accepts each action it can be asked to perform |
iam_tags | object | Filter resources on IAM tags (wire: iamTags) |
SELECT examples​
- get
- list
Get the details of the dedicated server resource. (Beta version)
SELECT
id,
checksum,
current_state,
current_tasks,
iam,
resource_status,
target_spec
FROM ovh.dedicated_server_v2.servers
WHERE service_name = '{{ service_name }}' -- required
AND actions = '{{ actions }}'
;
Get the list of all my dedicated server resources. (Beta version)
SELECT
id,
checksum,
current_state,
current_tasks,
iam,
resource_status,
target_spec
FROM ovh.dedicated_server_v2.servers
WHERE iam_tags = '{{ iam_tags }}'
;
Lifecycle Methods​
EXEC variables use wire (API) names.
- log_url
Generates a temporary URL to read the logs of one kind. The URL expires. (Beta version)
EXEC ovh.dedicated_server_v2.servers.log_url
@serviceName='{{ serviceName }}' --required
@@json=
'{
"kind": "{{ kind }}"
}'
;