Skip to content

put_resource_attributes

put_resource_attributes(
    progress_update_stream: ProgressUpdateStream,
    migration_task_name: MigrationTaskName,
    resource_attribute_list: ResourceAttributeList,
    *,
    config_overrides: Optional[MigrationHubClientConfig] = None,
    dry_run: Optional[DryRun] = None,
) -> PutResourceAttributesResult

Provides identifying details of the resource being migrated so that it can be associated in the Application Discovery Service repository. This association occurs asynchronously after PutResourceAttributes returns.

  • Keep in mind that subsequent calls to PutResourceAttributes will override previously stored attributes. For example, if it is first called with a MAC address, but later, it is desired to add an IP address, it will then be required to call it with both the IP and MAC addresses to prevent overriding the MAC address.

  • Note the instructions regarding the special use case of the ResourceAttributeList parameter when specifying any "VM" related value.

Because this is an asynchronous call, it will always return 200, whether an association occurs or not. To confirm if an association was found based on the provided details, call ListDiscoveredResources.

Parameters:

  • progress_update_stream (ProgressUpdateStream) –

    The name of the ProgressUpdateStream.

  • migration_task_name (MigrationTaskName) –

    Unique identifier that references the migration task. Do not store personal data in this field.

  • resource_attribute_list (ResourceAttributeList) –

    Information about the resource that is being migrated. This data will be used to map the task to a resource in the Application Discovery Service repository.

    Takes the object array of ResourceAttribute where the Type field is reserved for the following values: IPV4_ADDRESS | IPV6_ADDRESS | MAC_ADDRESS | FQDN | VM_MANAGER_ID | VM_MANAGED_OBJECT_REFERENCE | VM_NAME | VM_PATH | BIOS_ID | MOTHERBOARD_SERIAL_NUMBER where the identifying value can be a string up to 256 characters.

    • If any "VM" related value is set for a ResourceAttribute object, it is required that VM_MANAGER_ID, as a minimum, is always set. If VM_MANAGER_ID is not set, then all "VM" fields will be discarded and "VM" fields will not be used for matching the migration task to a server in Application Discovery Service repository. See the Example section below for a use case of specifying "VM" related values.

    • If a server you are trying to match has multiple IP or MAC addresses, you should provide as many as you know in separate type/value pairs passed to the ResourceAttributeList parameter to maximize the chances of matching.

  • dry_run (Optional[DryRun], default: None ) –

    Optional boolean flag to indicate whether any effect should take place. Used to test if the caller has permission to make the call.

Raises:

  • AccessDeniedException –

    You do not have sufficient access to perform this action.

  • DryRunOperation –

    Exception raised to indicate a successfully authorized action when the DryRun flag is set to "true".

  • HomeRegionNotSetException –

    The home region is not set. Set the home region to continue.

  • InternalServerError –

    Exception raised when an internal, configuration, or dependency error is encountered.

  • InvalidInputException –

    Exception raised when the provided input violates a policy constraint or is entered in the wrong format or data type.

  • ResourceNotFoundException –

    Exception raised when the request references a resource (Application Discovery Service configuration, update stream, migration task, etc.) that does not exist in Application Discovery Service (Application Discovery Service) or in Migration Hub's repository.

  • ServiceUnavailableException –

    Exception raised when there is an internal, configuration, or dependency error encountered.

  • ThrottlingException –

    The request was denied due to request throttling.

  • UnauthorizedOperation –

    Exception raised to indicate a request was not authorized when the DryRun flag is set to "true".

  • UnknownServiceError –

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

