documents
Creates, updates, deletes, gets or lists a documents resource.
Overview​
| Name | documents |
| Type | Resource |
| Id | ovh.me.documents |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | Document id |
name | string | Document name |
creation_date | string (date-time) | Document creation (wire: creationDate) |
expiration_date | string (date-time) | Document expiration (wire: expirationDate) |
get_url | string | URL used to get document (wire: getUrl) |
put_url | string | URL used to put document (wire: putUrl) |
size | integer | Document size (in bytes) |
tags | array | Document tags |
validation_date | string (date-time) | Document validation (wire: validationDate) |
List of documents added on your account
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | Document id |
name | string | Document name |
creation_date | string (date-time) | Document creation (wire: creationDate) |
expiration_date | string (date-time) | Document expiration (wire: expirationDate) |
get_url | string | URL used to get document (wire: getUrl) |
put_url | string | URL used to put document (wire: putUrl) |
size | integer | Document size (in bytes) |
tags | array | Document tags |
validation_date | string (date-time) | Document validation (wire: validationDate) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | id | Get this object properties | |
list | select | x_pagination_mode | List of documents added in your account | |
create | insert | name | Create new document | |
update | update | id | Alter this object properties | |
delete | delete | id | Delete a document | |
cors | exec | origin | Add CORS support on your container |
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"}}) |
id | string (uuid) | Document id |
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
Get this object properties
SELECT
id,
name,
creation_date,
expiration_date,
get_url,
put_url,
size,
tags,
validation_date
FROM ovh.me.documents
WHERE id = '{{ id }}' -- required
;
List of documents added in your account
SELECT
id,
name,
creation_date,
expiration_date,
get_url,
put_url,
size,
tags,
validation_date
FROM ovh.me.documents
WHERE x_pagination_mode = '{{ x_pagination_mode }}'
;
INSERT examples​
- create
- Manifest
Create new document
INSERT INTO ovh.me.documents (
name,
tags
)
SELECT
'{{ name }}' /* required */,
'{{ tags }}'
RETURNING
id,
name,
creation_date,
expiration_date,
get_url,
put_url,
size,
tags,
validation_date
;
# Description fields are for documentation purposes
- name: documents
props:
- name: name
value: "{{ name }}"
description: |
File name
- name: tags
description: |
File tags
value:
- key: "{{ key }}"
value: "{{ value }}"
UPDATE examples​
- update
Alter this object properties
UPDATE ovh.me.documents
SET
expiration_date = '{{ expiration_date }}'
WHERE
id = '{{ id }}' --required;
DELETE examples​
- delete
Delete a document
DELETE FROM ovh.me.documents
WHERE id = '{{ id }}' --required
;
Lifecycle Methods​
EXEC variables use wire (API) names.
- cors
Add CORS support on your container
EXEC ovh.me.documents.cors
@@json=
'{
"origin": "{{ origin }}"
}'
;