websites
Creates, updates, deletes, gets or lists a websites resource.
Overview​
| Name | websites |
| Type | Resource |
| Id | ovh.hosting_web.websites |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
id | integer | Website numeric identifier |
name | string | Customizable name of the website |
hosting_display_name | string | Display name of the hosting (wire: hostingDisplayName) |
hosting_service_name | string | Name of the hosting service (wire: hostingServiceName) |
domains | array | Domains of the website |
path | string | Relative path on the hosting filesystem the website is deployed into |
status | string | Current status of the website (created, creating, deleting, deploying, error, initialError) |
vcs_branch | string | Branch of the repository containing the website source code to deploy (wire: vcsBranch) |
vcs_url | string | URL of the repository containing the website source code to deploy (wire: vcsUrl) |
A website on your hosting
| Name | Datatype | Description |
|---|---|---|
id | integer | Website numeric identifier |
name | string | Customizable name of the website |
hosting_display_name | string | Display name of the hosting (wire: hostingDisplayName) |
hosting_service_name | string | Name of the hosting service (wire: hostingServiceName) |
domains | array | Domains of the website |
path | string | Relative path on the hosting filesystem the website is deployed into |
status | string | Current status of the website (created, creating, deleting, deploying, error, initialError) |
vcs_branch | string | Branch of the repository containing the website source code to deploy (wire: vcsBranch) |
vcs_url | string | URL of the repository containing the website source code to deploy (wire: vcsUrl) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | id, service_name | Returns the name, path, status, domains and repository of the website. | |
list | select | service_name | path, x_pagination_mode | Returns the IDs of the websites of the hosting. Filter them by path. |
create | insert | service_name, path, vcs_branch, vcs_url | Creates a website in a folder of the hosting, deployed from a repository branch, and returns the task. | |
update | update | id, service_name | Updates the repository branch deployed on the website. | |
delete | delete | delete_files, id, service_name | Deletes the website and returns the task. Set deleteFiles to true to also empty the website folder. | |
deploy | exec | id, serviceName | Deploys the website from its repository branch and returns the task. Set reset to true to reset the website files before deploying. |
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"}}) |
delete_files | boolean | Whether the website path should be emptied or not (wire: deleteFiles) |
id | integer | Id |
serviceName | string | Service name |
service_name | string | Service name (wire: serviceName) |
path | string | Filter the value of path property |
x_pagination_mode | string | Sent as CachedObjectList-Pages by default so the list returns the full objects rather than their identifiers. (wire: X-Pagination-Mode) |
SELECT examples​
- get
- list
Returns the name, path, status, domains and repository of the website.
SELECT
id,
name,
hosting_display_name,
hosting_service_name,
domains,
path,
status,
vcs_branch,
vcs_url
FROM ovh.hosting_web.websites
WHERE id = '{{ id }}' -- required
AND service_name = '{{ service_name }}' -- required
;
Returns the IDs of the websites of the hosting. Filter them by path.
SELECT
id,
name,
hosting_display_name,
hosting_service_name,
domains,
path,
status,
vcs_branch,
vcs_url
FROM ovh.hosting_web.websites
WHERE service_name = '{{ service_name }}' -- required
AND path = '{{ path }}'
AND x_pagination_mode = '{{ x_pagination_mode }}'
;
INSERT examples​
- create
- Manifest
Creates a website in a folder of the hosting, deployed from a repository branch, and returns the task.
INSERT INTO ovh.hosting_web.websites (
path,
vcs_branch,
vcs_url,
service_name
)
SELECT
'{{ path }}' /* required */,
'{{ vcs_branch }}' /* required */,
'{{ vcs_url }}' /* required */,
'{{ service_name }}'
RETURNING
id,
object_id,
done_date,
function,
last_update,
object_type,
start_date,
status
;
# Description fields are for documentation purposes
- name: websites
props:
- name: service_name
value: "{{ service_name }}"
description: Required parameter for the websites resource.
- name: path
value: "{{ path }}"
description: |
Relative path on the hosting filesystem the website will be deployed into
- name: vcs_branch
value: "{{ vcs_branch }}"
description: |
Branch of the repository containing the website source code to deploy
- name: vcs_url
value: "{{ vcs_url }}"
description: |
Clone URL of the repository containing the website source code to deploy
UPDATE examples​
- update
Updates the repository branch deployed on the website.
UPDATE ovh.hosting_web.websites
SET
vcs_branch = '{{ vcs_branch }}'
WHERE
id = '{{ id }}' --required
AND service_name = '{{ service_name }}' --required
RETURNING
id,
name,
hosting_display_name,
hosting_service_name,
domains,
path,
status,
vcs_branch,
vcs_url;
DELETE examples​
- delete
Deletes the website and returns the task. Set deleteFiles to true to also empty the website folder.
DELETE FROM ovh.hosting_web.websites
WHERE delete_files = '{{ delete_files }}' --required
AND id = '{{ id }}' --required
AND service_name = '{{ service_name }}' --required
;
Lifecycle Methods​
EXEC variables use wire (API) names.
- deploy
Deploys the website from its repository branch and returns the task. Set reset to true to reset the website files before deploying.
EXEC ovh.hosting_web.websites.deploy
@id='{{ id }}' --required,
@serviceName='{{ serviceName }}' --required
@@json=
'{
"reset": {{ reset }}
}'
;