Source code in docs_src/capo_migration_hub/_services/migration_hub.py
def put_resource_attributes(
    self,
    progress_update_stream: "capo_migration_hub.types.progress_update_stream.ProgressUpdateStream",
    migration_task_name: "capo_migration_hub.types.migration_task_name.MigrationTaskName",
    resource_attribute_list: "capo_migration_hub.types.resource_attribute_list.ResourceAttributeList",
    *,
    config_overrides: Optional[MigrationHubClientConfig] = None,
    dry_run: Optional["capo_migration_hub.types.dry_run.DryRun"] = None,
) -> "capo_migration_hub.types.put_resource_attributes_result.PutResourceAttributesResult":
    """<p>Provides identifying details of the resource being migrated so that it can be associated in the Application Discovery Service repository. This association occurs asynchronously after <code>PutResourceAttributes</code> returns.</p> <important> <ul> <li> <p>Keep in mind that subsequent calls to PutResourceAttributes will override previously stored attributes. For example, if it is first called with a MAC address, but later, it is desired to <i>add</i> an IP address, it will then be required to call it with <i>both</i> the IP and MAC addresses to prevent overriding the MAC address.</p> </li> <li> <p>Note the instructions regarding the special use case of the <a href="https://docs.aws.amazon.com/migrationhub/latest/ug/API_PutResourceAttributes.html#migrationhub-PutResourceAttributes-request-ResourceAttributeList"> <code>ResourceAttributeList</code> </a> parameter when specifying any "VM" related value.</p> </li> </ul> </important> <note> <p>Because this is an asynchronous call, it will always return 200, whether an association occurs or not. To confirm if an association was found based on the provided details, call <code>ListDiscoveredResources</code>.</p> </note>

    Args:
        progress_update_stream: <p>The name of the ProgressUpdateStream. </p>
        migration_task_name: <p>Unique identifier that references the migration task. <i>Do not store personal data in this field.</i> </p>
        resource_attribute_list: <p>Information about the resource that is being migrated. This data will be used to map the task to a resource in the Application Discovery Service repository.</p> <note> <p>Takes the object array of <code>ResourceAttribute</code> where the <code>Type</code> field is reserved for the following values: <code>IPV4_ADDRESS | IPV6_ADDRESS | MAC_ADDRESS | FQDN | VM_MANAGER_ID | VM_MANAGED_OBJECT_REFERENCE | VM_NAME | VM_PATH | BIOS_ID | MOTHERBOARD_SERIAL_NUMBER</code> where the identifying value can be a string up to 256 characters.</p> </note> <important> <ul> <li> <p>If any "VM" related value is set for a <code>ResourceAttribute</code> object, it is required that <code>VM_MANAGER_ID</code>, as a minimum, is always set. If <code>VM_MANAGER_ID</code> is not set, then all "VM" fields will be discarded and "VM" fields will not be used for matching the migration task to a server in Application Discovery Service repository. See the <a href="https://docs.aws.amazon.com/migrationhub/latest/ug/API_PutResourceAttributes.html#API_PutResourceAttributes_Examples">Example</a> section below for a use case of specifying "VM" related values.</p> </li> <li> <p> If a server you are trying to match has multiple IP or MAC addresses, you should provide as many as you know in separate type/value pairs passed to the <code>ResourceAttributeList</code> parameter to maximize the chances of matching.</p> </li> </ul> </important>
        dry_run: <p>Optional boolean flag to indicate whether any effect should take place. Used to test if the caller has permission to make the call.</p>

    Raises:
        capo_migration_hub.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_migration_hub.errors.dry_run_operation.DryRunOperation: <p>Exception raised to indicate a successfully authorized action when the <code>DryRun</code> flag is set to "true".</p>
        capo_migration_hub.errors.home_region_not_set_exception.HomeRegionNotSetException: <p>The home region is not set. Set the home region to continue.</p>
        capo_migration_hub.errors.internal_server_error.InternalServerError: <p>Exception raised when an internal, configuration, or dependency error is encountered.</p>
        capo_migration_hub.errors.invalid_input_exception.InvalidInputException: <p>Exception raised when the provided input violates a policy constraint or is entered in the wrong format or data type.</p>
        capo_migration_hub.errors.resource_not_found_exception.ResourceNotFoundException: <p>Exception raised when the request references a resource (Application Discovery Service configuration, update stream, migration task, etc.) that does not exist in Application Discovery Service (Application Discovery Service) or in Migration Hub's repository.</p>
        capo_migration_hub.errors.service_unavailable_exception.ServiceUnavailableException: <p>Exception raised when there is an internal, configuration, or dependency error encountered.</p>
        capo_migration_hub.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_migration_hub.errors.unauthorized_operation.UnauthorizedOperation: <p>Exception raised to indicate a request was not authorized when the <code>DryRun</code> flag is set to "true".</p>
        capo_migration_hub.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_migration_hub.types.put_resource_attributes_request.PutResourceAttributesRequest]",
    ) -> OperationResponse[
        "capo_migration_hub.types.put_resource_attributes_result.PutResourceAttributesResult"
    ]:
        import capo_migration_hub._operations.aws_migration_hub.put_resource_attributes

        output, http_response = (
            capo_migration_hub._operations.aws_migration_hub.put_resource_attributes.put_resource_attributes(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PutResourceAttributes")
    )
    input_: capo_migration_hub.types.put_resource_attributes_request.PutResourceAttributesRequest = {
        "progress_update_stream": progress_update_stream,
        "migration_task_name": migration_task_name,
        "resource_attribute_list": resource_attribute_list,
    }
    if dry_run is not None:
        input_["dry_run"] = dry_run

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