Skip to content

import_hypervisor_configuration

import_hypervisor_configuration(
    name: Name,
    host: Host,
    *,
    config_overrides: Optional[BackupGatewayClientConfig] = None,
    username: Optional[Username] = None,
    password: Optional[Password] = None,
    kms_key_arn: Optional[KmsKeyArn] = None,
    tags: Optional[Tags] = None,
) -> ImportHypervisorConfigurationOutput

Connect to a hypervisor by importing its configuration.

Parameters:

  • name (Name) –

    The name of the hypervisor.

  • host (Host) –

    The server host of the hypervisor. This can be either an IP address or a fully-qualified domain name (FQDN).

  • username (Optional[Username], default: None ) –

    The username for the hypervisor.

  • password (Optional[Password], default: None ) –

    The password for the hypervisor.

  • kms_key_arn (Optional[KmsKeyArn], default: None ) –

    The Key Management Service for the hypervisor.

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

    The tags of the hypervisor configuration to import.

Raises:

Source code in docs_src/capo_backup_gateway/_services/backup_gateway.py
def import_hypervisor_configuration(
    self,
    name: "capo_backup_gateway.types.name.Name",
    host: "capo_backup_gateway.types.host.Host",
    *,
    config_overrides: Optional[BackupGatewayClientConfig] = None,
    username: Optional["capo_backup_gateway.types.username.Username"] = None,
    password: Optional["capo_backup_gateway.types.password.Password"] = None,
    kms_key_arn: Optional["capo_backup_gateway.types.kms_key_arn.KmsKeyArn"] = None,
    tags: Optional["capo_backup_gateway.types.tags.Tags"] = None,
) -> "capo_backup_gateway.types.import_hypervisor_configuration_output.ImportHypervisorConfigurationOutput":
    """<p>Connect to a hypervisor by importing its configuration.</p>

    Args:
        name: <p>The name of the hypervisor.</p>
        host: <p>The server host of the hypervisor. This can be either an IP address or a fully-qualified domain name (FQDN).</p>
        username: <p>The username for the hypervisor.</p>
        password: <p>The password for the hypervisor.</p>
        kms_key_arn: <p>The Key Management Service for the hypervisor.</p>
        tags: <p>The tags of the hypervisor configuration to import.</p>

    Raises:
        capo_backup_gateway.errors.internal_server_exception.InternalServerException: <p>The operation did not succeed because an internal error occurred. Try again later.</p>
        capo_backup_gateway.errors.throttling_exception.ThrottlingException: <p>TPS has been limited to protect against intentional or unintentional high request volumes.</p>
        capo_backup_gateway.errors.validation_exception.ValidationException: <p>The operation did not succeed because a validation error occurred.</p>
        capo_backup_gateway.errors.access_denied_exception.AccessDeniedException: <p>The operation cannot proceed because you have insufficient permissions.</p>
        capo_backup_gateway.errors.conflict_exception.ConflictException: <p>The operation cannot proceed because it is not supported.</p>
        capo_backup_gateway.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_backup_gateway.types.import_hypervisor_configuration_input.ImportHypervisorConfigurationInput]",
    ) -> OperationResponse[
        "capo_backup_gateway.types.import_hypervisor_configuration_output.ImportHypervisorConfigurationOutput"
    ]:
        import capo_backup_gateway._operations.backup_on_premises_v20210101.import_hypervisor_configuration

        output, http_response = (
            capo_backup_gateway._operations.backup_on_premises_v20210101.import_hypervisor_configuration.import_hypervisor_configuration(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_backup_gateway.types.import_hypervisor_configuration_input.ImportHypervisorConfigurationInput",
    ) -> dict[str, Any]:
        import capo_backup_gateway.types.import_hypervisor_configuration_input

        return capo_backup_gateway.types.import_hypervisor_configuration_input.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "ImportHypervisorConfiguration", redact_input=_redact_input
        ),
    )
    input_: capo_backup_gateway.types.import_hypervisor_configuration_input.ImportHypervisorConfigurationInput = {
        "name": name,
        "host": host,
    }
    if username is not None:
        input_["username"] = username
    if password is not None:
        input_["password"] = password
    if kms_key_arn is not None:
        input_["kms_key_arn"] = kms_key_arn
    if tags is not None:
        input_["tags"] = tags

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