Snapm¶
Snapm — snapshot manager for creating, scheduling, and reverting coordinated snapshots across multiple LVM volumes. Integrates with Boom for snapshot-based boot environments.
sts.snapm.base
¶
Snapshot Manager base functionality.
SnapmBase
pydantic-model
¶
Bases: CliTool
Base class for Snapshot Manager operations.
Show JSON schema:
{
"additionalProperties": false,
"description": "Base class for Snapshot Manager operations.",
"properties": {
"debugopts": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Debugopts"
},
"verbose": {
"default": false,
"title": "Verbose",
"type": "boolean"
}
},
"title": "SnapmBase",
"type": "object"
}
Fields:
-
debugopts(list[str] | None) -
verbose(bool)
Source code in sts_libs/src/sts/snapm/base.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | |
version
cached
property
¶
Get snapm version.
sts.snapm.plugin
¶
Snapshot Manager plugin management.
Plugin
pydantic-model
¶
Bases: ReportModel
Snapshot Manager plugin report parsed from CLI JSON output.
Show JSON schema:
{
"description": "Snapshot Manager plugin report parsed from CLI JSON output.",
"properties": {
"plugin_name": {
"title": "Plugin Name",
"type": "string"
},
"plugin_version": {
"default": "",
"title": "Plugin Version",
"type": "string"
},
"plugin_type": {
"default": "",
"title": "Plugin Type",
"type": "string"
}
},
"required": [
"plugin_name"
],
"title": "Plugin",
"type": "object"
}
Config:
populate_by_name:True
Fields:
-
name(str) -
version(str) -
plugin_type(str)
Source code in sts_libs/src/sts/snapm/plugin.py
23 24 25 26 27 28 29 30 | |
PluginManager
pydantic-model
¶
Bases: SnapmBase
Plugin management.
Show JSON schema:
{
"additionalProperties": false,
"description": "Plugin management.",
"properties": {
"debugopts": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Debugopts"
},
"verbose": {
"default": false,
"title": "Verbose",
"type": "boolean"
}
},
"title": "PluginManager",
"type": "object"
}
Fields:
-
debugopts(list[str] | None) -
verbose(bool)
Source code in sts_libs/src/sts/snapm/plugin.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 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 85 86 87 88 89 90 | |
get_plugins()
¶
Get all available plugins as Plugin instances.
Source code in sts_libs/src/sts/snapm/plugin.py
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 90 | |
list_plugins(*, fields=None, json_output=False)
¶
List all plugins.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fields
|
str | None
|
Comma-separated list of fields to display (e.g. "plugin_name,plugin_version,plugin_type") |
None
|
json_output
|
bool
|
Whether to output in JSON format |
False
|
Source code in sts_libs/src/sts/snapm/plugin.py
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | |
sts.snapm.schedule
¶
Snapshot schedule management.
GcPolicyInfo
pydantic-model
¶
Bases: ReportModel
Garbage collection policy information.
Retention fields are policy-specific: keep_count for COUNT,
keep_years/months/weeks/days for AGE, and
keep_yearly/quarterly/monthly/weekly/daily/hourly for TIMELINE.
Show JSON schema:
{
"description": "Garbage collection policy information.\n\nRetention fields are policy-specific: ``keep_count`` for COUNT,\n``keep_years/months/weeks/days`` for AGE, and\n``keep_yearly/quarterly/monthly/weekly/daily/hourly`` for TIMELINE.",
"properties": {
"policy_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Policy Name"
},
"policy_type": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Policy Type"
},
"keep_count": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Keep Count"
},
"keep_years": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Keep Years"
},
"keep_months": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Keep Months"
},
"keep_weeks": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Keep Weeks"
},
"keep_days": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Keep Days"
},
"keep_yearly": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Keep Yearly"
},
"keep_quarterly": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Keep Quarterly"
},
"keep_monthly": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Keep Monthly"
},
"keep_weekly": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Keep Weekly"
},
"keep_daily": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Keep Daily"
},
"keep_hourly": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Keep Hourly"
}
},
"title": "GcPolicyInfo",
"type": "object"
}
Fields:
-
policy_name(str | None) -
policy_type(str | None) -
keep_count(int | None) -
keep_years(int | None) -
keep_months(int | None) -
keep_weeks(int | None) -
keep_days(int | None) -
keep_yearly(int | None) -
keep_quarterly(int | None) -
keep_monthly(int | None) -
keep_weekly(int | None) -
keep_daily(int | None) -
keep_hourly(int | None)
Source code in sts_libs/src/sts/snapm/schedule.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | |
Schedule
pydantic-model
¶
Bases: SnapmBase
Schedule management.
A Schedule defines automatic creation of snapshot sets.
Show JSON schema:
{
"$defs": {
"GcPolicyInfo": {
"description": "Garbage collection policy information.\n\nRetention fields are policy-specific: ``keep_count`` for COUNT,\n``keep_years/months/weeks/days`` for AGE, and\n``keep_yearly/quarterly/monthly/weekly/daily/hourly`` for TIMELINE.",
"properties": {
"policy_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Policy Name"
},
"policy_type": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Policy Type"
},
"keep_count": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Keep Count"
},
"keep_years": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Keep Years"
},
"keep_months": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Keep Months"
},
"keep_weeks": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Keep Weeks"
},
"keep_days": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Keep Days"
},
"keep_yearly": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Keep Yearly"
},
"keep_quarterly": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Keep Quarterly"
},
"keep_monthly": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Keep Monthly"
},
"keep_weekly": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Keep Weekly"
},
"keep_daily": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Keep Daily"
},
"keep_hourly": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Keep Hourly"
}
},
"title": "GcPolicyInfo",
"type": "object"
},
"ScheduleInfo": {
"description": "Schedule information parsed from ``snapm schedule show`` output.",
"properties": {
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Name"
},
"sources": {
"items": {
"type": "string"
},
"title": "Sources",
"type": "array"
},
"default_size_policy": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Default Size Policy"
},
"autoindex": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Autoindex"
},
"calendarspec": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Calendarspec"
},
"boot": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Boot"
},
"revert": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Revert"
},
"gc_policy": {
"anyOf": [
{
"$ref": "#/$defs/GcPolicyInfo"
},
{
"type": "null"
}
],
"default": null
},
"enabled": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Enabled"
},
"running": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Running"
},
"next_elapse": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Next Elapse"
}
},
"title": "ScheduleInfo",
"type": "object"
}
},
"additionalProperties": false,
"description": "Schedule management.\n\nA Schedule defines automatic creation of snapshot sets.",
"properties": {
"debugopts": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Debugopts"
},
"verbose": {
"default": false,
"title": "Verbose",
"type": "boolean"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Name"
},
"report": {
"anyOf": [
{
"$ref": "#/$defs/ScheduleInfo"
},
{
"type": "null"
}
],
"default": null
}
},
"title": "Schedule",
"type": "object"
}
Fields:
-
debugopts(list[str] | None) -
verbose(bool) -
name(str | None) -
report(ScheduleInfo | None)
Source code in sts_libs/src/sts/snapm/schedule.py
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 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 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 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 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 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 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 | |
create(schedule_name=None, sources=None, policy_type=None, calendarspec=None, size_policy=None, *, bootable=False, revert=False, **keep_options)
¶
Create a schedule.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
schedule_name
|
str | None
|
Schedule name (uses self.name if not provided) |
None
|
sources
|
list[str] | None
|
Source mount points or block devices |
None
|
policy_type
|
str | None
|
GC policy type (ALL, COUNT, AGE, TIMELINE) |
None
|
calendarspec
|
str | None
|
Calendar event expression for scheduling |
None
|
size_policy
|
str | None
|
Default size policy for sources |
None
|
bootable
|
bool
|
Whether to create boot entries for snapsets |
False
|
revert
|
bool
|
Whether to create revert entries for snapsets |
False
|
**keep_options
|
str
|
Retention kwargs matching the GC policy
(e.g. |
{}
|
Example
schedule = Schedule()
schedule.create(
'backup',
['/', '/home', '/var'],
policy_type='TIMELINE',
calendarspec='daily',
keep_daily=7,
keep_weekly=4,
keep_monthly=12,
bootable=True,
revert=True,
)
Source code in sts_libs/src/sts/snapm/schedule.py
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 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 | |
delete()
¶
Delete a schedule. Existing snapsets are not deleted.
Source code in sts_libs/src/sts/snapm/schedule.py
266 267 268 269 270 271 272 | |
disable()
¶
Disable a schedule.
Source code in sts_libs/src/sts/snapm/schedule.py
348 349 350 351 352 353 354 355 356 357 358 | |
edit(sources=None, policy_type=None, calendarspec=None, size_policy=None, *, bootable=None, revert=None, **keep_options)
¶
Edit a schedule. Only specified options are changed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sources
|
list[str] | None
|
Source mount points or block devices |
None
|
policy_type
|
str | None
|
GC policy type (ALL, COUNT, AGE, TIMELINE) |
None
|
calendarspec
|
str | None
|
Calendar event expression for scheduling |
None
|
size_policy
|
str | None
|
Default size policy for sources |
None
|
bootable
|
bool | None
|
Whether to create boot entries for snapsets |
None
|
revert
|
bool | None
|
Whether to create revert entries for snapsets |
None
|
**keep_options
|
str
|
Retention kwargs matching the GC policy |
{}
|
Source code in sts_libs/src/sts/snapm/schedule.py
274 275 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 313 314 315 316 317 318 319 320 321 322 323 324 325 326 | |
enable(*, start=False)
¶
Enable a schedule.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
start
|
bool
|
Whether to start the schedule immediately |
False
|
Source code in sts_libs/src/sts/snapm/schedule.py
328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 | |
gc(schedule_name=None)
¶
Run garbage collection, deleting snapsets according to policy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
schedule_name
|
str | None
|
Schedule name (uses self.name if not provided) |
None
|
Source code in sts_libs/src/sts/snapm/schedule.py
360 361 362 363 364 365 366 367 368 369 370 371 372 | |
get_all()
classmethod
¶
Get all schedules with their reports populated.
Source code in sts_libs/src/sts/snapm/schedule.py
406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 | |
list_items(*, fields=None, json_output=False)
¶
List all schedules.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fields
|
str | None
|
Comma-separated list of fields to display |
None
|
json_output
|
bool
|
Whether to output in JSON format |
False
|
Source code in sts_libs/src/sts/snapm/schedule.py
374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 | |
refresh_report()
¶
Refresh schedule information from show and list commands.
Source code in sts_libs/src/sts/snapm/schedule.py
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 | |
show(*, json_output=True)
¶
Show detailed schedule information.
Source code in sts_libs/src/sts/snapm/schedule.py
391 392 393 394 395 396 397 398 399 400 401 402 403 404 | |
ScheduleInfo
pydantic-model
¶
Bases: ReportModel
Schedule information parsed from snapm schedule show output.
Show JSON schema:
{
"$defs": {
"GcPolicyInfo": {
"description": "Garbage collection policy information.\n\nRetention fields are policy-specific: ``keep_count`` for COUNT,\n``keep_years/months/weeks/days`` for AGE, and\n``keep_yearly/quarterly/monthly/weekly/daily/hourly`` for TIMELINE.",
"properties": {
"policy_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Policy Name"
},
"policy_type": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Policy Type"
},
"keep_count": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Keep Count"
},
"keep_years": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Keep Years"
},
"keep_months": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Keep Months"
},
"keep_weeks": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Keep Weeks"
},
"keep_days": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Keep Days"
},
"keep_yearly": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Keep Yearly"
},
"keep_quarterly": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Keep Quarterly"
},
"keep_monthly": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Keep Monthly"
},
"keep_weekly": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Keep Weekly"
},
"keep_daily": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Keep Daily"
},
"keep_hourly": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Keep Hourly"
}
},
"title": "GcPolicyInfo",
"type": "object"
}
},
"description": "Schedule information parsed from ``snapm schedule show`` output.",
"properties": {
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Name"
},
"sources": {
"items": {
"type": "string"
},
"title": "Sources",
"type": "array"
},
"default_size_policy": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Default Size Policy"
},
"autoindex": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Autoindex"
},
"calendarspec": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Calendarspec"
},
"boot": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Boot"
},
"revert": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Revert"
},
"gc_policy": {
"anyOf": [
{
"$ref": "#/$defs/GcPolicyInfo"
},
{
"type": "null"
}
],
"default": null
},
"enabled": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Enabled"
},
"running": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Running"
},
"next_elapse": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Next Elapse"
}
},
"title": "ScheduleInfo",
"type": "object"
}
Fields:
-
name(str | None) -
sources(list[str]) -
default_size_policy(str | None) -
autoindex(bool | None) -
calendarspec(str | None) -
boot(bool | None) -
revert(bool | None) -
gc_policy(GcPolicyInfo | None) -
enabled(bool | None) -
running(bool | None) -
next_elapse(str | None)
Source code in sts_libs/src/sts/snapm/schedule.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 | |
sts.snapm.snapset
¶
Snapshot set management.
Snapset
pydantic-model
¶
Bases: SnapmBase
Snapset management.
A Snapset is a collection of snapshots across multiple filesystems.
Show JSON schema:
{
"$defs": {
"SnapsetInfo": {
"description": "Snapset information parsed from ``snapm snapset show`` output.",
"properties": {
"SnapsetName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Snapsetname"
},
"Sources": {
"items": {
"type": "string"
},
"title": "Sources",
"type": "array"
},
"MountPoints": {
"items": {
"type": "string"
},
"title": "Mountpoints",
"type": "array"
},
"Devices": {
"items": {
"type": "string"
},
"title": "Devices",
"type": "array"
},
"NrSnapshots": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Nrsnapshots"
},
"Timestamp": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Timestamp"
},
"Time": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Time"
},
"UUID": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Uuid"
},
"Status": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Status"
},
"Autoactivate": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Autoactivate"
},
"Bootable": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Bootable"
},
"BootEntries": {
"additionalProperties": {
"type": "string"
},
"title": "Bootentries",
"type": "object"
},
"Snapshots": {
"items": {
"$ref": "#/$defs/SnapshotInfo"
},
"title": "Snapshots",
"type": "array"
}
},
"title": "SnapsetInfo",
"type": "object"
},
"SnapshotInfo": {
"description": "Snapshot information parsed from ``snapm snapshot show`` output.",
"properties": {
"Name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Name"
},
"SnapsetName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Snapsetname"
},
"Origin": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Origin"
},
"Timestamp": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Timestamp"
},
"Time": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Time"
},
"Source": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Source"
},
"MountPoint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Mountpoint"
},
"Provider": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Provider"
},
"UUID": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Uuid"
},
"Status": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Status"
},
"Size": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Size"
},
"Free": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Free"
},
"SizeBytes": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Sizebytes"
},
"FreeBytes": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Freebytes"
},
"Autoactivate": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Autoactivate"
},
"DevicePath": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Devicepath"
}
},
"title": "SnapshotInfo",
"type": "object"
}
},
"additionalProperties": false,
"description": "Snapset management.\n\nA Snapset is a collection of snapshots across multiple filesystems.",
"properties": {
"debugopts": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Debugopts"
},
"verbose": {
"default": false,
"title": "Verbose",
"type": "boolean"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Name"
},
"uuid": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Uuid"
},
"report": {
"anyOf": [
{
"$ref": "#/$defs/SnapsetInfo"
},
{
"type": "null"
}
],
"default": null
}
},
"title": "Snapset",
"type": "object"
}
Fields:
-
debugopts(list[str] | None) -
verbose(bool) -
name(str | None) -
uuid(str | None) -
report(SnapsetInfo | None)
Source code in sts_libs/src/sts/snapm/snapset.py
45 46 47 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 85 86 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 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 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 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 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 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 | |
activate()
¶
Activate a snapset.
Source code in sts_libs/src/sts/snapm/snapset.py
272 273 274 | |
autoactivate(*, enable=True)
¶
Enable or disable auto-activation for a snapset.
Source code in sts_libs/src/sts/snapm/snapset.py
280 281 282 283 284 285 286 287 288 289 290 | |
create(snapset_name=None, sources=None, size_policy=None, *, bootable=False, revert=False, autoindex=False)
¶
Create a snapset.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
snapset_name
|
str | None
|
Snapset name (uses self.name if not provided) |
None
|
sources
|
list[str] | None
|
Source paths, optionally with size policy (e.g. |
None
|
size_policy
|
str | None
|
Default size policy for all sources (e.g. "50%FREE", "2G") |
None
|
bootable
|
bool
|
Whether to create a boot entry for this snapset |
False
|
revert
|
bool
|
Whether to create a revert entry for this snapset |
False
|
autoindex
|
bool
|
Treat name as basename and append a unique index |
False
|
Raises:
| Type | Description |
|---|---|
SnapmError
|
If the snapset name or sources are missing. |
Source code in sts_libs/src/sts/snapm/snapset.py
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 | |
create_scheduled(schedule_name)
¶
Create snapset from a schedule configuration.
Does not call .assert_ok() internally -- callers should check
result.failed or call .assert_ok() themselves.
Raises:
| Type | Description |
|---|---|
SnapmError
|
If schedule_name is missing. |
Source code in sts_libs/src/sts/snapm/snapset.py
210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 | |
deactivate()
¶
Deactivate a snapset.
Source code in sts_libs/src/sts/snapm/snapset.py
276 277 278 | |
delete()
¶
Delete a snapset and all associated snapshots.
Source code in sts_libs/src/sts/snapm/snapset.py
226 227 228 | |
diff(*args, **kwargs)
¶
Compare two snapshot sets or a snapshot set and the running system.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*args
|
str
|
'from' and 'to' targets (snapset name or '.' for running system) |
()
|
**kwargs
|
str | None
|
CLI options (underscores become dashes). Key options:
|
{}
|
Example
result = snapset.diff('before-upgrade', '.', output_format='tree')
Source code in sts_libs/src/sts/snapm/snapset.py
504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 | |
diffreport(*args, **kwargs)
¶
Compare snapshot sets and output results in a tabular report.
Same comparison as diff but formatted as a report with standard columns.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*args
|
str
|
'from' and 'to' targets |
()
|
**kwargs
|
str | None
|
All diff options plus report options
( |
{}
|
Source code in sts_libs/src/sts/snapm/snapset.py
529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 | |
exec_cmd(*args, **kwargs)
¶
Execute a command inside the mounted snapshot set.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*args
|
str
|
Snapset name (if not set on instance) followed by command and its args. |
()
|
Source code in sts_libs/src/sts/snapm/snapset.py
467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 | |
get_all()
classmethod
¶
Get all snapsets with their reports populated.
Source code in sts_libs/src/sts/snapm/snapset.py
375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 | |
get_snapshots()
¶
Get all snapshots in this snapset, refreshing the report first.
Source code in sts_libs/src/sts/snapm/snapset.py
423 424 425 426 427 428 429 430 431 432 433 | |
list_items(*, fields=None, json_output=False)
¶
List snapsets, optionally filtered by stored name/UUID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fields
|
str | None
|
Comma-separated list of fields to display |
None
|
json_output
|
bool
|
Whether to output in JSON format |
False
|
Source code in sts_libs/src/sts/snapm/snapset.py
292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 | |
mount(*args, **kwargs)
¶
Mount the members of a snapshot set at /run/snapm/mounts/<name>.
Source code in sts_libs/src/sts/snapm/snapset.py
435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 | |
prune(sources=None)
¶
Remove sources (and their snapshots) from the snapset. Cannot be undone.
Source code in sts_libs/src/sts/snapm/snapset.py
339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 | |
refresh_report()
¶
Refresh snapset information from show command.
Source code in sts_libs/src/sts/snapm/snapset.py
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 | |
rename(new_name)
¶
Rename a snapset.
Raises:
| Type | Description |
|---|---|
SnapmError
|
If the current snapset name is missing. |
Source code in sts_libs/src/sts/snapm/snapset.py
230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 | |
resize(sources=None, size_policy=None)
¶
Resize snapset.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sources
|
list[str] | None
|
Sources with optional size policies (e.g. |
None
|
size_policy
|
str | None
|
Default size policy to apply (e.g. "25%FREE") |
None
|
Source code in sts_libs/src/sts/snapm/snapset.py
253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 | |
revert()
¶
Revert to the state captured in the snapset. May require reboot.
Source code in sts_libs/src/sts/snapm/snapset.py
249 250 251 | |
shell(*args, **kwargs)
¶
Start an interactive shell in the mounted snapshot set.
Source code in sts_libs/src/sts/snapm/snapset.py
488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 | |
show(*, include_members=True, json_output=True)
¶
Show detailed snapset information.
Source code in sts_libs/src/sts/snapm/snapset.py
317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 | |
split(new_name=None, sources=None)
¶
Move specified sources into a new snapset, keeping the rest here.
Source code in sts_libs/src/sts/snapm/snapset.py
355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 | |
umount(*args, **kwargs)
¶
Unmount the members of a snapshot set.
Source code in sts_libs/src/sts/snapm/snapset.py
451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 | |
SnapsetInfo
pydantic-model
¶
Bases: ReportModel
Snapset information parsed from snapm snapset show output.
Show JSON schema:
{
"$defs": {
"SnapshotInfo": {
"description": "Snapshot information parsed from ``snapm snapshot show`` output.",
"properties": {
"Name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Name"
},
"SnapsetName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Snapsetname"
},
"Origin": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Origin"
},
"Timestamp": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Timestamp"
},
"Time": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Time"
},
"Source": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Source"
},
"MountPoint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Mountpoint"
},
"Provider": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Provider"
},
"UUID": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Uuid"
},
"Status": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Status"
},
"Size": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Size"
},
"Free": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Free"
},
"SizeBytes": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Sizebytes"
},
"FreeBytes": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Freebytes"
},
"Autoactivate": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Autoactivate"
},
"DevicePath": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Devicepath"
}
},
"title": "SnapshotInfo",
"type": "object"
}
},
"description": "Snapset information parsed from ``snapm snapset show`` output.",
"properties": {
"SnapsetName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Snapsetname"
},
"Sources": {
"items": {
"type": "string"
},
"title": "Sources",
"type": "array"
},
"MountPoints": {
"items": {
"type": "string"
},
"title": "Mountpoints",
"type": "array"
},
"Devices": {
"items": {
"type": "string"
},
"title": "Devices",
"type": "array"
},
"NrSnapshots": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Nrsnapshots"
},
"Timestamp": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Timestamp"
},
"Time": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Time"
},
"UUID": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Uuid"
},
"Status": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Status"
},
"Autoactivate": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Autoactivate"
},
"Bootable": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Bootable"
},
"BootEntries": {
"additionalProperties": {
"type": "string"
},
"title": "Bootentries",
"type": "object"
},
"Snapshots": {
"items": {
"$ref": "#/$defs/SnapshotInfo"
},
"title": "Snapshots",
"type": "array"
}
},
"title": "SnapsetInfo",
"type": "object"
}
Config:
populate_by_name:True
Fields:
-
name(str | None) -
sources(list[str]) -
mount_points(list[str]) -
devices(list[str]) -
snapshot_count(int | None) -
timestamp(int | None) -
time(str | None) -
uuid(str | None) -
status(str | None) -
autoactivate(bool | None) -
bootable(bool | None) -
boot_entries(dict[str, str]) -
snapshots(list[SnapshotInfo])
Source code in sts_libs/src/sts/snapm/snapset.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | |
sts.snapm.snapshot
¶
Individual snapshot management.
Snapshot
pydantic-model
¶
Bases: SnapmBase
Snapshot management.
A Snapshot is a point-in-time copy of a filesystem.
Show JSON schema:
{
"$defs": {
"SnapshotInfo": {
"description": "Snapshot information parsed from ``snapm snapshot show`` output.",
"properties": {
"Name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Name"
},
"SnapsetName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Snapsetname"
},
"Origin": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Origin"
},
"Timestamp": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Timestamp"
},
"Time": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Time"
},
"Source": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Source"
},
"MountPoint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Mountpoint"
},
"Provider": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Provider"
},
"UUID": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Uuid"
},
"Status": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Status"
},
"Size": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Size"
},
"Free": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Free"
},
"SizeBytes": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Sizebytes"
},
"FreeBytes": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Freebytes"
},
"Autoactivate": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Autoactivate"
},
"DevicePath": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Devicepath"
}
},
"title": "SnapshotInfo",
"type": "object"
}
},
"additionalProperties": false,
"description": "Snapshot management.\n\nA Snapshot is a point-in-time copy of a filesystem.",
"properties": {
"debugopts": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Debugopts"
},
"verbose": {
"default": false,
"title": "Verbose",
"type": "boolean"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Name"
},
"uuid": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Uuid"
},
"snapset_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Snapset Name"
},
"snapset_uuid": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Snapset Uuid"
},
"report": {
"anyOf": [
{
"$ref": "#/$defs/SnapshotInfo"
},
{
"type": "null"
}
],
"default": null
}
},
"title": "Snapshot",
"type": "object"
}
Fields:
-
debugopts(list[str] | None) -
verbose(bool) -
name(str | None) -
uuid(str | None) -
snapset_name(str | None) -
snapset_uuid(str | None) -
report(SnapshotInfo | None)
Source code in sts_libs/src/sts/snapm/snapshot.py
47 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 85 86 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 | |
activate()
¶
Activate a snapshot.
Source code in sts_libs/src/sts/snapm/snapshot.py
146 147 148 | |
autoactivate(*, enable=True)
¶
Enable or disable auto-activation for a snapshot.
Source code in sts_libs/src/sts/snapm/snapshot.py
154 155 156 157 158 159 160 161 162 163 164 | |
deactivate()
¶
Deactivate a snapshot.
Source code in sts_libs/src/sts/snapm/snapshot.py
150 151 152 | |
list_items(fields=None, *, json_output=False)
¶
List snapshots, optionally filtered by stored identifiers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fields
|
str | None
|
Comma-separated list of fields to display |
None
|
json_output
|
bool
|
Whether to output in JSON format |
False
|
Source code in sts_libs/src/sts/snapm/snapshot.py
166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | |
refresh_report()
¶
Refresh snapshot information from show command.
Source code in sts_libs/src/sts/snapm/snapshot.py
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 | |
show(*, json_output=True)
¶
Show detailed snapshot information.
Source code in sts_libs/src/sts/snapm/snapshot.py
189 190 191 192 193 194 195 196 197 198 199 200 201 202 | |
SnapshotInfo
pydantic-model
¶
Bases: ReportModel
Snapshot information parsed from snapm snapshot show output.
Show JSON schema:
{
"description": "Snapshot information parsed from ``snapm snapshot show`` output.",
"properties": {
"Name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Name"
},
"SnapsetName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Snapsetname"
},
"Origin": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Origin"
},
"Timestamp": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Timestamp"
},
"Time": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Time"
},
"Source": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Source"
},
"MountPoint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Mountpoint"
},
"Provider": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Provider"
},
"UUID": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Uuid"
},
"Status": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Status"
},
"Size": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Size"
},
"Free": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Free"
},
"SizeBytes": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Sizebytes"
},
"FreeBytes": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Freebytes"
},
"Autoactivate": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Autoactivate"
},
"DevicePath": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Devicepath"
}
},
"title": "SnapshotInfo",
"type": "object"
}
Config:
populate_by_name:True
Fields:
-
name(str | None) -
snapset_name(str | None) -
origin(str | None) -
timestamp(int | None) -
time(str | None) -
source(str | None) -
mount_point(str | None) -
provider(str | None) -
uuid(str | None) -
status(str | None) -
size(str | None) -
free(str | None) -
size_bytes(int | None) -
free_bytes(int | None) -
autoactivate(bool | None) -
device_path(str | None)
Source code in sts_libs/src/sts/snapm/snapshot.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | |