Skip to content

poll_for_jobs

poll_for_jobs(
    action_type_id: ActionTypeId,
    *,
    config_overrides: Optional[CodePipelineClientConfig] = None,
    max_batch_size: Optional[MaxBatchSize] = None,
    query_param: Optional[QueryParamMap] = None,
) -> PollForJobsOutput

Returns information about any jobs for CodePipeline to act on. PollForJobs is valid only for action types with "Custom" in the owner field. If the action type contains AWS or ThirdParty in the owner field, the PollForJobs action returns an error.

When this API is called, CodePipeline returns temporary credentials for the S3 bucket used to store artifacts for the pipeline, if the action requires access to that S3 bucket for input or output artifacts. This API also returns any secret values defined for the action.

Parameters:

  • action_type_id (ActionTypeId) –

    Represents information about an action type.

  • max_batch_size (Optional[MaxBatchSize], default: None ) –

    The maximum number of jobs to return in a poll for jobs call.

  • query_param (Optional[QueryParamMap], default: None ) –

    A map of property names and values. For an action type with no queryable properties, this value must be null or an empty map. For an action type with a queryable property, you must supply that property as a key in the map. Only jobs whose action configuration matches the mapped value are returned.

Raises:

Source code in docs_src/capo_codepipeline/_services/code_pipeline.py
def poll_for_jobs(
    self,
    action_type_id: "capo_codepipeline.types.action_type_id.ActionTypeId",
    *,
    config_overrides: Optional[CodePipelineClientConfig] = None,
    max_batch_size: Optional[
        "capo_codepipeline.types.max_batch_size.MaxBatchSize"
    ] = None,
    query_param: Optional[
        "capo_codepipeline.types.query_param_map.QueryParamMap"
    ] = None,
) -> "capo_codepipeline.types.poll_for_jobs_output.PollForJobsOutput":
    """<p>Returns information about any jobs for CodePipeline to act on. <code>PollForJobs</code> is valid only for action types with "Custom" in the owner field. If the action type contains <code>AWS</code> or <code>ThirdParty</code> in the owner field, the <code>PollForJobs</code> action returns an error.</p> <important> <p>When this API is called, CodePipeline returns temporary credentials for the S3 bucket used to store artifacts for the pipeline, if the action requires access to that S3 bucket for input or output artifacts. This API also returns any secret values defined for the action.</p> </important>

    Args:
        action_type_id: <p>Represents information about an action type.</p>
        max_batch_size: <p>The maximum number of jobs to return in a poll for jobs call.</p>
        query_param: <p>A map of property names and values. For an action type with no queryable properties, this value must be null or an empty map. For an action type with a queryable property, you must supply that property as a key in the map. Only jobs whose action configuration matches the mapped value are returned.</p>

    Raises:
        capo_codepipeline.errors.action_type_not_found_exception.ActionTypeNotFoundException: <p>The specified action type cannot be found.</p>
        capo_codepipeline.errors.validation_exception.ValidationException: <p>The validation was specified in an invalid format.</p>
        capo_codepipeline.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_codepipeline.types.poll_for_jobs_input.PollForJobsInput]",
    ) -> OperationResponse[
        "capo_codepipeline.types.poll_for_jobs_output.PollForJobsOutput"
    ]:
        import capo_codepipeline._operations.code_pipeline_20150709.poll_for_jobs

        output, http_response = (
            capo_codepipeline._operations.code_pipeline_20150709.poll_for_jobs.poll_for_jobs(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_codepipeline.types.poll_for_jobs_output.PollForJobsOutput",
    ) -> dict[str, Any]:
        import capo_codepipeline.types.poll_for_jobs_output

        return capo_codepipeline.types.poll_for_jobs_output.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("PollForJobs", redact_output=_redact_output),
    )
    input_: capo_codepipeline.types.poll_for_jobs_input.PollForJobsInput = {
        "action_type_id": action_type_id
    }
    if max_batch_size is not None:
        input_["max_batch_size"] = max_batch_size
    if query_param is not None:
        input_["query_param"] = query_param

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