DevOpsAgentService / Client / create_asset_file
create_asset_file¶
- DevOpsAgentService.Client.create_asset_file(**kwargs)¶
Creates a file in an asset
See also: AWS API Documentation
Request Syntax
response = client.create_asset_file( agentSpaceId='string', assetId='string', path='string', content={ 'bytes': b'bytes', 'text': 'string' }, metadata={...}|[...]|123|123.4|'string'|True|None, clientToken='string' )
- Parameters:
agentSpaceId (string) –
[REQUIRED]
The unique identifier for the agent space containing the asset
assetId (string) –
[REQUIRED]
The unique identifier of the asset to create the file in
path (string) –
[REQUIRED]
The path of the file within the asset
content (dict) –
[REQUIRED]
The content of the file to create
Note
This is a Tagged Union structure. Only one of the following top level keys can be set:
bytes,text.bytes (bytes) –
Binary file content
text (string) –
Text file content
metadata (document) – Optional metadata describing this file
clientToken (string) –
A unique, case-sensitive identifier used for idempotent asset file creation
This field is autopopulated if not provided.
- Return type:
dict
- Returns:
Response Syntax
{ 'file': { 'path': 'string', 'content': { 'bytes': b'bytes', 'text': 'string' }, 'metadata': {...}|[...]|123|123.4|'string'|True|None, 'version': 123, 'createdAt': datetime(2015, 1, 1), 'updatedAt': datetime(2015, 1, 1) } }
Response Structure
(dict) –
Response structure for creating an asset file
file (dict) –
The asset file object
path (string) –
The path of this file within the asset
content (dict) –
The content of this file
Note
This is a Tagged Union structure. Only one of the following top level keys will be set:
bytes,text. If a client receives an unknown member it will setSDK_UNKNOWN_MEMBERas the top level key, which maps to the name or tag of the unknown member. The structure ofSDK_UNKNOWN_MEMBERis as follows:'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
bytes (bytes) –
Binary file content
text (string) –
Text file content
metadata (document) –
The metadata for this file
version (integer) –
The asset version this file belongs to
createdAt (datetime) –
Timestamp when this file was created
updatedAt (datetime) –
Timestamp when this file was last updated
Exceptions
DevOpsAgentService.Client.exceptions.ValidationExceptionDevOpsAgentService.Client.exceptions.ContentSizeExceededExceptionDevOpsAgentService.Client.exceptions.ServiceQuotaExceededExceptionDevOpsAgentService.Client.exceptions.ConflictExceptionDevOpsAgentService.Client.exceptions.InternalServerExceptionDevOpsAgentService.Client.exceptions.AccessDeniedExceptionDevOpsAgentService.Client.exceptions.ResourceNotFoundExceptionDevOpsAgentService.Client.exceptions.ThrottlingExceptionDevOpsAgentService.Client.exceptions.InvalidParameterException