Skip to content

create_run_cache

create_run_cache(
    cache_s3_location: S3UriForBucketOrObject,
    request_id: RunCacheRequestId,
    *,
    config_overrides: Optional[OmicsClientConfig] = None,
    cache_behavior: Optional[CacheBehavior] = None,
    description: Optional[UserCustomDescription] = None,
    name: Optional[UserCustomName] = None,
    tags: Optional[TagMap] = None,
    cache_bucket_owner_id: Optional[AwsAccountId] = None,
) -> CreateRunCacheResponse

Creates a run cache to store and reference task outputs from completed private runs. Specify an Amazon S3 location where Amazon Web Services HealthOmics saves the cached data. This data must be immediately accessible and not in an archived state. You can save intermediate task files to a run cache if they are declared as task outputs in the workflow definition file.

For more information, see Call caching and Creating a run cache in the Amazon Web Services HealthOmics User Guide.

Parameters:

  • cache_behavior (Optional[CacheBehavior], default: None ) –

    Default cache behavior for runs that use this cache. Supported values are:

    CACHE_ON_FAILURE: Caches task outputs from completed tasks for runs that fail. This setting is useful if you're debugging a workflow that fails after several tasks completed successfully. The subsequent run uses the cache outputs for previously-completed tasks if the task definition, inputs, and container in ECR are identical to the prior run.

    CACHE_ALWAYS: Caches task outputs from completed tasks for all runs. This setting is useful in development mode, but do not use it in a production setting.

    If you don't specify a value, the default behavior is CACHE_ON_FAILURE. When you start a run that uses this cache, you can override the default cache behavior.

    For more information, see Run cache behavior in the Amazon Web Services HealthOmics User Guide.

  • cache_s3_location (S3UriForBucketOrObject) –

    Specify the S3 location for storing the cached task outputs. This data must be immediately accessible (not in an archived state).

  • description (Optional[UserCustomDescription], default: None ) –

    Enter a description of the run cache.

  • name (Optional[UserCustomName], default: None ) –

    Enter a user-friendly name for the run cache.

  • request_id (RunCacheRequestId) –

    A unique request token, to ensure idempotency. If you don't specify a token, Amazon Web Services HealthOmics automatically generates a universally unique identifier (UUID) for the request.

  • tags (Optional[TagMap], default: None ) –

    Specify one or more tags to associate with this run cache.

  • cache_bucket_owner_id (Optional[AwsAccountId], default: None ) –

    The Amazon Web Services account ID of the expected owner of the S3 bucket for the run cache. If not provided, your account ID is set as the owner of the bucket.

Raises:

Source code in docs_src/capo_omics/_services/omics.py
def create_run_cache(
    self,
    cache_s3_location: "capo_omics.types.s3_uri_for_bucket_or_object.S3UriForBucketOrObject",
    request_id: "capo_omics.types.run_cache_request_id.RunCacheRequestId",
    *,
    config_overrides: Optional[OmicsClientConfig] = None,
    cache_behavior: Optional[
        "capo_omics.types.cache_behavior.CacheBehavior"
    ] = None,
    description: Optional[
        "capo_omics.types.user_custom_description.UserCustomDescription"
    ] = None,
    name: Optional["capo_omics.types.user_custom_name.UserCustomName"] = None,
    tags: Optional["capo_omics.types.tag_map.TagMap"] = None,
    cache_bucket_owner_id: Optional[
        "capo_omics.types.aws_account_id.AwsAccountId"
    ] = None,
) -> "capo_omics.types.create_run_cache_response.CreateRunCacheResponse":
    """<p>Creates a run cache to store and reference task outputs from completed private runs. Specify an Amazon S3 location where Amazon Web Services HealthOmics saves the cached data. This data must be immediately accessible and not in an archived state. You can save intermediate task files to a run cache if they are declared as task outputs in the workflow definition file.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/omics/latest/dev/workflows-call-caching.html">Call caching</a> and <a href="https://docs.aws.amazon.com/omics/latest/dev/workflow-cache-create.html">Creating a run cache</a> in the <i>Amazon Web Services HealthOmics User Guide</i>.</p>

    Args:
        cache_behavior: <p>Default cache behavior for runs that use this cache. Supported values are:</p> <p> <code>CACHE_ON_FAILURE</code>: Caches task outputs from completed tasks for runs that fail. This setting is useful if you're debugging a workflow that fails after several tasks completed successfully. The subsequent run uses the cache outputs for previously-completed tasks if the task definition, inputs, and container in ECR are identical to the prior run.</p> <p> <code>CACHE_ALWAYS</code>: Caches task outputs from completed tasks for all runs. This setting is useful in development mode, but do not use it in a production setting.</p> <p>If you don't specify a value, the default behavior is CACHE_ON_FAILURE. When you start a run that uses this cache, you can override the default cache behavior.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/omics/latest/dev/how-run-cache.html#run-cache-behavior">Run cache behavior</a> in the <i>Amazon Web Services HealthOmics User Guide</i>.</p>
        cache_s3_location: <p>Specify the S3 location for storing the cached task outputs. This data must be immediately accessible (not in an archived state).</p>
        description: <p>Enter a description of the run cache.</p>
        name: <p>Enter a user-friendly name for the run cache.</p>
        request_id: <p>A unique request token, to ensure idempotency. If you don't specify a token, Amazon Web Services HealthOmics automatically generates a universally unique identifier (UUID) for the request.</p>
        tags: <p>Specify one or more tags to associate with this run cache.</p>
        cache_bucket_owner_id: <p>The Amazon Web Services account ID of the expected owner of the S3 bucket for the run cache. If not provided, your account ID is set as the owner of the bucket.</p>

    Raises:
        capo_omics.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_omics.errors.conflict_exception.ConflictException: <p>The request cannot be applied to the target resource in its current state.</p>
        capo_omics.errors.internal_server_exception.InternalServerException: <p>An unexpected error occurred. Try the request again.</p>
        capo_omics.errors.request_timeout_exception.RequestTimeoutException: <p>The request timed out.</p>
        capo_omics.errors.resource_not_found_exception.ResourceNotFoundException: <p>The target resource was not found in the current Region.</p>
        capo_omics.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request exceeds a service quota.</p>
        capo_omics.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_omics.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_omics.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_omics.types.create_run_cache_request.CreateRunCacheRequest]",
    ) -> OperationResponse[
        "capo_omics.types.create_run_cache_response.CreateRunCacheResponse"
    ]:
        import capo_omics._operations.omics.create_run_cache

        output, http_response = (
            capo_omics._operations.omics.create_run_cache.create_run_cache(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateRunCache")
    )
    input_: capo_omics.types.create_run_cache_request.CreateRunCacheRequest = {
        "cache_s3_location": cache_s3_location,
        "request_id": request_id,
    }
    if cache_behavior is not None:
        input_["cache_behavior"] = cache_behavior
    if description is not None:
        input_["description"] = description
    if name is not None:
        input_["name"] = name
    if tags is not None:
        input_["tags"] = tags
    if cache_bucket_owner_id is not None:
        input_["cache_bucket_owner_id"] = cache_bucket_owner_id

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output