prefect.cli.block

Command line interface for working with blocks.

Functions

display_block

display_block(block_document: 'BlockDocument') -> Table

display_block_type

display_block_type(block_type: 'BlockType') -> Table

display_block_schema_properties

display_block_schema_properties(block_schema_fields: dict[str, Any]) -> Table

display_block_schema_extra_definitions

display_block_schema_extra_definitions(block_schema_definitions: dict[str, Any]) -> Table

register

register(module_name: Optional[str] = typer.Option(None, '--module', '-m', help='Python module containing block types to be registered'), file_path: Optional[Path] = typer.Option(None, '--file', '-f', help='Path to .py file containing block types to be registered'))
Register blocks types within a module or file. This makes the blocks available for configuration via the UI. If a block type has already been registered, its registration will be updated to match the block’s current definition.  Examples:  Register block types in a Python module: prefect block register -m prefect_aws.credentials  Register block types in a .py file: prefect block register -f my_blocks.py

block_ls

block_ls()
View all configured blocks.

block_delete

block_delete(slug: Optional[str] = typer.Argument(None, help="A block slug. Formatted as '<BLOCK_TYPE_SLUG>/<BLOCK_NAME>'"), block_id: Optional[UUID] = typer.Option(None, '--id', help='A block id.'))
Delete a configured block.

block_create

block_create(block_type_slug: str = typer.Argument(..., help='A block type slug. View available types with: prefect block type ls', show_default=False))
Generate a link to the Prefect UI to create a block.

block_inspect

block_inspect(slug: Optional[str] = typer.Argument(None, help='A Block slug: <BLOCK_TYPE_SLUG>/<BLOCK_NAME>'), block_id: Optional[UUID] = typer.Option(None, '--id', help='A Block id to search for if no slug is given'))
Displays details about a configured block.

list_types

list_types()
List all block types.

blocktype_inspect

blocktype_inspect(slug: str = typer.Argument(..., help='A block type slug'))
Display details about a block type.

blocktype_delete

blocktype_delete(slug: str = typer.Argument(..., help='A Block type slug'))
Delete an unprotected Block Type.