Skip to content

sync_resource

sync_resource(
    resource_type: ResourceType,
    resource: ResourceSpecifier,
    *,
    config_overrides: Optional[ServiceCatalogAppRegistryClientConfig] = None,
) -> SyncResourceResponse

Syncs the resource with current AppRegistry records.

Specifically, the resource’s AppRegistry system tags sync with its associated application. We remove the resource's AppRegistry system tags if it does not associate with the application. The caller must have permissions to read and update the resource.

Parameters:

  • resource_type (ResourceType) –

    The type of resource of which the application will be associated.

  • resource (ResourceSpecifier) –

    An entity you can work with and specify with a name or ID. Examples include an Amazon EC2 instance, an Amazon Web Services CloudFormation stack, or an Amazon S3 bucket.

Raises:

Source code in docs_src/capo_service_catalog_appregistry/_services/service_catalog_app_registry.py
def sync_resource(
    self,
    resource_type: "capo_service_catalog_appregistry.types.resource_type.ResourceType",
    resource: "capo_service_catalog_appregistry.types.resource_specifier.ResourceSpecifier",
    *,
    config_overrides: Optional[ServiceCatalogAppRegistryClientConfig] = None,
) -> "capo_service_catalog_appregistry.types.sync_resource_response.SyncResourceResponse":
    """<p>Syncs the resource with current AppRegistry records.</p> <p>Specifically, the resource’s AppRegistry system tags sync with its associated application. We remove the resource's AppRegistry system tags if it does not associate with the application. The caller must have permissions to read and update the resource.</p>

    Args:
        resource_type: <p>The type of resource of which the application will be associated.</p>
        resource: <p>An entity you can work with and specify with a name or ID. Examples include an Amazon EC2 instance, an Amazon Web Services CloudFormation stack, or an Amazon S3 bucket.</p>

    Raises:
        capo_service_catalog_appregistry.errors.conflict_exception.ConflictException: <p>There was a conflict when processing the request (for example, a resource with the given name already exists within the account).</p>
        capo_service_catalog_appregistry.errors.internal_server_exception.InternalServerException: <p>The service is experiencing internal problems.</p>
        capo_service_catalog_appregistry.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
        capo_service_catalog_appregistry.errors.throttling_exception.ThrottlingException: <p> The maximum number of API requests has been exceeded. </p>
        capo_service_catalog_appregistry.errors.validation_exception.ValidationException: <p>The request has invalid or missing parameters.</p>
        capo_service_catalog_appregistry.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_service_catalog_appregistry.types.sync_resource_request.SyncResourceRequest]",
    ) -> OperationResponse[
        "capo_service_catalog_appregistry.types.sync_resource_response.SyncResourceResponse"
    ]:
        import capo_service_catalog_appregistry._operations.aws242_app_registry.sync_resource

        output, http_response = (
            capo_service_catalog_appregistry._operations.aws242_app_registry.sync_resource.sync_resource(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("SyncResource")
    )
    input_: capo_service_catalog_appregistry.types.sync_resource_request.SyncResourceRequest = {
        "resource_type": resource_type,
        "resource": resource,
    }

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