Skip to content

start_job async

start_job(
    action: JobAction,
    execution_role_arn: IamRoleArn,
    input_options: JobInputOptions,
    output_options: JobOutputOptions,
    *,
    config_overrides: Optional[AsyncLocationClientConfig] = None,
    client_token: Optional[ClientToken] = None,
    action_options: Optional[JobActionOptions] = None,
    name: Optional[ResourceName] = None,
    tags: Optional[TagMap] = None,
) -> StartJobResponse

StartJob starts a new asynchronous bulk processing job. You specify the input data location in Amazon S3, the action to perform, and the output location where results are written.

For more information, see Job concepts in the Amazon Location Service Developer Guide.

Parameters:

  • client_token (Optional[ClientToken], default: None ) –

    A unique identifier for this request to ensure idempotency.

  • action (JobAction) –

    The action to perform on the input data.

  • action_options (Optional[JobActionOptions], default: None ) –

    Additional parameters that can be requested for each result.

  • execution_role_arn (IamRoleArn) –

    The Amazon Resource Name (ARN) of the IAM role that Amazon Location Service assumes during job processing. Amazon Location Service uses this role to access the input and output locations specified for the job.

    The IAM role must be created in the same Amazon Web Services account where you plan to run your job.

    For more information about configuring IAM roles for Amazon Location jobs, see Configure IAM permissions in the Amazon Location Service Developer Guide.

  • input_options (JobInputOptions) –

    Configuration for input data location and format.

    Input files have a limitation of 10gb per file, and 1gb per Parquet row-group within the file.

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

    An optional name for the job resource.

  • output_options (JobOutputOptions) –

    Configuration for output data location and format.

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

    Tags and corresponding values to be associated with the job.

Raises:

  • AccessDeniedException –

    The request was denied because of insufficient access or permissions. Check with an administrator to verify your permissions.

  • InternalServerException –

    The request has failed to process because of an unknown server error, exception, or failure.

  • ThrottlingException –

    The request was denied because of request throttling.

  • ValidationException –

    The input failed to meet the constraints specified by the AWS service.

  • UnknownServiceError –

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

Source code in docs_src/capo_location/_services/async_location.py
async def start_job(
    self,
    action: "capo_location.types.job_action.JobAction",
    execution_role_arn: "capo_location.types.iam_role_arn.IamRoleArn",
    input_options: "capo_location.types.job_input_options.JobInputOptions",
    output_options: "capo_location.types.job_output_options.JobOutputOptions",
    *,
    config_overrides: Optional[AsyncLocationClientConfig] = None,
    client_token: Optional["capo_location.types.client_token.ClientToken"] = None,
    action_options: Optional[
        "capo_location.types.job_action_options.JobActionOptions"
    ] = None,
    name: Optional["capo_location.types.resource_name.ResourceName"] = None,
    tags: Optional["capo_location.types.tag_map.TagMap"] = None,
) -> "capo_location.types.start_job_response.StartJobResponse":
    """<p> <code>StartJob</code> starts a new asynchronous bulk processing job. You specify the input data location in Amazon S3, the action to perform, and the output location where results are written.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/location/latest/developerguide/jobs-concepts.html">Job concepts</a> in the <i>Amazon Location Service Developer Guide</i>.</p>

    Args:
        client_token: <p>A unique identifier for this request to ensure idempotency.</p>
        action: <p>The action to perform on the input data.</p>
        action_options: <p>Additional parameters that can be requested for each result.</p>
        execution_role_arn: <p>The Amazon Resource Name (ARN) of the IAM role that Amazon Location Service assumes during job processing. Amazon Location Service uses this role to access the input and output locations specified for the job.</p> <note> <p>The IAM role must be created in the same Amazon Web Services account where you plan to run your job.</p> </note> <p>For more information about configuring IAM roles for Amazon Location jobs, see <a href="https://docs.aws.amazon.com/location/latest/developerguide/configure-iam-role-policy-credentials.html">Configure IAM permissions</a> in the <i>Amazon Location Service Developer Guide</i>.</p>
        input_options: <p>Configuration for input data location and format.</p> <note> <p>Input files have a limitation of 10gb per file, and 1gb per Parquet row-group within the file.</p> </note>
        name: <p>An optional name for the job resource.</p>
        output_options: <p>Configuration for output data location and format.</p>
        tags: <p>Tags and corresponding values to be associated with the job.</p>

    Raises:
        capo_location.errors.access_denied_exception.AccessDeniedException: <p>The request was denied because of insufficient access or permissions. Check with an administrator to verify your permissions.</p>
        capo_location.errors.internal_server_exception.InternalServerException: <p>The request has failed to process because of an unknown server error, exception, or failure.</p>
        capo_location.errors.throttling_exception.ThrottlingException: <p>The request was denied because of request throttling.</p>
        capo_location.errors.validation_exception.ValidationException: <p>The input failed to meet the constraints specified by the AWS service. </p>
        capo_location.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_location.types.start_job_request.StartJobRequest]",
    ) -> AsyncOperationResponse[
        "capo_location.types.start_job_response.StartJobResponse"
    ]:
        import capo_location._operations.location_service.start_job

        (
            output,
            http_response,
        ) = await capo_location._operations.location_service.start_job.async_start_job(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_location.types.start_job_response.StartJobResponse",
    ) -> dict[str, Any]:
        import capo_location.types.start_job_response

        return capo_location.types.start_job_response.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StartJob", redact_output=_redact_output)
    )
    input_: capo_location.types.start_job_request.StartJobRequest = {
        "action": action,
        "execution_role_arn": execution_role_arn,
        "input_options": input_options,
        "output_options": output_options,
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if action_options is not None:
        input_["action_options"] = action_options
    if name is not None:
        input_["name"] = name
    if tags is not None:
        input_["tags"] = tags

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