resource_websites
Creates, updates, deletes, gets or lists a resource_websites resource.
Overview​
| Name | resource_websites |
| Type | Resource |
| Id | ovh.managed_cms.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 |
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 | Website readiness in the system (CREATING, CREATION_PLANNED, DELETING, ERROR, OUT_OF_SYNC, READY, SUSPENDED, UNKNOWN, UPDATING) (wire: resourceStatus) |
target_spec | object | Target specification of the website (wire: targetSpec) |
Information about a website
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | Unique identifier of the website |
checksum | string | Computed hash used to control concurrent modification requests |
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 | Website readiness in the system (CREATING, CREATION_PLANNED, DELETING, ERROR, OUT_OF_SYNC, READY, SUSPENDED, UNKNOWN, UPDATING) (wire: resourceStatus) |
target_spec | object | Target specification of the website (wire: targetSpec) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | service_id, website_id | Returns the CMS and PHP versions, domains, SFTP and database access, disk usage and planned update of the website. (Alpha version) | |
list | select | service_id | x_pagination_cursor, x_pagination_size | Returns the websites of the service. (Alpha version) |
create | insert | service_id, target_spec | Creates a WordPress website, imports one from its admin URL and credentials, or clones a website of the same service. The admin login of a created website must be an email address. Creation is asynchronous: follow its task in currentTasks. (Alpha version) | |
update | update | service_id, website_id | Updates the domains, primary FQDN or planned update of the website. It can also flush its CDN, or reset its database, SFTP or PhpMyAdmin password. (Alpha version) | |
delete | delete | service_id, website_id | Permanently deletes the website, with its files and database. (Alpha version) | |
application_password | exec | serviceId, websiteId | Each call creates a new application password on the existing administrator user. The previous ones stay valid. They can be revoked from the CMS administration. (Beta version) | |
flush_cdn | exec | serviceId, websiteId | Flushes the CDN cache of the website and returns the task. (Alpha version) | |
reset_database_password | exec | serviceId, websiteId | Generates a new database password and sets it on the database and in the WordPress configuration. Use it to revoke a leaked password: the new password is not returned. (Alpha version) | |
reset_php_my_admin_password | exec | serviceId, websiteId, password | Sets a new PhpMyAdmin password for the website and returns the task. The password needs 9 to 30 alphanumeric characters, with at least one uppercase letter, one lowercase letter and one digit. (Alpha version) | |
reset_sftp_password | exec | serviceId, websiteId, password | Sets a new SFTP password for the website and returns the task. The password needs 9 to 30 alphanumeric characters, with at least one uppercase letter, one lowercase letter and one digit. (Alpha version) | |
snapshot | exec | serviceId, websiteId | Exports a full backup of the website, files and database, and returns the task. The download links are sent by email. (Alpha 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"}}) |
serviceId | string (uuid) | Service ID |
service_id | string (uuid) | Service ID (wire: serviceId) |
websiteId | string (uuid) | Website ID |
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 CMS and PHP versions, domains, SFTP and database access, disk usage and planned update of the website. (Alpha version)
SELECT
id,
checksum,
current_state,
current_tasks,
resource_status,
target_spec
FROM ovh.managed_cms.resource_websites
WHERE service_id = '{{ service_id }}' -- required
AND website_id = '{{ website_id }}' -- required
;
Returns the websites of the service. (Alpha version)
SELECT
id,
checksum,
current_state,
current_tasks,
resource_status,
target_spec
FROM ovh.managed_cms.resource_websites
WHERE service_id = '{{ service_id }}' -- required
AND x_pagination_cursor = '{{ x_pagination_cursor }}'
AND x_pagination_size = '{{ x_pagination_size }}'
;
INSERT examples​
- create
- Manifest
Creates a WordPress website, imports one from its admin URL and credentials, or clones a website of the same service. The admin login of a created website must be an email address. Creation is asynchronous: follow its task in currentTasks. (Alpha version)
INSERT INTO ovh.managed_cms.resource_websites (
target_spec,
service_id
)
SELECT
'{{ target_spec }}' /* required */,
'{{ service_id }}'
RETURNING
id,
checksum,
current_state,
current_tasks,
resource_status,
target_spec
;
# Description fields are for documentation purposes
- name: resource_websites
props:
- name: service_id
value: "{{ service_id }}"
description: Required parameter for the resource_websites resource.
- name: target_spec
description: |
Target specification of the website
value:
clone:
sourceWebsiteId: "{{ sourceWebsiteId }}"
creation:
adminLogin: "{{ adminLogin }}"
adminPassword: "{{ adminPassword }}"
cms: "{{ cms }}"
cmsSpecific:
wordpress:
language: "{{ language }}"
phpVersion: "{{ phpVersion }}"
import:
adminLogin: "{{ adminLogin }}"
adminPassword: "{{ adminPassword }}"
adminURL: "{{ adminURL }}"
cms: "{{ cms }}"
UPDATE examples​
- update
Updates the domains, primary FQDN or planned update of the website. It can also flush its CDN, or reset its database, SFTP or PhpMyAdmin password. (Alpha version)
UPDATE ovh.managed_cms.resource_websites
SET
target_spec = '{{ target_spec }}'
WHERE
service_id = '{{ service_id }}' --required
AND website_id = '{{ website_id }}' --required
RETURNING
id,
checksum,
current_state,
current_tasks,
resource_status,
target_spec;
DELETE examples​
- delete
Permanently deletes the website, with its files and database. (Alpha version)
DELETE FROM ovh.managed_cms.resource_websites
WHERE service_id = '{{ service_id }}' --required
AND website_id = '{{ website_id }}' --required
;
Lifecycle Methods​
EXEC variables use wire (API) names.
- application_password
- flush_cdn
- reset_database_password
- reset_php_my_admin_password
- reset_sftp_password
- snapshot
Each call creates a new application password on the existing administrator user. The previous ones stay valid. They can be revoked from the CMS administration. (Beta version)
EXEC ovh.managed_cms.resource_websites.application_password
@serviceId='{{ serviceId }}' --required,
@websiteId='{{ websiteId }}' --required
;
Flushes the CDN cache of the website and returns the task. (Alpha version)
EXEC ovh.managed_cms.resource_websites.flush_cdn
@serviceId='{{ serviceId }}' --required,
@websiteId='{{ websiteId }}' --required
;
Generates a new database password and sets it on the database and in the WordPress configuration. Use it to revoke a leaked password: the new password is not returned. (Alpha version)
EXEC ovh.managed_cms.resource_websites.reset_database_password
@serviceId='{{ serviceId }}' --required,
@websiteId='{{ websiteId }}' --required
;
Sets a new PhpMyAdmin password for the website and returns the task. The password needs 9 to 30 alphanumeric characters, with at least one uppercase letter, one lowercase letter and one digit. (Alpha version)
EXEC ovh.managed_cms.resource_websites.reset_php_my_admin_password
@serviceId='{{ serviceId }}' --required,
@websiteId='{{ websiteId }}' --required
@@json=
'{
"password": "{{ password }}"
}'
;
Sets a new SFTP password for the website and returns the task. The password needs 9 to 30 alphanumeric characters, with at least one uppercase letter, one lowercase letter and one digit. (Alpha version)
EXEC ovh.managed_cms.resource_websites.reset_sftp_password
@serviceId='{{ serviceId }}' --required,
@websiteId='{{ websiteId }}' --required
@@json=
'{
"password": "{{ password }}"
}'
;
Exports a full backup of the website, files and database, and returns the task. The download links are sent by email. (Alpha version)
EXEC ovh.managed_cms.resource_websites.snapshot
@serviceId='{{ serviceId }}' --required,
@websiteId='{{ websiteId }}' --required
;