Deletes the specified image. You cannot delete an image when it is in use. After you delete an image, you cannot provision new capacity using the image.
Parameters:
Raises:
Source code in docs_src/capo_appstream/_services/async_app_stream.py
| async def delete_image(
self,
*,
config_overrides: Optional[AsyncAppStreamClientConfig] = None,
name: Optional["capo_appstream.types.name.Name"] = None,
) -> "capo_appstream.types.delete_image_result.DeleteImageResult":
"""<p>Deletes the specified image. You cannot delete an image when it is in use. After you delete an image, you cannot provision new capacity using the image.</p>
Args:
name: <p>The name of the image.</p>
Raises:
capo_appstream.errors.concurrent_modification_exception.ConcurrentModificationException: <p>An API error occurred. Wait a few minutes and try again.</p>
capo_appstream.errors.operation_not_permitted_exception.OperationNotPermittedException: <p>The attempted operation is not permitted.</p>
capo_appstream.errors.resource_in_use_exception.ResourceInUseException: <p>The specified resource is in use.</p>
capo_appstream.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
capo_appstream.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_appstream.types.delete_image_request.DeleteImageRequest]",
) -> AsyncOperationResponse[
"capo_appstream.types.delete_image_result.DeleteImageResult"
]:
import capo_appstream._operations.photon_admin_proxy_service.delete_image
(
output,
http_response,
) = await capo_appstream._operations.photon_admin_proxy_service.delete_image.async_delete_image(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeleteImage")
)
input_: capo_appstream.types.delete_image_request.DeleteImageRequest = {}
if name is not None:
input_["name"] = name
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|