Skip to main content

servers

Creates, updates, deletes, gets or lists a servers resource.

Overview​

Nameservers
TypeResource
Idovh.dedicated_server_v2.servers

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
idstringService name of the dedicated server resource
checksumstringChecksum of the target spec (mutable params). Send it back on update. Rejected if another caller changed the target since your read.
current_stateobjectState observed on the server (wire: currentState)
current_tasksarrayAsynchronous operations currently running. Omitted, never null, when no update is running, and always omitted from the server list. (wire: currentTasks)
iamobjectIAM resource metadata
resource_statusstringReflects 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_specobjectTarget specification last declared on the server (wire: targetSpec)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectservice_nameactionsGet the details of the dedicated server resource. (Beta version)
listselectiam_tagsGet the list of all my dedicated server resources. (Beta version)
log_urlexecserviceName, kindGenerates 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.

NameDatatypeDescription
api_hoststringThe 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"}})
serviceNamestringService name
service_namestringService name (wire: serviceName)
actionsbooleanAlso report, under currentState.actions, whether the server accepts each action it can be asked to perform
iam_tagsobjectFilter resources on IAM tags (wire: iamTags)

SELECT examples​

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 }}'
;

Lifecycle Methods​

EXEC variables use wire (API) names.

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 }}"
}'
;