asset_files
Creates, updates, deletes, gets or lists an asset_files resource.
Overview
| Name | asset_files |
| Type | Resource |
| Id | aws.devops_agent.asset_files |
Fields
The following fields are returned by SELECT queries:
- get_asset_file
- list_asset_files
| Name | Datatype | Description |
|---|---|---|
content | object | Content of an individual asset file |
created_at | string (date-time) | Timestamp when this file was created |
metadata | object | The metadata for this file |
path | string | The path of a file within an asset (pattern: <code>[a-zA-Z0-9_./ ()-]+</code>) |
updated_at | string (date-time) | Timestamp when this file was last updated |
version | integer | The asset version this file belongs to |
| Name | Datatype | Description |
|---|---|---|
created_at | string (date-time) | Timestamp when this file was created |
metadata | object | The metadata for this file |
path | string | The path of a file within an asset (pattern: <code>[a-zA-Z0-9_./ ()-]+</code>) |
updated_at | string (date-time) | Timestamp when this file was last updated |
version | integer | The asset version this file belongs to |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_asset_file | select | agent_space_id, asset_id, path, region | assetVersion | Gets a file from an asset |
list_asset_files | select | agent_space_id, asset_id, region | assetVersion, nextToken, maxResults | Lists files in an asset |
create_asset_file | insert | agent_space_id, asset_id, path, region, content | Creates a file in an asset | |
update_asset_file | update | agent_space_id, asset_id, path, region | Updates a file in an asset | |
delete_asset_file | delete | agent_space_id, asset_id, path, region | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
agent_space_id | string | The unique identifier for the agent space containing the asset |
asset_id | string | The unique identifier of the asset containing the file |
path | string | The path of the file within the asset to delete |
region | string | AWS region (default: us-east-1) |
assetVersion | integer | The specific asset version to list files from. If omitted, files from the latest version are returned. |
maxResults | integer | The maximum number of results to return in a single response |
nextToken | string | Pagination token from a previous response to retrieve the next page of results |
SELECT examples
- get_asset_file
- list_asset_files
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 }}'
;
Lists files in an asset
SELECT
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 region = '{{ region }}' -- required
AND assetVersion = '{{ assetVersion }}'
AND nextToken = '{{ nextToken }}'
AND maxResults = '{{ maxResults }}'
;
INSERT examples
- create_asset_file
- Manifest
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
;
# Description fields are for documentation purposes
- name: asset_files
props:
- name: agent_space_id
value: "{{ agent_space_id }}"
description: Required parameter for the asset_files resource.
- name: asset_id
value: "{{ asset_id }}"
description: Required parameter for the asset_files resource.
- name: path
value: "{{ path }}"
description: Required parameter for the asset_files resource.
- name: region
value: "{{ region }}"
description: Required parameter for the asset_files resource.
- name: content
description: |
Content of an individual asset file
value:
bytes: "{{ bytes }}"
text: "{{ text }}"
- name: metadata
value: "{{ metadata }}"
- name: clientToken
value: "{{ clientToken }}"
UPDATE examples
- update_asset_file
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
- delete_asset_file
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
;