Skip to content

create_datastore async

create_datastore(
    client_token: ClientToken,
    *,
    config_overrides: Optional[AsyncMedicalImagingClientConfig] = None,
    datastore_name: Optional[DatastoreName] = None,
    tags: Optional[TagMap] = None,
    kms_key_arn: Optional[KmsKeyArn] = None,
    lambda_authorizer_arn: Optional[LambdaArn] = None,
    lossless_storage_format: Optional[LosslessStorageFormat] = None,
) -> CreateDatastoreResponse

Create a data store.

Parameters:

  • datastore_name (Optional[DatastoreName], default: None ) –

    The data store name.

  • client_token (ClientToken) –

    A unique identifier for API idempotency.

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

    The tags provided when creating a data store.

  • kms_key_arn (Optional[KmsKeyArn], default: None ) –

    The Amazon Resource Name (ARN) assigned to the Key Management Service (KMS) key for accessing encrypted data.

  • lambda_authorizer_arn (Optional[LambdaArn], default: None ) –

    The ARN of the authorizer's Lambda function.

  • lossless_storage_format (Optional[LosslessStorageFormat], default: None ) –

    The lossless storage format for the datastore.

Raises:

Source code in docs_src/capo_medical_imaging/_services/async_medical_imaging.py
async def create_datastore(
    self,
    client_token: "capo_medical_imaging.types.client_token.ClientToken",
    *,
    config_overrides: Optional[AsyncMedicalImagingClientConfig] = None,
    datastore_name: Optional[
        "capo_medical_imaging.types.datastore_name.DatastoreName"
    ] = None,
    tags: Optional["capo_medical_imaging.types.tag_map.TagMap"] = None,
    kms_key_arn: Optional[
        "capo_medical_imaging.types.kms_key_arn.KmsKeyArn"
    ] = None,
    lambda_authorizer_arn: Optional[
        "capo_medical_imaging.types.lambda_arn.LambdaArn"
    ] = None,
    lossless_storage_format: Optional[
        "capo_medical_imaging.types.lossless_storage_format.LosslessStorageFormat"
    ] = None,
) -> "capo_medical_imaging.types.create_datastore_response.CreateDatastoreResponse":
    """<p>Create a data store.</p>

    Args:
        datastore_name: <p>The data store name.</p>
        client_token: <p>A unique identifier for API idempotency.</p>
        tags: <p>The tags provided when creating a data store.</p>
        kms_key_arn: <p>The Amazon Resource Name (ARN) assigned to the Key Management Service (KMS) key for accessing encrypted data.</p>
        lambda_authorizer_arn: <p>The ARN of the authorizer's Lambda function.</p>
        lossless_storage_format: <p>The lossless storage format for the datastore.</p>

    Raises:
        capo_medical_imaging.errors.access_denied_exception.AccessDeniedException: <p>The user does not have sufficient access to perform this action.</p>
        capo_medical_imaging.errors.conflict_exception.ConflictException: <p>Updating or deleting a resource can cause an inconsistent state.</p>
        capo_medical_imaging.errors.internal_server_exception.InternalServerException: <p>An unexpected error occurred during processing of the request.</p>
        capo_medical_imaging.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request references a resource which does not exist.</p>
        capo_medical_imaging.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request caused a service quota to be exceeded.</p>
        capo_medical_imaging.errors.throttling_exception.ThrottlingException: <p>The request was denied due to throttling.</p>
        capo_medical_imaging.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints set by the service.</p>
        capo_medical_imaging.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_medical_imaging.types.create_datastore_request.CreateDatastoreRequest]",
    ) -> AsyncOperationResponse[
        "capo_medical_imaging.types.create_datastore_response.CreateDatastoreResponse"
    ]:
        import capo_medical_imaging._operations.ahi_gateway_service.create_datastore

        (
            output,
            http_response,
        ) = await capo_medical_imaging._operations.ahi_gateway_service.create_datastore.async_create_datastore(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateDatastore")
    )
    input_: capo_medical_imaging.types.create_datastore_request.CreateDatastoreRequest = {
        "client_token": client_token
    }
    if datastore_name is not None:
        input_["datastore_name"] = datastore_name
    if tags is not None:
        input_["tags"] = tags
    if kms_key_arn is not None:
        input_["kms_key_arn"] = kms_key_arn
    if lambda_authorizer_arn is not None:
        input_["lambda_authorizer_arn"] = lambda_authorizer_arn
    if lossless_storage_format is not None:
        input_["lossless_storage_format"] = lossless_storage_format

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output