Skip to content

create_domain

create_domain(
    domain_name: DomainName,
    *,
    config_overrides: Optional[CloudSearchClientConfig] = None,
) -> CreateDomainResponse

Creates a new search domain. For more information, see Creating a Search Domain in the Amazon CloudSearch Developer Guide.

Parameters:

  • domain_name (DomainName) –

    A name for the domain you are creating. Allowed characters are a-z (lower-case letters), 0-9, and hyphen (-). Domain names must start with a letter or number and be at least 3 and no more than 28 characters long.

Raises:

Source code in docs_src/capo_cloudsearch/_services/cloud_search.py
def create_domain(
    self,
    domain_name: "capo_cloudsearch.types.domain_name.DomainName",
    *,
    config_overrides: Optional[CloudSearchClientConfig] = None,
) -> "capo_cloudsearch.types.create_domain_response.CreateDomainResponse":
    """<p>Creates a new search domain. For more information, see <a href="http://docs.aws.amazon.com/cloudsearch/latest/developerguide/creating-domains.html" target="_blank">Creating a Search Domain</a> in the <i>Amazon CloudSearch Developer Guide</i>.</p>

    Args:
        domain_name: <p>A name for the domain you are creating. Allowed characters are a-z (lower-case letters), 0-9, and hyphen (-). Domain names must start with a letter or number and be at least 3 and no more than 28 characters long.</p>

    Raises:
        capo_cloudsearch.errors.base_exception.BaseException: <p>An error occurred while processing the request.</p>
        capo_cloudsearch.errors.internal_exception.InternalException: <p>An internal error occurred while processing the request. If this problem persists, report an issue from the <a href="http://status.aws.amazon.com/" target="_blank">Service Health Dashboard</a>.</p>
        capo_cloudsearch.errors.limit_exceeded_exception.LimitExceededException: <p>The request was rejected because a resource limit has already been met.</p>
        capo_cloudsearch.errors.resource_already_exists_exception.ResourceAlreadyExistsException: <p>The request was rejected because it attempted to create a resource that already exists.</p>
        capo_cloudsearch.errors.validation_exception.ValidationException: <p>The request was rejected because it has invalid parameters.</p>
        capo_cloudsearch.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_cloudsearch.types.create_domain_request.CreateDomainRequest]",
    ) -> OperationResponse[
        "capo_cloudsearch.types.create_domain_response.CreateDomainResponse"
    ]:
        import capo_cloudsearch._operations.a9_search_cloud_config_service2013.create_domain

        output, http_response = (
            capo_cloudsearch._operations.a9_search_cloud_config_service2013.create_domain.create_domain(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateDomain")
    )
    input_: capo_cloudsearch.types.create_domain_request.CreateDomainRequest = {
        "domain_name": domain_name
    }

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