@flui-cloud/cli 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +661 -0
- package/README.md +124 -0
- package/bin/run +17 -0
- package/lib/cli/src/background/cluster-worker.d.ts +11 -0
- package/lib/cli/src/background/cluster-worker.js +90 -0
- package/lib/cli/src/cli-providers.module.d.ts +2 -0
- package/lib/cli/src/cli-providers.module.js +118 -0
- package/lib/cli/src/cli.module.d.ts +13 -0
- package/lib/cli/src/cli.module.js +80 -0
- package/lib/cli/src/commands/_diag-oidc.d.ts +6 -0
- package/lib/cli/src/commands/_diag-oidc.js +132 -0
- package/lib/cli/src/commands/app/backup/create.d.ts +20 -0
- package/lib/cli/src/commands/app/backup/create.js +128 -0
- package/lib/cli/src/commands/app/backup/delete.d.ts +19 -0
- package/lib/cli/src/commands/app/backup/delete.js +95 -0
- package/lib/cli/src/commands/app/build.d.ts +17 -0
- package/lib/cli/src/commands/app/build.js +133 -0
- package/lib/cli/src/commands/app/builds.d.ts +14 -0
- package/lib/cli/src/commands/app/builds.js +82 -0
- package/lib/cli/src/commands/app/crash.d.ts +16 -0
- package/lib/cli/src/commands/app/crash.js +106 -0
- package/lib/cli/src/commands/app/crashes.d.ts +15 -0
- package/lib/cli/src/commands/app/crashes.js +99 -0
- package/lib/cli/src/commands/app/delete.d.ts +16 -0
- package/lib/cli/src/commands/app/delete.js +149 -0
- package/lib/cli/src/commands/app/image/delete.d.ts +18 -0
- package/lib/cli/src/commands/app/image/delete.js +72 -0
- package/lib/cli/src/commands/app/init.d.ts +40 -0
- package/lib/cli/src/commands/app/init.js +436 -0
- package/lib/cli/src/commands/app/list.d.ts +11 -0
- package/lib/cli/src/commands/app/list.js +84 -0
- package/lib/cli/src/commands/app/logs.d.ts +18 -0
- package/lib/cli/src/commands/app/logs.js +121 -0
- package/lib/cli/src/commands/app/metrics.d.ts +17 -0
- package/lib/cli/src/commands/app/metrics.js +100 -0
- package/lib/cli/src/commands/app/redeploy.d.ts +14 -0
- package/lib/cli/src/commands/app/redeploy.js +60 -0
- package/lib/cli/src/commands/app/releases.d.ts +15 -0
- package/lib/cli/src/commands/app/releases.js +117 -0
- package/lib/cli/src/commands/app/restart.d.ts +12 -0
- package/lib/cli/src/commands/app/restart.js +44 -0
- package/lib/cli/src/commands/app/scale.d.ts +13 -0
- package/lib/cli/src/commands/app/scale.js +58 -0
- package/lib/cli/src/commands/app/snapshot/create.d.ts +14 -0
- package/lib/cli/src/commands/app/snapshot/create.js +85 -0
- package/lib/cli/src/commands/app/snapshot/delete.d.ts +14 -0
- package/lib/cli/src/commands/app/snapshot/delete.js +63 -0
- package/lib/cli/src/commands/app/snapshot/list.d.ts +11 -0
- package/lib/cli/src/commands/app/snapshot/list.js +82 -0
- package/lib/cli/src/commands/app/snapshot/restore.d.ts +15 -0
- package/lib/cli/src/commands/app/snapshot/restore.js +74 -0
- package/lib/cli/src/commands/app/snapshot/swap.d.ts +15 -0
- package/lib/cli/src/commands/app/snapshot/swap.js +68 -0
- package/lib/cli/src/commands/app/start.d.ts +12 -0
- package/lib/cli/src/commands/app/start.js +45 -0
- package/lib/cli/src/commands/app/status.d.ts +15 -0
- package/lib/cli/src/commands/app/status.js +108 -0
- package/lib/cli/src/commands/app/stop.d.ts +12 -0
- package/lib/cli/src/commands/app/stop.js +45 -0
- package/lib/cli/src/commands/app/versions.d.ts +14 -0
- package/lib/cli/src/commands/app/versions.js +80 -0
- package/lib/cli/src/commands/auth/generate-api-key.d.ts +12 -0
- package/lib/cli/src/commands/auth/generate-api-key.js +90 -0
- package/lib/cli/src/commands/auth/login.d.ts +11 -0
- package/lib/cli/src/commands/auth/login.js +296 -0
- package/lib/cli/src/commands/auth/reset-password.d.ts +15 -0
- package/lib/cli/src/commands/auth/reset-password.js +253 -0
- package/lib/cli/src/commands/backup/destination/create.d.ts +22 -0
- package/lib/cli/src/commands/backup/destination/create.js +102 -0
- package/lib/cli/src/commands/backup/destination/delete.d.ts +11 -0
- package/lib/cli/src/commands/backup/destination/delete.js +46 -0
- package/lib/cli/src/commands/backup/destination/list.d.ts +9 -0
- package/lib/cli/src/commands/backup/destination/list.js +42 -0
- package/lib/cli/src/commands/backup/destination/show.d.ts +11 -0
- package/lib/cli/src/commands/backup/destination/show.js +45 -0
- package/lib/cli/src/commands/backup/destination/test.d.ts +8 -0
- package/lib/cli/src/commands/backup/destination/test.js +39 -0
- package/lib/cli/src/commands/backup/job/list.d.ts +9 -0
- package/lib/cli/src/commands/backup/job/list.js +38 -0
- package/lib/cli/src/commands/backup/job/run.d.ts +8 -0
- package/lib/cli/src/commands/backup/job/run.js +32 -0
- package/lib/cli/src/commands/backup/job/show.d.ts +11 -0
- package/lib/cli/src/commands/backup/job/show.js +38 -0
- package/lib/cli/src/commands/backup/policy/create.d.ts +21 -0
- package/lib/cli/src/commands/backup/policy/create.js +97 -0
- package/lib/cli/src/commands/backup/policy/delete.d.ts +11 -0
- package/lib/cli/src/commands/backup/policy/delete.js +42 -0
- package/lib/cli/src/commands/backup/policy/list.d.ts +9 -0
- package/lib/cli/src/commands/backup/policy/list.js +40 -0
- package/lib/cli/src/commands/backup/policy/show.d.ts +11 -0
- package/lib/cli/src/commands/backup/policy/show.js +45 -0
- package/lib/cli/src/commands/backup/restore/create.d.ts +14 -0
- package/lib/cli/src/commands/backup/restore/create.js +68 -0
- package/lib/cli/src/commands/backup/restore/list.d.ts +8 -0
- package/lib/cli/src/commands/backup/restore/list.js +33 -0
- package/lib/cli/src/commands/backup/restore/preview.d.ts +9 -0
- package/lib/cli/src/commands/backup/restore/preview.js +29 -0
- package/lib/cli/src/commands/backup/restore/show.d.ts +11 -0
- package/lib/cli/src/commands/backup/restore/show.js +40 -0
- package/lib/cli/src/commands/catalog/validate.d.ts +14 -0
- package/lib/cli/src/commands/catalog/validate.js +155 -0
- package/lib/cli/src/commands/cluster/destroy.d.ts +15 -0
- package/lib/cli/src/commands/cluster/destroy.js +137 -0
- package/lib/cli/src/commands/config/get.d.ts +9 -0
- package/lib/cli/src/commands/config/get.js +47 -0
- package/lib/cli/src/commands/config/list.d.ts +15 -0
- package/lib/cli/src/commands/config/list.js +109 -0
- package/lib/cli/src/commands/config/remove.d.ts +12 -0
- package/lib/cli/src/commands/config/remove.js +92 -0
- package/lib/cli/src/commands/config/set.d.ts +15 -0
- package/lib/cli/src/commands/config/set.js +152 -0
- package/lib/cli/src/commands/config/show.d.ts +6 -0
- package/lib/cli/src/commands/config/show.js +15 -0
- package/lib/cli/src/commands/context/create.d.ts +12 -0
- package/lib/cli/src/commands/context/create.js +46 -0
- package/lib/cli/src/commands/context/delete.d.ts +12 -0
- package/lib/cli/src/commands/context/delete.js +53 -0
- package/lib/cli/src/commands/context/list.d.ts +6 -0
- package/lib/cli/src/commands/context/list.js +29 -0
- package/lib/cli/src/commands/context/show.d.ts +6 -0
- package/lib/cli/src/commands/context/show.js +12 -0
- package/lib/cli/src/commands/context/use.d.ts +9 -0
- package/lib/cli/src/commands/context/use.js +30 -0
- package/lib/cli/src/commands/deploy.d.ts +49 -0
- package/lib/cli/src/commands/deploy.js +542 -0
- package/lib/cli/src/commands/dev/creds.d.ts +19 -0
- package/lib/cli/src/commands/dev/creds.js +290 -0
- package/lib/cli/src/commands/dev/tunnel.d.ts +15 -0
- package/lib/cli/src/commands/dev/tunnel.js +268 -0
- package/lib/cli/src/commands/dns/cleanup.d.ts +11 -0
- package/lib/cli/src/commands/dns/cleanup.js +93 -0
- package/lib/cli/src/commands/env/capacity.d.ts +12 -0
- package/lib/cli/src/commands/env/capacity.js +177 -0
- package/lib/cli/src/commands/env/create.d.ts +21 -0
- package/lib/cli/src/commands/env/create.js +721 -0
- package/lib/cli/src/commands/env/credentials.d.ts +21 -0
- package/lib/cli/src/commands/env/credentials.js +435 -0
- package/lib/cli/src/commands/env/destroy.d.ts +9 -0
- package/lib/cli/src/commands/env/destroy.js +145 -0
- package/lib/cli/src/commands/env/diag-ca.d.ts +14 -0
- package/lib/cli/src/commands/env/diag-ca.js +192 -0
- package/lib/cli/src/commands/env/export-config.d.ts +39 -0
- package/lib/cli/src/commands/env/export-config.js +386 -0
- package/lib/cli/src/commands/env/force-ready.d.ts +10 -0
- package/lib/cli/src/commands/env/force-ready.js +222 -0
- package/lib/cli/src/commands/env/inspect.d.ts +12 -0
- package/lib/cli/src/commands/env/inspect.js +192 -0
- package/lib/cli/src/commands/env/kubectl.d.ts +9 -0
- package/lib/cli/src/commands/env/kubectl.js +33 -0
- package/lib/cli/src/commands/env/logs.d.ts +12 -0
- package/lib/cli/src/commands/env/logs.js +136 -0
- package/lib/cli/src/commands/env/orphan-volumes.d.ts +11 -0
- package/lib/cli/src/commands/env/orphan-volumes.js +153 -0
- package/lib/cli/src/commands/env/refresh-kubeconfig.d.ts +6 -0
- package/lib/cli/src/commands/env/refresh-kubeconfig.js +66 -0
- package/lib/cli/src/commands/env/repair-ssh-ca.d.ts +11 -0
- package/lib/cli/src/commands/env/repair-ssh-ca.js +137 -0
- package/lib/cli/src/commands/env/restart.d.ts +10 -0
- package/lib/cli/src/commands/env/restart.js +187 -0
- package/lib/cli/src/commands/env/scale-master.d.ts +11 -0
- package/lib/cli/src/commands/env/scale-master.js +160 -0
- package/lib/cli/src/commands/env/scale-node.d.ts +14 -0
- package/lib/cli/src/commands/env/scale-node.js +139 -0
- package/lib/cli/src/commands/env/status.d.ts +10 -0
- package/lib/cli/src/commands/env/status.js +182 -0
- package/lib/cli/src/commands/env/stop.d.ts +6 -0
- package/lib/cli/src/commands/env/stop.js +147 -0
- package/lib/cli/src/commands/env/storage-expand.d.ts +10 -0
- package/lib/cli/src/commands/env/storage-expand.js +124 -0
- package/lib/cli/src/commands/env/storage.d.ts +8 -0
- package/lib/cli/src/commands/env/storage.js +92 -0
- package/lib/cli/src/commands/env/sync.d.ts +17 -0
- package/lib/cli/src/commands/env/sync.js +225 -0
- package/lib/cli/src/commands/env/uncordon.d.ts +9 -0
- package/lib/cli/src/commands/env/uncordon.js +73 -0
- package/lib/cli/src/commands/env/update-firewall.d.ts +9 -0
- package/lib/cli/src/commands/env/update-firewall.js +185 -0
- package/lib/cli/src/commands/integration/connect.d.ts +13 -0
- package/lib/cli/src/commands/integration/connect.js +161 -0
- package/lib/cli/src/commands/integration/ghcr-pat/revoke.d.ts +9 -0
- package/lib/cli/src/commands/integration/ghcr-pat/revoke.js +61 -0
- package/lib/cli/src/commands/integration/ghcr-pat/set.d.ts +12 -0
- package/lib/cli/src/commands/integration/ghcr-pat/set.js +141 -0
- package/lib/cli/src/commands/integration/ghcr-pat/status.d.ts +6 -0
- package/lib/cli/src/commands/integration/ghcr-pat/status.js +69 -0
- package/lib/cli/src/commands/integration/installations.d.ts +6 -0
- package/lib/cli/src/commands/integration/installations.js +45 -0
- package/lib/cli/src/commands/integration/list.d.ts +8 -0
- package/lib/cli/src/commands/integration/list.js +67 -0
- package/lib/cli/src/commands/integration/remove-installation.d.ts +12 -0
- package/lib/cli/src/commands/integration/remove-installation.js +71 -0
- package/lib/cli/src/commands/integration/setup-github-app.d.ts +10 -0
- package/lib/cli/src/commands/integration/setup-github-app.js +162 -0
- package/lib/cli/src/commands/node/add.d.ts +11 -0
- package/lib/cli/src/commands/node/add.js +103 -0
- package/lib/cli/src/commands/node/list.d.ts +11 -0
- package/lib/cli/src/commands/node/list.js +83 -0
- package/lib/cli/src/commands/node/remove.d.ts +16 -0
- package/lib/cli/src/commands/node/remove.js +161 -0
- package/lib/cli/src/commands/reconcile.d.ts +19 -0
- package/lib/cli/src/commands/reconcile.js +171 -0
- package/lib/cli/src/commands/repo/connect.d.ts +12 -0
- package/lib/cli/src/commands/repo/connect.js +133 -0
- package/lib/cli/src/commands/repo/disconnect.d.ts +12 -0
- package/lib/cli/src/commands/repo/disconnect.js +73 -0
- package/lib/cli/src/commands/repo/list.d.ts +9 -0
- package/lib/cli/src/commands/repo/list.js +66 -0
- package/lib/cli/src/commands/server-types/list.d.ts +12 -0
- package/lib/cli/src/commands/server-types/list.js +205 -0
- package/lib/cli/src/commands/ssh.d.ts +9 -0
- package/lib/cli/src/commands/ssh.js +94 -0
- package/lib/cli/src/commands/standalone/install.d.ts +27 -0
- package/lib/cli/src/commands/standalone/install.js +330 -0
- package/lib/cli/src/commands/template/use.d.ts +16 -0
- package/lib/cli/src/commands/template/use.js +111 -0
- package/lib/cli/src/commands/update.d.ts +6 -0
- package/lib/cli/src/commands/update.js +87 -0
- package/lib/cli/src/config/bootstrap.config.d.ts +37 -0
- package/lib/cli/src/config/bootstrap.config.js +33 -0
- package/lib/cli/src/config/defaults.d.ts +46 -0
- package/lib/cli/src/config/defaults.js +79 -0
- package/lib/cli/src/config/key-router.d.ts +22 -0
- package/lib/cli/src/config/key-router.js +45 -0
- package/lib/cli/src/config/preferences-echo.d.ts +9 -0
- package/lib/cli/src/config/preferences-echo.js +61 -0
- package/lib/cli/src/config/preferences-resolver.d.ts +43 -0
- package/lib/cli/src/config/preferences-resolver.js +100 -0
- package/lib/cli/src/config/preferences-schema.d.ts +32 -0
- package/lib/cli/src/config/preferences-schema.js +53 -0
- package/lib/cli/src/hooks/command_not_found.d.ts +3 -0
- package/lib/cli/src/hooks/command_not_found.js +44 -0
- package/lib/cli/src/lib/api-client.d.ts +58 -0
- package/lib/cli/src/lib/api-client.js +162 -0
- package/lib/cli/src/lib/backup-client.d.ts +131 -0
- package/lib/cli/src/lib/backup-client.js +78 -0
- package/lib/cli/src/lib/browser-callback.d.ts +3 -0
- package/lib/cli/src/lib/browser-callback.js +83 -0
- package/lib/cli/src/lib/byos-precheck.d.ts +29 -0
- package/lib/cli/src/lib/byos-precheck.js +162 -0
- package/lib/cli/src/lib/ca-utils.d.ts +13 -0
- package/lib/cli/src/lib/ca-utils.js +72 -0
- package/lib/cli/src/lib/cli-credential-provider.service.d.ts +31 -0
- package/lib/cli/src/lib/cli-credential-provider.service.js +86 -0
- package/lib/cli/src/lib/config-storage.d.ts +128 -0
- package/lib/cli/src/lib/config-storage.js +349 -0
- package/lib/cli/src/lib/config.d.ts +23 -0
- package/lib/cli/src/lib/config.js +113 -0
- package/lib/cli/src/lib/context-banner.d.ts +12 -0
- package/lib/cli/src/lib/context-banner.js +25 -0
- package/lib/cli/src/lib/format-bytes.d.ts +1 -0
- package/lib/cli/src/lib/format-bytes.js +18 -0
- package/lib/cli/src/lib/framework-detector.d.ts +12 -0
- package/lib/cli/src/lib/framework-detector.js +216 -0
- package/lib/cli/src/lib/framework-postchecks.d.ts +11 -0
- package/lib/cli/src/lib/framework-postchecks.js +152 -0
- package/lib/cli/src/lib/nest-app.d.ts +17 -0
- package/lib/cli/src/lib/nest-app.js +69 -0
- package/lib/cli/src/lib/nip-base-domain.util.d.ts +8 -0
- package/lib/cli/src/lib/nip-base-domain.util.js +17 -0
- package/lib/cli/src/lib/profile-manager.d.ts +56 -0
- package/lib/cli/src/lib/profile-manager.js +207 -0
- package/lib/cli/src/lib/prompts.d.ts +67 -0
- package/lib/cli/src/lib/prompts.js +475 -0
- package/lib/cli/src/lib/provider-credential-schemas.d.ts +29 -0
- package/lib/cli/src/lib/provider-credential-schemas.js +48 -0
- package/lib/cli/src/lib/repositories/cli-cluster.repository.d.ts +56 -0
- package/lib/cli/src/lib/repositories/cli-cluster.repository.js +216 -0
- package/lib/cli/src/lib/repositories/cli-firewall.repository.d.ts +13 -0
- package/lib/cli/src/lib/repositories/cli-firewall.repository.js +147 -0
- package/lib/cli/src/lib/repositories/cli-node.repository.d.ts +26 -0
- package/lib/cli/src/lib/repositories/cli-node.repository.js +164 -0
- package/lib/cli/src/lib/repositories/cli-operation.repository.d.ts +57 -0
- package/lib/cli/src/lib/repositories/cli-operation.repository.js +226 -0
- package/lib/cli/src/lib/repositories/cli-vnet.repository.d.ts +22 -0
- package/lib/cli/src/lib/repositories/cli-vnet.repository.js +175 -0
- package/lib/cli/src/lib/repositories/index.d.ts +5 -0
- package/lib/cli/src/lib/repositories/index.js +21 -0
- package/lib/cli/src/lib/resolve-cluster.d.ts +16 -0
- package/lib/cli/src/lib/resolve-cluster.js +34 -0
- package/lib/cli/src/lib/scaleway-validator.d.ts +5 -0
- package/lib/cli/src/lib/scaleway-validator.js +87 -0
- package/lib/cli/src/lib/server-utils.d.ts +8 -0
- package/lib/cli/src/lib/server-utils.js +19 -0
- package/lib/cli/src/lib/services/cli-app.service.d.ts +294 -0
- package/lib/cli/src/lib/services/cli-app.service.js +162 -0
- package/lib/cli/src/lib/services/cli-node.service.d.ts +43 -0
- package/lib/cli/src/lib/services/cli-node.service.js +34 -0
- package/lib/cli/src/lib/services/provider-sync.service.d.ts +90 -0
- package/lib/cli/src/lib/services/provider-sync.service.js +178 -0
- package/lib/cli/src/lib/services/reconciliation.service.d.ts +40 -0
- package/lib/cli/src/lib/services/reconciliation.service.js +119 -0
- package/lib/cli/src/lib/services/vnet-provisioning.service.d.ts +37 -0
- package/lib/cli/src/lib/services/vnet-provisioning.service.js +164 -0
- package/lib/cli/src/lib/ssh-key.d.ts +23 -0
- package/lib/cli/src/lib/ssh-key.js +126 -0
- package/lib/cli/src/lib/template-fetcher.d.ts +25 -0
- package/lib/cli/src/lib/template-fetcher.js +48 -0
- package/lib/cli/src/lib/templates/firewall-rules.d.ts +8 -0
- package/lib/cli/src/lib/templates/firewall-rules.js +17 -0
- package/lib/cli/src/lib/typeorm-shim.d.ts +12 -0
- package/lib/cli/src/lib/typeorm-shim.js +17 -0
- package/lib/cli/src/lib/utils/env-file.d.ts +2 -0
- package/lib/cli/src/lib/utils/env-file.js +40 -0
- package/lib/cli/src/lib/utils/ip-detection.d.ts +27 -0
- package/lib/cli/src/lib/utils/ip-detection.js +144 -0
- package/lib/cli/src/modules/cli-infrastructure.module.d.ts +14 -0
- package/lib/cli/src/modules/cli-infrastructure.module.js +249 -0
- package/lib/cli/src/services/cli-ca.service.d.ts +62 -0
- package/lib/cli/src/services/cli-ca.service.js +281 -0
- package/lib/cli/src/services/cli-cluster-creator.service.d.ts +78 -0
- package/lib/cli/src/services/cli-cluster-creator.service.js +655 -0
- package/lib/cli/src/services/cli-clusters.service.d.ts +74 -0
- package/lib/cli/src/services/cli-clusters.service.js +762 -0
- package/lib/cli/src/services/cli-endpoint-resolver.service.d.ts +33 -0
- package/lib/cli/src/services/cli-endpoint-resolver.service.js +195 -0
- package/lib/cli/src/services/cli-k3s-script.service.d.ts +114 -0
- package/lib/cli/src/services/cli-k3s-script.service.js +288 -0
- package/lib/cli/src/services/cli-logger.service.d.ts +56 -0
- package/lib/cli/src/services/cli-logger.service.js +188 -0
- package/lib/cli/src/services/cli-observability-cluster.service.d.ts +128 -0
- package/lib/cli/src/services/cli-observability-cluster.service.js +525 -0
- package/lib/cli/src/services/cli-ssh.service.d.ts +90 -0
- package/lib/cli/src/services/cli-ssh.service.js +457 -0
- package/lib/cli/src/services/server-type-cache.service.d.ts +34 -0
- package/lib/cli/src/services/server-type-cache.service.js +156 -0
- package/lib/cli/src/services/server-type-validator.service.d.ts +80 -0
- package/lib/cli/src/services/server-type-validator.service.js +366 -0
- package/lib/cli/src/types/index.d.ts +41 -0
- package/lib/cli/src/types/index.js +2 -0
- package/lib/src/common/utils/project-root.util.d.ts +22 -0
- package/lib/src/common/utils/project-root.util.js +78 -0
- package/lib/src/modules/access/access.controller.d.ts +30 -0
- package/lib/src/modules/access/access.controller.js +336 -0
- package/lib/src/modules/access/access.module.d.ts +2 -0
- package/lib/src/modules/access/access.module.js +92 -0
- package/lib/src/modules/access/controllers/ca.controller.d.ts +22 -0
- package/lib/src/modules/access/controllers/ca.controller.js +242 -0
- package/lib/src/modules/access/dto/api-token.dto.d.ts +11 -0
- package/lib/src/modules/access/dto/api-token.dto.js +74 -0
- package/lib/src/modules/access/dto/bearer-token.dto.d.ts +7 -0
- package/lib/src/modules/access/dto/bearer-token.dto.js +36 -0
- package/lib/src/modules/access/dto/ca-public-key.dto.d.ts +7 -0
- package/lib/src/modules/access/dto/ca-public-key.dto.js +52 -0
- package/lib/src/modules/access/dto/create-api-token.dto.d.ts +7 -0
- package/lib/src/modules/access/dto/create-api-token.dto.js +64 -0
- package/lib/src/modules/access/dto/create-bearer-token.dto.d.ts +9 -0
- package/lib/src/modules/access/dto/create-bearer-token.dto.js +58 -0
- package/lib/src/modules/access/dto/create-ssh-key.dto.d.ts +7 -0
- package/lib/src/modules/access/dto/create-ssh-key.dto.js +61 -0
- package/lib/src/modules/access/dto/refresh-token.dto.d.ts +7 -0
- package/lib/src/modules/access/dto/refresh-token.dto.js +46 -0
- package/lib/src/modules/access/dto/register-ca.dto.d.ts +16 -0
- package/lib/src/modules/access/dto/register-ca.dto.js +111 -0
- package/lib/src/modules/access/dto/ssh-key.dto.d.ts +20 -0
- package/lib/src/modules/access/dto/ssh-key.dto.js +124 -0
- package/lib/src/modules/access/dto/update-ssh-key.dto.d.ts +7 -0
- package/lib/src/modules/access/dto/update-ssh-key.dto.js +73 -0
- package/lib/src/modules/access/entities/api-token.entity.d.ts +30 -0
- package/lib/src/modules/access/entities/api-token.entity.js +87 -0
- package/lib/src/modules/access/entities/ca-keypair.entity.d.ts +13 -0
- package/lib/src/modules/access/entities/ca-keypair.entity.js +63 -0
- package/lib/src/modules/access/entities/credentials.entity.d.ts +18 -0
- package/lib/src/modules/access/entities/credentials.entity.js +87 -0
- package/lib/src/modules/access/entities/ssh-key.entity.d.ts +15 -0
- package/lib/src/modules/access/entities/ssh-key.entity.js +81 -0
- package/lib/src/modules/access/enums/credential-purpose.enum.d.ts +4 -0
- package/lib/src/modules/access/enums/credential-purpose.enum.js +8 -0
- package/lib/src/modules/access/interfaces/access.repository.d.ts +11 -0
- package/lib/src/modules/access/interfaces/access.repository.js +2 -0
- package/lib/src/modules/access/interfaces/ssh-key.interface.d.ts +26 -0
- package/lib/src/modules/access/interfaces/ssh-key.interface.js +2 -0
- package/lib/src/modules/access/mapper/api-token.mapper.d.ts +6 -0
- package/lib/src/modules/access/mapper/api-token.mapper.js +21 -0
- package/lib/src/modules/access/mapper/ssh-key.mapper.d.ts +6 -0
- package/lib/src/modules/access/mapper/ssh-key.mapper.js +25 -0
- package/lib/src/modules/access/providers/contabo-ssh-provider.service.d.ts +13 -0
- package/lib/src/modules/access/providers/contabo-ssh-provider.service.js +40 -0
- package/lib/src/modules/access/providers/hetzner-ssh-provider.service.d.ts +17 -0
- package/lib/src/modules/access/providers/hetzner-ssh-provider.service.js +95 -0
- package/lib/src/modules/access/providers/interfaces/ssh-provider.interface.d.ts +8 -0
- package/lib/src/modules/access/providers/interfaces/ssh-provider.interface.js +3 -0
- package/lib/src/modules/access/providers/ssh-provider.factory.d.ts +13 -0
- package/lib/src/modules/access/providers/ssh-provider.factory.js +44 -0
- package/lib/src/modules/access/repositories/api-token.repository.d.ts +24 -0
- package/lib/src/modules/access/repositories/api-token.repository.js +99 -0
- package/lib/src/modules/access/repositories/default-access.repository.d.ts +16 -0
- package/lib/src/modules/access/repositories/default-access.repository.js +121 -0
- package/lib/src/modules/access/repositories/provider-credentials.repository.d.ts +17 -0
- package/lib/src/modules/access/repositories/provider-credentials.repository.js +106 -0
- package/lib/src/modules/access/services/access.service.d.ts +180 -0
- package/lib/src/modules/access/services/access.service.js +732 -0
- package/lib/src/modules/access/services/bearerToken.service.d.ts +15 -0
- package/lib/src/modules/access/services/bearerToken.service.js +107 -0
- package/lib/src/modules/access/services/ca-manager.service.d.ts +48 -0
- package/lib/src/modules/access/services/ca-manager.service.js +293 -0
- package/lib/src/modules/access/services/certificate-signer.service.d.ts +36 -0
- package/lib/src/modules/access/services/certificate-signer.service.js +155 -0
- package/lib/src/modules/access/services/key-storage.service.d.ts +17 -0
- package/lib/src/modules/access/services/key-storage.service.js +133 -0
- package/lib/src/modules/access/services/ssh-key-generator.service.d.ts +6 -0
- package/lib/src/modules/access/services/ssh-key-generator.service.js +51 -0
- package/lib/src/modules/app-builds/entities/app-build.entity.d.ts +38 -0
- package/lib/src/modules/app-builds/entities/app-build.entity.js +168 -0
- package/lib/src/modules/app-builds/enums/app-build-status.enum.d.ts +10 -0
- package/lib/src/modules/app-builds/enums/app-build-status.enum.js +14 -0
- package/lib/src/modules/app-builds/enums/build-provider.enum.d.ts +6 -0
- package/lib/src/modules/app-builds/enums/build-provider.enum.js +10 -0
- package/lib/src/modules/app-builds/services/build-job.service.d.ts +178 -0
- package/lib/src/modules/app-builds/services/build-job.service.js +1057 -0
- package/lib/src/modules/applications/entities/app-resource.entity.d.ts +24 -0
- package/lib/src/modules/applications/entities/app-resource.entity.js +117 -0
- package/lib/src/modules/applications/entities/app-revision.entity.d.ts +29 -0
- package/lib/src/modules/applications/entities/app-revision.entity.js +133 -0
- package/lib/src/modules/applications/entities/application.entity.d.ts +121 -0
- package/lib/src/modules/applications/entities/application.entity.js +279 -0
- package/lib/src/modules/applications/enums/app-event-type.enum.d.ts +24 -0
- package/lib/src/modules/applications/enums/app-event-type.enum.js +28 -0
- package/lib/src/modules/applications/enums/application-category.enum.d.ts +4 -0
- package/lib/src/modules/applications/enums/application-category.enum.js +8 -0
- package/lib/src/modules/applications/enums/application-exposure.enum.d.ts +4 -0
- package/lib/src/modules/applications/enums/application-exposure.enum.js +8 -0
- package/lib/src/modules/applications/enums/application-kind.enum.d.ts +6 -0
- package/lib/src/modules/applications/enums/application-kind.enum.js +10 -0
- package/lib/src/modules/applications/enums/application-resource-kind.enum.d.ts +17 -0
- package/lib/src/modules/applications/enums/application-resource-kind.enum.js +21 -0
- package/lib/src/modules/applications/enums/application-resource-status.enum.d.ts +8 -0
- package/lib/src/modules/applications/enums/application-resource-status.enum.js +12 -0
- package/lib/src/modules/applications/enums/application-source-type.enum.d.ts +6 -0
- package/lib/src/modules/applications/enums/application-source-type.enum.js +10 -0
- package/lib/src/modules/applications/enums/application-status.enum.d.ts +20 -0
- package/lib/src/modules/applications/enums/application-status.enum.js +24 -0
- package/lib/src/modules/applications/interfaces/source-config.interface.d.ts +132 -0
- package/lib/src/modules/applications/interfaces/source-config.interface.js +2 -0
- package/lib/src/modules/auth/decorators/admin.decorator.d.ts +2 -0
- package/lib/src/modules/auth/decorators/admin.decorator.js +7 -0
- package/lib/src/modules/auth/entities/user.entity.d.ts +19 -0
- package/lib/src/modules/auth/entities/user.entity.js +78 -0
- package/lib/src/modules/auth/guards/admin.guard.d.ts +7 -0
- package/lib/src/modules/auth/guards/admin.guard.js +50 -0
- package/lib/src/modules/auth/interfaces/authenticated-user.interface.d.ts +12 -0
- package/lib/src/modules/auth/interfaces/authenticated-user.interface.js +2 -0
- package/lib/src/modules/common/cache/cache.service.d.ts +77 -0
- package/lib/src/modules/common/cache/cache.service.js +232 -0
- package/lib/src/modules/common/cache/cache.tokens.d.ts +1 -0
- package/lib/src/modules/common/cache/cache.tokens.js +4 -0
- package/lib/src/modules/common/cache/enums/cache-category.enum.d.ts +33 -0
- package/lib/src/modules/common/cache/enums/cache-category.enum.js +42 -0
- package/lib/src/modules/common/common.module.d.ts +2 -0
- package/lib/src/modules/common/common.module.js +20 -0
- package/lib/src/modules/common/dto/async-operation-response.dto.d.ts +19 -0
- package/lib/src/modules/common/dto/async-operation-response.dto.js +65 -0
- package/lib/src/modules/common/dto/index.d.ts +1 -0
- package/lib/src/modules/common/dto/index.js +17 -0
- package/lib/src/modules/common/services/label.service.d.ts +70 -0
- package/lib/src/modules/common/services/label.service.js +128 -0
- package/lib/src/modules/dns/entities/app-endpoint.entity.d.ts +57 -0
- package/lib/src/modules/dns/entities/app-endpoint.entity.js +205 -0
- package/lib/src/modules/dns/entities/cluster-dns-zone.entity.d.ts +21 -0
- package/lib/src/modules/dns/entities/cluster-dns-zone.entity.js +88 -0
- package/lib/src/modules/dns/entities/dns-zone.entity.d.ts +12 -0
- package/lib/src/modules/dns/entities/dns-zone.entity.js +53 -0
- package/lib/src/modules/dns/entities/san-certificate.entity.d.ts +29 -0
- package/lib/src/modules/dns/entities/san-certificate.entity.js +132 -0
- package/lib/src/modules/dns/entities/wildcard-certificate.entity.d.ts +26 -0
- package/lib/src/modules/dns/entities/wildcard-certificate.entity.js +111 -0
- package/lib/src/modules/dns/enums/cert-challenge.enum.d.ts +4 -0
- package/lib/src/modules/dns/enums/cert-challenge.enum.js +8 -0
- package/lib/src/modules/dns/enums/endpoint-type.enum.d.ts +4 -0
- package/lib/src/modules/dns/enums/endpoint-type.enum.js +8 -0
- package/lib/src/modules/dns/enums/hostname-mode.enum.d.ts +4 -0
- package/lib/src/modules/dns/enums/hostname-mode.enum.js +8 -0
- package/lib/src/modules/dns/services/cluster-dns-cleanup.service.d.ts +12 -0
- package/lib/src/modules/dns/services/cluster-dns-cleanup.service.js +79 -0
- package/lib/src/modules/dns/utils/nip-hostname.util.d.ts +12 -0
- package/lib/src/modules/dns/utils/nip-hostname.util.js +27 -0
- package/lib/src/modules/dns/utils/nip-token.util.d.ts +2 -0
- package/lib/src/modules/dns/utils/nip-token.util.js +94 -0
- package/lib/src/modules/frameworks/framework-core/enums/build-stage.enum.d.ts +21 -0
- package/lib/src/modules/frameworks/framework-core/enums/build-stage.enum.js +29 -0
- package/lib/src/modules/frameworks/framework-core/enums/deploy-strategy.enum.d.ts +22 -0
- package/lib/src/modules/frameworks/framework-core/enums/deploy-strategy.enum.js +26 -0
- package/lib/src/modules/frameworks/framework-core/enums/framework-type.enum.d.ts +32 -0
- package/lib/src/modules/frameworks/framework-core/enums/framework-type.enum.js +47 -0
- package/lib/src/modules/grafana/services/grafana-config.service.d.ts +43 -0
- package/lib/src/modules/grafana/services/grafana-config.service.js +177 -0
- package/lib/src/modules/grafana/services/grafana-datasource.service.d.ts +70 -0
- package/lib/src/modules/grafana/services/grafana-datasource.service.js +333 -0
- package/lib/src/modules/infrastructure/clusters/clusters.service.d.ts +126 -0
- package/lib/src/modules/infrastructure/clusters/clusters.service.js +265 -0
- package/lib/src/modules/infrastructure/clusters/constants/storage-conventions.d.ts +60 -0
- package/lib/src/modules/infrastructure/clusters/constants/storage-conventions.js +64 -0
- package/lib/src/modules/infrastructure/clusters/dto/build-resources.dto.d.ts +19 -0
- package/lib/src/modules/infrastructure/clusters/dto/build-resources.dto.js +69 -0
- package/lib/src/modules/infrastructure/clusters/dto/cluster-capacity-plan.dto.d.ts +36 -0
- package/lib/src/modules/infrastructure/clusters/dto/cluster-capacity-plan.dto.js +149 -0
- package/lib/src/modules/infrastructure/clusters/dto/cluster-power-management.dto.d.ts +51 -0
- package/lib/src/modules/infrastructure/clusters/dto/cluster-power-management.dto.js +222 -0
- package/lib/src/modules/infrastructure/clusters/dto/cluster-response.dto.d.ts +42 -0
- package/lib/src/modules/infrastructure/clusters/dto/cluster-response.dto.js +238 -0
- package/lib/src/modules/infrastructure/clusters/dto/cluster-storage.dto.d.ts +35 -0
- package/lib/src/modules/infrastructure/clusters/dto/cluster-storage.dto.js +122 -0
- package/lib/src/modules/infrastructure/clusters/dto/create-cluster.dto.d.ts +43 -0
- package/lib/src/modules/infrastructure/clusters/dto/create-cluster.dto.js +334 -0
- package/lib/src/modules/infrastructure/clusters/dto/register-cluster.dto.d.ts +30 -0
- package/lib/src/modules/infrastructure/clusters/dto/register-cluster.dto.js +190 -0
- package/lib/src/modules/infrastructure/clusters/dto/resource-availability.dto.d.ts +15 -0
- package/lib/src/modules/infrastructure/clusters/dto/resource-availability.dto.js +91 -0
- package/lib/src/modules/infrastructure/clusters/entities/cluster-node.entity.d.ts +28 -0
- package/lib/src/modules/infrastructure/clusters/entities/cluster-node.entity.js +104 -0
- package/lib/src/modules/infrastructure/clusters/entities/cluster.entity.d.ts +64 -0
- package/lib/src/modules/infrastructure/clusters/entities/cluster.entity.js +199 -0
- package/lib/src/modules/infrastructure/clusters/entities/node-billable-interval.entity.d.ts +17 -0
- package/lib/src/modules/infrastructure/clusters/entities/node-billable-interval.entity.js +86 -0
- package/lib/src/modules/infrastructure/clusters/entities/volume-billable-interval.entity.d.ts +18 -0
- package/lib/src/modules/infrastructure/clusters/entities/volume-billable-interval.entity.js +79 -0
- package/lib/src/modules/infrastructure/clusters/services/billing-intervals.service.d.ts +48 -0
- package/lib/src/modules/infrastructure/clusters/services/billing-intervals.service.js +159 -0
- package/lib/src/modules/infrastructure/clusters/services/cluster-capacity.service.d.ts +23 -0
- package/lib/src/modules/infrastructure/clusters/services/cluster-capacity.service.js +198 -0
- package/lib/src/modules/infrastructure/clusters/services/cluster-creation.service.d.ts +25 -0
- package/lib/src/modules/infrastructure/clusters/services/cluster-creation.service.js +192 -0
- package/lib/src/modules/infrastructure/clusters/services/cluster-deletion.service.d.ts +36 -0
- package/lib/src/modules/infrastructure/clusters/services/cluster-deletion.service.js +159 -0
- package/lib/src/modules/infrastructure/clusters/services/cluster-firewall-integration.service.d.ts +25 -0
- package/lib/src/modules/infrastructure/clusters/services/cluster-firewall-integration.service.js +90 -0
- package/lib/src/modules/infrastructure/clusters/services/cluster-mapper.service.d.ts +15 -0
- package/lib/src/modules/infrastructure/clusters/services/cluster-mapper.service.js +63 -0
- package/lib/src/modules/infrastructure/clusters/services/cluster-node-scaling.service.d.ts +78 -0
- package/lib/src/modules/infrastructure/clusters/services/cluster-node-scaling.service.js +644 -0
- package/lib/src/modules/infrastructure/clusters/services/cluster-operations.service.d.ts +37 -0
- package/lib/src/modules/infrastructure/clusters/services/cluster-operations.service.js +244 -0
- package/lib/src/modules/infrastructure/clusters/services/cluster-power-management.service.d.ts +68 -0
- package/lib/src/modules/infrastructure/clusters/services/cluster-power-management.service.js +716 -0
- package/lib/src/modules/infrastructure/clusters/services/cluster-storage.service.d.ts +15 -0
- package/lib/src/modules/infrastructure/clusters/services/cluster-storage.service.js +179 -0
- package/lib/src/modules/infrastructure/clusters/services/cluster-validation.service.d.ts +29 -0
- package/lib/src/modules/infrastructure/clusters/services/cluster-validation.service.js +100 -0
- package/lib/src/modules/infrastructure/firewalls/dto/cluster-firewall.dto.d.ts +62 -0
- package/lib/src/modules/infrastructure/firewalls/dto/cluster-firewall.dto.js +252 -0
- package/lib/src/modules/infrastructure/firewalls/entities/cluster-firewall.entity.d.ts +20 -0
- package/lib/src/modules/infrastructure/firewalls/entities/cluster-firewall.entity.js +83 -0
- package/lib/src/modules/infrastructure/firewalls/services/firewall-desired-state.service.d.ts +73 -0
- package/lib/src/modules/infrastructure/firewalls/services/firewall-desired-state.service.js +329 -0
- package/lib/src/modules/infrastructure/firewalls/services/firewall-reconciliation.service.d.ts +43 -0
- package/lib/src/modules/infrastructure/firewalls/services/firewall-reconciliation.service.js +212 -0
- package/lib/src/modules/infrastructure/firewalls/templates/firewall-rules.template.d.ts +54 -0
- package/lib/src/modules/infrastructure/firewalls/templates/firewall-rules.template.js +167 -0
- package/lib/src/modules/infrastructure/operations/helpers/operation-steps.helper.d.ts +34 -0
- package/lib/src/modules/infrastructure/operations/helpers/operation-steps.helper.js +401 -0
- package/lib/src/modules/infrastructure/servers/dto/create-server.dto.d.ts +40 -0
- package/lib/src/modules/infrastructure/servers/dto/create-server.dto.js +157 -0
- package/lib/src/modules/infrastructure/servers/dto/delete-server.dto.d.ts +17 -0
- package/lib/src/modules/infrastructure/servers/dto/delete-server.dto.js +85 -0
- package/lib/src/modules/infrastructure/servers/dto/server-response.dto.d.ts +29 -0
- package/lib/src/modules/infrastructure/servers/dto/server-response.dto.js +147 -0
- package/lib/src/modules/infrastructure/servers/entities/infrastructure-operations.entity.d.ts +266 -0
- package/lib/src/modules/infrastructure/servers/entities/infrastructure-operations.entity.js +348 -0
- package/lib/src/modules/infrastructure/shared/enums/reconciliation-status.enum.d.ts +7 -0
- package/lib/src/modules/infrastructure/shared/enums/reconciliation-status.enum.js +11 -0
- package/lib/src/modules/infrastructure/shared/services/kubernetes.service.d.ts +304 -0
- package/lib/src/modules/infrastructure/shared/services/kubernetes.service.js +1164 -0
- package/lib/src/modules/infrastructure/shared/services/label.service.d.ts +97 -0
- package/lib/src/modules/infrastructure/shared/services/label.service.js +189 -0
- package/lib/src/modules/infrastructure/shared/shared-infrastructure.module.d.ts +2 -0
- package/lib/src/modules/infrastructure/shared/shared-infrastructure.module.js +24 -0
- package/lib/src/modules/infrastructure/vnets/entities/vnet-route.entity.d.ts +10 -0
- package/lib/src/modules/infrastructure/vnets/entities/vnet-route.entity.js +51 -0
- package/lib/src/modules/infrastructure/vnets/entities/vnet-subnet.entity.d.ts +20 -0
- package/lib/src/modules/infrastructure/vnets/entities/vnet-subnet.entity.js +77 -0
- package/lib/src/modules/infrastructure/vnets/entities/vnet.entity.d.ts +28 -0
- package/lib/src/modules/infrastructure/vnets/entities/vnet.entity.js +88 -0
- package/lib/src/modules/instances/entities/instance-status.enum.d.ts +12 -0
- package/lib/src/modules/instances/entities/instance-status.enum.js +16 -0
- package/lib/src/modules/instances/entities/instance-type.enum.d.ts +6 -0
- package/lib/src/modules/instances/entities/instance-type.enum.js +10 -0
- package/lib/src/modules/instances/entities/instance.entity.d.ts +41 -0
- package/lib/src/modules/instances/entities/instance.entity.js +126 -0
- package/lib/src/modules/management/dto/configure-provider.dto.d.ts +8 -0
- package/lib/src/modules/management/dto/configure-provider.dto.js +51 -0
- package/lib/src/modules/management/dto/credentials.dto.d.ts +15 -0
- package/lib/src/modules/management/dto/credentials.dto.js +114 -0
- package/lib/src/modules/management/dto/health-status.dto.d.ts +12 -0
- package/lib/src/modules/management/dto/health-status.dto.js +40 -0
- package/lib/src/modules/management/dto/node-size-option.dto.d.ts +37 -0
- package/lib/src/modules/management/dto/node-size-option.dto.js +178 -0
- package/lib/src/modules/management/dto/pricing-query.dto.d.ts +5 -0
- package/lib/src/modules/management/dto/pricing-query.dto.js +36 -0
- package/lib/src/modules/management/dto/pricing-response.dto.d.ts +21 -0
- package/lib/src/modules/management/dto/pricing-response.dto.js +80 -0
- package/lib/src/modules/management/dto/provider-configuration.dto.d.ts +23 -0
- package/lib/src/modules/management/dto/provider-configuration.dto.js +72 -0
- package/lib/src/modules/management/dto/provider-filters.dto.d.ts +7 -0
- package/lib/src/modules/management/dto/provider-filters.dto.js +45 -0
- package/lib/src/modules/management/dto/validation-result.dto.d.ts +16 -0
- package/lib/src/modules/management/dto/validation-result.dto.js +35 -0
- package/lib/src/modules/management/entities/credentials.entity.d.ts +21 -0
- package/lib/src/modules/management/entities/credentials.entity.js +10 -0
- package/lib/src/modules/management/entities/provider-capabilities.entity.d.ts +85 -0
- package/lib/src/modules/management/entities/provider-capabilities.entity.js +2 -0
- package/lib/src/modules/management/entities/provider-configuration.entity.d.ts +14 -0
- package/lib/src/modules/management/entities/provider-configuration.entity.js +65 -0
- package/lib/src/modules/management/entities/provider-definition.entity.d.ts +19 -0
- package/lib/src/modules/management/entities/provider-definition.entity.js +2 -0
- package/lib/src/modules/management/entities/provider-region.entity.d.ts +11 -0
- package/lib/src/modules/management/entities/provider-region.entity.js +2 -0
- package/lib/src/modules/management/entities/provider-status.enum.d.ts +8 -0
- package/lib/src/modules/management/entities/provider-status.enum.js +12 -0
- package/lib/src/modules/management/interfaces/provider-configuration.repository.interface.d.ts +17 -0
- package/lib/src/modules/management/interfaces/provider-configuration.repository.interface.js +2 -0
- package/lib/src/modules/management/repositories/provider-configuration.repository.d.ts +21 -0
- package/lib/src/modules/management/repositories/provider-configuration.repository.js +89 -0
- package/lib/src/modules/management/services/configuration-mode.service.d.ts +20 -0
- package/lib/src/modules/management/services/configuration-mode.service.js +54 -0
- package/lib/src/modules/management/services/management.service.d.ts +72 -0
- package/lib/src/modules/management/services/management.service.js +546 -0
- package/lib/src/modules/management/services/provider-definitions.service.d.ts +26 -0
- package/lib/src/modules/management/services/provider-definitions.service.js +133 -0
- package/lib/src/modules/providers/controllers/provider-firewalls.controller.d.ts +28 -0
- package/lib/src/modules/providers/controllers/provider-firewalls.controller.js +277 -0
- package/lib/src/modules/providers/core/factories/capabilities-provider.factory.d.ts +10 -0
- package/lib/src/modules/providers/core/factories/capabilities-provider.factory.js +39 -0
- package/lib/src/modules/providers/core/factories/certificate-provider.factory.d.ts +11 -0
- package/lib/src/modules/providers/core/factories/certificate-provider.factory.js +58 -0
- package/lib/src/modules/providers/core/factories/dns-provider.factory.d.ts +12 -0
- package/lib/src/modules/providers/core/factories/dns-provider.factory.js +65 -0
- package/lib/src/modules/providers/core/factories/firewall-provider.factory.d.ts +12 -0
- package/lib/src/modules/providers/core/factories/firewall-provider.factory.js +61 -0
- package/lib/src/modules/providers/core/factories/provider.factory.d.ts +9 -0
- package/lib/src/modules/providers/core/factories/provider.factory.js +47 -0
- package/lib/src/modules/providers/core/factories/vm-backup-provider.factory.d.ts +12 -0
- package/lib/src/modules/providers/core/factories/vm-backup-provider.factory.js +56 -0
- package/lib/src/modules/providers/core/factories/volume-export.factory.d.ts +12 -0
- package/lib/src/modules/providers/core/factories/volume-export.factory.js +56 -0
- package/lib/src/modules/providers/core/interfaces/certificate-provider.interface.d.ts +1 -0
- package/lib/src/modules/providers/core/interfaces/certificate-provider.interface.js +17 -0
- package/lib/src/modules/providers/core/interfaces/cloud-provider.interface.d.ts +1 -0
- package/lib/src/modules/providers/core/interfaces/cloud-provider.interface.js +17 -0
- package/lib/src/modules/providers/core/interfaces/dns-provider.interface.d.ts +1 -0
- package/lib/src/modules/providers/core/interfaces/dns-provider.interface.js +17 -0
- package/lib/src/modules/providers/core/interfaces/firewall-provider.interface.d.ts +1 -0
- package/lib/src/modules/providers/core/interfaces/firewall-provider.interface.js +17 -0
- package/lib/src/modules/providers/core/interfaces/provider-bootstrap-seeder.interface.d.ts +54 -0
- package/lib/src/modules/providers/core/interfaces/provider-bootstrap-seeder.interface.js +2 -0
- package/lib/src/modules/providers/core/tokens.d.ts +59 -0
- package/lib/src/modules/providers/core/tokens.js +19 -0
- package/lib/src/modules/providers/data/region-coordinates.d.ts +6 -0
- package/lib/src/modules/providers/data/region-coordinates.js +25 -0
- package/lib/src/modules/providers/dto/firewall.dto.d.ts +30 -0
- package/lib/src/modules/providers/dto/firewall.dto.js +105 -0
- package/lib/src/modules/providers/dto/node-size.dto.d.ts +46 -0
- package/lib/src/modules/providers/dto/node-size.dto.js +22 -0
- package/lib/src/modules/providers/dto/pricing.dto.d.ts +24 -0
- package/lib/src/modules/providers/dto/pricing.dto.js +19 -0
- package/lib/src/modules/providers/dto/provider-firewall-response.dto.d.ts +28 -0
- package/lib/src/modules/providers/dto/provider-firewall-response.dto.js +134 -0
- package/lib/src/modules/providers/enums/certificate-provider.enum.d.ts +4 -0
- package/lib/src/modules/providers/enums/certificate-provider.enum.js +8 -0
- package/lib/src/modules/providers/enums/cloud-provider.enum.d.ts +5 -0
- package/lib/src/modules/providers/enums/cloud-provider.enum.js +9 -0
- package/lib/src/modules/providers/enums/dns-provider.enum.d.ts +5 -0
- package/lib/src/modules/providers/enums/dns-provider.enum.js +9 -0
- package/lib/src/modules/providers/implementations/contabo/contabo-capabilities.service.d.ts +19 -0
- package/lib/src/modules/providers/implementations/contabo/contabo-capabilities.service.js +254 -0
- package/lib/src/modules/providers/implementations/contabo/contabo-provider.module.d.ts +10 -0
- package/lib/src/modules/providers/implementations/contabo/contabo-provider.module.js +72 -0
- package/lib/src/modules/providers/implementations/contabo/generated/api.d.ts +13374 -0
- package/lib/src/modules/providers/implementations/contabo/generated/api.js +11341 -0
- package/lib/src/modules/providers/implementations/contabo/generated/base.d.ts +66 -0
- package/lib/src/modules/providers/implementations/contabo/generated/base.js +66 -0
- package/lib/src/modules/providers/implementations/contabo/generated/common.d.ts +65 -0
- package/lib/src/modules/providers/implementations/contabo/generated/common.js +152 -0
- package/lib/src/modules/providers/implementations/contabo/generated/configuration.d.ts +91 -0
- package/lib/src/modules/providers/implementations/contabo/generated/configuration.js +50 -0
- package/lib/src/modules/providers/implementations/contabo/generated/index.d.ts +13 -0
- package/lib/src/modules/providers/implementations/contabo/generated/index.js +31 -0
- package/lib/src/modules/providers/implementations/hetzner/generated/api.d.ts +18419 -0
- package/lib/src/modules/providers/implementations/hetzner/generated/api.js +19133 -0
- package/lib/src/modules/providers/implementations/hetzner/generated/base.d.ts +66 -0
- package/lib/src/modules/providers/implementations/hetzner/generated/base.js +66 -0
- package/lib/src/modules/providers/implementations/hetzner/generated/common.d.ts +65 -0
- package/lib/src/modules/providers/implementations/hetzner/generated/common.js +152 -0
- package/lib/src/modules/providers/implementations/hetzner/generated/configuration.d.ts +91 -0
- package/lib/src/modules/providers/implementations/hetzner/generated/configuration.js +50 -0
- package/lib/src/modules/providers/implementations/hetzner/generated/index.d.ts +13 -0
- package/lib/src/modules/providers/implementations/hetzner/generated/index.js +31 -0
- package/lib/src/modules/providers/implementations/hetzner/hetzner-bootstrap-seeder.service.d.ts +19 -0
- package/lib/src/modules/providers/implementations/hetzner/hetzner-bootstrap-seeder.service.js +68 -0
- package/lib/src/modules/providers/implementations/hetzner/hetzner-capabilities.service.d.ts +29 -0
- package/lib/src/modules/providers/implementations/hetzner/hetzner-capabilities.service.js +392 -0
- package/lib/src/modules/providers/implementations/hetzner/hetzner-provider.module.d.ts +2 -0
- package/lib/src/modules/providers/implementations/hetzner/hetzner-provider.module.js +81 -0
- package/lib/src/modules/providers/implementations/hetzner/hetzner-volume-operations.service.d.ts +31 -0
- package/lib/src/modules/providers/implementations/hetzner/hetzner-volume-operations.service.js +312 -0
- package/lib/src/modules/providers/implementations/hetzner/object-storage/hetzner-object-storage-connection.controller.d.ts +18 -0
- package/lib/src/modules/providers/implementations/hetzner/object-storage/hetzner-object-storage-connection.controller.js +67 -0
- package/lib/src/modules/providers/implementations/hetzner/object-storage/hetzner-object-storage-connection.service.d.ts +24 -0
- package/lib/src/modules/providers/implementations/hetzner/object-storage/hetzner-object-storage-connection.service.js +107 -0
- package/lib/src/modules/providers/implementations/hetzner/object-storage/hetzner-object-storage.backend.d.ts +7 -0
- package/lib/src/modules/providers/implementations/hetzner/object-storage/hetzner-object-storage.backend.js +35 -0
- package/lib/src/modules/providers/implementations/hetzner/object-storage/hetzner-object-storage.module.d.ts +8 -0
- package/lib/src/modules/providers/implementations/hetzner/object-storage/hetzner-object-storage.module.js +60 -0
- package/lib/src/modules/providers/implementations/hetzner/object-storage/hetzner-object-storage.provisioner.d.ts +22 -0
- package/lib/src/modules/providers/implementations/hetzner/object-storage/hetzner-object-storage.provisioner.js +100 -0
- package/lib/src/modules/providers/implementations/hetzner/vm-backup/hetzner-vm-backup.service.d.ts +20 -0
- package/lib/src/modules/providers/implementations/hetzner/vm-backup/hetzner-vm-backup.service.js +118 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/baremetal/api.d.ts +4227 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/baremetal/api.js +3362 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/baremetal/base.d.ts +66 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/baremetal/base.js +66 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/baremetal/common.d.ts +65 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/baremetal/common.js +152 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/baremetal/configuration.d.ts +91 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/baremetal/configuration.js +50 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/baremetal/index.d.ts +13 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/baremetal/index.js +31 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/domain/api.d.ts +2486 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/domain/api.js +2424 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/domain/base.d.ts +66 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/domain/base.js +66 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/domain/common.d.ts +65 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/domain/common.js +152 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/domain/configuration.d.ts +91 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/domain/configuration.js +50 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/domain/index.d.ts +13 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/domain/index.js +31 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/iam/api.d.ts +6425 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/iam/api.js +6925 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/iam/base.d.ts +66 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/iam/base.js +66 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/iam/common.d.ts +65 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/iam/common.js +152 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/iam/configuration.d.ts +91 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/iam/configuration.js +50 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/iam/index.d.ts +13 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/iam/index.js +31 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/instances/api.d.ts +11187 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/instances/api.js +9264 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/instances/base.d.ts +66 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/instances/base.js +66 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/instances/common.d.ts +65 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/instances/common.js +152 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/instances/configuration.d.ts +91 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/instances/configuration.js +50 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/instances/index.d.ts +13 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/instances/index.js +31 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/private-network/api.d.ts +492 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/private-network/api.js +531 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/private-network/base.d.ts +66 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/private-network/base.js +66 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/private-network/common.d.ts +65 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/private-network/common.js +152 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/private-network/configuration.d.ts +91 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/private-network/configuration.js +50 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/private-network/index.d.ts +13 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/private-network/index.js +31 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/vpc/api.d.ts +2305 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/vpc/api.js +2443 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/vpc/base.d.ts +66 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/vpc/base.js +66 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/vpc/common.d.ts +65 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/vpc/common.js +152 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/vpc/configuration.d.ts +91 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/vpc/configuration.js +50 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/vpc/index.d.ts +13 -0
- package/lib/src/modules/providers/implementations/scaleway/generated/vpc/index.js +31 -0
- package/lib/src/modules/providers/implementations/scaleway/object-storage/scaleway-object-storage.backend.d.ts +8 -0
- package/lib/src/modules/providers/implementations/scaleway/object-storage/scaleway-object-storage.backend.js +49 -0
- package/lib/src/modules/providers/implementations/scaleway/object-storage/scaleway-object-storage.module.d.ts +9 -0
- package/lib/src/modules/providers/implementations/scaleway/object-storage/scaleway-object-storage.module.js +56 -0
- package/lib/src/modules/providers/implementations/scaleway/object-storage/scaleway-object-storage.provisioner.d.ts +27 -0
- package/lib/src/modules/providers/implementations/scaleway/object-storage/scaleway-object-storage.provisioner.js +120 -0
- package/lib/src/modules/providers/implementations/scaleway/scaleway-baremetal.adapter.d.ts +22 -0
- package/lib/src/modules/providers/implementations/scaleway/scaleway-baremetal.adapter.js +140 -0
- package/lib/src/modules/providers/implementations/scaleway/scaleway-bootstrap-seeder.service.d.ts +12 -0
- package/lib/src/modules/providers/implementations/scaleway/scaleway-bootstrap-seeder.service.js +65 -0
- package/lib/src/modules/providers/implementations/scaleway/scaleway-capabilities.service.d.ts +23 -0
- package/lib/src/modules/providers/implementations/scaleway/scaleway-capabilities.service.js +319 -0
- package/lib/src/modules/providers/implementations/scaleway/scaleway-dns.service.d.ts +24 -0
- package/lib/src/modules/providers/implementations/scaleway/scaleway-dns.service.js +189 -0
- package/lib/src/modules/providers/implementations/scaleway/scaleway-firewall.service.d.ts +43 -0
- package/lib/src/modules/providers/implementations/scaleway/scaleway-firewall.service.js +455 -0
- package/lib/src/modules/providers/implementations/scaleway/scaleway-iam.adapter.d.ts +32 -0
- package/lib/src/modules/providers/implementations/scaleway/scaleway-iam.adapter.js +108 -0
- package/lib/src/modules/providers/implementations/scaleway/scaleway-instances.adapter.d.ts +66 -0
- package/lib/src/modules/providers/implementations/scaleway/scaleway-instances.adapter.js +289 -0
- package/lib/src/modules/providers/implementations/scaleway/scaleway-provider.module.d.ts +17 -0
- package/lib/src/modules/providers/implementations/scaleway/scaleway-provider.module.js +122 -0
- package/lib/src/modules/providers/implementations/scaleway/scaleway-provider.service.d.ts +100 -0
- package/lib/src/modules/providers/implementations/scaleway/scaleway-provider.service.js +1395 -0
- package/lib/src/modules/providers/implementations/scaleway/scaleway-volume-operations.service.d.ts +24 -0
- package/lib/src/modules/providers/implementations/scaleway/scaleway-volume-operations.service.js +199 -0
- package/lib/src/modules/providers/implementations/scaleway/scaleway-vpc.adapter.d.ts +30 -0
- package/lib/src/modules/providers/implementations/scaleway/scaleway-vpc.adapter.js +180 -0
- package/lib/src/modules/providers/index.d.ts +17 -0
- package/lib/src/modules/providers/index.js +39 -0
- package/lib/src/modules/providers/interfaces/certificate-provider.interface.d.ts +38 -0
- package/lib/src/modules/providers/interfaces/certificate-provider.interface.js +11 -0
- package/lib/src/modules/providers/interfaces/cloud-provider.interface.d.ts +215 -0
- package/lib/src/modules/providers/interfaces/cloud-provider.interface.js +2 -0
- package/lib/src/modules/providers/interfaces/credential-provider.interface.d.ts +23 -0
- package/lib/src/modules/providers/interfaces/credential-provider.interface.js +2 -0
- package/lib/src/modules/providers/interfaces/dns-provider.interface.d.ts +55 -0
- package/lib/src/modules/providers/interfaces/dns-provider.interface.js +12 -0
- package/lib/src/modules/providers/interfaces/firewall-provider.interface.d.ts +47 -0
- package/lib/src/modules/providers/interfaces/firewall-provider.interface.js +2 -0
- package/lib/src/modules/providers/interfaces/network-provider.interface.d.ts +124 -0
- package/lib/src/modules/providers/interfaces/network-provider.interface.js +2 -0
- package/lib/src/modules/providers/interfaces/provider-capabilities.interface.d.ts +87 -0
- package/lib/src/modules/providers/interfaces/provider-capabilities.interface.js +2 -0
- package/lib/src/modules/providers/interfaces/vm-backup-provider.interface.d.ts +39 -0
- package/lib/src/modules/providers/interfaces/vm-backup-provider.interface.js +8 -0
- package/lib/src/modules/providers/interfaces/volume-export.interface.d.ts +162 -0
- package/lib/src/modules/providers/interfaces/volume-export.interface.js +21 -0
- package/lib/src/modules/providers/interfaces/volume-operations.interface.d.ts +149 -0
- package/lib/src/modules/providers/interfaces/volume-operations.interface.js +17 -0
- package/lib/src/modules/providers/mappers/node-size.mapper.d.ts +20 -0
- package/lib/src/modules/providers/mappers/node-size.mapper.js +75 -0
- package/lib/src/modules/providers/mappers/pricing.mapper.d.ts +14 -0
- package/lib/src/modules/providers/mappers/pricing.mapper.js +60 -0
- package/lib/src/modules/providers/provider-core.module.d.ts +13 -0
- package/lib/src/modules/providers/provider-core.module.js +59 -0
- package/lib/src/modules/providers/providers.module.d.ts +2 -0
- package/lib/src/modules/providers/providers.module.js +188 -0
- package/lib/src/modules/providers/services/acme-certificate.service.d.ts +38 -0
- package/lib/src/modules/providers/services/acme-certificate.service.js +144 -0
- package/lib/src/modules/providers/services/contabo-firewall.service.d.ts +11 -0
- package/lib/src/modules/providers/services/contabo-firewall.service.js +40 -0
- package/lib/src/modules/providers/services/contabo-provider.service.d.ts +48 -0
- package/lib/src/modules/providers/services/contabo-provider.service.js +194 -0
- package/lib/src/modules/providers/services/credential-provider.service.d.ts +17 -0
- package/lib/src/modules/providers/services/credential-provider.service.js +78 -0
- package/lib/src/modules/providers/services/dns-provider.factory.d.ts +5 -0
- package/lib/src/modules/providers/services/dns-provider.factory.js +9 -0
- package/lib/src/modules/providers/services/firewall-provider.factory.d.ts +5 -0
- package/lib/src/modules/providers/services/firewall-provider.factory.js +9 -0
- package/lib/src/modules/providers/services/hetzner-dns.service.d.ts +71 -0
- package/lib/src/modules/providers/services/hetzner-dns.service.js +565 -0
- package/lib/src/modules/providers/services/hetzner-firewall.service.d.ts +48 -0
- package/lib/src/modules/providers/services/hetzner-firewall.service.js +472 -0
- package/lib/src/modules/providers/services/hetzner-network.service.d.ts +84 -0
- package/lib/src/modules/providers/services/hetzner-network.service.js +408 -0
- package/lib/src/modules/providers/services/hetzner-provider.service.d.ts +213 -0
- package/lib/src/modules/providers/services/hetzner-provider.service.js +1159 -0
- package/lib/src/modules/providers/services/provider.factory.d.ts +5 -0
- package/lib/src/modules/providers/services/provider.factory.js +9 -0
- package/lib/src/modules/providers/services/volume-export.service.d.ts +50 -0
- package/lib/src/modules/providers/services/volume-export.service.js +650 -0
- package/lib/src/modules/shared/encryption/encryption.module.d.ts +2 -0
- package/lib/src/modules/shared/encryption/encryption.module.js +22 -0
- package/lib/src/modules/shared/encryption/services/encryption.service.d.ts +47 -0
- package/lib/src/modules/shared/encryption/services/encryption.service.js +199 -0
- package/lib/src/modules/storage/enums/storage-backend-provider.enum.d.ts +19 -0
- package/lib/src/modules/storage/enums/storage-backend-provider.enum.js +23 -0
- package/lib/src/modules/storage/factories/object-storage-provisioner.factory.d.ts +11 -0
- package/lib/src/modules/storage/factories/object-storage-provisioner.factory.js +48 -0
- package/lib/src/modules/storage/factories/storage-backend.factory.d.ts +12 -0
- package/lib/src/modules/storage/factories/storage-backend.factory.js +51 -0
- package/lib/src/modules/storage/implementations/generic-s3.backend.d.ts +23 -0
- package/lib/src/modules/storage/implementations/generic-s3.backend.js +172 -0
- package/lib/src/modules/storage/interfaces/backup-storage-backend.interface.d.ts +48 -0
- package/lib/src/modules/storage/interfaces/backup-storage-backend.interface.js +2 -0
- package/lib/src/modules/storage/interfaces/object-storage-provisioner.interface.d.ts +55 -0
- package/lib/src/modules/storage/interfaces/object-storage-provisioner.interface.js +9 -0
- package/lib/src/modules/storage/storage.module.d.ts +2 -0
- package/lib/src/modules/storage/storage.module.js +21 -0
- package/lib/src/modules/storage/tokens/object-storage-provisioner-registry.token.d.ts +12 -0
- package/lib/src/modules/storage/tokens/object-storage-provisioner-registry.token.js +8 -0
- package/lib/src/modules/storage/tokens/storage-backend-registry.token.d.ts +12 -0
- package/lib/src/modules/storage/tokens/storage-backend-registry.token.js +8 -0
- package/lib/src/modules/terminal/services/native-ssh-connection.service.d.ts +48 -0
- package/lib/src/modules/terminal/services/native-ssh-connection.service.js +282 -0
- package/oclif.manifest.json +5243 -0
- package/package.json +125 -0
|
@@ -0,0 +1,1395 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
15
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
16
|
+
};
|
|
17
|
+
var ScalewayProviderService_1;
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.ScalewayProviderService = void 0;
|
|
20
|
+
const common_1 = require("@nestjs/common");
|
|
21
|
+
const axios_1 = __importDefault(require("axios"));
|
|
22
|
+
const scaleway_iam_adapter_1 = require("./scaleway-iam.adapter");
|
|
23
|
+
const cloud_provider_enum_1 = require("../../enums/cloud-provider.enum");
|
|
24
|
+
const scaleway_vpc_adapter_1 = require("./scaleway-vpc.adapter");
|
|
25
|
+
const instance_entity_1 = require("../../../instances/entities/instance.entity");
|
|
26
|
+
const instance_status_enum_1 = require("../../../instances/entities/instance-status.enum");
|
|
27
|
+
const instance_type_enum_1 = require("../../../instances/entities/instance-type.enum");
|
|
28
|
+
const label_service_1 = require("../../../common/services/label.service");
|
|
29
|
+
const scaleway_instances_adapter_1 = require("./scaleway-instances.adapter");
|
|
30
|
+
const scaleway_baremetal_adapter_1 = require("./scaleway-baremetal.adapter");
|
|
31
|
+
const instances_1 = require("./generated/instances");
|
|
32
|
+
const baremetal_1 = require("./generated/baremetal");
|
|
33
|
+
// Scaleway SBS (Scaleway Block Storage) pricing — not exposed by the instance types API, sourced from pricing page.
|
|
34
|
+
const SBS_5K_PRICE_PER_GB_MONTHLY = '0.0993'; // €/GB/month — SBS 5K standard IOPS (2025)
|
|
35
|
+
let ScalewayProviderService = ScalewayProviderService_1 = class ScalewayProviderService {
|
|
36
|
+
constructor(credentialProvider, labelService, instancesAdapter, baremetalAdapter, vpcAdapter, iamAdapter) {
|
|
37
|
+
this.credentialProvider = credentialProvider;
|
|
38
|
+
this.labelService = labelService;
|
|
39
|
+
this.instancesAdapter = instancesAdapter;
|
|
40
|
+
this.baremetalAdapter = baremetalAdapter;
|
|
41
|
+
this.vpcAdapter = vpcAdapter;
|
|
42
|
+
this.iamAdapter = iamAdapter;
|
|
43
|
+
this.logger = new common_1.Logger(ScalewayProviderService_1.name);
|
|
44
|
+
}
|
|
45
|
+
// ─── Flui shared storage Volumes (§14 of scaling doc) ────────────────────
|
|
46
|
+
/**
|
|
47
|
+
* Provision Block Storage (SBS) Volumes and attach them to a freshly created
|
|
48
|
+
* instance. Uses raw axios calls because the Scaleway Block Storage API is
|
|
49
|
+
* not in the generated client. Each volume is created, awaited, then
|
|
50
|
+
* attached via the Instance API.
|
|
51
|
+
*
|
|
52
|
+
* Returns the device paths the bootstrap script will format/mount.
|
|
53
|
+
* Convention for Scaleway SBS attached volumes: /dev/disk/by-id/scsi-0SCW_b_<volume-id>.
|
|
54
|
+
*/
|
|
55
|
+
async provisionSharedVolumes(args) {
|
|
56
|
+
const { token, zone, requests, tags } = args;
|
|
57
|
+
const projectId = await this.iamAdapter.getDefaultProjectId();
|
|
58
|
+
const baseUrl = 'https://api.scaleway.com';
|
|
59
|
+
const headers = {
|
|
60
|
+
'X-Auth-Token': token,
|
|
61
|
+
'Content-Type': 'application/json',
|
|
62
|
+
};
|
|
63
|
+
const results = [];
|
|
64
|
+
for (const req of requests) {
|
|
65
|
+
const sizeBytes = Math.max(1, req.sizeGb) * 1_000_000_000;
|
|
66
|
+
this.logger.log(`[Scaleway] Creating SBS Volume ${req.name} (${req.sizeGb} GB) in zone ${zone}`);
|
|
67
|
+
let volumeId;
|
|
68
|
+
try {
|
|
69
|
+
const createResp = await axios_1.default.post(`${baseUrl}/block/v1/zones/${zone}/volumes`, {
|
|
70
|
+
name: req.name,
|
|
71
|
+
project_id: projectId,
|
|
72
|
+
from_empty: { size: sizeBytes },
|
|
73
|
+
perf_iops: 5000,
|
|
74
|
+
tags: [...tags, 'flui-shared-storage'],
|
|
75
|
+
}, { headers, timeout: 30000 });
|
|
76
|
+
volumeId = createResp.data?.id;
|
|
77
|
+
if (!volumeId) {
|
|
78
|
+
throw new Error(`SBS Volume create returned no id (response: ${JSON.stringify(createResp.data)})`);
|
|
79
|
+
}
|
|
80
|
+
this.logger.log(`[Scaleway] SBS Volume create accepted, id=${volumeId} status=${createResp.data?.status}`);
|
|
81
|
+
}
|
|
82
|
+
catch (err) {
|
|
83
|
+
const detail = err.response?.data
|
|
84
|
+
? JSON.stringify(err.response.data)
|
|
85
|
+
: err.message;
|
|
86
|
+
throw new Error(`SBS Volume create failed for ${req.name} (zone ${zone}): ${detail}`);
|
|
87
|
+
}
|
|
88
|
+
const start = Date.now();
|
|
89
|
+
const timeoutMs = 60_000;
|
|
90
|
+
let ready = false;
|
|
91
|
+
while (Date.now() - start < timeoutMs) {
|
|
92
|
+
try {
|
|
93
|
+
const statusResp = await axios_1.default.get(`${baseUrl}/block/v1/zones/${zone}/volumes/${volumeId}`, { headers, timeout: 15000 });
|
|
94
|
+
const status = statusResp.data.status;
|
|
95
|
+
if (status === 'available') {
|
|
96
|
+
ready = true;
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
if (status === 'error') {
|
|
100
|
+
throw new Error(`SBS Volume ${volumeId} reported error status`);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
catch (err) {
|
|
104
|
+
if (err.response?.status === 404) {
|
|
105
|
+
this.logger.warn(`[Scaleway] SBS Volume ${volumeId} GET 404 (eventual consistency), retrying`);
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
const detail = err.response?.data
|
|
109
|
+
? JSON.stringify(err.response.data)
|
|
110
|
+
: err.message;
|
|
111
|
+
throw new Error(`SBS Volume ${volumeId} status poll failed: ${detail}`);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
await new Promise((r) => setTimeout(r, 2000));
|
|
115
|
+
}
|
|
116
|
+
if (!ready) {
|
|
117
|
+
throw new Error(`SBS Volume ${volumeId} did not become available within ${timeoutMs / 1000}s`);
|
|
118
|
+
}
|
|
119
|
+
this.logger.log(`[Scaleway] ✅ SBS Volume ${volumeId} (${req.sizeGb} GB) ready for inline attach`);
|
|
120
|
+
results.push({
|
|
121
|
+
volumeId,
|
|
122
|
+
devicePath: `/dev/disk/by-id/scsi-0SCW_b_${volumeId}`,
|
|
123
|
+
sizeGb: req.sizeGb,
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
return results;
|
|
127
|
+
}
|
|
128
|
+
async deleteSharedVolume(args) {
|
|
129
|
+
const { token, zone, volumeId } = args;
|
|
130
|
+
const baseUrl = 'https://api.scaleway.com';
|
|
131
|
+
const headers = {
|
|
132
|
+
'X-Auth-Token': token,
|
|
133
|
+
'Content-Type': 'application/json',
|
|
134
|
+
};
|
|
135
|
+
try {
|
|
136
|
+
await axios_1.default.delete(`${baseUrl}/block/v1/zones/${zone}/volumes/${volumeId}`, { headers, timeout: 15000 });
|
|
137
|
+
}
|
|
138
|
+
catch (err) {
|
|
139
|
+
const detail = err.response?.data
|
|
140
|
+
? JSON.stringify(err.response.data)
|
|
141
|
+
: err.message;
|
|
142
|
+
this.logger.warn(`[Scaleway] Failed to cleanup SBS Volume ${volumeId} after instance failure: ${detail}`);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
// ─── Resource ID helpers ───────────────────────────────────────────────────
|
|
146
|
+
buildInstanceResourceId(zone, id) {
|
|
147
|
+
return `instance:${zone}:${id}`;
|
|
148
|
+
}
|
|
149
|
+
buildBaremetalResourceId(zone, id) {
|
|
150
|
+
return `baremetal:${zone}:${id}`;
|
|
151
|
+
}
|
|
152
|
+
parseResourceId(resourceId) {
|
|
153
|
+
const parts = resourceId.split(':');
|
|
154
|
+
if (parts.length !== 3)
|
|
155
|
+
return null;
|
|
156
|
+
const [family, zone, id] = parts;
|
|
157
|
+
if (family !== 'instance' && family !== 'baremetal')
|
|
158
|
+
return null;
|
|
159
|
+
return { family: family, zone, id };
|
|
160
|
+
}
|
|
161
|
+
// ─── Label / tag helpers ───────────────────────────────────────────────────
|
|
162
|
+
labelsToTags(labels) {
|
|
163
|
+
return Object.entries(labels).map(([k, v]) => `${k}=${v}`);
|
|
164
|
+
}
|
|
165
|
+
tagsToLabels(tags) {
|
|
166
|
+
const result = {};
|
|
167
|
+
for (const tag of tags) {
|
|
168
|
+
const eqIdx = tag.indexOf('=');
|
|
169
|
+
if (eqIdx > 0) {
|
|
170
|
+
result[tag.substring(0, eqIdx)] = tag.substring(eqIdx + 1);
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
result[tag] = '';
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
return result;
|
|
177
|
+
}
|
|
178
|
+
// ─── Status mapping ────────────────────────────────────────────────────────
|
|
179
|
+
mapInstanceStatus(state) {
|
|
180
|
+
switch (state) {
|
|
181
|
+
case instances_1.ScalewayInstanceV1ServerStateEnum.Running:
|
|
182
|
+
return instance_status_enum_1.InstanceStatus.RUNNING;
|
|
183
|
+
case instances_1.ScalewayInstanceV1ServerStateEnum.Stopped:
|
|
184
|
+
case instances_1.ScalewayInstanceV1ServerStateEnum.StoppedInPlace:
|
|
185
|
+
return instance_status_enum_1.InstanceStatus.STOPPED;
|
|
186
|
+
case instances_1.ScalewayInstanceV1ServerStateEnum.Starting:
|
|
187
|
+
return instance_status_enum_1.InstanceStatus.STARTING;
|
|
188
|
+
case instances_1.ScalewayInstanceV1ServerStateEnum.Stopping:
|
|
189
|
+
return instance_status_enum_1.InstanceStatus.STOPPING;
|
|
190
|
+
case instances_1.ScalewayInstanceV1ServerStateEnum.Locked:
|
|
191
|
+
return instance_status_enum_1.InstanceStatus.ERROR;
|
|
192
|
+
default:
|
|
193
|
+
return instance_status_enum_1.InstanceStatus.UNKNOWN;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
mapBaremetalStatus(status) {
|
|
197
|
+
switch (status) {
|
|
198
|
+
case baremetal_1.ScalewayBaremetalV1ServerStatusEnum.Ready:
|
|
199
|
+
return instance_status_enum_1.InstanceStatus.RUNNING;
|
|
200
|
+
case baremetal_1.ScalewayBaremetalV1ServerStatusEnum.Stopped:
|
|
201
|
+
return instance_status_enum_1.InstanceStatus.STOPPED;
|
|
202
|
+
case baremetal_1.ScalewayBaremetalV1ServerStatusEnum.Starting:
|
|
203
|
+
return instance_status_enum_1.InstanceStatus.STARTING;
|
|
204
|
+
case baremetal_1.ScalewayBaremetalV1ServerStatusEnum.Stopping:
|
|
205
|
+
return instance_status_enum_1.InstanceStatus.STOPPING;
|
|
206
|
+
case baremetal_1.ScalewayBaremetalV1ServerStatusEnum.Delivering:
|
|
207
|
+
case baremetal_1.ScalewayBaremetalV1ServerStatusEnum.Ordered:
|
|
208
|
+
case baremetal_1.ScalewayBaremetalV1ServerStatusEnum.Resetting:
|
|
209
|
+
return instance_status_enum_1.InstanceStatus.PROVISIONING;
|
|
210
|
+
case baremetal_1.ScalewayBaremetalV1ServerStatusEnum.Deleting:
|
|
211
|
+
return instance_status_enum_1.InstanceStatus.DELETING;
|
|
212
|
+
case baremetal_1.ScalewayBaremetalV1ServerStatusEnum.Error:
|
|
213
|
+
case baremetal_1.ScalewayBaremetalV1ServerStatusEnum.Locked:
|
|
214
|
+
return instance_status_enum_1.InstanceStatus.ERROR;
|
|
215
|
+
case baremetal_1.ScalewayBaremetalV1ServerStatusEnum.Migrating:
|
|
216
|
+
return instance_status_enum_1.InstanceStatus.MIGRATING;
|
|
217
|
+
default:
|
|
218
|
+
return instance_status_enum_1.InstanceStatus.UNKNOWN;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
// ─── DTO mappers ───────────────────────────────────────────────────────────
|
|
222
|
+
mapInstanceServerToEntity(server, zone, typeMap) {
|
|
223
|
+
const entity = new instance_entity_1.InstanceEntity();
|
|
224
|
+
entity.name = server.name || '';
|
|
225
|
+
entity.displayName = server.name || '';
|
|
226
|
+
entity.provider = cloud_provider_enum_1.CloudProvider.SCALEWAY;
|
|
227
|
+
entity.providerId = this.buildInstanceResourceId(zone, server.id);
|
|
228
|
+
entity.status = this.mapInstanceStatus(server.state);
|
|
229
|
+
entity.type = instance_type_enum_1.InstanceType.VM;
|
|
230
|
+
entity.dataCenter = zone;
|
|
231
|
+
entity.region = zone;
|
|
232
|
+
entity.regionName = zone;
|
|
233
|
+
const typeSpec = server.commercial_type
|
|
234
|
+
? typeMap?.get(server.commercial_type)
|
|
235
|
+
: undefined;
|
|
236
|
+
entity.cpuCores = typeSpec?.ncpus ?? 0;
|
|
237
|
+
entity.ramMb = typeSpec?.ram ? Math.round(typeSpec.ram / 1e6) : 0;
|
|
238
|
+
const volMax = typeSpec?.volumes_constraint?.max_size ?? 0;
|
|
239
|
+
entity.diskMb = volMax > 0 ? Math.round(volMax / 1e6) : 0;
|
|
240
|
+
entity.osType = null;
|
|
241
|
+
entity.defaultUser = 'root';
|
|
242
|
+
entity.additionalIps = [];
|
|
243
|
+
const publicIps = server.public_ips || [];
|
|
244
|
+
const firstIp = publicIps[0];
|
|
245
|
+
entity.ipConfig = {
|
|
246
|
+
v4: firstIp
|
|
247
|
+
? { ip: firstIp.address || '', gateway: '', netmaskCidr: 32 }
|
|
248
|
+
: undefined,
|
|
249
|
+
};
|
|
250
|
+
const instanceTags = server.tags || [];
|
|
251
|
+
entity.metadata = {
|
|
252
|
+
scalewayId: server.id,
|
|
253
|
+
zone,
|
|
254
|
+
commercialType: server.commercial_type,
|
|
255
|
+
tags: instanceTags,
|
|
256
|
+
labels: this.tagsToLabels(instanceTags),
|
|
257
|
+
arch: server.arch,
|
|
258
|
+
created: server.creation_date,
|
|
259
|
+
};
|
|
260
|
+
entity.userId = '';
|
|
261
|
+
return entity;
|
|
262
|
+
}
|
|
263
|
+
mapBaremetalServerToEntity(server, zone, offerMap) {
|
|
264
|
+
const entity = new instance_entity_1.InstanceEntity();
|
|
265
|
+
entity.name = server.name || '';
|
|
266
|
+
entity.displayName = server.name || '';
|
|
267
|
+
entity.provider = cloud_provider_enum_1.CloudProvider.SCALEWAY;
|
|
268
|
+
entity.providerId = this.buildBaremetalResourceId(zone, server.id);
|
|
269
|
+
entity.status = this.mapBaremetalStatus(server.status);
|
|
270
|
+
entity.type = instance_type_enum_1.InstanceType.DEDICATED;
|
|
271
|
+
entity.dataCenter = zone;
|
|
272
|
+
entity.region = zone;
|
|
273
|
+
entity.regionName = zone;
|
|
274
|
+
const offer = server.offer_id ? offerMap?.get(server.offer_id) : undefined;
|
|
275
|
+
entity.cpuCores = (offer?.cpus ?? []).reduce((s, c) => s + (c.core_count ?? 0), 0);
|
|
276
|
+
const totalRamBytes = (offer?.memories ?? []).reduce((s, m) => s + (m.capacity ?? 0), 0);
|
|
277
|
+
entity.ramMb = totalRamBytes > 0 ? Math.round(totalRamBytes / 1e6) : 0;
|
|
278
|
+
const totalDiskBytes = (offer?.disks ?? []).reduce((s, d) => s + (d.capacity ?? 0), 0);
|
|
279
|
+
entity.diskMb = totalDiskBytes > 0 ? Math.round(totalDiskBytes / 1e6) : 0;
|
|
280
|
+
entity.osType = null;
|
|
281
|
+
entity.defaultUser = 'root';
|
|
282
|
+
entity.additionalIps = [];
|
|
283
|
+
const ips = server.ips || [];
|
|
284
|
+
const ipv4 = ips.find((ip) => ip.version === baremetal_1.ScalewayBaremetalV1IPVersionEnum.Ipv4);
|
|
285
|
+
const ipv6 = ips.find((ip) => ip.version === baremetal_1.ScalewayBaremetalV1IPVersionEnum.Ipv6);
|
|
286
|
+
entity.ipConfig = {
|
|
287
|
+
v4: ipv4
|
|
288
|
+
? { ip: ipv4.address || '', gateway: '', netmaskCidr: 32 }
|
|
289
|
+
: undefined,
|
|
290
|
+
v6: ipv6
|
|
291
|
+
? { ip: ipv6.address || '', gateway: '', netmaskCidr: 64 }
|
|
292
|
+
: undefined,
|
|
293
|
+
};
|
|
294
|
+
const baremetalTags = server.tags || [];
|
|
295
|
+
entity.metadata = {
|
|
296
|
+
scalewayId: server.id,
|
|
297
|
+
zone,
|
|
298
|
+
offerId: server.offer_id,
|
|
299
|
+
offerName: server.offer_name,
|
|
300
|
+
tags: baremetalTags,
|
|
301
|
+
labels: this.tagsToLabels(baremetalTags),
|
|
302
|
+
created: server.created_at,
|
|
303
|
+
};
|
|
304
|
+
entity.userId = '';
|
|
305
|
+
return entity;
|
|
306
|
+
}
|
|
307
|
+
mapInstanceServerToDto(server, zone) {
|
|
308
|
+
const publicIps = server.public_ips || [];
|
|
309
|
+
const firstPublicIp = publicIps[0]?.address;
|
|
310
|
+
const labels = this.tagsToLabels(server.tags || []);
|
|
311
|
+
// Resolve the IPAM-assigned IP from the first private NIC (if any). The
|
|
312
|
+
// Scaleway server payload exposes the address either inline on the NIC or
|
|
313
|
+
// via the top-level private_ip field (legacy IPAM).
|
|
314
|
+
const privateNics = server.private_nics ?? [];
|
|
315
|
+
const firstNicIp = privateNics[0]?.private_ip ?? server.private_ip ?? null;
|
|
316
|
+
return {
|
|
317
|
+
id: this.buildInstanceResourceId(zone, server.id),
|
|
318
|
+
name: server.name || '',
|
|
319
|
+
provider: cloud_provider_enum_1.CloudProvider.SCALEWAY,
|
|
320
|
+
provider_resource_id: this.buildInstanceResourceId(zone, server.id),
|
|
321
|
+
server_type: server.commercial_type || '',
|
|
322
|
+
location: zone,
|
|
323
|
+
status: server.state || 'unknown',
|
|
324
|
+
public_ip: firstPublicIp || null,
|
|
325
|
+
private_ip: firstNicIp,
|
|
326
|
+
created_at: server.creation_date
|
|
327
|
+
? new Date(server.creation_date)
|
|
328
|
+
: new Date(),
|
|
329
|
+
updated_at: server.modification_date
|
|
330
|
+
? new Date(server.modification_date)
|
|
331
|
+
: new Date(),
|
|
332
|
+
lastSyncAt: new Date(),
|
|
333
|
+
labels: this.labelService.fromRecord(labels),
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
mapBaremetalServerToDto(server, zone) {
|
|
337
|
+
const ips = server.ips || [];
|
|
338
|
+
const ipv4 = ips.find((ip) => ip.version === baremetal_1.ScalewayBaremetalV1IPVersionEnum.Ipv4);
|
|
339
|
+
const labels = this.tagsToLabels(server.tags || []);
|
|
340
|
+
return {
|
|
341
|
+
id: this.buildBaremetalResourceId(zone, server.id),
|
|
342
|
+
name: server.name || '',
|
|
343
|
+
provider: cloud_provider_enum_1.CloudProvider.SCALEWAY,
|
|
344
|
+
provider_resource_id: this.buildBaremetalResourceId(zone, server.id),
|
|
345
|
+
server_type: server.offer_name || server.offer_id || '',
|
|
346
|
+
location: zone,
|
|
347
|
+
status: server.status || 'unknown',
|
|
348
|
+
public_ip: ipv4?.address || null,
|
|
349
|
+
private_ip: null,
|
|
350
|
+
created_at: server.created_at ? new Date(server.created_at) : new Date(),
|
|
351
|
+
updated_at: server.updated_at ? new Date(server.updated_at) : new Date(),
|
|
352
|
+
lastSyncAt: new Date(),
|
|
353
|
+
labels: this.labelService.fromRecord(labels),
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
// ─── ICloudProvider required methods ──────────────────────────────────────
|
|
357
|
+
async testConnection() {
|
|
358
|
+
try {
|
|
359
|
+
const token = await this.credentialProvider.getActiveApiToken(cloud_provider_enum_1.CloudProvider.SCALEWAY);
|
|
360
|
+
await this.instancesAdapter.listServers(token, instances_1.CreateServerZoneEnum.FrPar1);
|
|
361
|
+
return { success: true };
|
|
362
|
+
}
|
|
363
|
+
catch (error) {
|
|
364
|
+
this.logger.error('Scaleway connection test failed', error.message);
|
|
365
|
+
return { success: false, error: error.message };
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
async listInstances(filters) {
|
|
369
|
+
const token = await this.credentialProvider.getActiveApiToken(cloud_provider_enum_1.CloudProvider.SCALEWAY);
|
|
370
|
+
const entities = [];
|
|
371
|
+
// Pre-fetch server types per zone for hardware spec enrichment
|
|
372
|
+
const instanceTypeMapsByZone = new Map();
|
|
373
|
+
await Promise.allSettled(scaleway_instances_adapter_1.INSTANCE_ZONES.map(async (zone) => {
|
|
374
|
+
try {
|
|
375
|
+
const types = await this.instancesAdapter.listServerTypes(token, zone);
|
|
376
|
+
instanceTypeMapsByZone.set(zone, new Map(types.map((t) => [t.name, t])));
|
|
377
|
+
}
|
|
378
|
+
catch {
|
|
379
|
+
// non-fatal: hardware specs will be 0 for this zone
|
|
380
|
+
}
|
|
381
|
+
}));
|
|
382
|
+
const instanceResults = await Promise.allSettled(scaleway_instances_adapter_1.INSTANCE_ZONES.map(async (zone) => {
|
|
383
|
+
const servers = await this.instancesAdapter.listServers(token, zone);
|
|
384
|
+
const typeMap = instanceTypeMapsByZone.get(zone);
|
|
385
|
+
// Resolve IPAM-allocated private IPs in parallel so the entity reflects
|
|
386
|
+
// the VNet attachment. Without this, additionalIps stays empty and the
|
|
387
|
+
// Dashboard /instances view shows only the public IP.
|
|
388
|
+
return Promise.all(servers.map(async (s) => {
|
|
389
|
+
const entity = this.mapInstanceServerToEntity(s, zone, typeMap);
|
|
390
|
+
try {
|
|
391
|
+
const privateIp = await this.instancesAdapter.getInstancePrivateIp(token, zone, s);
|
|
392
|
+
if (privateIp) {
|
|
393
|
+
entity.additionalIps = [
|
|
394
|
+
...(entity.additionalIps ?? []),
|
|
395
|
+
privateIp,
|
|
396
|
+
];
|
|
397
|
+
entity.metadata = {
|
|
398
|
+
...entity.metadata,
|
|
399
|
+
privateIp,
|
|
400
|
+
};
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
catch {
|
|
404
|
+
// non-fatal: keep the entity without the private IP
|
|
405
|
+
}
|
|
406
|
+
return entity;
|
|
407
|
+
}));
|
|
408
|
+
}));
|
|
409
|
+
for (const result of instanceResults) {
|
|
410
|
+
if (result.status === 'fulfilled') {
|
|
411
|
+
if (filters?.clusterId) {
|
|
412
|
+
const clusterTag = `flui-cluster-id=${filters.clusterId}`;
|
|
413
|
+
entities.push(...result.value.filter((e) => Array.isArray(e.metadata?.tags) &&
|
|
414
|
+
e.metadata.tags.includes(clusterTag)));
|
|
415
|
+
}
|
|
416
|
+
else {
|
|
417
|
+
entities.push(...result.value);
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
// Pre-fetch baremetal offers per zone for hardware spec enrichment
|
|
422
|
+
const baremetalOfferMapsByZone = new Map();
|
|
423
|
+
await Promise.allSettled(scaleway_baremetal_adapter_1.BAREMETAL_ZONES.map(async (zone) => {
|
|
424
|
+
try {
|
|
425
|
+
const offers = await this.baremetalAdapter.listOffers(token, zone);
|
|
426
|
+
baremetalOfferMapsByZone.set(zone, new Map(offers.filter((o) => o.id).map((o) => [o.id, o])));
|
|
427
|
+
}
|
|
428
|
+
catch {
|
|
429
|
+
// non-fatal
|
|
430
|
+
}
|
|
431
|
+
}));
|
|
432
|
+
const baremetalResults = await Promise.allSettled(scaleway_baremetal_adapter_1.BAREMETAL_ZONES.map(async (zone) => {
|
|
433
|
+
const servers = await this.baremetalAdapter.listServers(token, zone);
|
|
434
|
+
const offerMap = baremetalOfferMapsByZone.get(zone);
|
|
435
|
+
return servers.map((s) => this.mapBaremetalServerToEntity(s, zone, offerMap));
|
|
436
|
+
}));
|
|
437
|
+
for (const result of baremetalResults) {
|
|
438
|
+
if (result.status === 'fulfilled') {
|
|
439
|
+
if (filters?.clusterId) {
|
|
440
|
+
const clusterTag = `flui-cluster-id=${filters.clusterId}`;
|
|
441
|
+
entities.push(...result.value.filter((e) => Array.isArray(e.metadata?.tags) &&
|
|
442
|
+
e.metadata.tags.includes(clusterTag)));
|
|
443
|
+
}
|
|
444
|
+
else {
|
|
445
|
+
entities.push(...result.value);
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
return entities;
|
|
450
|
+
}
|
|
451
|
+
async listServersAsDto() {
|
|
452
|
+
try {
|
|
453
|
+
const token = await this.credentialProvider.getActiveApiToken(cloud_provider_enum_1.CloudProvider.SCALEWAY);
|
|
454
|
+
const dtos = [];
|
|
455
|
+
const instanceResults = await Promise.allSettled(scaleway_instances_adapter_1.INSTANCE_ZONES.map(async (zone) => {
|
|
456
|
+
const servers = await this.instancesAdapter.listServers(token, zone);
|
|
457
|
+
return Promise.all(servers.map(async (s) => {
|
|
458
|
+
const dto = this.mapInstanceServerToDto(s, zone);
|
|
459
|
+
if (!dto.private_ip) {
|
|
460
|
+
const ipv4 = await this.instancesAdapter.getInstancePrivateIp(token, zone, s);
|
|
461
|
+
if (ipv4)
|
|
462
|
+
dto.private_ip = ipv4;
|
|
463
|
+
}
|
|
464
|
+
return dto;
|
|
465
|
+
}));
|
|
466
|
+
}));
|
|
467
|
+
for (const r of instanceResults) {
|
|
468
|
+
if (r.status === 'fulfilled')
|
|
469
|
+
dtos.push(...r.value);
|
|
470
|
+
}
|
|
471
|
+
const baremetalResults = await Promise.allSettled(scaleway_baremetal_adapter_1.BAREMETAL_ZONES.map(async (zone) => {
|
|
472
|
+
const servers = await this.baremetalAdapter.listServers(token, zone);
|
|
473
|
+
return servers.map((s) => this.mapBaremetalServerToDto(s, zone));
|
|
474
|
+
}));
|
|
475
|
+
for (const r of baremetalResults) {
|
|
476
|
+
if (r.status === 'fulfilled')
|
|
477
|
+
dtos.push(...r.value);
|
|
478
|
+
}
|
|
479
|
+
return dtos;
|
|
480
|
+
}
|
|
481
|
+
catch (error) {
|
|
482
|
+
this.logger.error('Failed to list Scaleway servers', error.message);
|
|
483
|
+
return [];
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
async getServerDetailsAsDto(serverId) {
|
|
487
|
+
const parsed = this.parseResourceId(serverId);
|
|
488
|
+
if (!parsed) {
|
|
489
|
+
this.logger.warn(`Invalid Scaleway resource ID: ${serverId}`);
|
|
490
|
+
return null;
|
|
491
|
+
}
|
|
492
|
+
try {
|
|
493
|
+
const token = await this.credentialProvider.getActiveApiToken(cloud_provider_enum_1.CloudProvider.SCALEWAY);
|
|
494
|
+
if (parsed.family === 'instance') {
|
|
495
|
+
const server = await this.instancesAdapter.getServer(token, parsed.zone, parsed.id);
|
|
496
|
+
if (!server)
|
|
497
|
+
return null;
|
|
498
|
+
return this.mapInstanceServerToDto(server, parsed.zone);
|
|
499
|
+
}
|
|
500
|
+
else {
|
|
501
|
+
const server = await this.baremetalAdapter.getServer(token, parsed.zone, parsed.id);
|
|
502
|
+
if (!server)
|
|
503
|
+
return null;
|
|
504
|
+
return this.mapBaremetalServerToDto(server, parsed.zone);
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
catch (error) {
|
|
508
|
+
this.logger.warn(`Failed to get Scaleway server details for ${serverId}`, error.message);
|
|
509
|
+
return null;
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
async createServer(config) {
|
|
513
|
+
this.logger.log(`Creating Scaleway server: ${config.name}`);
|
|
514
|
+
const token = await this.credentialProvider.getActiveApiToken(cloud_provider_enum_1.CloudProvider.SCALEWAY);
|
|
515
|
+
const labels = config.labels
|
|
516
|
+
? this.labelService.toRecord(config.labels)
|
|
517
|
+
: {};
|
|
518
|
+
const tags = this.labelsToTags(labels);
|
|
519
|
+
// Determine if this is a baremetal offer by checking the offer_id prefix or server_type
|
|
520
|
+
// Convention: baremetal server_types start with "EM-" (Elastic Metal) or "BM-"
|
|
521
|
+
const serverType = config.server_type || '';
|
|
522
|
+
const isBaremetal = serverType.toUpperCase().startsWith('EM-') ||
|
|
523
|
+
serverType.toUpperCase().startsWith('BM-');
|
|
524
|
+
// Scaleway Instances require a zone (e.g. 'fr-par-1'), not a region (e.g. 'fr-par').
|
|
525
|
+
// If the caller passes a region, append '-1' to use the first/default zone.
|
|
526
|
+
const rawLocation = config.location || 'fr-par-1';
|
|
527
|
+
const zone = (/^[a-z]{2}-[a-z]{3}$/.test(rawLocation) ? `${rawLocation}-1` : rawLocation);
|
|
528
|
+
if (isBaremetal) {
|
|
529
|
+
return this.createBaremetalServer(token, config, zone, tags);
|
|
530
|
+
}
|
|
531
|
+
else {
|
|
532
|
+
return this.createInstanceServer(token, config, zone, tags);
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
async createInstanceServer(token, config, zone, tags) {
|
|
536
|
+
// Resolve the root volume:
|
|
537
|
+
// - For local-SSD types (DEV1-*, GP1-*, PLAY2-*, ...) Scaleway only allocates
|
|
538
|
+
// the per-type minimum unless we explicitly size the boot volume. Default to
|
|
539
|
+
// the type's `volumes_constraint.max_size` so the user actually gets the
|
|
540
|
+
// storage already included in the price (e.g. DEV1-M = 40 GB).
|
|
541
|
+
// - For network-storage-only types (PRO2-*, ENT1-*) we must create an
|
|
542
|
+
// SBS volume; user must pass `diskSizeGb`.
|
|
543
|
+
const commercialType = (config.server_type || 'DEV1-S').toUpperCase();
|
|
544
|
+
let typeSpec;
|
|
545
|
+
try {
|
|
546
|
+
const types = await this.instancesAdapter.listServerTypes(token, zone);
|
|
547
|
+
typeSpec = types.find((t) => t.name === commercialType);
|
|
548
|
+
}
|
|
549
|
+
catch (err) {
|
|
550
|
+
this.logger.warn(`[Scaleway] Failed to fetch instance type spec for ${commercialType}: ${err.message}`);
|
|
551
|
+
}
|
|
552
|
+
const lssdMax = typeSpec?.per_volume_constraint?.l_ssd?.max_size ?? 0;
|
|
553
|
+
const isLocalSsd = lssdMax > 0;
|
|
554
|
+
const typeMaxSize = typeSpec?.volumes_constraint?.max_size ?? 0;
|
|
555
|
+
const volumes = {};
|
|
556
|
+
let rootBytes = 0;
|
|
557
|
+
let volumeType;
|
|
558
|
+
if (config.diskSizeGb && config.diskSizeGb > 0) {
|
|
559
|
+
rootBytes = config.diskSizeGb * 1_000_000_000;
|
|
560
|
+
volumeType = isLocalSsd
|
|
561
|
+
? instances_1.CreateServerRequestVolumesVolumeKeyVolumeTypeEnum.LSsd
|
|
562
|
+
: instances_1.CreateServerRequestVolumesVolumeKeyVolumeTypeEnum.SbsVolume;
|
|
563
|
+
}
|
|
564
|
+
else if (isLocalSsd && typeMaxSize > 0) {
|
|
565
|
+
rootBytes = typeMaxSize;
|
|
566
|
+
volumeType = instances_1.CreateServerRequestVolumesVolumeKeyVolumeTypeEnum.LSsd;
|
|
567
|
+
}
|
|
568
|
+
if (rootBytes > 0 && volumeType) {
|
|
569
|
+
volumes['0'] = {
|
|
570
|
+
volume_type: volumeType,
|
|
571
|
+
size: rootBytes,
|
|
572
|
+
boot: true,
|
|
573
|
+
};
|
|
574
|
+
this.logger.log(`[Scaleway] Creating instance ${config.name} (${commercialType}) ` +
|
|
575
|
+
`with root volume: ${Math.round(rootBytes / 1e9)} GB ${volumeType} ` +
|
|
576
|
+
`(${config.diskSizeGb ? 'user-specified' : 'type default max_size'})`);
|
|
577
|
+
}
|
|
578
|
+
else if (!isLocalSsd) {
|
|
579
|
+
this.logger.warn(`[Scaleway] ${commercialType} requires network storage but diskSizeGb was not set — Scaleway will reject the request`);
|
|
580
|
+
}
|
|
581
|
+
const projectId = await this.iamAdapter.getDefaultProjectId();
|
|
582
|
+
// Pre-provision Flui-managed extra Volumes (§14 of scaling doc) BEFORE
|
|
583
|
+
// creating the instance. Once available, attach them inline via the
|
|
584
|
+
// createServer `volumes` dict (id + volume_type + boot:false). This is
|
|
585
|
+
// the documented Scaleway pattern and avoids the post-create attach
|
|
586
|
+
// race that previously left instances unable to power on.
|
|
587
|
+
let preprovisionedVolumes = [];
|
|
588
|
+
if (config.attachedVolumes && config.attachedVolumes.length > 0) {
|
|
589
|
+
preprovisionedVolumes = await this.provisionSharedVolumes({
|
|
590
|
+
token,
|
|
591
|
+
zone: zone,
|
|
592
|
+
requests: config.attachedVolumes,
|
|
593
|
+
tags,
|
|
594
|
+
});
|
|
595
|
+
let nextKey = 1;
|
|
596
|
+
while (volumes[String(nextKey)])
|
|
597
|
+
nextKey++;
|
|
598
|
+
for (const v of preprovisionedVolumes) {
|
|
599
|
+
volumes[String(nextKey)] = {
|
|
600
|
+
id: v.volumeId,
|
|
601
|
+
volume_type: instances_1.CreateServerRequestVolumesVolumeKeyVolumeTypeEnum.SbsVolume,
|
|
602
|
+
boot: false,
|
|
603
|
+
};
|
|
604
|
+
nextKey++;
|
|
605
|
+
}
|
|
606
|
+
this.logger.log(`[Scaleway] Including ${preprovisionedVolumes.length} pre-created SBS volume(s) in createServer payload`);
|
|
607
|
+
}
|
|
608
|
+
// Extract the security group UUID from the first firewall ID (format: "<zone>:<sgId>")
|
|
609
|
+
// Passing security_group at creation time is the recommended approach — it ensures the
|
|
610
|
+
// firewall rules are applied before the instance boots for the first time.
|
|
611
|
+
let securityGroupId;
|
|
612
|
+
if (config.firewalls && config.firewalls.length > 0) {
|
|
613
|
+
const firstFw = config.firewalls[0];
|
|
614
|
+
const colonIdx = firstFw.indexOf(':');
|
|
615
|
+
if (colonIdx > 0) {
|
|
616
|
+
securityGroupId = firstFw.substring(colonIdx + 1);
|
|
617
|
+
this.logger.log(`[Scaleway] Attaching security group ${securityGroupId} at instance creation time (from firewall ${firstFw})`);
|
|
618
|
+
}
|
|
619
|
+
else {
|
|
620
|
+
this.logger.warn(`[Scaleway] Cannot parse firewall ID "${firstFw}" — expected "<zone>:<sgId>", security group will NOT be attached at creation`);
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
else {
|
|
624
|
+
this.logger.log(`[Scaleway] No firewalls configured for instance ${config.name} — creating without security group`);
|
|
625
|
+
}
|
|
626
|
+
let server;
|
|
627
|
+
try {
|
|
628
|
+
server = await this.instancesAdapter.createServer(token, zone, {
|
|
629
|
+
name: config.name,
|
|
630
|
+
commercial_type: config.server_type || 'DEV1-S',
|
|
631
|
+
image: 'ubuntu_noble',
|
|
632
|
+
tags,
|
|
633
|
+
project: projectId,
|
|
634
|
+
volumes: Object.keys(volumes).length > 0 ? volumes : undefined,
|
|
635
|
+
security_group: securityGroupId,
|
|
636
|
+
});
|
|
637
|
+
}
|
|
638
|
+
catch (err) {
|
|
639
|
+
const detail = err.response?.data
|
|
640
|
+
? JSON.stringify(err.response.data)
|
|
641
|
+
: err.message;
|
|
642
|
+
this.logger.error(`[Scaleway] createServer failed (zone=${zone}, type=${config.server_type}, volumes-keys=${Object.keys(volumes).join(',')}): ${detail}`);
|
|
643
|
+
for (const v of preprovisionedVolumes) {
|
|
644
|
+
await this.deleteSharedVolume({
|
|
645
|
+
token,
|
|
646
|
+
zone: zone,
|
|
647
|
+
volumeId: v.volumeId,
|
|
648
|
+
});
|
|
649
|
+
}
|
|
650
|
+
throw new Error(`Scaleway createServer failed: ${detail} (volumes payload keys: ${Object.keys(volumes).join(',')})`);
|
|
651
|
+
}
|
|
652
|
+
// Set cloud-init user data before powering on
|
|
653
|
+
if (server.id && config.user_data) {
|
|
654
|
+
this.logger.log(`[Scaleway] Setting user_data (cloud-init) on instance ${server.id} (zone: ${zone}, size: ${config.user_data.length} bytes)`);
|
|
655
|
+
this.logger.debug(`[Scaleway] cloud-init preview (first 300 chars): ${config.user_data.substring(0, 300)}`);
|
|
656
|
+
try {
|
|
657
|
+
await this.instancesAdapter.setUserData(token, zone, server.id, config.user_data);
|
|
658
|
+
this.logger.log(`[Scaleway] ✅ user_data set successfully on instance ${server.id}`);
|
|
659
|
+
}
|
|
660
|
+
catch (err) {
|
|
661
|
+
const errDetails = err.response?.data
|
|
662
|
+
? ` — ${JSON.stringify(err.response.data)}`
|
|
663
|
+
: '';
|
|
664
|
+
this.logger.error(`[Scaleway] ❌ Failed to set user_data for instance ${server.id}: ${err.message}${errDetails}`);
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
else if (server.id && !config.user_data) {
|
|
668
|
+
this.logger.warn(`[Scaleway] ⚠️ No user_data provided for instance ${server.id} — cloud-init will NOT run`);
|
|
669
|
+
}
|
|
670
|
+
// SBS volumes were pre-provisioned and attached inline via the
|
|
671
|
+
// createServer `volumes` dict (see above). Nothing extra to do here.
|
|
672
|
+
const attachedVolumesResult = preprovisionedVolumes;
|
|
673
|
+
// Power on the server (instances start stopped by default after create)
|
|
674
|
+
if (server.id &&
|
|
675
|
+
server.state !== instances_1.ScalewayInstanceV1ServerStateEnum.Running) {
|
|
676
|
+
this.logger.log(`[Scaleway] Powering on instance ${server.id} (current state: ${server.state})`);
|
|
677
|
+
try {
|
|
678
|
+
await this.instancesAdapter.serverAction(token, zone, server.id, instances_1.ServerActionRequestActionEnum.Poweron);
|
|
679
|
+
this.logger.log(`[Scaleway] ✅ Power-on action sent for instance ${server.id}`);
|
|
680
|
+
}
|
|
681
|
+
catch (err) {
|
|
682
|
+
this.logger.warn(`Failed to power on instance ${server.id}: ${err.message}`);
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
// Verify/confirm security group attachment (first one was set at creation time, extras via update)
|
|
686
|
+
if (config.firewalls && config.firewalls.length > 0 && server.id) {
|
|
687
|
+
// Log current security group on the created server for verification
|
|
688
|
+
const createdSg = server.security_group;
|
|
689
|
+
this.logger.log(`[Scaleway] Instance ${server.id} security_group after creation: ${JSON.stringify(createdSg)}`);
|
|
690
|
+
for (let i = 0; i < config.firewalls.length; i++) {
|
|
691
|
+
const firewallId = config.firewalls[i];
|
|
692
|
+
const parts = firewallId.split(':');
|
|
693
|
+
if (parts.length === 2) {
|
|
694
|
+
const [fwZone, sgId] = parts;
|
|
695
|
+
if (i === 0 && securityGroupId === sgId) {
|
|
696
|
+
// Already set at creation time — just log confirmation
|
|
697
|
+
this.logger.log(`[Scaleway] ✅ Security group ${sgId} was set at instance creation time (no extra call needed)`);
|
|
698
|
+
continue;
|
|
699
|
+
}
|
|
700
|
+
// Additional firewalls (index > 0) applied via updateServer
|
|
701
|
+
try {
|
|
702
|
+
await this.instancesAdapter.applySecurityGroupToServer(token, fwZone, server.id, sgId);
|
|
703
|
+
this.logger.log(`[Scaleway] ✅ Additional security group ${sgId} attached to instance ${server.id}`);
|
|
704
|
+
}
|
|
705
|
+
catch (err) {
|
|
706
|
+
const responseDetails = err.response?.data
|
|
707
|
+
? ` — response: ${JSON.stringify(err.response.data)}`
|
|
708
|
+
: '';
|
|
709
|
+
this.logger.error(`[Scaleway] ❌ Failed to attach security group ${sgId} to instance ${server.id}: ${err.message}${responseDetails}`);
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
else {
|
|
713
|
+
this.logger.warn(`[Scaleway] Skipping firewall with unexpected format: "${firewallId}" (expected "<zone>:<sgId>")`);
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
else if (!server.id) {
|
|
718
|
+
this.logger.warn(`[Scaleway] Cannot attach security groups — server.id is missing after creation`);
|
|
719
|
+
}
|
|
720
|
+
// Newly-created instances don't have a public IP until they finish booting.
|
|
721
|
+
// Poll getServer until public_ips is populated (~30-60s typical, 5 min cap).
|
|
722
|
+
let ipAddress = server.public_ips?.[0]?.address ?? undefined;
|
|
723
|
+
let finalState = server.state;
|
|
724
|
+
let privateIp = server.private_ip ?? undefined;
|
|
725
|
+
if (server.id && !ipAddress) {
|
|
726
|
+
const startedAt = Date.now();
|
|
727
|
+
const timeoutMs = 5 * 60_000;
|
|
728
|
+
while (Date.now() - startedAt < timeoutMs) {
|
|
729
|
+
await new Promise((r) => setTimeout(r, 5_000));
|
|
730
|
+
try {
|
|
731
|
+
const fresh = await this.instancesAdapter.getServer(token, zone, server.id);
|
|
732
|
+
finalState = fresh.state ?? finalState;
|
|
733
|
+
privateIp = fresh.private_ip ?? privateIp;
|
|
734
|
+
const ip = fresh.public_ips?.[0]?.address;
|
|
735
|
+
if (ip) {
|
|
736
|
+
ipAddress = ip;
|
|
737
|
+
break;
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
catch (err) {
|
|
741
|
+
this.logger.warn(`[Scaleway] Poll for instance ${server.id} IP failed: ${err.message}`);
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
if (!ipAddress) {
|
|
745
|
+
throw new Error(`Scaleway instance ${server.id} did not receive a public IP within 5 minutes`);
|
|
746
|
+
}
|
|
747
|
+
this.logger.log(`[Scaleway] Instance ${server.id} got public IP ${ipAddress} (state: ${finalState})`);
|
|
748
|
+
}
|
|
749
|
+
// Attach to Private Network when the caller passed `networks`.
|
|
750
|
+
// Each entry is a vnetId in our canonical "<region>:<uuid>" form; we strip
|
|
751
|
+
// the region prefix because Scaleway's createPrivateNIC takes the bare UUID.
|
|
752
|
+
if (server.id && config.networks && config.networks.length > 0) {
|
|
753
|
+
for (const networkRef of config.networks) {
|
|
754
|
+
const pnId = this.vpcAdapter.parseVnetId(networkRef).id;
|
|
755
|
+
try {
|
|
756
|
+
await this.instancesAdapter.attachToPrivateNetwork(token, zone, server.id, pnId);
|
|
757
|
+
}
|
|
758
|
+
catch (err) {
|
|
759
|
+
this.logger.error(`[Scaleway] Failed to attach instance ${server.id} to private network ${pnId}: ${err.message}`);
|
|
760
|
+
throw err;
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
// Poll once more so the IPAM-assigned private IP propagates onto the
|
|
764
|
+
// server payload before we return. Scaleway's NICs only carry the IP
|
|
765
|
+
// ID (`ipam_ip_ids`) — the actual address must be resolved via IPAM.
|
|
766
|
+
const startedAt = Date.now();
|
|
767
|
+
const timeoutMs = 90_000;
|
|
768
|
+
while (Date.now() - startedAt < timeoutMs) {
|
|
769
|
+
await new Promise((r) => setTimeout(r, 5_000));
|
|
770
|
+
try {
|
|
771
|
+
const fresh = await this.instancesAdapter.getServer(token, zone, server.id);
|
|
772
|
+
const ipv4 = await this.instancesAdapter.getInstancePrivateIp(token, zone, fresh);
|
|
773
|
+
if (ipv4) {
|
|
774
|
+
privateIp = ipv4;
|
|
775
|
+
break;
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
catch {
|
|
779
|
+
// ignore transient errors during polling
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
if (privateIp) {
|
|
783
|
+
this.logger.log(`[Scaleway] Instance ${server.id} got private IP ${privateIp} from IPAM`);
|
|
784
|
+
}
|
|
785
|
+
else {
|
|
786
|
+
this.logger.warn(`[Scaleway] Instance ${server.id} attached to VNet but private IP not yet visible after ${timeoutMs / 1000}s`);
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
return {
|
|
790
|
+
serverId: this.buildInstanceResourceId(zone, server.id),
|
|
791
|
+
ipAddress,
|
|
792
|
+
privateIp,
|
|
793
|
+
status: finalState || 'unknown',
|
|
794
|
+
attachedVolumes: attachedVolumesResult.length > 0 ? attachedVolumesResult : undefined,
|
|
795
|
+
};
|
|
796
|
+
}
|
|
797
|
+
async createBaremetalServer(token, config, zone, tags) {
|
|
798
|
+
const server = await this.baremetalAdapter.createServer(token, zone, {
|
|
799
|
+
name: config.name,
|
|
800
|
+
offer_id: config.server_type || '',
|
|
801
|
+
description: config.name,
|
|
802
|
+
tags,
|
|
803
|
+
install: config.ssh_keys && config.ssh_keys.length > 0
|
|
804
|
+
? {
|
|
805
|
+
os_id: config.image || '',
|
|
806
|
+
hostname: config.name,
|
|
807
|
+
ssh_key_ids: config.ssh_keys,
|
|
808
|
+
}
|
|
809
|
+
: undefined,
|
|
810
|
+
user_data: config.user_data ? { value: config.user_data } : undefined,
|
|
811
|
+
});
|
|
812
|
+
const ips = server.ips || [];
|
|
813
|
+
const ipv4 = ips.find((ip) => ip.version === baremetal_1.ScalewayBaremetalV1IPVersionEnum.Ipv4);
|
|
814
|
+
return {
|
|
815
|
+
serverId: this.buildBaremetalResourceId(zone, server.id),
|
|
816
|
+
ipAddress: ipv4?.address,
|
|
817
|
+
status: server.status || 'unknown',
|
|
818
|
+
};
|
|
819
|
+
}
|
|
820
|
+
async deleteServer(config) {
|
|
821
|
+
const parsed = this.parseResourceId(config.server_id);
|
|
822
|
+
if (!parsed) {
|
|
823
|
+
throw new Error(`Invalid Scaleway resource ID: ${config.server_id}`);
|
|
824
|
+
}
|
|
825
|
+
this.logger.log(`Deleting Scaleway server: ${config.server_id}`);
|
|
826
|
+
const token = await this.credentialProvider.getActiveApiToken(cloud_provider_enum_1.CloudProvider.SCALEWAY);
|
|
827
|
+
try {
|
|
828
|
+
if (parsed.family === 'instance') {
|
|
829
|
+
await this.instancesAdapter.deleteServer(token, parsed.zone, parsed.id);
|
|
830
|
+
}
|
|
831
|
+
else {
|
|
832
|
+
await this.baremetalAdapter.deleteServer(token, parsed.zone, parsed.id);
|
|
833
|
+
}
|
|
834
|
+
return { message: `Server ${config.server_id} deletion initiated` };
|
|
835
|
+
}
|
|
836
|
+
catch (error) {
|
|
837
|
+
if (error.response?.status === 404) {
|
|
838
|
+
throw new Error(`Server ${config.server_id} not found`);
|
|
839
|
+
}
|
|
840
|
+
throw new Error(`Server deletion failed: ${error.message}`);
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
async getServerStatus(serverId) {
|
|
844
|
+
const parsed = this.parseResourceId(serverId);
|
|
845
|
+
if (!parsed)
|
|
846
|
+
return 'error';
|
|
847
|
+
try {
|
|
848
|
+
const token = await this.credentialProvider.getActiveApiToken(cloud_provider_enum_1.CloudProvider.SCALEWAY);
|
|
849
|
+
if (parsed.family === 'instance') {
|
|
850
|
+
const server = await this.instancesAdapter.getServer(token, parsed.zone, parsed.id);
|
|
851
|
+
return server?.state || 'not-found';
|
|
852
|
+
}
|
|
853
|
+
else {
|
|
854
|
+
const server = await this.baremetalAdapter.getServer(token, parsed.zone, parsed.id);
|
|
855
|
+
return server?.status || 'not-found';
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
catch (error) {
|
|
859
|
+
if (error.response?.status === 404)
|
|
860
|
+
return 'not-found';
|
|
861
|
+
return 'error';
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
// ─── Optional methods ──────────────────────────────────────────────────────
|
|
865
|
+
async powerOnServer(serverId) {
|
|
866
|
+
const parsed = this.parseResourceId(serverId);
|
|
867
|
+
if (!parsed)
|
|
868
|
+
throw new Error(`Invalid resource ID: ${serverId}`);
|
|
869
|
+
const token = await this.credentialProvider.getActiveApiToken(cloud_provider_enum_1.CloudProvider.SCALEWAY);
|
|
870
|
+
if (parsed.family === 'instance') {
|
|
871
|
+
await this.instancesAdapter.serverAction(token, parsed.zone, parsed.id, instances_1.ServerActionRequestActionEnum.Poweron);
|
|
872
|
+
}
|
|
873
|
+
else {
|
|
874
|
+
await this.baremetalAdapter.startServer(token, parsed.zone, parsed.id);
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
async changeServerType(serverId, config) {
|
|
878
|
+
const parsed = this.parseResourceId(serverId);
|
|
879
|
+
if (!parsed)
|
|
880
|
+
throw new Error(`Invalid resource ID: ${serverId}`);
|
|
881
|
+
if (parsed.family !== 'instance') {
|
|
882
|
+
throw new Error(`changeServerType is not supported for Scaleway ${parsed.family} servers (bare-metal requires re-provisioning).`);
|
|
883
|
+
}
|
|
884
|
+
const token = await this.credentialProvider.getActiveApiToken(cloud_provider_enum_1.CloudProvider.SCALEWAY);
|
|
885
|
+
this.logger.log(`[Scaleway] change commercial_type server=${parsed.id} → ${config.targetServerType} (zone=${parsed.zone})`);
|
|
886
|
+
await this.instancesAdapter.updateServerCommercialType(token, parsed.zone, parsed.id, config.targetServerType);
|
|
887
|
+
return {};
|
|
888
|
+
}
|
|
889
|
+
async expandVolume(volumeId, newSizeGb) {
|
|
890
|
+
// Scaleway SBS resize requires a zone-scoped PATCH against the Block API.
|
|
891
|
+
// The orchestration layer must pass volumeId as `<zone>:<uuid>` so we can
|
|
892
|
+
// route the call without an additional lookup. Cluster-managed SBS
|
|
893
|
+
// volumes always live in the same zone as the master node, which the
|
|
894
|
+
// caller already knows from ClusterEntity.
|
|
895
|
+
const colon = volumeId.indexOf(':');
|
|
896
|
+
if (colon < 0) {
|
|
897
|
+
throw new Error(`Scaleway expandVolume requires volumeId in "<zone>:<uuid>" format (got "${volumeId}")`);
|
|
898
|
+
}
|
|
899
|
+
const zone = volumeId.slice(0, colon);
|
|
900
|
+
const id = volumeId.slice(colon + 1);
|
|
901
|
+
const token = await this.credentialProvider.getActiveApiToken(cloud_provider_enum_1.CloudProvider.SCALEWAY);
|
|
902
|
+
const baseUrl = 'https://api.scaleway.com';
|
|
903
|
+
const headers = { 'X-Auth-Token': token };
|
|
904
|
+
const sizeBytes = newSizeGb * 1_000_000_000;
|
|
905
|
+
this.logger.log(`[Scaleway] SBS resize volume=${id} zone=${zone} → ${newSizeGb} GB`);
|
|
906
|
+
try {
|
|
907
|
+
await axios_1.default.patch(`${baseUrl}/block/v1/zones/${zone}/volumes/${id}`, { size: sizeBytes }, { headers, timeout: 30000 });
|
|
908
|
+
return {};
|
|
909
|
+
}
|
|
910
|
+
catch (err) {
|
|
911
|
+
const detail = err.response?.data
|
|
912
|
+
? JSON.stringify(err.response.data)
|
|
913
|
+
: err.message;
|
|
914
|
+
throw new Error(`Scaleway SBS resize failed for ${id} (zone ${zone}): ${detail}`);
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
async detachVolume(volumeId) {
|
|
918
|
+
const parsed = this.parseVolumeRef(volumeId);
|
|
919
|
+
const token = await this.credentialProvider.getActiveApiToken(cloud_provider_enum_1.CloudProvider.SCALEWAY);
|
|
920
|
+
const headers = { 'X-Auth-Token': token };
|
|
921
|
+
this.logger.log(`[Scaleway] detach SBS volume=${parsed.id} zone=${parsed.zone}`);
|
|
922
|
+
try {
|
|
923
|
+
const lookup = await axios_1.default.get(`https://api.scaleway.com/block/v1/zones/${parsed.zone}/volumes/${parsed.id}`, { headers, timeout: 30000 });
|
|
924
|
+
const refs = (lookup.data?.references ?? []);
|
|
925
|
+
const instanceRef = refs.find((r) => r?.product_resource_type === 'instance_server');
|
|
926
|
+
if (!instanceRef?.id) {
|
|
927
|
+
this.logger.warn(`[Scaleway] volume ${parsed.id} has no instance reference — nothing to detach`);
|
|
928
|
+
return {};
|
|
929
|
+
}
|
|
930
|
+
// SBS detach: delete the reference via Block API. Instance API has no
|
|
931
|
+
// detach_volume action — that's a legacy local-storage concept.
|
|
932
|
+
await axios_1.default.delete(`https://api.scaleway.com/block/v1/zones/${parsed.zone}/volumes/${parsed.id}/references/${instanceRef.id}`, { headers, timeout: 30000 });
|
|
933
|
+
return {};
|
|
934
|
+
}
|
|
935
|
+
catch (err) {
|
|
936
|
+
if (err.response?.status === 404) {
|
|
937
|
+
this.logger.warn(`[Scaleway] volume ${parsed.id} not found during detach — treating as success`);
|
|
938
|
+
return {};
|
|
939
|
+
}
|
|
940
|
+
const detail = err.response?.data
|
|
941
|
+
? JSON.stringify(err.response.data)
|
|
942
|
+
: err.message;
|
|
943
|
+
throw new Error(`Scaleway detach volume failed for ${parsed.id}: ${detail}`);
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
async deleteVolume(volumeId) {
|
|
947
|
+
const parsed = this.parseVolumeRef(volumeId);
|
|
948
|
+
const token = await this.credentialProvider.getActiveApiToken(cloud_provider_enum_1.CloudProvider.SCALEWAY);
|
|
949
|
+
const headers = { 'X-Auth-Token': token };
|
|
950
|
+
this.logger.log(`[Scaleway] delete SBS volume=${parsed.id} zone=${parsed.zone}`);
|
|
951
|
+
try {
|
|
952
|
+
await axios_1.default.delete(`https://api.scaleway.com/block/v1/zones/${parsed.zone}/volumes/${parsed.id}`, { headers, timeout: 30000 });
|
|
953
|
+
}
|
|
954
|
+
catch (err) {
|
|
955
|
+
if (err.response?.status === 404) {
|
|
956
|
+
this.logger.warn(`[Scaleway] volume ${parsed.id} already gone`);
|
|
957
|
+
return;
|
|
958
|
+
}
|
|
959
|
+
const detail = err.response?.data
|
|
960
|
+
? JSON.stringify(err.response.data)
|
|
961
|
+
: err.message;
|
|
962
|
+
throw new Error(`Scaleway delete volume failed for ${parsed.id}: ${detail}`);
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
async listFluiManagedVolumes() {
|
|
966
|
+
const token = await this.credentialProvider.getActiveApiToken(cloud_provider_enum_1.CloudProvider.SCALEWAY);
|
|
967
|
+
const headers = { 'X-Auth-Token': token };
|
|
968
|
+
const zones = ['fr-par-1', 'fr-par-2', 'nl-ams-1', 'pl-waw-1'];
|
|
969
|
+
const results = [];
|
|
970
|
+
for (const zone of zones) {
|
|
971
|
+
try {
|
|
972
|
+
const res = await axios_1.default.get(`https://api.scaleway.com/block/v1/zones/${zone}/volumes`, {
|
|
973
|
+
headers,
|
|
974
|
+
params: { tags: 'managed-by=flui-cloud' },
|
|
975
|
+
timeout: 30000,
|
|
976
|
+
});
|
|
977
|
+
for (const v of res.data?.volumes ?? []) {
|
|
978
|
+
const tags = v.tags ?? [];
|
|
979
|
+
if (!tags.includes('managed-by=flui-cloud'))
|
|
980
|
+
continue;
|
|
981
|
+
const labels = {};
|
|
982
|
+
for (const t of tags) {
|
|
983
|
+
const eq = t.indexOf('=');
|
|
984
|
+
if (eq > 0)
|
|
985
|
+
labels[t.slice(0, eq)] = t.slice(eq + 1);
|
|
986
|
+
}
|
|
987
|
+
const serverRef = (v.references ?? []).find((r) => r?.product_resource_type === 'instance_server');
|
|
988
|
+
results.push({
|
|
989
|
+
volumeId: `${zone}:${v.id}`,
|
|
990
|
+
name: v.name,
|
|
991
|
+
sizeGb: Math.round((v.size ?? 0) / 1_000_000_000),
|
|
992
|
+
region: zone,
|
|
993
|
+
attachedServerId: serverRef?.product_resource_id ?? null,
|
|
994
|
+
labels,
|
|
995
|
+
createdAt: v.created_at,
|
|
996
|
+
});
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
catch (err) {
|
|
1000
|
+
if (err.response?.status === 404)
|
|
1001
|
+
continue;
|
|
1002
|
+
this.logger.warn(`[Scaleway] listFluiManagedVolumes in ${zone} failed: ${err.message}`);
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
return results;
|
|
1006
|
+
}
|
|
1007
|
+
parseVolumeRef(volumeId) {
|
|
1008
|
+
const colon = volumeId.indexOf(':');
|
|
1009
|
+
if (colon < 0) {
|
|
1010
|
+
throw new Error(`Scaleway volume id must be "<zone>:<uuid>" (got "${volumeId}")`);
|
|
1011
|
+
}
|
|
1012
|
+
return { zone: volumeId.slice(0, colon), id: volumeId.slice(colon + 1) };
|
|
1013
|
+
}
|
|
1014
|
+
async powerOffServer(serverId) {
|
|
1015
|
+
const parsed = this.parseResourceId(serverId);
|
|
1016
|
+
if (!parsed)
|
|
1017
|
+
throw new Error(`Invalid resource ID: ${serverId}`);
|
|
1018
|
+
const token = await this.credentialProvider.getActiveApiToken(cloud_provider_enum_1.CloudProvider.SCALEWAY);
|
|
1019
|
+
if (parsed.family === 'instance') {
|
|
1020
|
+
await this.instancesAdapter.serverAction(token, parsed.zone, parsed.id, instances_1.ServerActionRequestActionEnum.Poweroff);
|
|
1021
|
+
}
|
|
1022
|
+
else {
|
|
1023
|
+
await this.baremetalAdapter.stopServer(token, parsed.zone, parsed.id);
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
async updateServerLabels(serverId, labels) {
|
|
1027
|
+
const parsed = this.parseResourceId(serverId);
|
|
1028
|
+
if (!parsed)
|
|
1029
|
+
throw new Error(`Invalid resource ID: ${serverId}`);
|
|
1030
|
+
const token = await this.credentialProvider.getActiveApiToken(cloud_provider_enum_1.CloudProvider.SCALEWAY);
|
|
1031
|
+
const tags = this.labelsToTags(labels);
|
|
1032
|
+
if (parsed.family === 'instance') {
|
|
1033
|
+
await this.instancesAdapter.updateServerTags(token, parsed.zone, parsed.id, tags);
|
|
1034
|
+
}
|
|
1035
|
+
else {
|
|
1036
|
+
await this.baremetalAdapter.updateServerTags(token, parsed.zone, parsed.id, tags);
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
async getNodeSizes(includeAvailability = true) {
|
|
1040
|
+
try {
|
|
1041
|
+
const token = await this.credentialProvider.getActiveApiToken(cloud_provider_enum_1.CloudProvider.SCALEWAY);
|
|
1042
|
+
const nodeSizes = [];
|
|
1043
|
+
// ── Instance types ────────────────────────────────────────────────────
|
|
1044
|
+
// Fetch from all zones to build per-region availability + pricing.
|
|
1045
|
+
// Types and specs are identical across zones; only availability may differ.
|
|
1046
|
+
try {
|
|
1047
|
+
// Map: typeName → { typeData, availableRegions: Set<string>, pricesByRegion }
|
|
1048
|
+
const typeMap = new Map();
|
|
1049
|
+
const instanceZoneResults = await Promise.allSettled(scaleway_instances_adapter_1.INSTANCE_ZONES.map((zone) => this.instancesAdapter.listServerTypes(token, zone)));
|
|
1050
|
+
for (const [i, result] of instanceZoneResults.entries()) {
|
|
1051
|
+
if (result.status !== 'fulfilled')
|
|
1052
|
+
continue;
|
|
1053
|
+
const zone = scaleway_instances_adapter_1.INSTANCE_ZONES[i];
|
|
1054
|
+
const region = zone.replace(/-\d+$/, '');
|
|
1055
|
+
for (const t of result.value) {
|
|
1056
|
+
if (!t.name)
|
|
1057
|
+
continue;
|
|
1058
|
+
if (!typeMap.has(t.name)) {
|
|
1059
|
+
typeMap.set(t.name, {
|
|
1060
|
+
type: t,
|
|
1061
|
+
availableRegions: new Set(),
|
|
1062
|
+
pricesByRegion: new Map(),
|
|
1063
|
+
});
|
|
1064
|
+
}
|
|
1065
|
+
const entry = typeMap.get(t.name);
|
|
1066
|
+
entry.availableRegions.add(region);
|
|
1067
|
+
if (t.hourly_price != null && !entry.pricesByRegion.has(region)) {
|
|
1068
|
+
entry.pricesByRegion.set(region, {
|
|
1069
|
+
hourly: t.hourly_price,
|
|
1070
|
+
monthlyCap: typeof t.monthly_price === 'number' && t.monthly_price > 0
|
|
1071
|
+
? t.monthly_price
|
|
1072
|
+
: undefined,
|
|
1073
|
+
});
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
const mapArch = (arch) => {
|
|
1078
|
+
if (arch === 'arm' || arch === 'arm64')
|
|
1079
|
+
return 'arm';
|
|
1080
|
+
return 'x86';
|
|
1081
|
+
};
|
|
1082
|
+
const hasLocalSsd = (t) => {
|
|
1083
|
+
// l_ssd can be present as an empty object {} on block-storage-only types (PRO2, ENT1…).
|
|
1084
|
+
// Only consider it a real local SSD if max_size > 0.
|
|
1085
|
+
return (t.per_volume_constraint?.l_ssd?.max_size ?? 0) > 0;
|
|
1086
|
+
};
|
|
1087
|
+
const mapVolumeType = (t) => {
|
|
1088
|
+
return hasLocalSsd(t) ? 'local' : 'network';
|
|
1089
|
+
};
|
|
1090
|
+
const mapDiskGb = (t) => {
|
|
1091
|
+
// Scaleway uses decimal bytes (1 GB = 1_000_000_000), not binary GiB.
|
|
1092
|
+
// volumes_constraint.max_size is the default root disk size for LSSD types
|
|
1093
|
+
// (e.g. DEV1-S max=20_000_000_000 → 20 GB, GP1-S max=300_000_000_000 → 300 GB).
|
|
1094
|
+
// min_size is always 0 — not useful. Block-storage-only types have max_size=0 → disk=0.
|
|
1095
|
+
if (!hasLocalSsd(t))
|
|
1096
|
+
return 0;
|
|
1097
|
+
const volMax = t.volumes_constraint?.max_size ?? 0;
|
|
1098
|
+
return volMax > 0 ? Math.round(volMax / 1e9) : 0;
|
|
1099
|
+
};
|
|
1100
|
+
const mapCpuType = (name) => {
|
|
1101
|
+
// DEV, STARDUST, PLAY2 → shared vCPU; GP1, PRO2, ENT1, POP2, COPARM → dedicated vCPU
|
|
1102
|
+
const shared = /^(DEV|STARDUST|PLAY2)/i.test(name);
|
|
1103
|
+
return shared ? 'shared' : 'dedicated';
|
|
1104
|
+
};
|
|
1105
|
+
for (const [name, entry] of typeMap.entries()) {
|
|
1106
|
+
const t = entry.type;
|
|
1107
|
+
const ramBytes = t.ram || 0;
|
|
1108
|
+
const ramGb = Math.round(ramBytes / 1e9); // Scaleway uses decimal bytes (1 GB = 1_000_000_000)
|
|
1109
|
+
const diskGb = mapDiskGb(t);
|
|
1110
|
+
const prices = [];
|
|
1111
|
+
for (const [region, p] of entry.pricesByRegion.entries()) {
|
|
1112
|
+
// Scaleway bills min(hourly * hours, monthly_cap). Prefer the
|
|
1113
|
+
// provider-declared monthly cap so estimates match what the
|
|
1114
|
+
// customer actually pays. Fall back to hourly * 720 only when the
|
|
1115
|
+
// cap is missing or zero (some new types omit it).
|
|
1116
|
+
const monthly = p.monthlyCap ?? Math.round(p.hourly * 720 * 1000) / 1000;
|
|
1117
|
+
prices.push({
|
|
1118
|
+
location: region,
|
|
1119
|
+
priceHourly: { net: String(p.hourly), gross: String(p.hourly) },
|
|
1120
|
+
priceMonthly: { net: String(monthly), gross: String(monthly) },
|
|
1121
|
+
});
|
|
1122
|
+
}
|
|
1123
|
+
const availability = Array.from(entry.availableRegions).map((region) => ({
|
|
1124
|
+
location: region,
|
|
1125
|
+
available: true,
|
|
1126
|
+
deprecated: t.end_of_service ?? false,
|
|
1127
|
+
}));
|
|
1128
|
+
nodeSizes.push({
|
|
1129
|
+
id: name,
|
|
1130
|
+
name,
|
|
1131
|
+
description: `Scaleway ${name} — ${t.ncpus || 0} vCPU, ${ramGb} GB RAM`,
|
|
1132
|
+
cores: t.ncpus || 0,
|
|
1133
|
+
memory: ramGb,
|
|
1134
|
+
disk: diskGb,
|
|
1135
|
+
storageType: mapVolumeType(t),
|
|
1136
|
+
cpuType: mapCpuType(name),
|
|
1137
|
+
architecture: mapArch(t.arch),
|
|
1138
|
+
deprecated: t.end_of_service ?? false,
|
|
1139
|
+
bareMetal: false,
|
|
1140
|
+
managedFirewall: true, // Security Groups work on all Scaleway Instances
|
|
1141
|
+
supportsHourlyBilling: true,
|
|
1142
|
+
blockStoragePricePerGbMonthly: mapVolumeType(t) === 'network'
|
|
1143
|
+
? SBS_5K_PRICE_PER_GB_MONTHLY
|
|
1144
|
+
: undefined,
|
|
1145
|
+
prices,
|
|
1146
|
+
locations: availability.map((av) => ({
|
|
1147
|
+
id: 0,
|
|
1148
|
+
name: av.location,
|
|
1149
|
+
deprecation: null,
|
|
1150
|
+
})),
|
|
1151
|
+
availability,
|
|
1152
|
+
});
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
1155
|
+
catch (err) {
|
|
1156
|
+
this.logger.warn('Failed to fetch Scaleway instance types', err.message);
|
|
1157
|
+
}
|
|
1158
|
+
// ── Baremetal offers (per zone, deduplicated by offer_id) ─────────────
|
|
1159
|
+
const seenOfferIds = new Set();
|
|
1160
|
+
const baremetalResults = await Promise.allSettled(scaleway_baremetal_adapter_1.BAREMETAL_ZONES.map((zone) => this.baremetalAdapter.listOffers(token, zone)));
|
|
1161
|
+
for (const [i, result] of baremetalResults.entries()) {
|
|
1162
|
+
if (result.status !== 'fulfilled')
|
|
1163
|
+
continue;
|
|
1164
|
+
const zone = scaleway_baremetal_adapter_1.BAREMETAL_ZONES[i];
|
|
1165
|
+
for (const offer of result.value) {
|
|
1166
|
+
if (!offer.id || seenOfferIds.has(offer.id))
|
|
1167
|
+
continue;
|
|
1168
|
+
seenOfferIds.add(offer.id);
|
|
1169
|
+
// Sum across all CPU sockets, memory modules, and physical disks
|
|
1170
|
+
const totalCores = (offer.cpus || []).reduce((s, c) => s + (c.core_count || 0), 0);
|
|
1171
|
+
const totalMemoryBytes = (offer.memories || []).reduce((s, m) => s + (m.capacity || 0), 0);
|
|
1172
|
+
const totalDiskBytes = (offer.disks || []).reduce((s, d) => s + (d.capacity || 0), 0);
|
|
1173
|
+
const priceHourly = offer.price_per_hour;
|
|
1174
|
+
const priceMonthly = offer.price_per_month;
|
|
1175
|
+
const formatPrice = (p) => {
|
|
1176
|
+
if (!p)
|
|
1177
|
+
return '0';
|
|
1178
|
+
return String((p.units || 0) + (p.nanos || 0) / 1e9);
|
|
1179
|
+
};
|
|
1180
|
+
const priceEntry = {
|
|
1181
|
+
location: zone,
|
|
1182
|
+
priceHourly: {
|
|
1183
|
+
net: formatPrice(priceHourly),
|
|
1184
|
+
gross: formatPrice(priceHourly),
|
|
1185
|
+
},
|
|
1186
|
+
priceMonthly: {
|
|
1187
|
+
net: formatPrice(priceMonthly),
|
|
1188
|
+
gross: formatPrice(priceMonthly),
|
|
1189
|
+
},
|
|
1190
|
+
};
|
|
1191
|
+
const regionName = zone.replace(/-\d+$/, ''); // fr-par-1 → fr-par
|
|
1192
|
+
nodeSizes.push({
|
|
1193
|
+
id: offer.id,
|
|
1194
|
+
name: offer.name || offer.id,
|
|
1195
|
+
description: offer.name || offer.id,
|
|
1196
|
+
cores: totalCores,
|
|
1197
|
+
memory: Math.round(totalMemoryBytes / 1e9), // decimal bytes → GB
|
|
1198
|
+
disk: Math.round(totalDiskBytes / 1e9), // sum of all physical disks → GB
|
|
1199
|
+
storageType: 'local',
|
|
1200
|
+
cpuType: 'dedicated',
|
|
1201
|
+
architecture: 'x86',
|
|
1202
|
+
deprecated: !(offer.enable ?? true),
|
|
1203
|
+
bareMetal: true,
|
|
1204
|
+
managedFirewall: false, // Scaleway Security Groups are not available on Elastic Metal
|
|
1205
|
+
supportsHourlyBilling: true, // Elastic Metal supports hourly billing (pay-as-you-go)
|
|
1206
|
+
prices: [priceEntry],
|
|
1207
|
+
locations: [{ id: 0, name: regionName, deprecation: null }],
|
|
1208
|
+
availability: [
|
|
1209
|
+
{
|
|
1210
|
+
location: regionName,
|
|
1211
|
+
available: offer.enable ?? true,
|
|
1212
|
+
deprecated: false,
|
|
1213
|
+
},
|
|
1214
|
+
],
|
|
1215
|
+
});
|
|
1216
|
+
}
|
|
1217
|
+
}
|
|
1218
|
+
return nodeSizes;
|
|
1219
|
+
}
|
|
1220
|
+
catch (error) {
|
|
1221
|
+
this.logger.error('Failed to fetch Scaleway node sizes', error.message);
|
|
1222
|
+
return [];
|
|
1223
|
+
}
|
|
1224
|
+
}
|
|
1225
|
+
// ─── VNet / Private Network Management ────────────────────────────────────
|
|
1226
|
+
async createVNet(config) {
|
|
1227
|
+
const region = this.extractRegionFromLabels(config.labels) ?? 'fr-par';
|
|
1228
|
+
const tags = (config.labels ?? []).map((l) => `${l.key}=${l.value}`);
|
|
1229
|
+
const subnets = config.subnets?.map((s) => s.ipRange) ??
|
|
1230
|
+
(config.ipRange ? [config.ipRange] : []);
|
|
1231
|
+
return this.vpcAdapter.createPrivateNetwork(region, config.name, tags, subnets);
|
|
1232
|
+
}
|
|
1233
|
+
async deleteVNet(vnetId) {
|
|
1234
|
+
const { region, id } = this.vpcAdapter.parseVnetId(vnetId);
|
|
1235
|
+
await this.vpcAdapter.deletePrivateNetwork(region, id);
|
|
1236
|
+
return { message: `Private Network ${id} deleted` };
|
|
1237
|
+
}
|
|
1238
|
+
async getVNet(vnetId) {
|
|
1239
|
+
const { region, id } = this.vpcAdapter.parseVnetId(vnetId);
|
|
1240
|
+
return this.vpcAdapter.getPrivateNetwork(region, id);
|
|
1241
|
+
}
|
|
1242
|
+
async listVNets() {
|
|
1243
|
+
const regions = ['fr-par', 'nl-ams', 'pl-waw'];
|
|
1244
|
+
const results = await Promise.all(regions.map((r) => this.vpcAdapter.listPrivateNetworks(r)));
|
|
1245
|
+
return results.flat();
|
|
1246
|
+
}
|
|
1247
|
+
async addSubnet(config) {
|
|
1248
|
+
const { region, id } = this.vpcAdapter.parseVnetId(config.vnetId);
|
|
1249
|
+
await this.vpcAdapter.addSubnets(region, id, [config.ipRange]);
|
|
1250
|
+
return {};
|
|
1251
|
+
}
|
|
1252
|
+
async deleteSubnet(config) {
|
|
1253
|
+
const { region, id } = this.vpcAdapter.parseVnetId(config.vnetId);
|
|
1254
|
+
await this.vpcAdapter.deleteSubnets(region, id, [config.ipRange]);
|
|
1255
|
+
return {};
|
|
1256
|
+
}
|
|
1257
|
+
async addRoute(config) {
|
|
1258
|
+
// Scaleway routes are managed at VPC level, not Private Network level
|
|
1259
|
+
this.logger.warn(`addRoute is not supported for Scaleway Private Networks (destination=${config.destination})`);
|
|
1260
|
+
return {};
|
|
1261
|
+
}
|
|
1262
|
+
async deleteRoute(config) {
|
|
1263
|
+
this.logger.warn(`deleteRoute is not supported for Scaleway Private Networks (destination=${config.destination})`);
|
|
1264
|
+
return {};
|
|
1265
|
+
}
|
|
1266
|
+
async attachServerToVNet(config) {
|
|
1267
|
+
const { id: pnId } = this.vpcAdapter.parseVnetId(config.vnetId);
|
|
1268
|
+
const parsed = this.parseResourceId(config.serverId);
|
|
1269
|
+
if (parsed?.family === 'baremetal') {
|
|
1270
|
+
await this.vpcAdapter.attachBaremetalToPrivateNetwork(parsed.zone, parsed.id, pnId);
|
|
1271
|
+
return {
|
|
1272
|
+
message: `Elastic Metal server ${parsed.id} attached to private network ${pnId}`,
|
|
1273
|
+
};
|
|
1274
|
+
}
|
|
1275
|
+
// For Instances: attachment is handled automatically by Scaleway IPAM/DHCP
|
|
1276
|
+
// when the private network is assigned at server creation time
|
|
1277
|
+
this.logger.log(`Instance ${config.serverId} — private network attachment managed by Scaleway IPAM (no explicit API call needed)`);
|
|
1278
|
+
return {
|
|
1279
|
+
message: `Instance ${config.serverId} uses Scaleway IPAM for private network connectivity`,
|
|
1280
|
+
};
|
|
1281
|
+
}
|
|
1282
|
+
async detachServerFromVNet(config) {
|
|
1283
|
+
const { id: pnId } = this.vpcAdapter.parseVnetId(config.vnetId);
|
|
1284
|
+
const parsed = this.parseResourceId(config.serverId);
|
|
1285
|
+
if (parsed?.family === 'baremetal') {
|
|
1286
|
+
await this.vpcAdapter.detachBaremetalFromPrivateNetwork(parsed.zone, parsed.id, pnId);
|
|
1287
|
+
}
|
|
1288
|
+
else {
|
|
1289
|
+
this.logger.log(`Instance ${config.serverId} — private network detachment managed by Scaleway IPAM`);
|
|
1290
|
+
}
|
|
1291
|
+
return {};
|
|
1292
|
+
}
|
|
1293
|
+
// ─── Private helpers ────────────────────────────────────────────────────────
|
|
1294
|
+
extractRegionFromLabels(labels) {
|
|
1295
|
+
const label = labels?.find((l) => l.key === 'region' || l.key === 'scaleway-region');
|
|
1296
|
+
return label?.value ?? null;
|
|
1297
|
+
}
|
|
1298
|
+
// ─── SSH Key Registry (IAM) ──────────────────────────────────────────────────
|
|
1299
|
+
async resolveSSHKeys(keys) {
|
|
1300
|
+
const providerIds = [];
|
|
1301
|
+
for (const key of keys) {
|
|
1302
|
+
if (key.existingProviderId) {
|
|
1303
|
+
this.logger.log(`[Scaleway] SSH key "${key.name}" already synced → provider ID: ${key.existingProviderId}`);
|
|
1304
|
+
providerIds.push(key.existingProviderId);
|
|
1305
|
+
continue;
|
|
1306
|
+
}
|
|
1307
|
+
try {
|
|
1308
|
+
const result = await this.createSSHKey(key.name, key.publicKey);
|
|
1309
|
+
this.logger.log(`[Scaleway] SSH key "${key.name}" created on IAM → provider ID: ${result.id}`);
|
|
1310
|
+
providerIds.push(result.id);
|
|
1311
|
+
}
|
|
1312
|
+
catch (error) {
|
|
1313
|
+
if (error.message?.includes('already exists')) {
|
|
1314
|
+
const existing = await this.listSSHKeys();
|
|
1315
|
+
const match = existing.find((k) => k.fingerprint === key.fingerprint || k.name === key.name);
|
|
1316
|
+
if (match) {
|
|
1317
|
+
this.logger.log(`[Scaleway] SSH key "${key.name}" already exists on IAM → provider ID: ${match.id}`);
|
|
1318
|
+
providerIds.push(match.id);
|
|
1319
|
+
continue;
|
|
1320
|
+
}
|
|
1321
|
+
}
|
|
1322
|
+
this.logger.error(`[Scaleway] Failed to resolve SSH key "${key.name}": ${error.message}`);
|
|
1323
|
+
throw error;
|
|
1324
|
+
}
|
|
1325
|
+
}
|
|
1326
|
+
this.logger.log(`[Scaleway] resolveSSHKeys complete — ${providerIds.length} key(s) resolved: [${providerIds.join(', ')}]`);
|
|
1327
|
+
return providerIds;
|
|
1328
|
+
}
|
|
1329
|
+
async listSSHKeys() {
|
|
1330
|
+
const keys = await this.iamAdapter.listSSHKeys();
|
|
1331
|
+
return keys.map((k) => ({
|
|
1332
|
+
id: k.id ?? '',
|
|
1333
|
+
name: k.name ?? '',
|
|
1334
|
+
publicKey: k.public_key ?? '',
|
|
1335
|
+
fingerprint: k.fingerprint ?? '',
|
|
1336
|
+
type: this.extractKeyType(k.public_key),
|
|
1337
|
+
createdAt: k.created_at ? new Date(k.created_at) : new Date(),
|
|
1338
|
+
updatedAt: k.updated_at ? new Date(k.updated_at) : undefined,
|
|
1339
|
+
source: cloud_provider_enum_1.CloudProvider.SCALEWAY,
|
|
1340
|
+
syncedFromProvider: true,
|
|
1341
|
+
providerKeyId: k.id,
|
|
1342
|
+
isActive: !(k.disabled ?? false),
|
|
1343
|
+
autoGenerated: false,
|
|
1344
|
+
}));
|
|
1345
|
+
}
|
|
1346
|
+
async createSSHKey(name, publicKey, labels) {
|
|
1347
|
+
try {
|
|
1348
|
+
return await this.iamAdapter.createSSHKey(name, publicKey, labels);
|
|
1349
|
+
}
|
|
1350
|
+
catch (e) {
|
|
1351
|
+
if (e.response?.status === 409) {
|
|
1352
|
+
throw new Error(`SSH key with name "${name}" already exists on Scaleway`);
|
|
1353
|
+
}
|
|
1354
|
+
throw e;
|
|
1355
|
+
}
|
|
1356
|
+
}
|
|
1357
|
+
async deleteSSHKey(providerKeyId) {
|
|
1358
|
+
try {
|
|
1359
|
+
await this.iamAdapter.deleteSSHKey(providerKeyId);
|
|
1360
|
+
}
|
|
1361
|
+
catch (e) {
|
|
1362
|
+
if (e.response?.status === 404)
|
|
1363
|
+
return;
|
|
1364
|
+
throw e;
|
|
1365
|
+
}
|
|
1366
|
+
}
|
|
1367
|
+
async getSSHKey(providerKeyId) {
|
|
1368
|
+
const k = await this.iamAdapter.getSSHKey(providerKeyId);
|
|
1369
|
+
return {
|
|
1370
|
+
id: k.id ?? '',
|
|
1371
|
+
name: k.name ?? '',
|
|
1372
|
+
publicKey: k.public_key ?? '',
|
|
1373
|
+
fingerprint: k.fingerprint ?? '',
|
|
1374
|
+
};
|
|
1375
|
+
}
|
|
1376
|
+
extractKeyType(publicKey) {
|
|
1377
|
+
if (publicKey?.startsWith('ssh-rsa'))
|
|
1378
|
+
return 'rsa';
|
|
1379
|
+
if (publicKey?.startsWith('ssh-ed25519'))
|
|
1380
|
+
return 'ed25519';
|
|
1381
|
+
if (publicKey?.startsWith('ecdsa-sha2'))
|
|
1382
|
+
return 'ecdsa';
|
|
1383
|
+
return 'unknown';
|
|
1384
|
+
}
|
|
1385
|
+
};
|
|
1386
|
+
exports.ScalewayProviderService = ScalewayProviderService;
|
|
1387
|
+
exports.ScalewayProviderService = ScalewayProviderService = ScalewayProviderService_1 = __decorate([
|
|
1388
|
+
(0, common_1.Injectable)(),
|
|
1389
|
+
__param(0, (0, common_1.Inject)('ICredentialProvider')),
|
|
1390
|
+
__metadata("design:paramtypes", [Object, label_service_1.LabelService,
|
|
1391
|
+
scaleway_instances_adapter_1.ScalewayInstancesAdapter,
|
|
1392
|
+
scaleway_baremetal_adapter_1.ScalewayBareMetalAdapter,
|
|
1393
|
+
scaleway_vpc_adapter_1.ScalewayVpcAdapter,
|
|
1394
|
+
scaleway_iam_adapter_1.ScalewayIamAdapter])
|
|
1395
|
+
], ScalewayProviderService);
|