Skip to main content

runtimes

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

Overview​

Nameruntimes
TypeResource
Idovh.hosting_web.runtimes

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
idintegerThe runtime configuration ID
namestringThe custom display name of the runtime configuration
task_idintegerThe link current task for the runtime configuration (wire: taskId)
app_bootstrapstringThe client application bootstrap script (wire: appBootstrap)
app_envstringThe client application environment (development, production) (wire: appEnv)
creation_datestring (date-time)The creation date of the runtime configuration (wire: creationDate)
is_defaultbooleanIs the runtime configuration is the one by default for the hosting (wire: isDefault)
is_deletablebooleanReturn if the runtime configuration can be deleted (wire: isDeletable)
last_updatestring (date-time)The last update date of the runtime configuration (wire: lastUpdate)
public_dirstringThe client application public directory (wire: publicDir)
statusstringThe status of the runtime (created, creating, deleting, updating)
typestringThe backend type of the runtime (nodejs-10, nodejs-11, nodejs-12, nodejs-14, nodejs-8, nodejs-9, phpfpm-5.6, phpfpm-7.0, phpfpm-7.1, phpfpm-7.2, phpfpm-7.3, phpfpm-7.4, phpfpm-8.0, python-2, python-3, ruby-2.6)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectid, service_nameGet a runtime configuration. Returns the backend type, environment, bootstrap script, public directory and status of the runtime configuration.
listselectservice_namename, type, x_pagination_modeList runtime configurations. Returns the IDs of the runtime configurations of the hosting. Filter them by name or type.
createinsertservice_nameCreate a runtime configuration. Creates a runtime configuration with a backend type, an environment, a bootstrap script and a public directory, linked to attached domains, and returns the task.
updateupdateid, service_nameUpdate a runtime configuration. Updates the name, backend type, environment, bootstrap script, public directory or default status of the runtime configuration.
deletedeleteid, service_nameDelete a runtime configuration. Deletes the runtime configuration and returns the task. Only a configuration with isDeletable set to true can be deleted.

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"}})
idintegerThe runtime configuration ID
service_namestringThe internal name of your hosting (wire: serviceName)
namestringFilter the value of name property (like)
typestringFilter the value of type property (=)
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 runtime configuration. Returns the backend type, environment, bootstrap script, public directory and status of the runtime configuration.

SELECT
id,
name,
task_id,
app_bootstrap,
app_env,
creation_date,
is_default,
is_deletable,
last_update,
public_dir,
status,
type
FROM ovh.hosting_web.runtimes
WHERE id = '{{ id }}' -- required
AND service_name = '{{ service_name }}' -- required
;

INSERT examples​

Create a runtime configuration. Creates a runtime configuration with a backend type, an environment, a bootstrap script and a public directory, linked to attached domains, and returns the task.

INSERT INTO ovh.hosting_web.runtimes (
app_bootstrap,
app_env,
attached_domains,
is_default,
name,
public_dir,
type,
service_name
)
SELECT
'{{ app_bootstrap }}',
'{{ app_env }}',
'{{ attached_domains }}',
{{ is_default }},
'{{ name }}',
'{{ public_dir }}',
'{{ type }}',
'{{ service_name }}'
RETURNING
id,
object_id,
done_date,
function,
last_update,
object_type,
start_date,
status
;

UPDATE examples​

Update a runtime configuration. Updates the name, backend type, environment, bootstrap script, public directory or default status of the runtime configuration.

UPDATE ovh.hosting_web.runtimes
SET
app_bootstrap = '{{ app_bootstrap }}',
app_env = '{{ app_env }}',
is_default = {{ is_default }},
name = '{{ name }}',
public_dir = '{{ public_dir }}',
type = '{{ type }}'
WHERE
id = '{{ id }}' --required
AND service_name = '{{ service_name }}' --required;

DELETE examples​

Delete a runtime configuration. Deletes the runtime configuration and returns the task. Only a configuration with isDeletable set to true can be deleted.

DELETE FROM ovh.hosting_web.runtimes
WHERE id = '{{ id }}' --required
AND service_name = '{{ service_name }}' --required
;