Skip to content

update_namespace async

update_namespace(
    namespace_name: NamespaceName,
    *,
    config_overrides: Optional[AsyncRedshiftServerlessClientConfig] = None,
    admin_user_password: Optional[DbPassword] = None,
    admin_username: Optional[DbUser] = None,
    kms_key_id: Optional[str] = None,
    default_iam_role_arn: Optional[str] = None,
    iam_roles: Optional[IamRoleArnList] = None,
    log_exports: Optional[LogExportList] = None,
    manage_admin_password: Optional[bool] = None,
    admin_password_secret_kms_key_id: Optional[KmsKeyId] = None,
    log_destination_type: Optional[LogDestinationType] = None,
    s3_table_action: Optional[S3TableAction] = None,
    s3_table_names: Optional[S3TableNameList] = None,
    s3_table_kms_key_id: Optional[KmsKeyId] = None,
    s3_table_granularity: Optional[S3TableGranularity] = None,
) -> UpdateNamespaceResponse

Updates a namespace with the specified settings. Unless required, you can't update multiple parameters in one request. For example, you must specify both adminUsername and adminUserPassword to update either field, but you can't update both kmsKeyId and logExports in a single request.

Similarly, an S3 Tables log-publishing update (a request where logDestinationType is s3table) cannot be combined with any other namespace configuration change and must be submitted as its own request.

Parameters:

  • namespace_name (NamespaceName) –

    The name of the namespace to update. You can't update the name of a namespace once it is created.

  • admin_user_password (Optional[DbPassword], default: None ) –

    The password of the administrator for the first database created in the namespace. This parameter must be updated together with adminUsername.

    You can't use adminUserPassword if manageAdminPassword is true.

    If your admin user account is locked, this operation also unlocks your account and resets the failed-login counter. This option is available only when account lockout security is enabled for the namespace.

  • admin_username (Optional[DbUser], default: None ) –

    The username of the administrator for the first database created in the namespace. This parameter must be updated together with adminUserPassword.

  • kms_key_id (Optional[str], default: None ) –

    The ID of the Amazon Web Services Key Management Service key used to encrypt your data.

  • default_iam_role_arn (Optional[str], default: None ) –

    The Amazon Resource Name (ARN) of the IAM role to set as a default in the namespace. This parameter must be updated together with iamRoles.

  • iam_roles (Optional[IamRoleArnList], default: None ) –

    A list of IAM roles to associate with the namespace. This parameter must be updated together with defaultIamRoleArn.

  • log_exports (Optional[LogExportList], default: None ) –

    The types of logs the namespace can export. The export types are userlog, connectionlog, and useractivitylog.

  • manage_admin_password (Optional[bool], default: None ) –

    If true, Amazon Redshift uses Secrets Manager to manage the namespace's admin credentials. You can't use adminUserPassword if manageAdminPassword is true. If manageAdminPassword is false or not set, Amazon Redshift uses adminUserPassword for the admin user account's password.

  • admin_password_secret_kms_key_id (Optional[KmsKeyId], default: None ) –

    The ID of the Key Management Service (KMS) key used to encrypt and store the namespace's admin credentials secret. You can only use this parameter if manageAdminPassword is true.

  • log_destination_type (Optional[LogDestinationType], default: None ) –

    The destination for the log data. Valid values are s3table and cloudwatch.

    Set this to s3table to manage Amazon S3 Tables system-table publishing for the namespace.

  • s3_table_action (Optional[S3TableAction], default: None ) –

    Whether to enable or disable Amazon S3 Tables publishing. Valid values are Enable and Disable, matched case-insensitively.

    When omitted, defaults to Enable. Valid only when logDestinationType is s3table.

  • s3_table_names (Optional[S3TableNameList], default: None ) –

    The system tables to publish (on enable) or to stop publishing (on disable). Each value is either a system table view name that begins with sys_ or the keyword all.

    Omitting this parameter, passing an empty list, or including all each select every current and future system table. Each name must be 1-128 characters, and the list can contain up to 256 names.

    Valid only when logDestinationType is s3table.

  • s3_table_kms_key_id (Optional[KmsKeyId], default: None ) –

    The identifier of the Key Management Service key used to encrypt the published Amazon S3 Tables data. When omitted, the data is encrypted with SSE-S3 (Amazon S3 managed keys).

    Valid only when logDestinationType is s3table.

  • s3_table_granularity (Optional[S3TableGranularity], default: None ) –

    The scope of the Amazon S3 Tables destination. Valid values are namespace and account, matched case-insensitively. namespace scopes the published tables to this namespace; account scopes them to the Amazon Web Services account.

    Required when enabling. Omitting this parameter or passing a blank value fails with ValidationException. Valid only when logDestinationType is s3table.

