prefect.settings.profiles
Profile
Bases: BaseModel
A user profile containing settings.
Source code in src/prefect/settings/profiles.py
48 49 50 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 |
|
to_environment_variables()
Convert the profile settings to a dictionary of environment variables.
Source code in src/prefect/settings/profiles.py
59 60 61 62 63 64 65 |
|
ProfilesCollection
" A utility class for working with a collection of profiles.
Profiles in the collection must have unique names.
The collection may store the name of the active profile.
Source code in src/prefect/settings/profiles.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 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 |
|
active_profile: Optional[Profile]
property
Retrieve the active profile in this collection.
names: Set[str]
property
Return a set of profile names in this collection.
add_profile(profile)
Add a profile to the collection.
If the profile name already exists, an exception will be raised.
Source code in src/prefect/settings/profiles.py
170 171 172 173 174 175 176 177 178 179 180 181 |
|
remove_profile(name)
Remove a profile from the collection.
Source code in src/prefect/settings/profiles.py
183 184 185 186 187 |
|
set_active(name, check=True)
Set the active profile name in the collection.
A null value may be passed to indicate that this collection does not determine the active profile.
Source code in src/prefect/settings/profiles.py
118 119 120 121 122 123 124 125 126 127 |
|
to_dict()
Convert to a dictionary suitable for writing to disk.
Source code in src/prefect/settings/profiles.py
204 205 206 207 208 209 210 211 212 213 214 |
|
update_profile(name, settings, source=None)
Add a profile to the collection or update the existing on if the name is already present in this collection.
If updating an existing profile, the settings will be merged. Settings can
be dropped from the existing profile by setting them to None
in the new
profile.
Returns the new profile object.
Source code in src/prefect/settings/profiles.py
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
|
without_profile_source(path)
Remove profiles that were loaded from a given path.
Returns a new collection.
Source code in src/prefect/settings/profiles.py
189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
|
load_current_profile()
Load the current profile from the default and current profile paths.
This will not include settings from the current settings context. Only settings that have been persisted to the profiles file will be saved.
Source code in src/prefect/settings/profiles.py
315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 |
|
load_profile(name)
Load a single profile by name.
Source code in src/prefect/settings/profiles.py
343 344 345 346 347 348 349 350 351 |
|
load_profiles(include_defaults=True)
Load profiles from the current profile path. Optionally include profiles from the default profile path.
Source code in src/prefect/settings/profiles.py
276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 |
|
save_profiles(profiles)
Writes all non-default profiles to the current profiles path.
Source code in src/prefect/settings/profiles.py
333 334 335 336 337 338 339 340 |
|
update_current_profile(settings)
Update the persisted data for the profile currently in-use.
If the profile does not exist in the profiles file, it will be created.
Given settings will be merged with the existing settings as described in
ProfilesCollection.update_profile
.
Returns:
Type | Description |
---|---|
Profile
|
The new profile. |
Source code in src/prefect/settings/profiles.py
354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 |
|