Skip to content

update_directory_setup async

update_directory_setup(
    directory_id: DirectoryId,
    update_type: UpdateType,
    *,
    config_overrides: Optional[AsyncDirectoryServiceClientConfig] = None,
    os_update_settings: Optional[OSUpdateSettings] = None,
    directory_size_update_settings: Optional[DirectorySizeUpdateSettings] = None,
    network_update_settings: Optional[NetworkUpdateSettings] = None,
    create_snapshot_before_update: Optional[CreateSnapshotBeforeUpdate] = None,
) -> UpdateDirectorySetupResult

Updates directory configuration for the specified update type.

Parameters:

  • directory_id (DirectoryId) –

    The identifier of the directory to update.

  • update_type (UpdateType) –

    The type of update to perform on the directory.

  • os_update_settings (Optional[OSUpdateSettings], default: None ) –

    Operating system configuration to apply during the directory update operation.

  • directory_size_update_settings (Optional[DirectorySizeUpdateSettings], default: None ) –

    Directory size configuration to apply during the update operation.

  • network_update_settings (Optional[NetworkUpdateSettings], default: None ) –

    Network configuration to apply during the directory update operation.

  • create_snapshot_before_update (Optional[CreateSnapshotBeforeUpdate], default: None ) –

    Specifies whether to create a directory snapshot before performing the update.

Raises:

Source code in docs_src/capo_directory_service/_services/async_directory_service.py
async def update_directory_setup(
    self,
    directory_id: "capo_directory_service.types.directory_id.DirectoryId",
    update_type: "capo_directory_service.types.update_type.UpdateType",
    *,
    config_overrides: Optional[AsyncDirectoryServiceClientConfig] = None,
    os_update_settings: Optional[
        "capo_directory_service.types.os_update_settings.OSUpdateSettings"
    ] = None,
    directory_size_update_settings: Optional[
        "capo_directory_service.types.directory_size_update_settings.DirectorySizeUpdateSettings"
    ] = None,
    network_update_settings: Optional[
        "capo_directory_service.types.network_update_settings.NetworkUpdateSettings"
    ] = None,
    create_snapshot_before_update: Optional[
        "capo_directory_service.types.create_snapshot_before_update.CreateSnapshotBeforeUpdate"
    ] = None,
) -> "capo_directory_service.types.update_directory_setup_result.UpdateDirectorySetupResult":
    """<p>Updates directory configuration for the specified update type.</p>

    Args:
        directory_id: <p>The identifier of the directory to update.</p>
        update_type: <p>The type of update to perform on the directory.</p>
        os_update_settings: <p>Operating system configuration to apply during the directory update operation.</p>
        directory_size_update_settings: <p>Directory size configuration to apply during the update operation.</p>
        network_update_settings: <p>Network configuration to apply during the directory update operation.</p>
        create_snapshot_before_update: <p>Specifies whether to create a directory snapshot before performing the update.</p>

    Raises:
        capo_directory_service.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_directory_service.errors.client_exception.ClientException: <p>A client exception has occurred.</p>
        capo_directory_service.errors.directory_does_not_exist_exception.DirectoryDoesNotExistException: <p>The specified directory does not exist in the system.</p>
        capo_directory_service.errors.directory_in_desired_state_exception.DirectoryInDesiredStateException: <p> The directory is already updated to desired update type settings. </p>
        capo_directory_service.errors.directory_unavailable_exception.DirectoryUnavailableException: <p>The specified directory is unavailable.</p>
        capo_directory_service.errors.invalid_parameter_exception.InvalidParameterException: <p>One or more parameters are not valid.</p>
        capo_directory_service.errors.service_exception.ServiceException: <p>An exception has occurred in Directory Service.</p>
        capo_directory_service.errors.snapshot_limit_exceeded_exception.SnapshotLimitExceededException: <p>The maximum number of manual snapshots for the directory has been reached. You can use the <a>GetSnapshotLimits</a> operation to determine the snapshot limits for a directory.</p>
        capo_directory_service.errors.unsupported_operation_exception.UnsupportedOperationException: <p>The operation is not supported.</p>
        capo_directory_service.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_directory_service.types.update_directory_setup_request.UpdateDirectorySetupRequest]",
    ) -> AsyncOperationResponse[
        "capo_directory_service.types.update_directory_setup_result.UpdateDirectorySetupResult"
    ]:
        import capo_directory_service._operations.directory_service_20150416.update_directory_setup

        (
            output,
            http_response,
        ) = await capo_directory_service._operations.directory_service_20150416.update_directory_setup.async_update_directory_setup(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateDirectorySetup")
    )
    input_: capo_directory_service.types.update_directory_setup_request.UpdateDirectorySetupRequest = {
        "directory_id": directory_id,
        "update_type": update_type,
    }
    if os_update_settings is not None:
        input_["os_update_settings"] = os_update_settings
    if directory_size_update_settings is not None:
        input_["directory_size_update_settings"] = directory_size_update_settings
    if network_update_settings is not None:
        input_["network_update_settings"] = network_update_settings
    if create_snapshot_before_update is not None:
        input_["create_snapshot_before_update"] = create_snapshot_before_update

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