Raises:

Source code in docs_src/capo_redshift_serverless/_services/async_redshift_serverless.py
async def update_namespace(
    self,
    namespace_name: "capo_redshift_serverless.types.namespace_name.NamespaceName",
    *,
    config_overrides: Optional[AsyncRedshiftServerlessClientConfig] = None,
    admin_user_password: Optional[
        "capo_redshift_serverless.types.db_password.DbPassword"
    ] = None,
    admin_username: Optional[
        "capo_redshift_serverless.types.db_user.DbUser"
    ] = None,
    kms_key_id: Optional[str] = None,
    default_iam_role_arn: Optional[str] = None,
    iam_roles: Optional[
        "capo_redshift_serverless.types.iam_role_arn_list.IamRoleArnList"
    ] = None,
    log_exports: Optional[
        "capo_redshift_serverless.types.log_export_list.LogExportList"
    ] = None,
    manage_admin_password: Optional[bool] = None,
    admin_password_secret_kms_key_id: Optional[
        "capo_redshift_serverless.types.kms_key_id.KmsKeyId"
    ] = None,
    log_destination_type: Optional[
        "capo_redshift_serverless.types.log_destination_type.LogDestinationType"
    ] = None,
    s3_table_action: Optional[
        "capo_redshift_serverless.types.s3_table_action.S3TableAction"
    ] = None,
    s3_table_names: Optional[
        "capo_redshift_serverless.types.s3_table_name_list.S3TableNameList"
    ] = None,
    s3_table_kms_key_id: Optional[
        "capo_redshift_serverless.types.kms_key_id.KmsKeyId"
    ] = None,
    s3_table_granularity: Optional[
        "capo_redshift_serverless.types.s3_table_granularity.S3TableGranularity"
    ] = None,
) -> "capo_redshift_serverless.types.update_namespace_response.UpdateNamespaceResponse":
    """<p>Updates a namespace with the specified settings. Unless required, you can't update multiple parameters in one request. For example, you must specify both <code>adminUsername</code> and <code>adminUserPassword</code> to update either field, but you can't update both <code>kmsKeyId</code> and <code>logExports</code> in a single request.</p> <p>Similarly, an S3 Tables log-publishing update (a request where <code>logDestinationType</code> is <code>s3table</code>) cannot be combined with any other namespace configuration change and must be submitted as its own request.</p>

    Args:
        namespace_name: <p>The name of the namespace to update. You can't update the name of a namespace once it is created.</p>
        admin_user_password: <p>The password of the administrator for the first database created in the namespace. This parameter must be updated together with <code>adminUsername</code>.</p> <p>You can't use <code>adminUserPassword</code> if <code>manageAdminPassword</code> is true. </p> <p>If your admin user account is locked, this operation also unlocks your account and resets the failed-login counter. This option is available only when account lockout security is enabled for the namespace.</p>
        admin_username: <p>The username of the administrator for the first database created in the namespace. This parameter must be updated together with <code>adminUserPassword</code>.</p>
        kms_key_id: <p>The ID of the Amazon Web Services Key Management Service key used to encrypt your data.</p>
        default_iam_role_arn: <p>The Amazon Resource Name (ARN) of the IAM role to set as a default in the namespace. This parameter must be updated together with <code>iamRoles</code>.</p>
        iam_roles: <p>A list of IAM roles to associate with the namespace. This parameter must be updated together with <code>defaultIamRoleArn</code>.</p>
        log_exports: <p>The types of logs the namespace can export. The export types are <code>userlog</code>, <code>connectionlog</code>, and <code>useractivitylog</code>.</p>
        manage_admin_password: <p>If <code>true</code>, Amazon Redshift uses Secrets Manager to manage the namespace's admin credentials. You can't use <code>adminUserPassword</code> if <code>manageAdminPassword</code> is true. If <code>manageAdminPassword</code> is false or not set, Amazon Redshift uses <code>adminUserPassword</code> for the admin user account's password. </p>
        admin_password_secret_kms_key_id: <p>The ID of the Key Management Service (KMS) key used to encrypt and store the namespace's admin credentials secret. You can only use this parameter if <code>manageAdminPassword</code> is true.</p>
        log_destination_type: <p>The destination for the log data. Valid values are <code>s3table</code> and <code>cloudwatch</code>.</p> <p>Set this to <code>s3table</code> to manage Amazon S3 Tables system-table publishing for the namespace.</p>
        s3_table_action: <p>Whether to enable or disable Amazon S3 Tables publishing. Valid values are <code>Enable</code> and <code>Disable</code>, matched case-insensitively.</p> <p>When omitted, defaults to <code>Enable</code>. Valid only when <code>logDestinationType</code> is <code>s3table</code>.</p>
        s3_table_names: <p>The system tables to publish (on enable) or to stop publishing (on disable). Each value is either a system table view name that begins with <code>sys_</code> or the keyword <code>all</code>.</p> <p>Omitting this parameter, passing an empty list, or including <code>all</code> each select every current and future system table. Each name must be 1-128 characters, and the list can contain up to 256 names.</p> <p>Valid only when <code>logDestinationType</code> is <code>s3table</code>.</p>
        s3_table_kms_key_id: <p>The identifier of the Key Management Service key used to encrypt the published Amazon S3 Tables data. When omitted, the data is encrypted with SSE-S3 (Amazon S3 managed keys).</p> <p>Valid only when <code>logDestinationType</code> is <code>s3table</code>.</p>
        s3_table_granularity: <p>The scope of the Amazon S3 Tables destination. Valid values are <code>namespace</code> and <code>account</code>, matched case-insensitively. <code>namespace</code> scopes the published tables to this namespace; <code>account</code> scopes them to the Amazon Web Services account.</p> <p>Required when enabling. Omitting this parameter or passing a blank value fails with <code>ValidationException</code>. Valid only when <code>logDestinationType</code> is <code>s3table</code>.</p>

    Raises:
        capo_redshift_serverless.errors.conflict_exception.ConflictException: <p>The submitted action has conflicts.</p>
        capo_redshift_serverless.errors.internal_server_exception.InternalServerException: <p>The request processing has failed because of an unknown error, exception or failure.</p>
        capo_redshift_serverless.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource could not be found.</p>
        capo_redshift_serverless.errors.validation_exception.ValidationException: <p>The input failed to satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_redshift_serverless.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_redshift_serverless.types.update_namespace_request.UpdateNamespaceRequest]",
    ) -> AsyncOperationResponse[
        "capo_redshift_serverless.types.update_namespace_response.UpdateNamespaceResponse"
    ]:
        import capo_redshift_serverless._operations.redshift_serverless.update_namespace

        (
            output,
            http_response,
        ) = await capo_redshift_serverless._operations.redshift_serverless.update_namespace.async_update_namespace(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_redshift_serverless.types.update_namespace_request.UpdateNamespaceRequest",
    ) -> dict[str, Any]:
        import capo_redshift_serverless.types.update_namespace_request

        return capo_redshift_serverless.types.update_namespace_request.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_redshift_serverless.types.update_namespace_response.UpdateNamespaceResponse",
    ) -> dict[str, Any]:
        import capo_redshift_serverless.types.update_namespace_response

        return capo_redshift_serverless.types.update_namespace_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "UpdateNamespace",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_redshift_serverless.types.update_namespace_request.UpdateNamespaceRequest = {
        "namespace_name": namespace_name
    }
    if admin_user_password is not None:
        input_["admin_user_password"] = admin_user_password
    if admin_username is not None:
        input_["admin_username"] = admin_username
    if kms_key_id is not None:
        input_["kms_key_id"] = kms_key_id
    if default_iam_role_arn is not None:
        input_["default_iam_role_arn"] = default_iam_role_arn
    if iam_roles is not None:
        input_["iam_roles"] = iam_roles
    if log_exports is not None:
        input_["log_exports"] = log_exports
    if manage_admin_password is not None:
        input_["manage_admin_password"] = manage_admin_password
    if admin_password_secret_kms_key_id is not None:
        input_["admin_password_secret_kms_key_id"] = (
            admin_password_secret_kms_key_id
        )
    if log_destination_type is not None:
        input_["log_destination_type"] = log_destination_type
    if s3_table_action is not None:
        input_["s3_table_action"] = s3_table_action
    if s3_table_names is not None:
        input_["s3_table_names"] = s3_table_names
    if s3_table_kms_key_id is not None:
        input_["s3_table_kms_key_id"] = s3_table_kms_key_id
    if s3_table_granularity is not None:
        input_["s3_table_granularity"] = s3_table_granularity

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