Skip to content

create_updated_image async

create_updated_image(
    *,
    config_overrides: Optional[AsyncAppStreamClientConfig] = None,
    existing_image_name: Optional[Name] = None,
    new_image_name: Optional[Name] = None,
    new_image_description: Optional[Description] = None,
    new_image_display_name: Optional[DisplayName] = None,
    new_image_tags: Optional[Tags] = None,
    dry_run: Optional[Boolean] = None,
) -> CreateUpdatedImageResult

Creates a new image with the latest Windows operating system updates, driver updates, and WorkSpaces Applications agent software.

For more information, see the "Update an Image by Using Managed WorkSpaces Applications Image Updates" section in Administer Your WorkSpaces Applications Images, in the Amazon WorkSpaces Applications Administration Guide.

Parameters:

  • existing_image_name (Optional[Name], default: None ) –

    The name of the image to update.

  • new_image_name (Optional[Name], default: None ) –

    The name of the new image. The name must be unique within the AWS account and Region.

  • new_image_description (Optional[Description], default: None ) –

    The description to display for the new image.

  • new_image_display_name (Optional[DisplayName], default: None ) –

    The name to display for the new image.

  • new_image_tags (Optional[Tags], default: None ) –

    The tags to associate with the new image. A tag is a key-value pair, and the value is optional. For example, Environment=Test. If you do not specify a value, Environment=.

    Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following special characters:

    _ . : / = + \ - @

    If you do not specify a value, the value is set to an empty string.

    For more information about tags, see Tagging Your Resources in the Amazon WorkSpaces Applications Administration Guide.

  • dry_run (Optional[Boolean], default: None ) –

    Indicates whether to display the status of image update availability before WorkSpaces Applications initiates the process of creating a new updated image. If this value is set to true, WorkSpaces Applications displays whether image updates are available. If this value is set to false, WorkSpaces Applications initiates the process of creating a new updated image without displaying whether image updates are available.

Raises:

Source code in docs_src/capo_appstream/_services/async_app_stream.py
async def create_updated_image(
    self,
    *,
    config_overrides: Optional[AsyncAppStreamClientConfig] = None,
    existing_image_name: Optional["capo_appstream.types.name.Name"] = None,
    new_image_name: Optional["capo_appstream.types.name.Name"] = None,
    new_image_description: Optional[
        "capo_appstream.types.description.Description"
    ] = None,
    new_image_display_name: Optional[
        "capo_appstream.types.display_name.DisplayName"
    ] = None,
    new_image_tags: Optional["capo_appstream.types.tags.Tags"] = None,
    dry_run: Optional["capo_appstream.types.boolean.Boolean"] = None,
) -> "capo_appstream.types.create_updated_image_result.CreateUpdatedImageResult":
    r"""<p>Creates a new image with the latest Windows operating system updates, driver updates, and WorkSpaces Applications agent software.</p> <p>For more information, see the "Update an Image by Using Managed WorkSpaces Applications Image Updates" section in <a href="https://docs.aws.amazon.com/appstream2/latest/developerguide/administer-images.html">Administer Your WorkSpaces Applications Images</a>, in the <i>Amazon WorkSpaces Applications Administration Guide</i>.</p>

    Args:
        existing_image_name: <p>The name of the image to update.</p>
        new_image_name: <p>The name of the new image. The name must be unique within the AWS account and Region.</p>
        new_image_description: <p>The description to display for the new image.</p>
        new_image_display_name: <p>The name to display for the new image.</p>
        new_image_tags: <p>The tags to associate with the new image. A tag is a key-value pair, and the value is optional. For example, Environment=Test. If you do not specify a value, Environment=. </p> <p>Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following special characters: </p> <p>_ . : / = + \ - @</p> <p>If you do not specify a value, the value is set to an empty string.</p> <p>For more information about tags, see <a href="https://docs.aws.amazon.com/appstream2/latest/developerguide/tagging-basic.html">Tagging Your Resources</a> in the <i>Amazon WorkSpaces Applications Administration Guide</i>.</p>
        dry_run: <p>Indicates whether to display the status of image update availability before WorkSpaces Applications initiates the process of creating a new updated image. If this value is set to <code>true</code>, WorkSpaces Applications displays whether image updates are available. If this value is set to <code>false</code>, WorkSpaces Applications initiates the process of creating a new updated image without displaying whether image updates are available.</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.incompatible_image_exception.IncompatibleImageException: <p>The image can't be updated because it's not compatible for updates.</p>
        capo_appstream.errors.invalid_account_status_exception.InvalidAccountStatusException: <p>The resource cannot be created because your AWS account is suspended. For assistance, contact AWS Support. </p>
        capo_appstream.errors.limit_exceeded_exception.LimitExceededException: <p>The requested limit exceeds the permitted limit for an account.</p>
        capo_appstream.errors.operation_not_permitted_exception.OperationNotPermittedException: <p>The attempted operation is not permitted.</p>
        capo_appstream.errors.resource_already_exists_exception.ResourceAlreadyExistsException: <p>The specified resource already exists.</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.create_updated_image_request.CreateUpdatedImageRequest]",
    ) -> AsyncOperationResponse[
        "capo_appstream.types.create_updated_image_result.CreateUpdatedImageResult"
    ]:
        import capo_appstream._operations.photon_admin_proxy_service.create_updated_image

        (
            output,
            http_response,
        ) = await capo_appstream._operations.photon_admin_proxy_service.create_updated_image.async_create_updated_image(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateUpdatedImage")
    )
    input_: capo_appstream.types.create_updated_image_request.CreateUpdatedImageRequest = {}
    if existing_image_name is not None:
        input_["existing_image_name"] = existing_image_name
    if new_image_name is not None:
        input_["new_image_name"] = new_image_name
    if new_image_description is not None:
        input_["new_image_description"] = new_image_description
    if new_image_display_name is not None:
        input_["new_image_display_name"] = new_image_display_name
    if new_image_tags is not None:
        input_["new_image_tags"] = new_image_tags
    if dry_run is not None:
        input_["dry_run"] = dry_run

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output