Skip to content

schedule_run async

schedule_run(
    project_arn: AmazonResourceName,
    test: ScheduleRunTest,
    *,
    config_overrides: Optional[AsyncDeviceFarmClientConfig] = None,
    app_arn: Optional[AmazonResourceName] = None,
    device_pool_arn: Optional[AmazonResourceName] = None,
    device_selection_configuration: Optional[DeviceSelectionConfiguration] = None,
    name: Optional[Name] = None,
    configuration: Optional[ScheduleRunConfiguration] = None,
    execution_configuration: Optional[ExecutionConfiguration] = None,
) -> ScheduleRunResult

Schedules a run.

Parameters:

  • project_arn (AmazonResourceName) –

    The ARN of the project for the run to be scheduled.

  • app_arn (Optional[AmazonResourceName], default: None ) –

    The ARN of an application package to run tests against, created with CreateUpload. See ListUploads.

  • device_pool_arn (Optional[AmazonResourceName], default: None ) –

    The ARN of the device pool for the run to be scheduled.

  • device_selection_configuration (Optional[DeviceSelectionConfiguration], default: None ) –

    The filter criteria used to dynamically select a set of devices for a test run and the maximum number of devices to be included in the run.

    Either devicePoolArn or deviceSelectionConfiguration is required in a request.

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

    The name for the run to be scheduled.

  • test (ScheduleRunTest) –

    Information about the test for the run to be scheduled.

  • configuration (Optional[ScheduleRunConfiguration], default: None ) –

    Information about the settings for the run to be scheduled.

  • execution_configuration (Optional[ExecutionConfiguration], default: None ) –

    Specifies configuration information about a test run, such as the execution timeout (in minutes).

Raises:

Examples:

To schedule a test run The following example schedules a test run named MyRun.

>>> await client.schedule_run(project_arn='arn:aws:devicefarm:us-west-2:123456789101:project:EXAMPLE-GUID-123-456', device_pool_arn='arn:aws:devicefarm:us-west-2:123456789101:pool:EXAMPLE-GUID-123-456', name='MyRun', test={'type': 'APPIUM_JAVA_JUNIT', 'testPackageArn': 'arn:aws:devicefarm:us-west-2:123456789101:test:EXAMPLE-GUID-123-456'})
Source code in docs_src/capo_device_farm/_services/async_device_farm.py
async def schedule_run(
    self,
    project_arn: "capo_device_farm.types.amazon_resource_name.AmazonResourceName",
    test: "capo_device_farm.types.schedule_run_test.ScheduleRunTest",
    *,
    config_overrides: Optional[AsyncDeviceFarmClientConfig] = None,
    app_arn: Optional[
        "capo_device_farm.types.amazon_resource_name.AmazonResourceName"
    ] = None,
    device_pool_arn: Optional[
        "capo_device_farm.types.amazon_resource_name.AmazonResourceName"
    ] = None,
    device_selection_configuration: Optional[
        "capo_device_farm.types.device_selection_configuration.DeviceSelectionConfiguration"
    ] = None,
    name: Optional["capo_device_farm.types.name.Name"] = None,
    configuration: Optional[
        "capo_device_farm.types.schedule_run_configuration.ScheduleRunConfiguration"
    ] = None,
    execution_configuration: Optional[
        "capo_device_farm.types.execution_configuration.ExecutionConfiguration"
    ] = None,
) -> "capo_device_farm.types.schedule_run_result.ScheduleRunResult":
    """<p>Schedules a run.</p>

    Args:
        project_arn: <p>The ARN of the project for the run to be scheduled.</p>
        app_arn: <p>The ARN of an application package to run tests against, created with <a>CreateUpload</a>. See <a>ListUploads</a>.</p>
        device_pool_arn: <p>The ARN of the device pool for the run to be scheduled.</p>
        device_selection_configuration: <p>The filter criteria used to dynamically select a set of devices for a test run and the maximum number of devices to be included in the run.</p> <p>Either <b> <code>devicePoolArn</code> </b> or <b> <code>deviceSelectionConfiguration</code> </b> is required in a request.</p>
        name: <p>The name for the run to be scheduled.</p>
        test: <p>Information about the test for the run to be scheduled.</p>
        configuration: <p>Information about the settings for the run to be scheduled.</p>
        execution_configuration: <p>Specifies configuration information about a test run, such as the execution timeout (in minutes).</p>

    Raises:
        capo_device_farm.errors.argument_exception.ArgumentException: <p>An invalid argument was specified.</p>
        capo_device_farm.errors.idempotency_exception.IdempotencyException: <p>An entity with the same name already exists.</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 schedule a test run
        The following example schedules a test run named MyRun.

        >>> await client.schedule_run(project_arn='arn:aws:devicefarm:us-west-2:123456789101:project:EXAMPLE-GUID-123-456', device_pool_arn='arn:aws:devicefarm:us-west-2:123456789101:pool:EXAMPLE-GUID-123-456', name='MyRun', test={'type': 'APPIUM_JAVA_JUNIT', 'testPackageArn': 'arn:aws:devicefarm:us-west-2:123456789101:test:EXAMPLE-GUID-123-456'})
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_device_farm.types.schedule_run_request.ScheduleRunRequest]",
    ) -> AsyncOperationResponse[
        "capo_device_farm.types.schedule_run_result.ScheduleRunResult"
    ]:
        import capo_device_farm._operations.device_farm_20150623.schedule_run

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

    def _redact_output(
        output: "capo_device_farm.types.schedule_run_result.ScheduleRunResult",
    ) -> dict[str, Any]:
        import capo_device_farm.types.schedule_run_result

        return capo_device_farm.types.schedule_run_result.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("ScheduleRun", redact_output=_redact_output),
    )
    input_: capo_device_farm.types.schedule_run_request.ScheduleRunRequest = {
        "project_arn": project_arn,
        "test": test,
    }
    if app_arn is not None:
        input_["app_arn"] = app_arn
    if device_pool_arn is not None:
        input_["device_pool_arn"] = device_pool_arn
    if device_selection_configuration is not None:
        input_["device_selection_configuration"] = device_selection_configuration
    if name is not None:
        input_["name"] = name
    if configuration is not None:
        input_["configuration"] = configuration
    if execution_configuration is not None:
        input_["execution_configuration"] = execution_configuration

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