flayer.providers.yandex¶
flayer.providers.yandex ¶
Read-only Yandex Cloud CLI adapter with bounded commands and sanitized failures.
RESOURCE_COMMANDS
module-attribute
¶
RESOURCE_COMMANDS: dict[ResourceKind, tuple[str, str]] = {ResourceKind.INSTANCE: ('compute', 'instance'), ResourceKind.DISK: ('compute', 'disk'), ResourceKind.NETWORK: ('vpc', 'network'), ResourceKind.SUBNET: ('vpc', 'subnet'), ResourceKind.ADDRESS: ('vpc', 'address'), ResourceKind.SECURITY_GROUP: ('vpc', 'security-group')}
ERROR_MARKERS
module-attribute
¶
ERROR_MARKERS: tuple[tuple[ProviderErrorCode, tuple[str, ...]], ...] = ((ProviderErrorCode.AUTHENTICATION, ('unauthenticated', 'invalid token', 'token expired')), (ProviderErrorCode.PERMISSION_DENIED, ('permissiondenied', 'permission_denied', 'forbidden')), (ProviderErrorCode.NOT_FOUND, ('notfound', 'not_found', 'not found')), (ProviderErrorCode.TIMEOUT, ('deadlineexceeded', 'deadline_exceeded', 'timed out')), (ProviderErrorCode.THROTTLED, ('resourceexhausted', 'resource_exhausted', 'too many requests')), (ProviderErrorCode.CONFLICT, ('alreadyexists', 'already_exists', 'conflict')))
YandexCloudSettings
dataclass
¶
YandexCloudSettings(folder_id: str, profile: str = 'default', executable: str = 'yc', command_timeout: float = 45.0, inventory_limit: int = 10000)
Explicit folder/profile configuration with no stored tokens or secret keys.
CommandResult
dataclass
¶
CommandResult(return_code: int, stdout: str = '', stderr: str = '')
An ephemeral command result whose representation omits potentially secret output.
CommandRunner ¶
Bases: Protocol
Injectable execution boundary for deterministic tests and alternative transports.
Run ¶
Run(command: tuple[str, ...], timeout: float) -> CommandResult
Execute one argument vector without modifying its order or scope.
Source code in installed/flayer/providers/yandex.py
96 97 98 99 | |
SubprocessCommandRunner ¶
Execute the configured CLI directly without a shell or interactive standard input.
Run ¶
Run(command: tuple[str, ...], timeout: float) -> CommandResult
Capture output transiently while enforcing a per-command timeout.
Source code in installed/flayer/providers/yandex.py
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 | |
YandexCloudProvider ¶
YandexCloudProvider(settings: YandexCloudSettings, runner: CommandRunner | None = None)
Normalize CLI inventory inside one folder; expose no cloud mutation methods.
Construct a provider without executing commands or reading credential files.
Source code in installed/flayer/providers/yandex.py
126 127 128 129 130 131 132 133 | |
Identity
property
¶
Identity: ProviderIdentity
Return the non-secret identity used to validate all resources and references.
Capabilities
property
¶
Capabilities: frozenset[ProviderCapability]
Declare implemented read operations without inferring lifecycle capability.
CheckAvailability ¶
CheckAvailability() -> ProviderStatus
Check CLI execution locally; no token, profile or infrastructure read occurs.
Source code in installed/flayer/providers/yandex.py
147 148 149 150 151 152 153 154 155 156 | |
CheckAuthentication ¶
CheckAuthentication() -> ProviderStatus
Verify access to the selected folder through the CLI's existing credentials.
Source code in installed/flayer/providers/yandex.py
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 | |
ListResources ¶
ListResources(kind: ResourceKind) -> tuple[ProviderResource, ...]
Read one resource kind, rejecting malformed or possibly truncated inventory.
Source code in installed/flayer/providers/yandex.py
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 | |
GetResource ¶
GetResource(reference: ResourceReference) -> ProviderResource
Read by ID and revalidate returned scope because vendor ID lookup is global.
Source code in installed/flayer/providers/yandex.py
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 | |
DiscoverInventory ¶
DiscoverInventory() -> tuple[ProviderResource, ...]
Return a deterministic complete inventory, never a partial success snapshot.
Source code in installed/flayer/providers/yandex.py
216 217 218 219 220 221 222 223 224 | |