Skip to main content

apps

Creates, updates, deletes, gets or lists an apps resource.

Overview​

Nameapps
TypeResource
Idovh.cloud_ai.apps

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
idstring (uuid)App Id
created_atstring (date-time)App creation date (wire: createdAt)
specobjectApp spec
statusobjectApp Container Status
updated_atstring (date-time)App last update date (wire: updatedAt)
userstringApp user owner

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectapp_id, service_nameGet app information
listselectservice_namelabel_selector, order, page, size, sort, status_state, updated_after, updated_before, user_nameList apps
createinsertservice_name, image, region, resourcesCreate a new app
updateupdateapp_id, service_nameUpdate several parts of an app's spec
deletedeleteapp_id, service_nameforceDelete an app
commandexecservice_name, image, region, resourcesGenerate an app spec corresponding CLI command
datasyncexecappId, service_nameStarts a manual data synchronization on an app
update_imageexecappId, service_name, urlSet the Docker image of an AI app
update_labelexecappId, service_name, nameUpdate/add an AI Solutions app label
update_scalingstrategyexecappId, service_nameScale a App
startexecappId, service_nameStart an existing AI Solutions app
stopexecappId, service_nameStop an AI Solutions app

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"}})
appIdstring (uuid)App ID
app_idstring (uuid)App ID (wire: appId)
service_namestringThe Public Cloud project ID. Resolved from OVH_CLOUD_PROJECT_SERVICE when set.
forcebooleanForce app deletion by killing it if at a running state
label_selectorstringFilter on app label (e.g. 'app_name=kind_of_magic') (wire: labelSelector)
orderstringOrder the result set
pageintegerPage of the result set
sizeintegerSize of the result set
sortstringSort the result with this field
status_statearrayFilter on status state (wire: statusState)
updated_afterstring (date-time)Filter on updatedAt property (>) (wire: updatedAfter)
updated_beforestring (date-time)Filter on updatedAt property (<) (wire: updatedBefore)
user_namestringUser that submit the job (wire: userName)

SELECT examples​

Get app information

SELECT
id,
created_at,
spec,
status,
updated_at,
user
FROM ovh.cloud_ai.apps
WHERE app_id = '{{ app_id }}' -- required
AND service_name = '{{ service_name }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
;

INSERT examples​

Create a new app

INSERT INTO ovh.cloud_ai.apps (
command,
default_http_port,
deployment_strategy,
env_vars,
grpc_port,
image,
labels,
liveness_probe,
name,
partner_id,
probe,
region,
resources,
scaling_strategy,
unsecure_http,
volumes,
service_name
)
SELECT
'{{ command }}',
{{ default_http_port }},
'{{ deployment_strategy }}',
'{{ env_vars }}',
{{ grpc_port }},
'{{ image }}' /* required */,
'{{ labels }}',
'{{ liveness_probe }}',
'{{ name }}',
'{{ partner_id }}',
'{{ probe }}',
'{{ region }}' /* required */,
'{{ resources }}' /* required */,
'{{ scaling_strategy }}',
{{ unsecure_http }},
'{{ volumes }}',
'{{ service_name }}'
RETURNING
id,
created_at,
spec,
status,
updated_at,
user
;

UPDATE examples​

Update several parts of an app's spec

UPDATE ovh.cloud_ai.apps
SET
command = '{{ command }}',
cpu = {{ cpu }},
default_http_port = {{ default_http_port }},
deployment_strategy = '{{ deployment_strategy }}',
env_vars = '{{ env_vars }}',
flavor = '{{ flavor }}',
flavor_count = {{ flavor_count }},
gpu = {{ gpu }},
grpc_port = {{ grpc_port }},
liveness_probe = '{{ liveness_probe }}',
probe = '{{ probe }}',
url = '{{ url }}'
WHERE
app_id = '{{ app_id }}' --required
AND service_name = '{{ service_name }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
RETURNING
id,
created_at,
spec,
status,
updated_at,
user;

DELETE examples​

Delete an app

DELETE FROM ovh.cloud_ai.apps
WHERE app_id = '{{ app_id }}' --required
AND service_name = '{{ service_name }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
AND force = '{{ force }}'
;

Lifecycle Methods​

EXEC variables use wire (API) names.

Generate an app spec corresponding CLI command

EXEC ovh.cloud_ai.apps.command
@service_name='{{ service_name }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
@@json=
'{
"command": "{{ command }}",
"defaultHttpPort": {{ defaultHttpPort }},
"deploymentStrategy": "{{ deploymentStrategy }}",
"envVars": "{{ envVars }}",
"grpcPort": {{ grpcPort }},
"image": "{{ image }}",
"labels": "{{ labels }}",
"livenessProbe": "{{ livenessProbe }}",
"name": "{{ name }}",
"partnerId": "{{ partnerId }}",
"probe": "{{ probe }}",
"region": "{{ region }}",
"resources": "{{ resources }}",
"scalingStrategy": "{{ scalingStrategy }}",
"unsecureHttp": {{ unsecureHttp }},
"volumes": "{{ volumes }}"
}'
;