Skip to content

create_target_domain async

create_target_domain(
    target_domain_name: str,
    verification_method: DomainVerificationMethod,
    *,
    config_overrides: Optional[AsyncSecurityAgentClientConfig] = None,
    tags: Optional[TagMap] = None,
) -> CreateTargetDomainOutput

Creates a new target domain for penetration testing. A target domain is a web domain that must be registered and verified before it can be tested.

Parameters:

  • target_domain_name (str) –

    The domain name to register as a target domain.

  • verification_method (DomainVerificationMethod) –

    The method to use for verifying domain ownership. Valid values are DNS_TXT, HTTP_ROUTE, and PRIVATE_VPC.

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

    The tags to associate with the target domain.

Raises:

Source code in docs_src/capo_securityagent/_services/async_security_agent.py
async def create_target_domain(
    self,
    target_domain_name: str,
    verification_method: "capo_securityagent.types.domain_verification_method.DomainVerificationMethod",
    *,
    config_overrides: Optional[AsyncSecurityAgentClientConfig] = None,
    tags: Optional["capo_securityagent.types.tag_map.TagMap"] = None,
) -> (
    "capo_securityagent.types.create_target_domain_output.CreateTargetDomainOutput"
):
    """<p>Creates a new target domain for penetration testing. A target domain is a web domain that must be registered and verified before it can be tested.</p>

    Args:
        target_domain_name: <p>The domain name to register as a target domain.</p>
        verification_method: <p>The method to use for verifying domain ownership. Valid values are DNS_TXT, HTTP_ROUTE, and PRIVATE_VPC.</p>
        tags: <p>The tags to associate with the target domain.</p>

    Raises:
        capo_securityagent.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_securityagent.types.create_target_domain_input.CreateTargetDomainInput]",
    ) -> AsyncOperationResponse[
        "capo_securityagent.types.create_target_domain_output.CreateTargetDomainOutput"
    ]:
        import capo_securityagent._operations.security_agent.create_target_domain

        (
            output,
            http_response,
        ) = await capo_securityagent._operations.security_agent.create_target_domain.async_create_target_domain(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateTargetDomain")
    )
    input_: capo_securityagent.types.create_target_domain_input.CreateTargetDomainInput = {
        "target_domain_name": target_domain_name,
        "verification_method": verification_method,
    }
    if tags is not None:
        input_["tags"] = tags

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