Skip to main content

resource_websites

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

Overview​

Nameresource_websites
TypeResource
Idovh.webhosting.resource_websites

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
idstring (uuid)Unique identifier of the website
checksumstringComputed hash used to control concurrent modification requests. Here, it represents the current target specification value.
current_stateobjectCurrent state of the website (wire: currentState)
current_tasksarrayOngoing asynchronous tasks related to the website (wire: currentTasks)
resource_statusstringWebhosting Website readiness in the system (CREATING, CREATION_PLANNED, DELETING, ERROR, OUT_OF_SYNC, READY, SUSPENDED, UNKNOWN, UPDATING) (wire: resourceStatus)
target_specobjectWebhosting Website target specification (wire: targetSpec)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectname, website_idReturns the website name, root folder, number of linked domains and its Git and module status. (Beta version)
listselectnamex_pagination_cursor, x_pagination_sizeReturns the websites of the hosting. (Beta version)
createinsertname, target_specCreates a website on a domain, with its root folder, and can install a WordPress, Joomla, Drupal or PrestaShop module. Creation is asynchronous: follow resourceStatus until READY. Set bypassDNSConfiguration to true to leave the DNS zone unchanged. (Beta version)
updateupdatename, website_id, target_specUpdates the name and root folder of the website. (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"}})
namestringName
website_idstring (uuid)Website ID (wire: websiteId)
x_pagination_cursorstringPagination cursor (wire: X-Pagination-Cursor)
x_pagination_sizeintegerPagination size (wire: X-Pagination-Size)

SELECT examples​

Returns the website name, root folder, number of linked domains and its Git and module status. (Beta version)

SELECT
id,
checksum,
current_state,
current_tasks,
resource_status,
target_spec
FROM ovh.webhosting.resource_websites
WHERE name = '{{ name }}' -- required
AND website_id = '{{ website_id }}' -- required
;

INSERT examples​

Creates a website on a domain, with its root folder, and can install a WordPress, Joomla, Drupal or PrestaShop module. Creation is asynchronous: follow resourceStatus until READY. Set bypassDNSConfiguration to true to leave the DNS zone unchanged. (Beta version)

INSERT INTO ovh.webhosting.resource_websites (
target_spec,
name
)
SELECT
'{{ target_spec }}' /* required */,
'{{ name }}'
RETURNING
id,
checksum,
current_state,
current_tasks,
resource_status,
target_spec
;

UPDATE examples​

Updates the name and root folder of the website. (Beta version)

UPDATE ovh.webhosting.resource_websites
SET
target_spec = '{{ target_spec }}'
WHERE
name = '{{ name }}' --required
AND website_id = '{{ website_id }}' --required
AND target_spec = '{{ target_spec }}' --required
RETURNING
id,
checksum,
current_state,
current_tasks,
resource_status,
target_spec;