DevOpsAgentService / Client / create_asset

create_asset

DevOpsAgentService.Client.create_asset(**kwargs)

Creates a new asset in the specified agent space

See also: AWS API Documentation

Request Syntax

response = client.create_asset(
    agentSpaceId='string',
    assetType='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 where the asset will be created

  • assetType (string) –

    [REQUIRED]

    The type of asset to create

  • metadata (document) – The metadata describing this asset

  • content (dict) –

    [REQUIRED]

    The content for the asset. Provide a single file, a zip bundle, or a sourceUrl to import from an external 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 creation

    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 creating a new 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.ValidationException

  • DevOpsAgentService.Client.exceptions.ContentSizeExceededException

  • DevOpsAgentService.Client.exceptions.ServiceQuotaExceededException

  • DevOpsAgentService.Client.exceptions.ConflictException

  • DevOpsAgentService.Client.exceptions.InternalServerException

  • DevOpsAgentService.Client.exceptions.AccessDeniedException

  • DevOpsAgentService.Client.exceptions.ThrottlingException

  • DevOpsAgentService.Client.exceptions.InvalidParameterException

  • DevOpsAgentService.Client.exceptions.ResourceNotFoundException