flayer.providers.yandex_lifecycle¶
flayer.providers.yandex_lifecycle ¶
Bounded Yandex mutations with explicit ownership and recoverable uncertain outcomes.
RESOURCE_NAME_PATTERN
module-attribute
¶
RESOURCE_NAME_PATTERN = re.compile('[a-z](?:[a-z0-9-]{0,61}[a-z0-9])?\\Z')
REQUIRED_PARAMETERS
module-attribute
¶
REQUIRED_PARAMETERS: dict[ResourceKind, frozenset[str]] = {ResourceKind.NETWORK: frozenset(), ResourceKind.SUBNET: frozenset({'zone_id', 'ipv4_cidr', 'network_dependency'}), ResourceKind.SECURITY_GROUP: frozenset({'network_dependency', 'rules'}), ResourceKind.ADDRESS: frozenset({'zone_id'}), ResourceKind.DISK: frozenset({'zone_id', 'image_id', 'size_gib'}), ResourceKind.INSTANCE: frozenset({'zone_id', 'cores', 'memory_gib', 'boot_disk_dependency', 'subnet_dependency', 'security_group_dependency', 'address_dependency', 'ssh_public_key'})}
OPTIONAL_PARAMETERS
module-attribute
¶
OPTIONAL_PARAMETERS: dict[ResourceKind, frozenset[str]] = {ResourceKind.NETWORK: frozenset(), ResourceKind.SUBNET: frozenset(), ResourceKind.SECURITY_GROUP: frozenset(), ResourceKind.ADDRESS: frozenset(), ResourceKind.DISK: frozenset({'type'}), ResourceKind.INSTANCE: frozenset({'ssh_username', 'user_data_file', 'user_data_sha256', 'platform_id', 'core_fraction'})}
DEPENDENCY_KINDS
module-attribute
¶
DEPENDENCY_KINDS = {'network_dependency': ResourceKind.NETWORK, 'boot_disk_dependency': ResourceKind.DISK, 'subnet_dependency': ResourceKind.SUBNET, 'security_group_dependency': ResourceKind.SECURITY_GROUP, 'address_dependency': ResourceKind.ADDRESS}
KNOWN_STATUSES
module-attribute
¶
KNOWN_STATUSES = frozenset({'UNKNOWN', 'ACTIVE', 'CREATING', 'PROVISIONING', 'READY', 'RUNNING', 'STARTING', 'STOPPING', 'STOPPED', 'RESTARTING', 'UPDATING', 'DELETING', 'ERROR', 'FAILED'})
USER_DATA_FIELDS
module-attribute
¶
USER_DATA_FIELDS = frozenset({'ssh_pwauth', 'disable_root', 'users', 'package_update', 'package_upgrade', 'packages', 'write_files', 'runcmd'})
YandexLifecycleProvider ¶
YandexLifecycleProvider(settings: YandexCloudSettings, runner: CommandRunner | None = None)
Bases: YandexCloudProvider
Create and delete an explicit six-kind subset using existing read-only observation.
Source code in installed/flayer/providers/yandex.py
127 128 129 130 131 132 133 134 | |
Capabilities
property
¶
Capabilities: frozenset[ProviderCapability]
Advertise implemented mutations without promising credentials or account permission.
ValidateSpec ¶
ValidateSpec(spec: ResourceSpec) -> None
Validate the complete supported option/dependency subset without cloud access.
Source code in installed/flayer/providers/yandex_lifecycle.py
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 | |
GetResource ¶
GetResource(reference: ResourceReference) -> ProviderResource
Use the scoped base adapter while restricting observed lifecycle fields.
Source code in installed/flayer/providers/yandex_lifecycle.py
369 370 371 372 | |
FindResource ¶
FindResource(spec: ResourceSpec, identity: StackIdentity) -> ProviderResource | None
Reconcile exact logical ownership; duplicates and changed desired content conflict.
Source code in installed/flayer/providers/yandex_lifecycle.py
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 | |
CreateResource ¶
CreateResource(spec: ResourceSpec, identity: StackIdentity, dependencies: Mapping[str, ProviderResource], operation_id: str) -> ProviderResource
Create once with stable ownership labels and an explicit, separately owned boot disk.
Source code in installed/flayer/providers/yandex_lifecycle.py
632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 | |
DeleteResource ¶
DeleteResource(reference: ResourceReference, identity: StackIdentity, logical_id: str, operation_id: str | None = None) -> None
Observe and verify ownership before exact-ID deletion, then confirm absence once.
Source code in installed/flayer/providers/yandex_lifecycle.py
739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 | |
ValidateComputeShape ¶
ValidateComputeShape(options: Mapping[str, JsonValue]) -> None
Validate the supported Intel shapes without consulting a cloud account.
Source code in installed/flayer/providers/yandex_lifecycle.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 | |