Skip to main content

modules

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

Overview​

Namemodules
TypeResource
Idovh.hosting_web.modules

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
idintegerInstallation ID
module_idintegerID of the module associated with this installation (wire: moduleId)
task_idintegerThe task ID working on this module (wire: taskId)
admin_namestringLogin for the admin account (wire: adminName)
admin_folderstringThe admin folder, relative to the module's installation path (wire: adminFolder)
creation_datestring (date-time)Date of the installation of the module (wire: creationDate)
dependenciesarrayThe dependencies to which the module has access. A dependency can be a standard database (like MySQL or PostgreSQL) or a key-value store (like Redis or Memcached) for example
languagestringThe language of the module (cz, de, en, es, fi, fr, it, lt, nl, pl, pt)
last_updatestring (date-time)Date of the last module's upgrade (wire: lastUpdate)
pathstringWhere the module is installed, relative to your home directory
statusstringThe module status (created, creating, deleting, updating)
target_urlstringThe URL from where your module can be reached (wire: targetUrl)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectid, service_nameGet an installed module. Returns the path, URL, admin login, language, dependencies and status of the installed module.
listselectservice_namex_pagination_modeList installed modules. Returns the installation IDs of the modules installed on the hosting. Get the details of one with its installation ID.
createinsertservice_name, module_idInstall a module. Installs a module from the available modules in a folder of the hosting, with its admin account and dependencies, and returns the task. The admin password needs at least 8 characters.
deletedeleteid, service_nameDelete an installed module. Deletes the module installation and returns the task. Use the installation ID, not the module ID.

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"}})
idintegerInstallation ID
service_namestringThe internal name of your hosting (wire: serviceName)
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 an installed module. Returns the path, URL, admin login, language, dependencies and status of the installed module.

SELECT
id,
module_id,
task_id,
admin_name,
admin_folder,
creation_date,
dependencies,
language,
last_update,
path,
status,
target_url
FROM ovh.hosting_web.modules
WHERE id = '{{ id }}' -- required
AND service_name = '{{ service_name }}' -- required
;

INSERT examples​

Install a module. Installs a module from the available modules in a folder of the hosting, with its admin account and dependencies, and returns the task. The admin password needs at least 8 characters.

INSERT INTO ovh.hosting_web.modules (
admin_name,
admin_password,
dependencies,
domain,
language,
module_id,
path,
service_name
)
SELECT
'{{ admin_name }}',
'{{ admin_password }}',
'{{ dependencies }}',
'{{ domain }}',
'{{ language }}',
{{ module_id }} /* required */,
'{{ path }}',
'{{ service_name }}'
RETURNING
id,
object_id,
done_date,
function,
last_update,
object_type,
start_date,
status
;

DELETE examples​

Delete an installed module. Deletes the module installation and returns the task. Use the installation ID, not the module ID.

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