Static Assets management service¶
Summary¶
Manage Murano Static Assets
Operations
Name | Tag | Summary |
---|---|---|
asset.delete() | Delete an existing asset | |
asset.list() | Get information on existing assets | |
asset.send() | Sends a file as response | |
asset.store() | Stores an uploaded file | |
asset.update() |
Operations¶
delete¶
Description
Deletes an existing asset based on the given path name.
Arguments
Name | Type | Description |
---|---|---|
path | string | Path name of the asset. |
Responses
- Returns
nil
for The object was deleted
list¶
Description
Lists existing assets with the given path. "*" can be used as wildcard in the path.
Arguments
Name | Type | Description |
---|---|---|
path | string | Path name of the asset. |
Responses
-
Returns
{[ object ]}
for List of FilesName Type Description md5 string MD5 checksum of the stored file path string Path of the stored file size integer Size in bytes of the stored file mime_type string Mime type of the stored file
send¶
Description
Sends the given asset as response to a webservice request.
Arguments
Name | Type | Description |
---|---|---|
request_id | string | Request id |
file | string | The path name of the asset that should be sent. |
Responses
- Returns
nil
for File was sent successfully.
store¶
Description
Stores an uploaded file permanently in the asset store under the provided path.
Arguments
Name | Type | Description |
---|---|---|
path | string | Path name of the asset. |
file_id | string | The file_id from the Webservice Request that should be permanently stored. |
request_id | string | The request_id from the Webservice Request that should be permanently stored. |
Responses
- Returns
nil
for The file was uploaded successfully
Example
-- In a webservice endpoint script:
if request.files[1] then
return Asset.store({request_id = request.request_id, file_id = request.files[1].file_id, path = "/api/location"})
end
return "no file provided"
update¶
Description
Update file metadata
Arguments
Name | Type | Description |
---|---|---|
file | string | The API path where file is located |
path | string | API endpoint to access the file. |
Responses
- Returns
nil
for File updated