Verifies the subscription and performs resource dependency checks on the requested Amazon Web Services Marketplace resource. The caller must be entitled to the resource. For Amazon Web Services Marketplace components, the response contains fields to download the components and their artifacts.
Parameters:
-
resource_type
(MarketplaceResourceType)
–
Specifies which type of Amazon Web Services Marketplace resource Image Builder retrieves.
-
resource_arn
(ImageBuilderArn)
–
The Amazon Resource Name (ARN) that uniquely identifies an Amazon Web Services Marketplace resource.
-
resource_location
(Optional[MarketplaceResourceLocation], default:
None
)
–
The Amazon S3 location of the component artifact to retrieve, in s3://bucket/key form.
Raises:
-
CallRateLimitExceededException
–
You have exceeded the permitted request rate for the Amazon EC2 APIs that Image Builder calls on your behalf. Retry with an increasing or variable delay between requests.
-
ClientException
–
A generic client error. This error usually indicates that the request failed a validation check, such as when a downstream service rejects a configured value.
-
ForbiddenException
–
You are not authorized to perform the requested operation.
-
InvalidRequestException
–
The request is malformed or otherwise invalid. Verify the request and try again.
-
ServiceException
–
An internal server error occurred while Image Builder processed the request. Retrying the request may succeed.
-
ServiceUnavailableException
–
The service is unable to process your request at this time.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_imagebuilder/_services/async_imagebuilder.py
| async def get_marketplace_resource(
self,
resource_type: "capo_imagebuilder.types.marketplace_resource_type.MarketplaceResourceType",
resource_arn: "capo_imagebuilder.types.image_builder_arn.ImageBuilderArn",
*,
config_overrides: Optional[AsyncimagebuilderClientConfig] = None,
resource_location: Optional[
"capo_imagebuilder.types.marketplace_resource_location.MarketplaceResourceLocation"
] = None,
) -> "capo_imagebuilder.types.get_marketplace_resource_response.GetMarketplaceResourceResponse":
"""<p>Verifies the subscription and performs resource dependency checks on the requested Amazon Web Services Marketplace resource. The caller must be entitled to the resource. For Amazon Web Services Marketplace components, the response contains fields to download the components and their artifacts.</p>
Args:
resource_type: <p>Specifies which type of Amazon Web Services Marketplace resource Image Builder retrieves.</p>
resource_arn: <p>The Amazon Resource Name (ARN) that uniquely identifies an Amazon Web Services Marketplace resource.</p>
resource_location: <p>The Amazon S3 location of the component artifact to retrieve, in <code>s3://bucket/key</code> form.</p>
Raises:
capo_imagebuilder.errors.call_rate_limit_exceeded_exception.CallRateLimitExceededException: <p>You have exceeded the permitted request rate for the Amazon EC2 APIs that Image Builder calls on your behalf. Retry with an increasing or variable delay between requests.</p>
capo_imagebuilder.errors.client_exception.ClientException: <p>A generic client error. This error usually indicates that the request failed a validation check, such as when a downstream service rejects a configured value.</p>
capo_imagebuilder.errors.forbidden_exception.ForbiddenException: <p>You are not authorized to perform the requested operation.</p>
capo_imagebuilder.errors.invalid_request_exception.InvalidRequestException: <p>The request is malformed or otherwise invalid. Verify the request and try again.</p>
capo_imagebuilder.errors.service_exception.ServiceException: <p>An internal server error occurred while Image Builder processed the request. Retrying the request may succeed.</p>
capo_imagebuilder.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service is unable to process your request at this time.</p>
capo_imagebuilder.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_imagebuilder.types.get_marketplace_resource_request.GetMarketplaceResourceRequest]",
) -> AsyncOperationResponse[
"capo_imagebuilder.types.get_marketplace_resource_response.GetMarketplaceResourceResponse"
]:
import capo_imagebuilder._operations.imagebuilder.get_marketplace_resource
(
output,
http_response,
) = await capo_imagebuilder._operations.imagebuilder.get_marketplace_resource.async_get_marketplace_resource(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetMarketplaceResource")
)
input_: capo_imagebuilder.types.get_marketplace_resource_request.GetMarketplaceResourceRequest = {
"resource_type": resource_type,
"resource_arn": resource_arn,
}
if resource_location is not None:
input_["resource_location"] = resource_location
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|