Skip to main content

asset_files

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

Overview

Nameasset_files
TypeResource
Idaws.devops_agent.asset_files

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
contentobjectContent of an individual asset file
created_atstring (date-time)Timestamp when this file was created
metadataobjectThe metadata for this file
pathstringThe path of a file within an asset (pattern: <code>[a-zA-Z0-9_./ ()-]+</code>)
updated_atstring (date-time)Timestamp when this file was last updated
versionintegerThe asset version this file belongs to

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_asset_fileselectagent_space_id, asset_id, path, regionassetVersionGets a file from an asset
list_asset_filesselectagent_space_id, asset_id, regionassetVersion, nextToken, maxResultsLists files in an asset
create_asset_fileinsertagent_space_id, asset_id, path, region, contentCreates a file in an asset
update_asset_fileupdateagent_space_id, asset_id, path, regionUpdates a file in an asset
delete_asset_filedeleteagent_space_id, asset_id, path, regionDeletes a file from an asset

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
agent_space_idstringThe unique identifier for the agent space containing the asset
asset_idstringThe unique identifier of the asset containing the file
pathstringThe path of the file within the asset to delete
regionstringAWS region (default: us-east-1)
assetVersionintegerThe specific asset version to list files from. If omitted, files from the latest version are returned.
maxResultsintegerThe maximum number of results to return in a single response
nextTokenstringPagination token from a previous response to retrieve the next page of results

SELECT examples

Gets a file from an asset

SELECT
content,
created_at,
metadata,
path,
updated_at,
version
FROM aws.devops_agent.asset_files
WHERE agent_space_id = '{{ agent_space_id }}' -- required
AND asset_id = '{{ asset_id }}' -- required
AND path = '{{ path }}' -- required
AND region = '{{ region }}' -- required
AND assetVersion = '{{ assetVersion }}'
;

INSERT examples

Creates a file in an asset

INSERT INTO aws.devops_agent.asset_files (
content,
metadata,
clientToken,
agent_space_id,
asset_id,
path,
region
)
SELECT
'{{ content }}' /* required */,
'{{ metadata }}',
'{{ clientToken }}',
'{{ agent_space_id }}',
'{{ asset_id }}',
'{{ path }}',
'{{ region }}'
RETURNING
file
;

UPDATE examples

Updates a file in an asset

UPDATE aws.devops_agent.asset_files
SET
content = '{{ content }}',
metadata = '{{ metadata }}',
clientToken = '{{ clientToken }}'
WHERE
agent_space_id = '{{ agent_space_id }}' --required
AND asset_id = '{{ asset_id }}' --required
AND path = '{{ path }}' --required
AND region = '{{ region }}' --required
RETURNING
file;

DELETE examples

Deletes a file from an asset

DELETE FROM aws.devops_agent.asset_files
WHERE agent_space_id = '{{ agent_space_id }}' --required
AND asset_id = '{{ asset_id }}' --required
AND path = '{{ path }}' --required
AND region = '{{ region }}' --required
;