Creates a Dataset in a Domain and starts building it. A new dataset has the status CREATING. When it's ready to use, its status changes to ACTIVE, or to CREATE_FAILED if it fails to build. To check the status, call GetDataset.
This operation is idempotent: if you retry a request with the same clientToken, it returns the dataset that the first request created.
For a medical coding dataset, Amazon Connect Health uses the coded examples that are in the s3InputPath when you create the dataset, and writes evaluation scores to the s3OutputPath. Later changes to the s3InputPath don't change the dataset. To use this operation, you must have s3:GetObject and s3:ListBucket permissions for the input location and s3:PutObject permission for the output location, and kms:Decrypt and kms:GenerateDataKey permissions if you encrypt the locations with an AWS KMS key.
Datasets are in preview release and are subject to change.
Parameters:
-
domain_id
(DomainId)
–
The unique identifier of the parent Domain.
-
name
(BoundedSafeString)
–
-
config
(DatasetConfig)
–
The configuration of the dataset. The member that you set determines the dataset type. You can't change the configuration after you create the dataset.
-
client_token
(Optional[str], default:
None
)
–
A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, the operation returns the dataset that the first request created. If you reuse a clientToken with different parameters, the request fails with ConflictException. Use a new clientToken for a request with different parameters.
Raises:
Source code in docs_src/capo_connecthealth/_services/connect_health.py
| def create_dataset(
self,
domain_id: "capo_connecthealth.types.domain_id.DomainId",
name: "capo_connecthealth.types.bounded_safe_string.BoundedSafeString",
config: "capo_connecthealth.types.dataset_config.DatasetConfig",
*,
config_overrides: Optional[ConnectHealthClientConfig] = None,
client_token: Optional[str] = None,
) -> "capo_connecthealth.types.create_dataset_output.CreateDatasetOutput":
"""<p>Creates a Dataset in a Domain and starts building it. A new dataset has the status CREATING. When it's ready to use, its status changes to ACTIVE, or to CREATE_FAILED if it fails to build. To check the status, call GetDataset.</p> <p>This operation is idempotent: if you retry a request with the same clientToken, it returns the dataset that the first request created.</p> <p>For a medical coding dataset, Amazon Connect Health uses the coded examples that are in the s3InputPath when you create the dataset, and writes evaluation scores to the s3OutputPath. Later changes to the s3InputPath don't change the dataset. To use this operation, you must have s3:GetObject and s3:ListBucket permissions for the input location and s3:PutObject permission for the output location, and kms:Decrypt and kms:GenerateDataKey permissions if you encrypt the locations with an AWS KMS key.</p> <p>Datasets are in preview release and are subject to change.</p>
Args:
domain_id: <p>The unique identifier of the parent Domain.</p>
name: <p>A name for the dataset.</p>
config: <p>The configuration of the dataset. The member that you set determines the dataset type. You can't change the configuration after you create the dataset.</p>
client_token: <p>A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, the operation returns the dataset that the first request created. If you reuse a clientToken with different parameters, the request fails with ConflictException. Use a new clientToken for a request with different parameters.</p>
Raises:
capo_connecthealth.errors.access_denied_exception.AccessDeniedException: <p>This error is thrown when the client does not supply proper credentials to the API.</p>
capo_connecthealth.errors.conflict_exception.ConflictException: <p>This error is thrown when a resource update is no longer valid due to assumptions about initial state changing.</p>
capo_connecthealth.errors.internal_server_exception.InternalServerException: <p>This error is thrown when a transient error causes our API to fail.</p>
capo_connecthealth.errors.resource_not_found_exception.ResourceNotFoundException: <p>This error is thrown when the requested resource is not found.</p>
capo_connecthealth.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request exceeds a service quota.</p>
capo_connecthealth.errors.throttling_exception.ThrottlingException: <p>This error is thrown when the client exceeds the allowed request rate.</p>
capo_connecthealth.errors.validation_exception.ValidationException: <p>This error is thrown when the client supplies invalid input to the API.</p>
capo_connecthealth.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_connecthealth.types.create_dataset_input.CreateDatasetInput]",
) -> OperationResponse[
"capo_connecthealth.types.create_dataset_output.CreateDatasetOutput"
]:
import capo_connecthealth._operations.connect_health.create_dataset
output, http_response = (
capo_connecthealth._operations.connect_health.create_dataset.create_dataset(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("CreateDataset")
)
input_: capo_connecthealth.types.create_dataset_input.CreateDatasetInput = {
"domain_id": domain_id,
"name": name,
"config": config,
}
if client_token is None:
client_token = str(uuid.uuid4())
input_["client_token"] = client_token
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|