Skip to content

resolve_component_candidates

resolve_component_candidates(
    *,
    config_overrides: Optional[GreengrassV2ClientConfig] = None,
    platform: Optional[ComponentPlatform] = None,
    component_candidates: Optional[ComponentCandidateList] = None,
) -> ResolveComponentCandidatesResponse

Retrieves a list of components that meet the component, version, and platform requirements of a deployment. Greengrass core devices call this operation when they receive a deployment to identify the components to install.

This operation identifies components that meet all dependency requirements for a deployment. If the requirements conflict, then this operation returns an error and the deployment fails. For example, this occurs if component A requires version >2.0.0 and component B requires version <2.0.0 of a component dependency.

When you specify the component candidates to resolve, IoT Greengrass compares each component's digest from the core device with the component's digest in the Amazon Web Services Cloud. If the digests don't match, then IoT Greengrass specifies to use the version from the Amazon Web Services Cloud.

To use this operation, you must use the data plane API endpoint and authenticate with an IoT device certificate. For more information, see IoT Greengrass endpoints and quotas.

Parameters:

Raises:

  • AccessDeniedException –

    You don't have permission to perform the action.

  • ConflictException –

    Your request has conflicting operations. This can occur if you're trying to perform more than one operation on the same resource at the same time.

  • InternalServerException –

    IoT Greengrass can't process your request right now. Try again later.

  • ResourceNotFoundException –

    The requested resource can't be found.

  • ThrottlingException –

    Your request exceeded a request rate quota. For example, you might have exceeded the amount of times that you can retrieve device or deployment status per second.

  • ValidationException –

    The request isn't valid. This can occur if your request contains malformed JSON or unsupported characters.

  • UnknownServiceError –

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

Source code in docs_src/capo_greengrassv2/_services/greengrass_v2.py
def resolve_component_candidates(
    self,
    *,
    config_overrides: Optional[GreengrassV2ClientConfig] = None,
    platform: Optional[
        "capo_greengrassv2.types.component_platform.ComponentPlatform"
    ] = None,
    component_candidates: Optional[
        "capo_greengrassv2.types.component_candidate_list.ComponentCandidateList"
    ] = None,
) -> "capo_greengrassv2.types.resolve_component_candidates_response.ResolveComponentCandidatesResponse":
    """<p>Retrieves a list of components that meet the component, version, and platform requirements of a deployment. Greengrass core devices call this operation when they receive a deployment to identify the components to install.</p> <p>This operation identifies components that meet all dependency requirements for a deployment. If the requirements conflict, then this operation returns an error and the deployment fails. For example, this occurs if component <code>A</code> requires version <code>>2.0.0</code> and component <code>B</code> requires version <code><2.0.0</code> of a component dependency.</p> <p>When you specify the component candidates to resolve, IoT Greengrass compares each component's digest from the core device with the component's digest in the Amazon Web Services Cloud. If the digests don't match, then IoT Greengrass specifies to use the version from the Amazon Web Services Cloud.</p> <important> <p>To use this operation, you must use the data plane API endpoint and authenticate with an IoT device certificate. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/greengrass.html">IoT Greengrass endpoints and quotas</a>.</p> </important>

    Args:
        platform: <p>The platform to use to resolve compatible components.</p>
        component_candidates: <p>The list of components to resolve.</p>

    Raises:
        capo_greengrassv2.errors.access_denied_exception.AccessDeniedException: <p>You don't have permission to perform the action.</p>
        capo_greengrassv2.errors.conflict_exception.ConflictException: <p>Your request has conflicting operations. This can occur if you're trying to perform more than one operation on the same resource at the same time.</p>
        capo_greengrassv2.errors.internal_server_exception.InternalServerException: <p>IoT Greengrass can't process your request right now. Try again later.</p>
        capo_greengrassv2.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource can't be found.</p>
        capo_greengrassv2.errors.throttling_exception.ThrottlingException: <p>Your request exceeded a request rate quota. For example, you might have exceeded the amount of times that you can retrieve device or deployment status per second.</p>
        capo_greengrassv2.errors.validation_exception.ValidationException: <p>The request isn't valid. This can occur if your request contains malformed JSON or unsupported characters.</p>
        capo_greengrassv2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_greengrassv2.types.resolve_component_candidates_request.ResolveComponentCandidatesRequest]",
    ) -> OperationResponse[
        "capo_greengrassv2.types.resolve_component_candidates_response.ResolveComponentCandidatesResponse"
    ]:
        import capo_greengrassv2._operations.greengrass_v2.resolve_component_candidates

        output, http_response = (
            capo_greengrassv2._operations.greengrass_v2.resolve_component_candidates.resolve_component_candidates(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ResolveComponentCandidates")
    )
    input_: capo_greengrassv2.types.resolve_component_candidates_request.ResolveComponentCandidatesRequest = {}
    if platform is not None:
        input_["platform"] = platform
    if component_candidates is not None:
        input_["component_candidates"] = component_candidates

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