Skip to main content

servers

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

Overview​

Nameservers
TypeResource
Idovh.dedicated_server.servers

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
namestringdedicated server name
boot_idinteger (wire: bootId)
server_idintegeryour server id (wire: serverId)
availability_zonestringdedicated AZ localisation (wire: availabilityZone)
boot_scriptstringIpxe script served on boot (wire: bootScript)
commercial_rangestringdedicater server commercial range (wire: commercialRange)
datacenterstringdedicated datacenter localisation (bhs1, bhs2, bhs3, bhs4, bhs5, bhs6, bhs7, bhs8, cch01, crx1, crx2, dc1, eri1, eri2, frcrx41, frcrx42, frcrx43, gra04, gra1, gra2, gra3, gsw, hdf01, hil1, ieb01, itbsi01, itmil01, itzvf01, lil1-int1, lim1, lim2, lim3, mr901, p19, rbx, rbx-hz, rbx1, rbx10, rbx2, rbx3, rbx4, rbx5, rbx6, rbx7, rbx8, rbx9, sbg1, sbg2, sbg3, sbg4, sbg5, sgp02, sgp1, syd03, syd1, syd2, vin1, waw1, ynm1, yyz01)
efi_bootloader_pathstringEfiBootloader path (wire: efiBootloaderPath)
iamobjectIAM resource metadata
ipstring (ipv4)dedicated server ip (example: 192.0.2.0)
link_speedinteger (wire: linkSpeed)
monitoringbooleanIcmp monitoring state
new_upgrade_systemboolean (wire: newUpgradeSystem)
no_interventionbooleanPrevent datacenter intervention (wire: noIntervention)
osstringOperating system
power_statestringPower state of the server (poweroff, poweron) (wire: powerState)
professional_usebooleanDoes this server have professional use option (wire: professionalUse)
rackstring
regionstringdedicated region localisation
rescue_mailstringCustom email used to receive rescue credentials (wire: rescueMail)
rescue_ssh_keystringPublic SSH Key used in the rescue mode (wire: rescueSshKey)
reversestringdedicated server reverse
root_devicestring (wire: rootDevice)
statestringAll states a Dedicated can in (error, hacked, hackedBlocked, ok)
support_levelstringDedicated server support level (critical, fastpath, gs, pro) (wire: supportLevel)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectservice_nameGet a server. Returns the properties of the server, such as its datacenter, IP address, operating system, power state, and boot and rescue settings. The response also contains the IAM metadata of the server.
listselectiam_tags, x_pagination_modeList servers. Returns the names of the dedicated servers the account can access. Each name is the serviceName used by the other calls on a server.
updateupdateservice_nameUpdate a server. Updates the writable properties of the server, such as its boot, rescue, monitoring and datacenter intervention settings. The other properties are read-only.
authentication_secretexecserviceNameGet access credentials. Returns the credentials to connect to the server or to an application installed on it, such as SSH, RDP, SQL Server or a web control panel. Each entry gives the access type, URL, login and password.
change_contactexecserviceNameChange service contacts. Starts a procedure to change the admin, tech or billing contact of the service.
confirm_terminationexecserviceName, tokenConfirm service termination. Terminates the service with the token sent by email to the admin contact. A reason, a future use and a comment can be given.
ip_block_mergeexecserviceName, blockMerge a split IP block. Merges a split IP block and routes it to the server. This operation cannot be undone. Returns the task that performs the merge.
ip_moveexecserviceName, ipMove a failover IP to the server. Moves the given failover IP block to the server. Returns the task that performs the move.
license_windowsexecserviceName, licenseId, versionAdd an existing Windows license. Attaches an existing Windows license serial number to the server, for the given license version. The license can then be managed under /license/windows. Returns a task.
ola_aggregationexecserviceName, name, virtualNetworkInterfacesAggregate network interfaces. Groups virtual network interfaces into one link aggregation, under the given name. Returns a task. (Beta version)
ola_resetexecserviceName, virtualNetworkInterfaceReset a network interface. Resets a virtual network interface to its default configuration. Returns a task. (Beta version)
rebootexecserviceNameReboot the server. Performs a hard reboot of the server: the power is cycled without a clean shutdown of the operating system. Returns the reboot task, with its status and completion date.
reinstallexecserviceName, operatingSystemInstalls an operating system on the server and returns the installation task. operatingSystem must be one of the names returned by GET /dedicated/server/{serviceName}/install/compatibleTemplates. By default, all disks of the disk group are erased.
support_replace_coolingexecserviceName, comment, detailsRequest a cooling module replacement. Opens a support request to replace a cooling module of the server, with a comment and technical details or logs. Returns the identifiers of the created support ticket and message. (Beta version)
support_replace_hard_disk_driveexecserviceName, comment, disks, inverseRequest a disk replacement. Opens a support request to replace disks of the server, identified by serial number or slot. With inverse set to true, the listed disks are kept and all the other disks are replaced. Returns the identifiers of the created support ticket and message. (Beta version)
support_replace_memoryexecserviceName, comment, detailsRequest a memory module replacement. Opens a support request to replace a faulty RAM module of the server, with a comment and technical details or logs. The faulty slots can be listed if known. Returns the identifiers of the created support ticket and message. (Beta version)
terminateexecserviceNameRequest service termination. Starts the termination of the service. The admin contact receives a token by email, to confirm with the confirmTermination call.

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"}})
serviceNamestringThe internal name of your dedicated server
service_namestringThe internal name of your dedicated server (wire: serviceName)
iam_tagsobjectFilter resources on IAM tags (wire: iamTags)
x_pagination_modestringSent as CachedObjectList-Pages by default so the list returns the full objects rather than their identifiers. (wire: X-Pagination-Mode)

SELECT examples​

Get a server. Returns the properties of the server, such as its datacenter, IP address, operating system, power state, and boot and rescue settings. The response also contains the IAM metadata of the server.

SELECT
name,
boot_id,
server_id,
availability_zone,
boot_script,
commercial_range,
datacenter,
efi_bootloader_path,
iam,
ip,
link_speed,
monitoring,
new_upgrade_system,
no_intervention,
os,
power_state,
professional_use,
rack,
region,
rescue_mail,
rescue_ssh_key,
reverse,
root_device,
state,
support_level
FROM ovh.dedicated_server.servers
WHERE service_name = '{{ service_name }}' -- required
;

UPDATE examples​

Update a server. Updates the writable properties of the server, such as its boot, rescue, monitoring and datacenter intervention settings. The other properties are read-only.

UPDATE ovh.dedicated_server.servers
SET
boot_id = {{ boot_id }},
boot_script = '{{ boot_script }}',
efi_bootloader_path = '{{ efi_bootloader_path }}',
monitoring = {{ monitoring }},
no_intervention = {{ no_intervention }},
rescue_mail = '{{ rescue_mail }}',
rescue_ssh_key = '{{ rescue_ssh_key }}',
root_device = '{{ root_device }}',
state = '{{ state }}'
WHERE
service_name = '{{ service_name }}' --required;

Lifecycle Methods​

EXEC variables use wire (API) names.

Get access credentials. Returns the credentials to connect to the server or to an application installed on it, such as SSH, RDP, SQL Server or a web control panel. Each entry gives the access type, URL, login and password.

EXEC ovh.dedicated_server.servers.authentication_secret
@serviceName='{{ serviceName }}' --required
;