Skip to content

create_app_block

create_app_block(
    *,
    config_overrides: Optional[AppStreamClientConfig] = None,
    name: Optional[Name] = None,
    description: Optional[Description] = None,
    display_name: Optional[DisplayName] = None,
    source_s3_location: Optional[S3Location] = None,
    setup_script_details: Optional[ScriptDetails] = None,
    tags: Optional[Tags] = None,
    post_setup_script_details: Optional[ScriptDetails] = None,
    packaging_type: Optional[PackagingType] = None,
) -> CreateAppBlockResult

Creates an app block.

App blocks are a WorkSpaces Applications resource that stores the details about the virtual hard disk in an S3 bucket. It also stores the setup script with details about how to mount the virtual hard disk. The virtual hard disk includes the application binaries and other files necessary to launch your applications. Multiple applications can be assigned to a single app block.

This is only supported for Elastic fleets.

Parameters:

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

    The name of the app block.

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

    The description of the app block.

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

    The display name of the app block. This is not displayed to the user.

  • source_s3_location (Optional[S3Location], default: None ) –

    The source S3 location of the app block.

  • setup_script_details (Optional[ScriptDetails], default: None ) –

    The setup script details of the app block. This must be provided for the CUSTOM PackagingType.

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

    The tags assigned to the app block.

  • post_setup_script_details (Optional[ScriptDetails], default: None ) –

    The post setup script details of the app block. This can only be provided for the APPSTREAM2 PackagingType.

  • packaging_type (Optional[PackagingType], default: None ) –

    The packaging type of the app block.

Raises:

Source code in docs_src/capo_appstream/_services/app_stream.py
def create_app_block(
    self,
    *,
    config_overrides: Optional[AppStreamClientConfig] = None,
    name: Optional["capo_appstream.types.name.Name"] = None,
    description: Optional["capo_appstream.types.description.Description"] = None,
    display_name: Optional["capo_appstream.types.display_name.DisplayName"] = None,
    source_s3_location: Optional[
        "capo_appstream.types.s3_location.S3Location"
    ] = None,
    setup_script_details: Optional[
        "capo_appstream.types.script_details.ScriptDetails"
    ] = None,
    tags: Optional["capo_appstream.types.tags.Tags"] = None,
    post_setup_script_details: Optional[
        "capo_appstream.types.script_details.ScriptDetails"
    ] = None,
    packaging_type: Optional[
        "capo_appstream.types.packaging_type.PackagingType"
    ] = None,
) -> "capo_appstream.types.create_app_block_result.CreateAppBlockResult":
    """<p>Creates an app block.</p> <p>App blocks are a WorkSpaces Applications resource that stores the details about the virtual hard disk in an S3 bucket. It also stores the setup script with details about how to mount the virtual hard disk. The virtual hard disk includes the application binaries and other files necessary to launch your applications. Multiple applications can be assigned to a single app block.</p> <p>This is only supported for Elastic fleets.</p>

    Args:
        name: <p>The name of the app block.</p>
        description: <p>The description of the app block.</p>
        display_name: <p>The display name of the app block. This is not displayed to the user.</p>
        source_s3_location: <p>The source S3 location of the app block.</p>
        setup_script_details: <p>The setup script details of the app block. This must be provided for the <code>CUSTOM</code> PackagingType.</p>
        tags: <p>The tags assigned to the app block.</p>
        post_setup_script_details: <p>The post setup script details of the app block. This can only be provided for the <code>APPSTREAM2</code> PackagingType.</p>
        packaging_type: <p>The packaging type of the app block.</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.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.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_appstream.types.create_app_block_request.CreateAppBlockRequest]",
    ) -> OperationResponse[
        "capo_appstream.types.create_app_block_result.CreateAppBlockResult"
    ]:
        import capo_appstream._operations.photon_admin_proxy_service.create_app_block

        output, http_response = (
            capo_appstream._operations.photon_admin_proxy_service.create_app_block.create_app_block(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateAppBlock")
    )
    input_: capo_appstream.types.create_app_block_request.CreateAppBlockRequest = {}
    if name is not None:
        input_["name"] = name
    if description is not None:
        input_["description"] = description
    if display_name is not None:
        input_["display_name"] = display_name
    if source_s3_location is not None:
        input_["source_s3_location"] = source_s3_location
    if setup_script_details is not None:
        input_["setup_script_details"] = setup_script_details
    if tags is not None:
        input_["tags"] = tags
    if post_setup_script_details is not None:
        input_["post_setup_script_details"] = post_setup_script_details
    if packaging_type is not None:
        input_["packaging_type"] = packaging_type

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