Skip to content

join_domain async

join_domain(
    gateway_arn: GatewayARN,
    domain_name: DomainName,
    user_name: DomainUserName,
    password: DomainUserPassword,
    *,
    config_overrides: Optional[AsyncStorageGatewayClientConfig] = None,
    organizational_unit: Optional[OrganizationalUnit] = None,
    domain_controllers: Optional[Hosts] = None,
    timeout_in_seconds: Optional[TimeoutInSeconds] = None,
) -> JoinDomainOutput

Adds a file gateway to an Active Directory domain. This operation is only supported for file gateways that support the SMB file protocol.

Joining a domain creates an Active Directory computer account in the default organizational unit, using the gateway's Gateway ID as the account name (for example, SGW-1234ADE). If your Active Directory environment requires that you pre-stage accounts to facilitate the join domain process, you will need to create this account ahead of time.

To create the gateway's computer account in an organizational unit other than the default, you must specify the organizational unit when joining the domain.

Parameters:

  • gateway_arn (GatewayARN) –

    The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation to return a list of gateways for your account and Amazon Web Services Region.

  • domain_name (DomainName) –

    The name of the domain that you want the gateway to join.

  • organizational_unit (Optional[OrganizationalUnit], default: None ) –

    The organizational unit (OU) is a container in an Active Directory that can hold users, groups, computers, and other OUs and this parameter specifies the OU that the gateway will join within the AD domain.

  • domain_controllers (Optional[Hosts], default: None ) –

    List of IP addresses, NetBIOS names, or host names of your domain server. If you need to specify the port number include it after the colon (“:”). For example, mydc.mydomain.com:389.

    S3 File Gateway supports IPv6 addresses in addition to IPv4 and other existing formats.

    FSx File Gateway does not support IPv6.

  • timeout_in_seconds (Optional[TimeoutInSeconds], default: None ) –

    Specifies the time in seconds, in which the JoinDomain operation must complete. The default is 20 seconds.

  • user_name (DomainUserName) –

    Sets the user name of user who has permission to add the gateway to the Active Directory domain. The domain user account should be enabled to join computers to the domain. For example, you can use the domain administrator account or an account with delegated permissions to join computers to the domain.

  • password (DomainUserPassword) –

    Sets the password of the user who has permission to add the gateway to the Active Directory domain.

Raises:

  • InternalServerError –

    An internal server error has occurred during the request. For more information, see the error and message fields.

  • InvalidGatewayRequestException –

    An exception occurred because an invalid gateway request was issued to the service. For more information, see the error and message fields.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_storage_gateway/_services/async_storage_gateway.py
async def join_domain(
    self,
    gateway_arn: "capo_storage_gateway.types.gateway_arn.GatewayARN",
    domain_name: "capo_storage_gateway.types.domain_name.DomainName",
    user_name: "capo_storage_gateway.types.domain_user_name.DomainUserName",
    password: "capo_storage_gateway.types.domain_user_password.DomainUserPassword",
    *,
    config_overrides: Optional[AsyncStorageGatewayClientConfig] = None,
    organizational_unit: Optional[
        "capo_storage_gateway.types.organizational_unit.OrganizationalUnit"
    ] = None,
    domain_controllers: Optional["capo_storage_gateway.types.hosts.Hosts"] = None,
    timeout_in_seconds: Optional[
        "capo_storage_gateway.types.timeout_in_seconds.TimeoutInSeconds"
    ] = None,
) -> "capo_storage_gateway.types.join_domain_output.JoinDomainOutput":
    """<p>Adds a file gateway to an Active Directory domain. This operation is only supported for file gateways that support the SMB file protocol.</p> <note> <p>Joining a domain creates an Active Directory computer account in the default organizational unit, using the gateway's <b>Gateway ID</b> as the account name (for example, SGW-1234ADE). If your Active Directory environment requires that you pre-stage accounts to facilitate the join domain process, you will need to create this account ahead of time.</p> <p>To create the gateway's computer account in an organizational unit other than the default, you must specify the organizational unit when joining the domain.</p> </note>

    Args:
        gateway_arn: <p>The Amazon Resource Name (ARN) of the gateway. Use the <code>ListGateways</code> operation to return a list of gateways for your account and Amazon Web Services Region.</p>
        domain_name: <p>The name of the domain that you want the gateway to join.</p>
        organizational_unit: <p>The organizational unit (OU) is a container in an Active Directory that can hold users, groups, computers, and other OUs and this parameter specifies the OU that the gateway will join within the AD domain.</p>
        domain_controllers: <p>List of IP addresses, NetBIOS names, or host names of your domain server. If you need to specify the port number include it after the colon (“:”). For example, <code>mydc.mydomain.com:389</code>.</p> <note> <p>S3 File Gateway supports IPv6 addresses in addition to IPv4 and other existing formats.</p> <p>FSx File Gateway does not support IPv6.</p> </note>
        timeout_in_seconds: <p>Specifies the time in seconds, in which the <code>JoinDomain</code> operation must complete. The default is 20 seconds.</p>
        user_name: <p>Sets the user name of user who has permission to add the gateway to the Active Directory domain. The domain user account should be enabled to join computers to the domain. For example, you can use the domain administrator account or an account with delegated permissions to join computers to the domain.</p>
        password: <p>Sets the password of the user who has permission to add the gateway to the Active Directory domain.</p>

    Raises:
        capo_storage_gateway.errors.internal_server_error.InternalServerError: <p>An internal server error has occurred during the request. For more information, see the error and message fields.</p>
        capo_storage_gateway.errors.invalid_gateway_request_exception.InvalidGatewayRequestException: <p>An exception occurred because an invalid gateway request was issued to the service. For more information, see the error and message fields.</p>
        capo_storage_gateway.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_storage_gateway.types.join_domain_input.JoinDomainInput]",
    ) -> AsyncOperationResponse[
        "capo_storage_gateway.types.join_domain_output.JoinDomainOutput"
    ]:
        import capo_storage_gateway._operations.storage_gateway_20130630.join_domain

        (
            output,
            http_response,
        ) = await capo_storage_gateway._operations.storage_gateway_20130630.join_domain.async_join_domain(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_storage_gateway.types.join_domain_input.JoinDomainInput",
    ) -> dict[str, Any]:
        import capo_storage_gateway.types.join_domain_input

        return capo_storage_gateway.types.join_domain_input.redact_sensitive(input_)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("JoinDomain", redact_input=_redact_input)
    )
    input_: capo_storage_gateway.types.join_domain_input.JoinDomainInput = {
        "gateway_arn": gateway_arn,
        "domain_name": domain_name,
        "user_name": user_name,
        "password": password,
    }
    if organizational_unit is not None:
        input_["organizational_unit"] = organizational_unit
    if domain_controllers is not None:
        input_["domain_controllers"] = domain_controllers
    if timeout_in_seconds is not None:
        input_["timeout_in_seconds"] = timeout_in_seconds

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