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 |
Session
|
A database session. |
required |
block_schema |
BlockSchema
|
A block schema object. |
required |
Returns:
Type | Description |
---|---|
The ID of the registered block schema. |
Source code in src/prefect/server/models/block_registration.py
51 52 53 54 55 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 |
|
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 |
Session
|
A database session. |
required |
block_type |
BlockType
|
A block type object. |
required |
Returns:
Type | Description |
---|---|
The ID of the registered block type. |
Source code in src/prefect/server/models/block_registration.py
87 88 89 90 91 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 |
|
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 |
Session
|
A database session. |
required |
Source code in src/prefect/server/models/block_registration.py
198 199 200 201 202 203 204 205 206 207 208 |
|