DevOpsAgentService / Client / update_asset
update_asset¶
- DevOpsAgentService.Client.update_asset(**kwargs)¶
Updates an asset in the specified agent space
See also: AWS API Documentation
Request Syntax
response = client.update_asset( agentSpaceId='string', assetId='string', metadata={...}|[...]|123|123.4|'string'|True|None, content={ 'file': { 'path': 'string', 'body': { 'bytes': b'bytes', 'text': 'string' }, 'metadata': {...}|[...]|123|123.4|'string'|True|None }, 'zip': { 'zipFile': b'bytes' }, 'sourceUrl': { 'url': 'string' } }, 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 update
metadata (document) – Metadata fields to update. Only the fields present in this document are updated. Omitted fields retain their current values.
content (dict) –
Optional content update. A single file adds or replaces one file; a zip replaces all files; a sourceUrl re-syncs from the original source.
Note
This is a Tagged Union structure. Only one of the following top level keys can be set:
file,zip,sourceUrl.file (dict) –
A single file with path and content
path (string) – [REQUIRED]
The path of the file within the asset
body (dict) – [REQUIRED]
The file content
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 for this file
zip (dict) –
A zip file containing multiple files
zipFile (bytes) – [REQUIRED]
The zip file bytes
sourceUrl (dict) –
A source URL to import asset content from
url (string) – [REQUIRED]
The source URL to import asset content from
clientToken (string) –
A unique, case-sensitive identifier used for idempotent asset update
This field is autopopulated if not provided.
- Return type:
dict
- Returns:
Response Syntax
{ 'asset': { 'assetId': 'string', 'assetType': '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 updating an asset
asset (dict) –
The asset object
assetId (string) –
The unique identifier for this asset
assetType (string) –
The type of this asset
metadata (document) –
The metadata for this asset
version (integer) –
The version number of this asset
createdAt (datetime) –
Timestamp when this asset was created
updatedAt (datetime) –
Timestamp when this asset 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