Skip to content

update_device_pool async

update_device_pool(
    arn: AmazonResourceName,
    *,
    config_overrides: Optional[AsyncDeviceFarmClientConfig] = None,
    name: Optional[Name] = None,
    description: Optional[Message] = None,
    rules: Optional[Rules] = None,
    max_devices: Optional[Integer] = None,
    clear_max_devices: Optional[Boolean] = None,
) -> UpdateDevicePoolResult

Modifies the name, description, and rules in a device pool given the attributes and the pool ARN. Rule updates are all-or-nothing, meaning they can only be updated as a whole (or not at all).

Parameters:

  • arn (AmazonResourceName) –

    The Amazon Resource Name (ARN) of the Device Farm device pool to update.

  • name (Optional[Name], default: None ) –

    A string that represents the name of the device pool to update.

  • description (Optional[Message], default: None ) –

    A description of the device pool to update.

  • rules (Optional[Rules], default: None ) –

    Represents the rules to modify for the device pool. Updating rules is optional. If you update rules for your request, the update replaces the existing rules.

  • max_devices (Optional[Integer], default: None ) –

    The number of devices that Device Farm can add to your device pool. Device Farm adds devices that are available and that meet the criteria that you assign for the rules parameter. Depending on how many devices meet these constraints, your device pool might contain fewer devices than the value for this parameter.

    By specifying the maximum number of devices, you can control the costs that you incur by running tests.

    If you use this parameter in your request, you cannot use the clearMaxDevices parameter in the same request.

  • clear_max_devices (Optional[Boolean], default: None ) –

    Sets whether the maxDevices parameter applies to your device pool. If you set this parameter to true, the maxDevices parameter does not apply, and Device Farm does not limit the number of devices that it adds to your device pool. In this case, Device Farm adds all available devices that meet the criteria specified in the rules parameter.

    If you use this parameter in your request, you cannot use the maxDevices parameter in the same request.

Raises:

Examples:

To update a device pool The following example updates the specified device pool with a new name and description. It also enables remote access of devices in the device pool.

>>> await client.update_device_pool(arn='arn:aws:devicefarm:us-west-2::devicepool:082d10e5-d7d7-48a5-ba5c-12345EXAMPLE', name='NewName', description='NewDescription', rules=[{'attribute': 'REMOTE_ACCESS_ENABLED', 'operator': 'EQUALS', 'value': 'True'}])
Source code in docs_src/capo_device_farm/_services/async_device_farm.py
async def update_device_pool(
    self,
    arn: "capo_device_farm.types.amazon_resource_name.AmazonResourceName",
    *,
    config_overrides: Optional[AsyncDeviceFarmClientConfig] = None,
    name: Optional["capo_device_farm.types.name.Name"] = None,
    description: Optional["capo_device_farm.types.message.Message"] = None,
    rules: Optional["capo_device_farm.types.rules.Rules"] = None,
    max_devices: Optional["capo_device_farm.types.integer.Integer"] = None,
    clear_max_devices: Optional["capo_device_farm.types.boolean.Boolean"] = None,
) -> "capo_device_farm.types.update_device_pool_result.UpdateDevicePoolResult":
    """<p>Modifies the name, description, and rules in a device pool given the attributes and the pool ARN. Rule updates are all-or-nothing, meaning they can only be updated as a whole (or not at all).</p>

    Args:
        arn: <p>The Amazon Resource Name (ARN) of the Device Farm device pool to update.</p>
        name: <p>A string that represents the name of the device pool to update.</p>
        description: <p>A description of the device pool to update.</p>
        rules: <p>Represents the rules to modify for the device pool. Updating rules is optional. If you update rules for your request, the update replaces the existing rules.</p>
        max_devices: <p>The number of devices that Device Farm can add to your device pool. Device Farm adds devices that are available and that meet the criteria that you assign for the <code>rules</code> parameter. Depending on how many devices meet these constraints, your device pool might contain fewer devices than the value for this parameter.</p> <p>By specifying the maximum number of devices, you can control the costs that you incur by running tests.</p> <p>If you use this parameter in your request, you cannot use the <code>clearMaxDevices</code> parameter in the same request.</p>
        clear_max_devices: <p>Sets whether the <code>maxDevices</code> parameter applies to your device pool. If you set this parameter to <code>true</code>, the <code>maxDevices</code> parameter does not apply, and Device Farm does not limit the number of devices that it adds to your device pool. In this case, Device Farm adds all available devices that meet the criteria specified in the <code>rules</code> parameter.</p> <p>If you use this parameter in your request, you cannot use the <code>maxDevices</code> parameter in the same request.</p>

    Raises:
        capo_device_farm.errors.argument_exception.ArgumentException: <p>An invalid argument was specified.</p>
        capo_device_farm.errors.limit_exceeded_exception.LimitExceededException: <p>A limit was exceeded.</p>
        capo_device_farm.errors.not_found_exception.NotFoundException: <p>The specified entity was not found.</p>
        capo_device_farm.errors.service_account_exception.ServiceAccountException: <p>There was a problem with the service account.</p>
        capo_device_farm.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To update a device pool
        The following example updates the specified device pool with a new name and description. It also enables remote access of devices in the device pool.

        >>> await client.update_device_pool(arn='arn:aws:devicefarm:us-west-2::devicepool:082d10e5-d7d7-48a5-ba5c-12345EXAMPLE', name='NewName', description='NewDescription', rules=[{'attribute': 'REMOTE_ACCESS_ENABLED', 'operator': 'EQUALS', 'value': 'True'}])
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_device_farm.types.update_device_pool_request.UpdateDevicePoolRequest]",
    ) -> AsyncOperationResponse[
        "capo_device_farm.types.update_device_pool_result.UpdateDevicePoolResult"
    ]:
        import capo_device_farm._operations.device_farm_20150623.update_device_pool

        (
            output,
            http_response,
        ) = await capo_device_farm._operations.device_farm_20150623.update_device_pool.async_update_device_pool(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateDevicePool")
    )
    input_: capo_device_farm.types.update_device_pool_request.UpdateDevicePoolRequest = {
        "arn": arn
    }
    if name is not None:
        input_["name"] = name
    if description is not None:
        input_["description"] = description
    if rules is not None:
        input_["rules"] = rules
    if max_devices is not None:
        input_["max_devices"] = max_devices
    if clear_max_devices is not None:
        input_["clear_max_devices"] = clear_max_devices

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