resource_websites
Creates, updates, deletes, gets or lists a resource_websites resource.
Overview​
| Name | resource_websites |
| Type | Resource |
| Id | ovh.webhosting.resource_websites |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | Unique identifier of the website |
checksum | string | Computed hash used to control concurrent modification requests. Here, it represents the current target specification value. |
current_state | object | Current state of the website (wire: currentState) |
current_tasks | array | Ongoing asynchronous tasks related to the website (wire: currentTasks) |
resource_status | string | Webhosting Website readiness in the system (CREATING, CREATION_PLANNED, DELETING, ERROR, OUT_OF_SYNC, READY, SUSPENDED, UNKNOWN, UPDATING) (wire: resourceStatus) |
target_spec | object | Webhosting Website target specification (wire: targetSpec) |
Webhosting Website
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | Unique identifier of the website |
checksum | string | Computed hash used to control concurrent modification requests. Here, it represents the current target specification value. |
current_state | object | Current state of the website (wire: currentState) |
current_tasks | array | Ongoing asynchronous tasks related to the website (wire: currentTasks) |
resource_status | string | Webhosting Website readiness in the system (CREATING, CREATION_PLANNED, DELETING, ERROR, OUT_OF_SYNC, READY, SUSPENDED, UNKNOWN, UPDATING) (wire: resourceStatus) |
target_spec | object | Webhosting Website target specification (wire: targetSpec) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | name, website_id | Returns the website name, root folder, number of linked domains and its Git and module status. (Beta version) | |
list | select | name | x_pagination_cursor, x_pagination_size | Returns the websites of the hosting. (Beta version) |
create | insert | name, target_spec | 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) | |
update | update | name, website_id, target_spec | Updates 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.
| 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"}}) |
name | string | Name |
website_id | string (uuid) | Website ID (wire: websiteId) |
x_pagination_cursor | string | Pagination cursor (wire: X-Pagination-Cursor) |
x_pagination_size | integer | Pagination size (wire: X-Pagination-Size) |
SELECT examples​
- get
- list
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
;
Returns the websites of the hosting. (Beta version)
SELECT
id,
checksum,
current_state,
current_tasks,
resource_status,
target_spec
FROM ovh.webhosting.resource_websites
WHERE name = '{{ name }}' -- required
AND x_pagination_cursor = '{{ x_pagination_cursor }}'
AND x_pagination_size = '{{ x_pagination_size }}'
;
INSERT examples​
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: resource_websites
props:
- name: name
value: "{{ name }}"
description: Required parameter for the resource_websites resource.
- name: target_spec
description: |
Target specification of the website
value:
adminConfiguration:
adminLogin: "{{ adminLogin }}"
adminPassword: "{{ adminPassword }}"
domain: "{{ domain }}"
installPath: "{{ installPath }}"
language: "{{ language }}"
bypassDNSConfiguration: {{ bypassDNSConfiguration }}
cdn:
status: "{{ status }}"
databaseConfiguration:
databaseName: "{{ databaseName }}"
password: "{{ password }}"
port: {{ port }}
server: "{{ server }}"
user: "{{ user }}"
firewall:
status: "{{ status }}"
fqdn: "{{ fqdn }}"
ipLocation: "{{ ipLocation }}"
module:
name: "{{ name }}"
name: "{{ name }}"
path: "{{ path }}"
UPDATE examples​
- update
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;