prefect.server.models.block_registration
register_block_schema(session, block_schema)
async
Stores the provided block schema in the Prefect REST API database.
If a block schema with a matching checksum and version is already saved, then the ID of the existing block schema will be returned.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session
|
AsyncSession
|
A database session. |
required |
block_schema
|
Union[BlockSchema, BlockSchema]
|
A block schema object. |
required |
Returns:
Type | Description |
---|---|
UUID
|
The ID of the registered block schema. |
Source code in src/prefect/server/models/block_registration.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
|
register_block_type(session, block_type)
async
Stores the provided block type in the Prefect REST API database.
If a block type with a matching slug is already saved, then the block type will be updated to match the passed in block type.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session
|
AsyncSession
|
A database session. |
required |
block_type
|
Union[BlockType, BlockType]
|
A block type object. |
required |
Returns:
Type | Description |
---|---|
UUID
|
The ID of the registered block type. |
Source code in src/prefect/server/models/block_registration.py
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
|
run_block_auto_registration(session)
async
Registers all blocks in the client block registry and any blocks from Prefect Collections that are configured for auto-registration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session
|
AsyncSession
|
A database session. |
required |
Source code in src/prefect/server/models/block_registration.py
204 205 206 207 208 209 210 211 212 213 214 |
|