├── internal ├── pkg │ ├── fileutils │ │ └── test-data │ │ │ ├── empty-file.txt │ │ │ ├── folder-exists │ │ │ └── dummy.txt │ │ │ └── file-with-content.txt │ ├── services │ │ ├── alb │ │ │ ├── utils │ │ │ │ ├── utils.go │ │ │ │ └── utils_test.go │ │ │ └── client │ │ │ │ └── client.go │ │ ├── git │ │ │ ├── client │ │ │ │ └── client.go │ │ │ └── utils │ │ │ │ └── utils.go │ │ ├── kms │ │ │ └── client │ │ │ │ └── client.go │ │ ├── ske │ │ │ └── client │ │ │ │ └── client.go │ │ ├── dns │ │ │ └── client │ │ │ │ └── client.go │ │ ├── iaas │ │ │ └── client │ │ │ │ └── client.go │ │ ├── logme │ │ │ └── client │ │ │ │ └── client.go │ │ ├── redis │ │ │ └── client │ │ │ │ └── client.go │ │ ├── mariadb │ │ │ └── client │ │ │ │ └── client.go │ │ ├── rabbitmq │ │ │ └── client │ │ │ │ └── client.go │ │ ├── mongodbflex │ │ │ └── client │ │ │ │ └── client.go │ │ ├── opensearch │ │ │ └── client │ │ │ │ └── client.go │ │ ├── runcommand │ │ │ ├── client │ │ │ │ └── client.go │ │ │ └── utils │ │ │ │ ├── utils.go │ │ │ │ └── utils_test.go │ │ ├── postgresflex │ │ │ └── client │ │ │ │ └── client.go │ │ ├── serverbackup │ │ │ └── client │ │ │ │ └── client.go │ │ ├── load-balancer │ │ │ └── client │ │ │ │ └── client.go │ │ ├── serverosupdate │ │ │ └── client │ │ │ │ └── client.go │ │ ├── authorization │ │ │ └── client │ │ │ │ └── client.go │ │ ├── object-storage │ │ │ └── client │ │ │ │ └── client.go │ │ ├── observability │ │ │ └── client │ │ │ │ └── client.go │ │ ├── sqlserverflex │ │ │ └── client │ │ │ │ └── client.go │ │ ├── resourcemanager │ │ │ ├── client │ │ │ │ └── client.go │ │ │ └── utils │ │ │ │ └── utils.go │ │ ├── secrets-manager │ │ │ └── client │ │ │ │ └── client.go │ │ ├── service-account │ │ │ └── client │ │ │ │ └── client.go │ │ ├── intake │ │ │ └── client │ │ │ │ └── client.go │ │ └── service-enablement │ │ │ ├── client │ │ │ └── client.go │ │ │ └── utils │ │ │ └── utils.go │ ├── types │ │ └── cmd_params.go │ ├── flags │ │ ├── flags_required.go │ │ ├── uuid.go │ │ ├── cidr.go │ │ ├── uuidslice.go │ │ └── cidrslice.go │ ├── utils │ │ └── strings_test.go │ ├── examples │ │ └── examples.go │ ├── spinner │ │ └── spinner.go │ └── config │ │ └── template │ │ └── test_profile.json └── cmd │ ├── key-pair │ ├── create │ │ └── template │ │ │ └── id_ed25519.pub │ └── key-pair.go │ ├── beta │ ├── alb │ │ ├── pool │ │ │ ├── update │ │ │ │ └── testdata │ │ │ │ │ └── testconfig.json │ │ │ └── pool.go │ │ └── template │ │ │ └── template-pool.yaml │ ├── intake │ │ └── intake.go │ ├── kms │ │ ├── kms.go │ │ ├── keyring │ │ │ └── keyring.go │ │ └── wrappingkey │ │ │ └── wrappingkey.go │ └── sqlserverflex │ │ └── sqlserverflex.go │ ├── project │ ├── role │ │ └── role.go │ └── member │ │ └── member.go │ ├── organization │ ├── role │ │ └── role.go │ ├── member │ │ └── member.go │ └── organization.go │ ├── quota │ └── quota.go │ ├── git │ ├── flavor │ │ └── flavor.go │ ├── git.go │ └── instance │ │ └── instance.go │ ├── public-ip │ └── ranges │ │ └── ranges.go │ ├── dns │ └── dns.go │ ├── config │ ├── profile │ │ ├── list │ │ │ └── list_test.go │ │ └── import │ │ │ └── template │ │ │ └── profile.json │ └── list │ │ └── list_test.go │ ├── server │ ├── public-ip │ │ └── public_ip.go │ ├── command │ │ ├── template │ │ │ └── template.go │ │ └── command.go │ ├── backup │ │ └── volume-backup │ │ │ └── volumebackup.go │ ├── machine-type │ │ └── machine-type.go │ ├── service-account │ │ └── service-account.go │ └── network-interface │ │ └── network-interface.go │ ├── secrets-manager │ └── secrets_manager.go │ ├── ske │ ├── kubeconfig │ │ └── kubeconfig.go │ └── credentials │ │ └── credentials.go │ ├── logme │ ├── logme.go │ └── credentials │ │ └── credentials.go │ ├── redis │ ├── redis.go │ └── credentials │ │ └── credentials.go │ ├── mariadb │ ├── mariadb.go │ └── credentials │ │ └── credentials.go │ ├── rabbitmq │ ├── rabbitmq.go │ └── credentials │ │ └── credentials.go │ ├── opensearch │ └── opensearch.go │ ├── auth │ ├── logout │ │ └── logout.go │ └── auth.go │ ├── volume │ └── performance-class │ │ └── performance_class.go │ ├── service-account │ └── token │ │ └── token.go │ ├── observability │ ├── credentials │ │ └── credentials.go │ └── grafana │ │ └── grafana.go │ ├── object-storage │ ├── credentials │ │ └── credentials.go │ ├── credentials-group │ │ └── credentials_group.go │ └── bucket │ │ └── bucket.go │ ├── postgresflex │ └── backup │ │ └── backup.go │ ├── load-balancer │ └── target-pool │ │ └── target_pool.go │ ├── affinity-groups │ └── affinity-groups.go │ ├── mongodbflex │ └── mongodbflex.go │ ├── image │ └── image.go │ └── security-group │ └── rule │ └── security_group_rule.go ├── .github ├── CODEOWNERS ├── dependabot.yml ├── workflows │ └── renovate.yaml ├── renovate.json ├── docs │ └── contribution-guide │ │ └── client.go ├── ISSUE_TEMPLATE │ ├── feature_request.md │ └── bug_report.md └── pull_request_template.md ├── NOTICE.txt ├── .yamllint.yaml ├── renovate.json ├── .gitignore ├── main.go ├── RELEASE.md ├── scripts └── check-docs.sh ├── SECURITY.md ├── docs ├── stackit_quota.md ├── stackit_quota_list.md ├── stackit_project_role.md ├── stackit_image_delete.md ├── stackit_image_describe.md ├── stackit_beta_intake.md ├── stackit_server_stop.md ├── stackit_auth_logout.md ├── stackit_dns_zone_delete.md ├── stackit_git_flavor.md ├── stackit_ske_enable.md ├── stackit_organization_role.md ├── stackit_server_unrescue.md ├── stackit_dns.md ├── stackit_key-pair_delete.md ├── stackit_server_deallocate.md ├── stackit_beta_alb_plans.md ├── stackit_server_delete.md ├── stackit_ske_describe.md ├── stackit_volume_backup_delete.md ├── stackit_volume_delete.md ├── stackit_beta_alb_pool.md ├── stackit_network_delete.md ├── stackit_public-ip_ranges.md ├── stackit_volume_backup_restore.md ├── stackit_volume_resize.md ├── stackit_security-group_describe.md ├── stackit_affinity-group_delete.md ├── stackit_beta_kms_keyring_describe.md ├── stackit_git.md ├── stackit_security-group_delete.md ├── stackit_volume_snapshot_delete.md ├── stackit_auth_get-access-token.md ├── stackit_logme_instance_delete.md ├── stackit_redis_instance_delete.md ├── stackit_beta_kms_keyring_delete.md ├── stackit_beta_alb_quotas.md ├── stackit_git_instance_describe.md ├── stackit_public-ip_delete.md ├── stackit_server_start.md ├── stackit_ske_cluster_delete.md ├── stackit_ske_disable.md ├── stackit_git_instance_delete.md ├── stackit_beta_alb_delete.md ├── stackit_mariadb_instance_delete.md ├── stackit_object-storage_enable.md ├── stackit_beta_intake_runner_delete.md ├── stackit_load-balancer_delete.md ├── stackit_affinity-group_describe.md ├── stackit_beta_alb_describe.md ├── stackit_beta_kms_key_describe.md ├── stackit_project_delete.md ├── stackit_rabbitmq_instance_delete.md ├── stackit_service-account_list.md ├── stackit_beta_kms_keyring_list.md ├── stackit_opensearch_instance_delete.md ├── stackit_mongodbflex_instance_delete.md ├── stackit_object-storage_disable.md ├── stackit_server_backup_enable.md ├── stackit_server_describe.md ├── stackit_ske_cluster_hibernate.md ├── stackit_ske_cluster_reconcile.md ├── stackit_volume_describe.md ├── stackit_beta_alb_list.md ├── stackit_server_backup_disable.md ├── stackit_dns_record-set_delete.md ├── stackit_network_describe.md ├── stackit_ske_cluster_maintenance.md ├── stackit_logme.md ├── stackit_observability_instance_delete.md ├── stackit_project_member.md ├── stackit_redis.md ├── stackit_server_public-ip.md ├── stackit_server_reboot.md ├── stackit_server_rescue.md ├── stackit_service-account_delete.md ├── stackit_ske_kubeconfig.md ├── stackit_dns_zone_describe.md ├── stackit_object-storage_bucket_create.md ├── stackit_object-storage_bucket_delete.md ├── stackit_server_volume_detach.md ├── stackit_ske_cluster_wakeup.md ├── stackit_secrets-manager.md ├── stackit_server_backup_delete.md ├── stackit_server_os-update_enable.md └── stackit_affinity-group_list.md ├── .aptly.conf └── Makefile /internal/pkg/fileutils/test-data/empty-file.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @stackitcloud/developer-tools -------------------------------------------------------------------------------- /internal/pkg/fileutils/test-data/folder-exists/dummy.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /NOTICE.txt: -------------------------------------------------------------------------------- 1 | STACKIT CLI 2 | Copyright 2024 Schwarz IT GmBH & Co. KG -------------------------------------------------------------------------------- /internal/pkg/fileutils/test-data/file-with-content.txt: -------------------------------------------------------------------------------- 1 | my-content -------------------------------------------------------------------------------- /.yamllint.yaml: -------------------------------------------------------------------------------- 1 | # Empty rules means that only syntax is checked 2 | rules: {} -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json" 3 | } 4 | -------------------------------------------------------------------------------- /internal/pkg/services/alb/utils/utils.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | type AlbClient interface { 4 | } 5 | -------------------------------------------------------------------------------- /internal/pkg/services/alb/utils/utils_test.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | type AlbClientMocked struct { 4 | } 5 | -------------------------------------------------------------------------------- /internal/cmd/key-pair/create/template/id_ed25519.pub: -------------------------------------------------------------------------------- 1 | ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFG1ogKtJ5SElBm3mxhFhdvXxXiz+FxYoOvcdWSW2/ZI 2 | -------------------------------------------------------------------------------- /internal/pkg/types/cmd_params.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/pkg/print" 5 | ) 6 | 7 | type CmdParams struct { 8 | Printer *print.Printer 9 | CliVersion string 10 | } 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries 2 | bin/ 3 | dist/ 4 | 5 | # IDE 6 | .vscode 7 | .idea 8 | 9 | # OS generated files 10 | .DS_Store 11 | 12 | # Go workspace file 13 | go.work 14 | go.work.sum 15 | 16 | # Test coverage reports 17 | coverage.out 18 | coverage.html 19 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "gomod" 4 | directory: "/" 5 | schedule: 6 | interval: "daily" 7 | - package-ecosystem: "github-actions" 8 | directory: "/" 9 | schedule: 10 | interval: "daily" 11 | -------------------------------------------------------------------------------- /internal/pkg/flags/flags_required.go: -------------------------------------------------------------------------------- 1 | package flags 2 | 3 | import "github.com/spf13/cobra" 4 | 5 | // Marks all given flags as required, causing the command to report an error if invoked without them. 6 | func MarkFlagsRequired(cmd *cobra.Command, flags ...string) error { 7 | for _, flag := range flags { 8 | err := cmd.MarkFlagRequired(flag) 9 | if err != nil { 10 | return err 11 | } 12 | } 13 | return nil 14 | } 15 | -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/cmd" 5 | "github.com/stackitcloud/stackit-cli/internal/pkg/config" 6 | ) 7 | 8 | // These values are overwritten by GoReleaser at build time 9 | var ( 10 | version = "DEV" 11 | date = "UNKNOWN" 12 | ) 13 | 14 | func main() { 15 | // Set up configuration files 16 | config.InitConfig() 17 | 18 | cmd.Execute(version, date) 19 | } 20 | -------------------------------------------------------------------------------- /.github/workflows/renovate.yaml: -------------------------------------------------------------------------------- 1 | name: Renovate 2 | 3 | on: 4 | schedule: 5 | - cron: "0 0 * * *" 6 | workflow_dispatch: 7 | 8 | jobs: 9 | renovate: 10 | name: Renovate 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Checkout 14 | uses: actions/checkout@v6 15 | - name: Self-hosted Renovate 16 | uses: renovatebot/github-action@v44.0.5 17 | with: 18 | configurationFile: .github/renovate.json 19 | token: ${{ secrets.RENOVATE_TOKEN }} 20 | -------------------------------------------------------------------------------- /.github/renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": ["config:recommended"], 4 | "prHourlyLimit": 10, 5 | "labels": ["renovate"], 6 | "repositories": ["stackitcloud/stackit-cli"], 7 | "enabledManagers": ["gomod", "github-actions"], 8 | "packageRules": [ 9 | { 10 | "matchSourceUrls": ["https://github.com/stackitcloud/stackit-sdk-go"], 11 | "groupName": "STACKIT SDK modules" 12 | } 13 | ], 14 | "postUpdateOptions": ["gomodTidy", "gomodUpdateImportPaths"] 15 | } 16 | -------------------------------------------------------------------------------- /.github/docs/contribution-guide/client.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "github.com/spf13/viper" 5 | genericclient "github.com/stackitcloud/stackit-cli/internal/pkg/generic-client" 6 | "github.com/stackitcloud/stackit-cli/internal/pkg/print" 7 | "github.com/stackitcloud/stackit-sdk-go/services/foo" 8 | // (...) 9 | ) 10 | 11 | func ConfigureClient(p *print.Printer, cliVersion string) (*foo.APIClient, error) { 12 | return genericclient.ConfigureClientGeneric(p, cliVersion, viper.GetString(config.fooCustomEndpointKey), false, genericclient.CreateApiClient[*foo.APIClient](foo.NewAPIClient)) 13 | } 14 | -------------------------------------------------------------------------------- /internal/pkg/services/alb/client/client.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/pkg/config" 5 | genericclient "github.com/stackitcloud/stackit-cli/internal/pkg/generic-client" 6 | "github.com/stackitcloud/stackit-cli/internal/pkg/print" 7 | 8 | "github.com/spf13/viper" 9 | "github.com/stackitcloud/stackit-sdk-go/services/alb" 10 | ) 11 | 12 | func ConfigureClient(p *print.Printer, cliVersion string) (*alb.APIClient, error) { 13 | return genericclient.ConfigureClientGeneric(p, cliVersion, viper.GetString(config.AlbCustomEndpoint), true, genericclient.CreateApiClient[*alb.APIClient](alb.NewAPIClient)) 14 | } 15 | -------------------------------------------------------------------------------- /internal/pkg/services/git/client/client.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/pkg/config" 5 | genericclient "github.com/stackitcloud/stackit-cli/internal/pkg/generic-client" 6 | "github.com/stackitcloud/stackit-cli/internal/pkg/print" 7 | 8 | "github.com/spf13/viper" 9 | "github.com/stackitcloud/stackit-sdk-go/services/git" 10 | ) 11 | 12 | func ConfigureClient(p *print.Printer, cliVersion string) (*git.APIClient, error) { 13 | return genericclient.ConfigureClientGeneric(p, cliVersion, viper.GetString(config.GitCustomEndpointKey), false, genericclient.CreateApiClient[*git.APIClient](git.NewAPIClient)) 14 | } 15 | -------------------------------------------------------------------------------- /internal/pkg/services/kms/client/client.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/pkg/config" 5 | genericclient "github.com/stackitcloud/stackit-cli/internal/pkg/generic-client" 6 | "github.com/stackitcloud/stackit-cli/internal/pkg/print" 7 | 8 | "github.com/spf13/viper" 9 | "github.com/stackitcloud/stackit-sdk-go/services/kms" 10 | ) 11 | 12 | func ConfigureClient(p *print.Printer, cliVersion string) (*kms.APIClient, error) { 13 | return genericclient.ConfigureClientGeneric(p, cliVersion, viper.GetString(config.KMSCustomEndpointKey), false, genericclient.CreateApiClient[*kms.APIClient](kms.NewAPIClient)) 14 | } 15 | -------------------------------------------------------------------------------- /internal/pkg/services/ske/client/client.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/pkg/config" 5 | genericclient "github.com/stackitcloud/stackit-cli/internal/pkg/generic-client" 6 | "github.com/stackitcloud/stackit-cli/internal/pkg/print" 7 | 8 | "github.com/spf13/viper" 9 | "github.com/stackitcloud/stackit-sdk-go/services/ske" 10 | ) 11 | 12 | func ConfigureClient(p *print.Printer, cliVersion string) (*ske.APIClient, error) { 13 | return genericclient.ConfigureClientGeneric(p, cliVersion, viper.GetString(config.SKECustomEndpointKey), false, genericclient.CreateApiClient[*ske.APIClient](ske.NewAPIClient)) 14 | } 15 | -------------------------------------------------------------------------------- /internal/pkg/services/dns/client/client.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | genericclient "github.com/stackitcloud/stackit-cli/internal/pkg/generic-client" 5 | 6 | "github.com/stackitcloud/stackit-cli/internal/pkg/config" 7 | "github.com/stackitcloud/stackit-cli/internal/pkg/print" 8 | 9 | "github.com/spf13/viper" 10 | "github.com/stackitcloud/stackit-sdk-go/services/dns" 11 | ) 12 | 13 | func ConfigureClient(p *print.Printer, cliVersion string) (*dns.APIClient, error) { 14 | return genericclient.ConfigureClientGeneric(p, cliVersion, viper.GetString(config.DNSCustomEndpointKey), false, genericclient.CreateApiClient[*dns.APIClient](dns.NewAPIClient)) 15 | } 16 | -------------------------------------------------------------------------------- /internal/pkg/services/iaas/client/client.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/pkg/config" 5 | genericclient "github.com/stackitcloud/stackit-cli/internal/pkg/generic-client" 6 | "github.com/stackitcloud/stackit-cli/internal/pkg/print" 7 | 8 | "github.com/spf13/viper" 9 | "github.com/stackitcloud/stackit-sdk-go/services/iaas" 10 | ) 11 | 12 | func ConfigureClient(p *print.Printer, cliVersion string) (*iaas.APIClient, error) { 13 | return genericclient.ConfigureClientGeneric(p, cliVersion, viper.GetString(config.IaaSCustomEndpointKey), false, genericclient.CreateApiClient[*iaas.APIClient](iaas.NewAPIClient)) 14 | } 15 | -------------------------------------------------------------------------------- /RELEASE.md: -------------------------------------------------------------------------------- 1 | # Release 2 | 3 | ## Release cycle 4 | 5 | A release should be created at least every 2 weeks. 6 | 7 | ## Release creation 8 | 9 | > [!IMPORTANT] 10 | > Consider informing / syncing with the team before creating a new release. 11 | 12 | 1. Check out latest main branch on your machine 13 | 2. Create git tag: `git tag vX.X.X` 14 | 3. Push the git tag: `git push origin --tags` 15 | 4. The [release pipeline](https://github.com/stackitcloud/stackit-cli/actions/workflows/release.yaml) will build the release and publish it on GitHub 16 | 5. Ensure the release was created properly using the [releases page](https://github.com/stackitcloud/stackit-cli/releases) 17 | 18 | -------------------------------------------------------------------------------- /internal/pkg/services/logme/client/client.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/pkg/config" 5 | genericclient "github.com/stackitcloud/stackit-cli/internal/pkg/generic-client" 6 | "github.com/stackitcloud/stackit-cli/internal/pkg/print" 7 | 8 | "github.com/spf13/viper" 9 | "github.com/stackitcloud/stackit-sdk-go/services/logme" 10 | ) 11 | 12 | func ConfigureClient(p *print.Printer, cliVersion string) (*logme.APIClient, error) { 13 | return genericclient.ConfigureClientGeneric(p, cliVersion, viper.GetString(config.LogMeCustomEndpointKey), true, genericclient.CreateApiClient[*logme.APIClient](logme.NewAPIClient)) 14 | } 15 | -------------------------------------------------------------------------------- /internal/pkg/services/redis/client/client.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/pkg/config" 5 | genericclient "github.com/stackitcloud/stackit-cli/internal/pkg/generic-client" 6 | "github.com/stackitcloud/stackit-cli/internal/pkg/print" 7 | 8 | "github.com/spf13/viper" 9 | "github.com/stackitcloud/stackit-sdk-go/services/redis" 10 | ) 11 | 12 | func ConfigureClient(p *print.Printer, cliVersion string) (*redis.APIClient, error) { 13 | return genericclient.ConfigureClientGeneric(p, cliVersion, viper.GetString(config.RedisCustomEndpointKey), true, genericclient.CreateApiClient[*redis.APIClient](redis.NewAPIClient)) 14 | } 15 | -------------------------------------------------------------------------------- /internal/cmd/beta/alb/pool/update/testdata/testconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "activeHealthCheck": { 3 | "healthyThreshold": 1, 4 | "httpHealthChecks": { 5 | "okStatuses": [ 6 | "string" 7 | ], 8 | "path": "string" 9 | }, 10 | "interval": "3s", 11 | "intervalJitter": "3s", 12 | "timeout": "3s", 13 | "unhealthyThreshold": 1 14 | }, 15 | "name": "my-target-pool", 16 | "targetPort": 5732, 17 | "targets": [ 18 | { 19 | "displayName": "my-target", 20 | "ip": "192.0.2.5" 21 | } 22 | ], 23 | "tlsConfig": { 24 | "customCa": "string", 25 | "enabled": true, 26 | "skipCertificateValidation": true 27 | } 28 | } -------------------------------------------------------------------------------- /internal/pkg/services/git/utils/utils.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | 7 | "github.com/stackitcloud/stackit-sdk-go/services/git" 8 | ) 9 | 10 | type GitClient interface { 11 | GetInstanceExecute(ctx context.Context, projectId string, instanceId string) (*git.Instance, error) 12 | } 13 | 14 | func GetInstanceName(ctx context.Context, apiClient GitClient, projectId, instanceId string) (string, error) { 15 | resp, err := apiClient.GetInstanceExecute(ctx, projectId, instanceId) 16 | if err != nil { 17 | return "", fmt.Errorf("get instance: %w", err) 18 | } 19 | if resp.Name == nil { 20 | return "", nil 21 | } 22 | return *resp.Name, nil 23 | } 24 | -------------------------------------------------------------------------------- /internal/pkg/services/mariadb/client/client.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/pkg/config" 5 | genericclient "github.com/stackitcloud/stackit-cli/internal/pkg/generic-client" 6 | "github.com/stackitcloud/stackit-cli/internal/pkg/print" 7 | 8 | "github.com/spf13/viper" 9 | "github.com/stackitcloud/stackit-sdk-go/services/mariadb" 10 | ) 11 | 12 | func ConfigureClient(p *print.Printer, cliVersion string) (*mariadb.APIClient, error) { 13 | return genericclient.ConfigureClientGeneric(p, cliVersion, viper.GetString(config.MariaDBCustomEndpointKey), true, genericclient.CreateApiClient[*mariadb.APIClient](mariadb.NewAPIClient)) 14 | } 15 | -------------------------------------------------------------------------------- /internal/cmd/beta/alb/template/template-pool.yaml: -------------------------------------------------------------------------------- 1 | activeHealthCheck: 2 | healthyThreshold: 1 3 | httpHealthChecks: 4 | okStatuses: 5 | - "200" 6 | path: /health 7 | interval: 3s 8 | intervalJitter: 3s 9 | timeout: 3s 10 | unhealthyThreshold: 1 11 | name: my-target-pool 12 | targetPort: 4000 13 | targets: 14 | - displayName: my-target 15 | ip: 10.0.1.155 16 | # if the backend servers must be accessed via TLS the following block 17 | # allows defining the TLS configuration 18 | # tlsConfig: 19 | # # A PEM and base64 encoded certificate 20 | # customCa: LS0... 21 | # enabled: true 22 | # skipCertificateValidation: false 23 | 24 | -------------------------------------------------------------------------------- /scripts/check-docs.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # This script is used to ensure for PRs the docs are up-to-date via the CI pipeline 4 | # Usage: ./check-docs.sh 5 | set -eo pipefail 6 | 7 | ROOT_DIR=$(git rev-parse --show-toplevel) 8 | 9 | before_hash=$(find docs -type f -exec sha256sum {} \; | sort | sha256sum | awk '{print $1}') 10 | 11 | # re-generate the docs 12 | go run $ROOT_DIR/scripts/generate.go 13 | 14 | after_hash=$(find docs -type f -exec sha256sum {} \; | sort | sha256sum | awk '{print $1}') 15 | 16 | if [[ "$before_hash" == "$after_hash" ]]; then 17 | echo "Docs are up-to-date" 18 | else 19 | echo "Changes detected. Docs are *not* up-to-date." 20 | exit 1 21 | fi 22 | -------------------------------------------------------------------------------- /internal/pkg/services/rabbitmq/client/client.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/pkg/config" 5 | genericclient "github.com/stackitcloud/stackit-cli/internal/pkg/generic-client" 6 | "github.com/stackitcloud/stackit-cli/internal/pkg/print" 7 | 8 | "github.com/spf13/viper" 9 | "github.com/stackitcloud/stackit-sdk-go/services/rabbitmq" 10 | ) 11 | 12 | func ConfigureClient(p *print.Printer, cliVersion string) (*rabbitmq.APIClient, error) { 13 | return genericclient.ConfigureClientGeneric(p, cliVersion, viper.GetString(config.RabbitMQCustomEndpointKey), true, genericclient.CreateApiClient[*rabbitmq.APIClient](rabbitmq.NewAPIClient)) 14 | } 15 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Reporting Security Issues 2 | 3 | **Please do not report security vulnerabilities through public GitHub issues.** 4 | 5 | We at STACKIT take security seriously. We appreciate your efforts to responsibly disclose your findings, and will make every effort to acknowledge your contributions. 6 | 7 | To report a security issue, please send an email to [stackit-security@stackit.de](mailto:stackit-security@stackit.de). 8 | 9 | Our team will send a response indicating the next steps in handling your report. After the initial reply to your report, the security team will keep you informed of the progress towards a fix and full announcement, and may ask for additional information or guidance. 10 | -------------------------------------------------------------------------------- /internal/pkg/services/mongodbflex/client/client.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "github.com/spf13/viper" 5 | "github.com/stackitcloud/stackit-cli/internal/pkg/config" 6 | genericclient "github.com/stackitcloud/stackit-cli/internal/pkg/generic-client" 7 | "github.com/stackitcloud/stackit-cli/internal/pkg/print" 8 | "github.com/stackitcloud/stackit-sdk-go/services/mongodbflex" 9 | ) 10 | 11 | func ConfigureClient(p *print.Printer, cliVersion string) (*mongodbflex.APIClient, error) { 12 | return genericclient.ConfigureClientGeneric(p, cliVersion, viper.GetString(config.MongoDBFlexCustomEndpointKey), false, genericclient.CreateApiClient[*mongodbflex.APIClient](mongodbflex.NewAPIClient)) 13 | } 14 | -------------------------------------------------------------------------------- /internal/pkg/services/opensearch/client/client.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/pkg/config" 5 | genericclient "github.com/stackitcloud/stackit-cli/internal/pkg/generic-client" 6 | "github.com/stackitcloud/stackit-cli/internal/pkg/print" 7 | 8 | "github.com/spf13/viper" 9 | "github.com/stackitcloud/stackit-sdk-go/services/opensearch" 10 | ) 11 | 12 | func ConfigureClient(p *print.Printer, cliVersion string) (*opensearch.APIClient, error) { 13 | return genericclient.ConfigureClientGeneric(p, cliVersion, viper.GetString(config.OpenSearchCustomEndpointKey), true, genericclient.CreateApiClient[*opensearch.APIClient](opensearch.NewAPIClient)) 14 | } 15 | -------------------------------------------------------------------------------- /internal/pkg/services/runcommand/client/client.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/pkg/config" 5 | genericclient "github.com/stackitcloud/stackit-cli/internal/pkg/generic-client" 6 | "github.com/stackitcloud/stackit-cli/internal/pkg/print" 7 | 8 | "github.com/spf13/viper" 9 | "github.com/stackitcloud/stackit-sdk-go/services/runcommand" 10 | ) 11 | 12 | func ConfigureClient(p *print.Printer, cliVersion string) (*runcommand.APIClient, error) { 13 | return genericclient.ConfigureClientGeneric(p, cliVersion, viper.GetString(config.RunCommandCustomEndpointKey), false, genericclient.CreateApiClient[*runcommand.APIClient](runcommand.NewAPIClient)) 14 | } 15 | -------------------------------------------------------------------------------- /internal/pkg/services/postgresflex/client/client.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/pkg/config" 5 | genericclient "github.com/stackitcloud/stackit-cli/internal/pkg/generic-client" 6 | "github.com/stackitcloud/stackit-cli/internal/pkg/print" 7 | 8 | "github.com/spf13/viper" 9 | "github.com/stackitcloud/stackit-sdk-go/services/postgresflex" 10 | ) 11 | 12 | func ConfigureClient(p *print.Printer, cliVersion string) (*postgresflex.APIClient, error) { 13 | return genericclient.ConfigureClientGeneric(p, cliVersion, viper.GetString(config.PostgresFlexCustomEndpointKey), true, genericclient.CreateApiClient[*postgresflex.APIClient](postgresflex.NewAPIClient)) 14 | } 15 | -------------------------------------------------------------------------------- /internal/pkg/services/serverbackup/client/client.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/pkg/config" 5 | genericclient "github.com/stackitcloud/stackit-cli/internal/pkg/generic-client" 6 | "github.com/stackitcloud/stackit-cli/internal/pkg/print" 7 | 8 | "github.com/spf13/viper" 9 | "github.com/stackitcloud/stackit-sdk-go/services/serverbackup" 10 | ) 11 | 12 | func ConfigureClient(p *print.Printer, cliVersion string) (*serverbackup.APIClient, error) { 13 | return genericclient.ConfigureClientGeneric(p, cliVersion, viper.GetString(config.ServerBackupCustomEndpointKey), true, genericclient.CreateApiClient[*serverbackup.APIClient](serverbackup.NewAPIClient)) 14 | } 15 | -------------------------------------------------------------------------------- /internal/pkg/services/load-balancer/client/client.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/pkg/config" 5 | genericclient "github.com/stackitcloud/stackit-cli/internal/pkg/generic-client" 6 | "github.com/stackitcloud/stackit-cli/internal/pkg/print" 7 | 8 | "github.com/spf13/viper" 9 | "github.com/stackitcloud/stackit-sdk-go/services/loadbalancer" 10 | ) 11 | 12 | func ConfigureClient(p *print.Printer, cliVersion string) (*loadbalancer.APIClient, error) { 13 | return genericclient.ConfigureClientGeneric(p, cliVersion, viper.GetString(config.LoadBalancerCustomEndpointKey), false, genericclient.CreateApiClient[*loadbalancer.APIClient](loadbalancer.NewAPIClient)) 14 | } 15 | -------------------------------------------------------------------------------- /internal/pkg/services/runcommand/utils/utils.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "os" 5 | "strings" 6 | ) 7 | 8 | func ParseScriptParams(params map[string]string) (map[string]string, error) { 9 | if params == nil { 10 | return nil, nil 11 | } 12 | parsed := map[string]string{} 13 | for k, v := range params { 14 | parsed[k] = v 15 | if k == "script" && strings.HasPrefix(v, "@{") && strings.HasSuffix(v, "}") { 16 | // Check if a script file path was specified, like: --params script=@{/tmp/test.sh} 17 | fileContents, err := os.ReadFile(v[2 : len(v)-1]) 18 | if err != nil { 19 | return nil, err 20 | } 21 | parsed[k] = string(fileContents) 22 | } 23 | } 24 | return parsed, nil 25 | } 26 | -------------------------------------------------------------------------------- /internal/pkg/services/serverosupdate/client/client.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/pkg/config" 5 | genericclient "github.com/stackitcloud/stackit-cli/internal/pkg/generic-client" 6 | "github.com/stackitcloud/stackit-cli/internal/pkg/print" 7 | 8 | "github.com/spf13/viper" 9 | "github.com/stackitcloud/stackit-sdk-go/services/serverupdate" 10 | ) 11 | 12 | func ConfigureClient(p *print.Printer, cliVersion string) (*serverupdate.APIClient, error) { 13 | return genericclient.ConfigureClientGeneric(p, cliVersion, viper.GetString(config.ServerOsUpdateCustomEndpointKey), false, genericclient.CreateApiClient[*serverupdate.APIClient](serverupdate.NewAPIClient)) 14 | } 15 | -------------------------------------------------------------------------------- /internal/pkg/services/authorization/client/client.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/pkg/config" 5 | genericclient "github.com/stackitcloud/stackit-cli/internal/pkg/generic-client" 6 | "github.com/stackitcloud/stackit-cli/internal/pkg/print" 7 | 8 | "github.com/spf13/viper" 9 | "github.com/stackitcloud/stackit-sdk-go/services/authorization" 10 | ) 11 | 12 | func ConfigureClient(p *print.Printer, cliVersion string) (*authorization.APIClient, error) { 13 | return genericclient.ConfigureClientGeneric(p, cliVersion, viper.GetString(config.AuthorizationCustomEndpointKey), false, genericclient.CreateApiClient[*authorization.APIClient](authorization.NewAPIClient)) 14 | } 15 | -------------------------------------------------------------------------------- /internal/pkg/services/object-storage/client/client.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/pkg/config" 5 | genericclient "github.com/stackitcloud/stackit-cli/internal/pkg/generic-client" 6 | "github.com/stackitcloud/stackit-cli/internal/pkg/print" 7 | 8 | "github.com/spf13/viper" 9 | "github.com/stackitcloud/stackit-sdk-go/services/objectstorage" 10 | ) 11 | 12 | func ConfigureClient(p *print.Printer, cliVersion string) (*objectstorage.APIClient, error) { 13 | return genericclient.ConfigureClientGeneric(p, cliVersion, viper.GetString(config.ObjectStorageCustomEndpointKey), true, genericclient.CreateApiClient[*objectstorage.APIClient](objectstorage.NewAPIClient)) 14 | } 15 | -------------------------------------------------------------------------------- /internal/pkg/services/observability/client/client.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/pkg/config" 5 | genericclient "github.com/stackitcloud/stackit-cli/internal/pkg/generic-client" 6 | "github.com/stackitcloud/stackit-cli/internal/pkg/print" 7 | "github.com/stackitcloud/stackit-sdk-go/services/observability" 8 | 9 | "github.com/spf13/viper" 10 | ) 11 | 12 | func ConfigureClient(p *print.Printer, cliVersion string) (*observability.APIClient, error) { 13 | return genericclient.ConfigureClientGeneric(p, cliVersion, viper.GetString(config.ObservabilityCustomEndpointKey), true, genericclient.CreateApiClient[*observability.APIClient](observability.NewAPIClient)) 14 | } 15 | -------------------------------------------------------------------------------- /internal/pkg/services/sqlserverflex/client/client.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/pkg/config" 5 | genericclient "github.com/stackitcloud/stackit-cli/internal/pkg/generic-client" 6 | "github.com/stackitcloud/stackit-cli/internal/pkg/print" 7 | 8 | "github.com/spf13/viper" 9 | "github.com/stackitcloud/stackit-sdk-go/services/sqlserverflex" 10 | ) 11 | 12 | func ConfigureClient(p *print.Printer, cliVersion string) (*sqlserverflex.APIClient, error) { 13 | return genericclient.ConfigureClientGeneric(p, cliVersion, viper.GetString(config.SQLServerFlexCustomEndpointKey), false, genericclient.CreateApiClient[*sqlserverflex.APIClient](sqlserverflex.NewAPIClient)) 14 | } 15 | -------------------------------------------------------------------------------- /internal/pkg/services/resourcemanager/client/client.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/pkg/config" 5 | genericclient "github.com/stackitcloud/stackit-cli/internal/pkg/generic-client" 6 | "github.com/stackitcloud/stackit-cli/internal/pkg/print" 7 | 8 | "github.com/spf13/viper" 9 | "github.com/stackitcloud/stackit-sdk-go/services/resourcemanager" 10 | ) 11 | 12 | func ConfigureClient(p *print.Printer, cliVersion string) (*resourcemanager.APIClient, error) { 13 | return genericclient.ConfigureClientGeneric(p, cliVersion, viper.GetString(config.ResourceManagerEndpointKey), false, genericclient.CreateApiClient[*resourcemanager.APIClient](resourcemanager.NewAPIClient)) 14 | } 15 | -------------------------------------------------------------------------------- /internal/pkg/services/secrets-manager/client/client.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/pkg/config" 5 | genericclient "github.com/stackitcloud/stackit-cli/internal/pkg/generic-client" 6 | "github.com/stackitcloud/stackit-cli/internal/pkg/print" 7 | 8 | "github.com/spf13/viper" 9 | "github.com/stackitcloud/stackit-sdk-go/services/secretsmanager" 10 | ) 11 | 12 | func ConfigureClient(p *print.Printer, cliVersion string) (*secretsmanager.APIClient, error) { 13 | return genericclient.ConfigureClientGeneric(p, cliVersion, viper.GetString(config.SecretsManagerCustomEndpointKey), true, genericclient.CreateApiClient[*secretsmanager.APIClient](secretsmanager.NewAPIClient)) 14 | } 15 | -------------------------------------------------------------------------------- /internal/pkg/services/service-account/client/client.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/pkg/config" 5 | genericclient "github.com/stackitcloud/stackit-cli/internal/pkg/generic-client" 6 | "github.com/stackitcloud/stackit-cli/internal/pkg/print" 7 | 8 | "github.com/spf13/viper" 9 | "github.com/stackitcloud/stackit-sdk-go/services/serviceaccount" 10 | ) 11 | 12 | func ConfigureClient(p *print.Printer, cliVersion string) (*serviceaccount.APIClient, error) { 13 | return genericclient.ConfigureClientGeneric(p, cliVersion, viper.GetString(config.ServiceAccountCustomEndpointKey), false, genericclient.CreateApiClient[*serviceaccount.APIClient](serviceaccount.NewAPIClient)) 14 | } 15 | -------------------------------------------------------------------------------- /internal/pkg/services/intake/client/client.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "github.com/spf13/viper" 5 | "github.com/stackitcloud/stackit-cli/internal/pkg/config" 6 | genericclient "github.com/stackitcloud/stackit-cli/internal/pkg/generic-client" 7 | "github.com/stackitcloud/stackit-cli/internal/pkg/print" 8 | "github.com/stackitcloud/stackit-sdk-go/services/intake" 9 | ) 10 | 11 | // ConfigureClient creates and configures a new Intake API client 12 | func ConfigureClient(p *print.Printer, cliVersion string) (*intake.APIClient, error) { 13 | return genericclient.ConfigureClientGeneric(p, cliVersion, viper.GetString(config.IntakeCustomEndpointKey), true, genericclient.CreateApiClient[*intake.APIClient](intake.NewAPIClient)) 14 | } 15 | -------------------------------------------------------------------------------- /internal/pkg/services/service-enablement/client/client.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "github.com/spf13/viper" 5 | "github.com/stackitcloud/stackit-cli/internal/pkg/config" 6 | genericclient "github.com/stackitcloud/stackit-cli/internal/pkg/generic-client" 7 | "github.com/stackitcloud/stackit-cli/internal/pkg/print" 8 | 9 | "github.com/stackitcloud/stackit-sdk-go/services/serviceenablement" 10 | ) 11 | 12 | func ConfigureClient(p *print.Printer, cliVersion string) (*serviceenablement.APIClient, error) { 13 | return genericclient.ConfigureClientGeneric(p, cliVersion, viper.GetString(config.ServiceEnablementCustomEndpointKey), true, genericclient.CreateApiClient[*serviceenablement.APIClient](serviceenablement.NewAPIClient)) 14 | } 15 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for the STACKIT CLI 4 | title: '' 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | ## Problem description 11 | 12 | *Is your feature request related to a problem? If so, please give us a clear and concise description of what the problem is. 13 | Example: I'm always frustrated when [...]* 14 | 15 | ## Proposed solution 16 | 17 | *A clear and concise description of what you want to happen.* 18 | 19 | ## Alternative solutions (optional) 20 | 21 | *A clear and concise description of any alternative solutions or features you've considered. (optional)* 22 | 23 | ## Additional information 24 | 25 | *Feel free to add any additional information here.* 26 | -------------------------------------------------------------------------------- /internal/cmd/project/role/role.go: -------------------------------------------------------------------------------- 1 | package role 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/cmd/project/role/list" 5 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 6 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 7 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 8 | 9 | "github.com/spf13/cobra" 10 | ) 11 | 12 | func NewCmd(params *types.CmdParams) *cobra.Command { 13 | cmd := &cobra.Command{ 14 | Use: "role", 15 | Short: "Manages project roles", 16 | Long: "Manages project roles.", 17 | Args: args.NoArgs, 18 | Run: utils.CmdHelp, 19 | } 20 | addSubcommands(cmd, params) 21 | return cmd 22 | } 23 | 24 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 25 | cmd.AddCommand(list.NewCmd(params)) 26 | } 27 | -------------------------------------------------------------------------------- /internal/cmd/organization/role/role.go: -------------------------------------------------------------------------------- 1 | package role 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/cmd/organization/role/list" 5 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 6 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 7 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 8 | 9 | "github.com/spf13/cobra" 10 | ) 11 | 12 | func NewCmd(params *types.CmdParams) *cobra.Command { 13 | cmd := &cobra.Command{ 14 | Use: "role", 15 | Short: "Manages organization roles", 16 | Long: "Manages organization roles.", 17 | Args: args.NoArgs, 18 | Run: utils.CmdHelp, 19 | } 20 | addSubcommands(cmd, params) 21 | return cmd 22 | } 23 | 24 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 25 | cmd.AddCommand(list.NewCmd(params)) 26 | } 27 | -------------------------------------------------------------------------------- /internal/cmd/quota/quota.go: -------------------------------------------------------------------------------- 1 | package quota 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/cmd/quota/list" 5 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 6 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 7 | 8 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 9 | 10 | "github.com/spf13/cobra" 11 | ) 12 | 13 | func NewCmd(params *types.CmdParams) *cobra.Command { 14 | cmd := &cobra.Command{ 15 | Use: "quota", 16 | Short: "Manage server quotas", 17 | Long: "Manage the lifecycle of server quotas.", 18 | Args: args.NoArgs, 19 | Run: utils.CmdHelp, 20 | } 21 | addSubcommands(cmd, params) 22 | return cmd 23 | } 24 | 25 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 26 | cmd.AddCommand( 27 | list.NewCmd(params), 28 | ) 29 | } 30 | -------------------------------------------------------------------------------- /internal/cmd/git/flavor/flavor.go: -------------------------------------------------------------------------------- 1 | package flavor 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/cmd/git/flavor/list" 5 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 6 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 7 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 8 | 9 | "github.com/spf13/cobra" 10 | ) 11 | 12 | func NewCmd(params *types.CmdParams) *cobra.Command { 13 | cmd := &cobra.Command{ 14 | Use: "flavor", 15 | Short: "Provides functionality for STACKIT Git flavors", 16 | Long: "Provides functionality for STACKIT Git flavors.", 17 | Args: args.NoArgs, 18 | Run: utils.CmdHelp, 19 | } 20 | addSubcommands(cmd, params) 21 | return cmd 22 | } 23 | 24 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 25 | cmd.AddCommand( 26 | list.NewCmd(params), 27 | ) 28 | } 29 | -------------------------------------------------------------------------------- /internal/cmd/public-ip/ranges/ranges.go: -------------------------------------------------------------------------------- 1 | package ranges 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/cmd/public-ip/ranges/list" 5 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 6 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 7 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 8 | 9 | "github.com/spf13/cobra" 10 | ) 11 | 12 | func NewCmd(params *types.CmdParams) *cobra.Command { 13 | cmd := &cobra.Command{ 14 | Use: "ranges", 15 | Short: "Provides functionality for STACKIT public-ip ranges", 16 | Long: "Provides functionality for STACKIT public-ip ranges", 17 | Args: args.NoArgs, 18 | Run: utils.CmdHelp, 19 | } 20 | addSubcommands(cmd, params) 21 | return cmd 22 | } 23 | 24 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 25 | cmd.AddCommand(list.NewCmd(params)) 26 | } 27 | -------------------------------------------------------------------------------- /internal/cmd/beta/intake/intake.go: -------------------------------------------------------------------------------- 1 | package intake 2 | 3 | import ( 4 | "github.com/spf13/cobra" 5 | "github.com/stackitcloud/stackit-cli/internal/cmd/beta/intake/runner" 6 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 7 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 8 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 9 | ) 10 | 11 | // NewCmd creates the 'stackit intake' command 12 | func NewCmd(params *types.CmdParams) *cobra.Command { 13 | cmd := &cobra.Command{ 14 | Use: "intake", 15 | Short: "Provides functionality for intake", 16 | Long: "Provides functionality for intake.", 17 | Args: args.NoArgs, 18 | Run: utils.CmdHelp, 19 | } 20 | addSubcommands(cmd, params) 21 | return cmd 22 | } 23 | 24 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 25 | cmd.AddCommand(runner.NewCmd(params)) 26 | } 27 | -------------------------------------------------------------------------------- /internal/cmd/beta/alb/pool/pool.go: -------------------------------------------------------------------------------- 1 | package pool 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/cmd/beta/alb/pool/update" 5 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 6 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 7 | 8 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 9 | 10 | "github.com/spf13/cobra" 11 | ) 12 | 13 | func NewCmd(params *types.CmdParams) *cobra.Command { 14 | cmd := &cobra.Command{ 15 | Use: "pool", 16 | Short: "Manages target pools for application loadbalancers", 17 | Long: "Manage the lifecycle of target pools for application loadbalancers.", 18 | Args: args.NoArgs, 19 | Run: utils.CmdHelp, 20 | } 21 | addSubcommands(cmd, params) 22 | return cmd 23 | } 24 | 25 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 26 | cmd.AddCommand(update.NewCmd(params)) 27 | } 28 | -------------------------------------------------------------------------------- /internal/pkg/flags/uuid.go: -------------------------------------------------------------------------------- 1 | package flags 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 7 | 8 | "github.com/spf13/pflag" 9 | ) 10 | 11 | type uuidFlag struct { 12 | value string 13 | } 14 | 15 | // Ensure the implementation satisfies the expected interface 16 | var _ pflag.Value = &uuidFlag{} 17 | 18 | // UUIDFlag returns a flag which must be a valid UUID. 19 | func UUIDFlag() *uuidFlag { 20 | return &uuidFlag{} 21 | } 22 | 23 | func (f *uuidFlag) String() string { 24 | return f.value 25 | } 26 | 27 | func (f *uuidFlag) Set(value string) error { 28 | if value == "" { 29 | return fmt.Errorf("value cannot be empty") 30 | } 31 | err := utils.ValidateUUID(value) 32 | if err != nil { 33 | return err 34 | } 35 | f.value = value 36 | return nil 37 | } 38 | 39 | func (f *uuidFlag) Type() string { 40 | return "string" 41 | } 42 | -------------------------------------------------------------------------------- /internal/pkg/utils/strings_test.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/stackitcloud/stackit-sdk-go/core/utils" 7 | ) 8 | 9 | func TestTruncate(t *testing.T) { 10 | type args struct { 11 | s *string 12 | maxLen int 13 | } 14 | tests := []struct { 15 | name string 16 | args args 17 | want string 18 | }{ 19 | {"nil string", args{nil, 3}, ""}, 20 | {"empty string", args{utils.Ptr(""), 10}, ""}, 21 | {"length below maxlength", args{utils.Ptr("foo"), 10}, "foo"}, 22 | {"exactly maxlength", args{utils.Ptr("foo"), 3}, "foo"}, 23 | {"above maxlength", args{utils.Ptr("foobarbaz"), 3}, "foo…"}, 24 | } 25 | for _, tt := range tests { 26 | t.Run(tt.name, func(t *testing.T) { 27 | if got := Truncate(tt.args.s, tt.args.maxLen); got != tt.want { 28 | t.Errorf("Truncate() = %v, want %v", got, tt.want) 29 | } 30 | }) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | ## Description 2 | 3 | 7 | 8 | relates to #1234 9 | 10 | ## Checklist 11 | 12 | - [ ] Issue was linked above 13 | - [ ] Code format was applied: `make fmt` 14 | - [ ] Examples were added / adjusted (see e.g. [here](https://github.com/stackitcloud/stackit-cli/blob/ef291d1683ca5b0d719ec0a26ecb999a32685117/internal/cmd/ske/cluster/create/create.go#L49-L63)) 15 | - [x] Docs are up-to-date: `make generate-docs` (will be checked by CI) 16 | - [ ] Unit tests got implemented or updated 17 | - [x] Unit tests are passing: `make test` (will be checked by CI) 18 | - [x] No linter issues: `make lint` (will be checked by CI) 19 | -------------------------------------------------------------------------------- /internal/cmd/dns/dns.go: -------------------------------------------------------------------------------- 1 | package dns 2 | 3 | import ( 4 | recordset "github.com/stackitcloud/stackit-cli/internal/cmd/dns/record-set" 5 | "github.com/stackitcloud/stackit-cli/internal/cmd/dns/zone" 6 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 7 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 8 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 9 | 10 | "github.com/spf13/cobra" 11 | ) 12 | 13 | func NewCmd(params *types.CmdParams) *cobra.Command { 14 | cmd := &cobra.Command{ 15 | Use: "dns", 16 | Short: "Provides functionality for DNS", 17 | Long: "Provides functionality for DNS.", 18 | Args: args.NoArgs, 19 | Run: utils.CmdHelp, 20 | } 21 | addSubcommands(cmd, params) 22 | return cmd 23 | } 24 | 25 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 26 | cmd.AddCommand(zone.NewCmd(params)) 27 | cmd.AddCommand(recordset.NewCmd(params)) 28 | } 29 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Report a bug in the STACKIT CLI 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | ## Description 11 | 12 | *Please add a clear and concise description of what the bug is.* 13 | 14 | ## Steps to reproduce 15 | 16 | 17 | 1. Run `stackit ...` 18 | 2. Run `stackit ...` 19 | 3. ... 20 | 21 | ## Actual behavior 22 | 23 | *Please describe the current behavior of the STACKIT CLI. Don't forget to add detailed information like error messages.* 24 | 25 | ## Expected behavior 26 | 27 | *Please describe the behavior which you would expect from the STACKIT CLI in that case.* 28 | 29 | ## Environment 30 | - OS: 31 | - Version of STACKIT CLI (see `stackit --version`): `vX.X.X` 32 | 33 | **Additional information** 34 | 35 | *Feel free to add any additional information here.* 36 | -------------------------------------------------------------------------------- /internal/cmd/git/git.go: -------------------------------------------------------------------------------- 1 | package git 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/cmd/git/flavor" 5 | "github.com/stackitcloud/stackit-cli/internal/cmd/git/instance" 6 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 7 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 8 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 9 | 10 | "github.com/spf13/cobra" 11 | ) 12 | 13 | func NewCmd(params *types.CmdParams) *cobra.Command { 14 | cmd := &cobra.Command{ 15 | Use: "git", 16 | Short: "Provides functionality for STACKIT Git", 17 | Long: "Provides functionality for STACKIT Git.", 18 | Args: args.NoArgs, 19 | Run: utils.CmdHelp, 20 | } 21 | addSubcommands(cmd, params) 22 | return cmd 23 | } 24 | 25 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 26 | cmd.AddCommand( 27 | instance.NewCmd(params), 28 | flavor.NewCmd(params), 29 | ) 30 | } 31 | -------------------------------------------------------------------------------- /internal/cmd/config/profile/list/list_test.go: -------------------------------------------------------------------------------- 1 | package list 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 7 | 8 | "github.com/stackitcloud/stackit-cli/internal/pkg/print" 9 | ) 10 | 11 | func TestOutputResult(t *testing.T) { 12 | type args struct { 13 | outputFormat string 14 | profiles []profileInfo 15 | } 16 | tests := []struct { 17 | name string 18 | args args 19 | wantErr bool 20 | }{ 21 | { 22 | name: "empty", 23 | args: args{}, 24 | wantErr: false, 25 | }, 26 | } 27 | p := print.NewPrinter() 28 | p.Cmd = NewCmd(&types.CmdParams{Printer: p}) 29 | for _, tt := range tests { 30 | t.Run(tt.name, func(t *testing.T) { 31 | if err := outputResult(p, tt.args.outputFormat, tt.args.profiles); (err != nil) != tt.wantErr { 32 | t.Errorf("outputResult() error = %v, wantErr %v", err, tt.wantErr) 33 | } 34 | }) 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /internal/pkg/examples/examples.go: -------------------------------------------------------------------------------- 1 | package examples 2 | 3 | import "fmt" 4 | 5 | type Example struct { 6 | Description string 7 | Commands []string 8 | } 9 | 10 | // Creates a new example 11 | func NewExample(description string, commands ...string) Example { 12 | return Example{ 13 | Description: description, 14 | Commands: commands, 15 | } 16 | } 17 | 18 | // Returns the example formatted 19 | func (e *Example) format() string { 20 | formatted := fmt.Sprintf(" %s\n", e.Description) 21 | for i, c := range e.Commands { 22 | formatted += fmt.Sprintf(" %s", c) 23 | if i != len(e.Commands)-1 { 24 | formatted += "\n" 25 | } 26 | } 27 | return formatted 28 | } 29 | 30 | // Builds a list of formatted examples 31 | func Build(examples ...Example) string { 32 | formatted := "" 33 | for i, e := range examples { 34 | formatted += e.format() 35 | if i != len(examples)-1 { 36 | formatted += "\n\n" 37 | } 38 | } 39 | return formatted 40 | } 41 | -------------------------------------------------------------------------------- /internal/cmd/config/list/list_test.go: -------------------------------------------------------------------------------- 1 | package list 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 7 | 8 | "github.com/stackitcloud/stackit-cli/internal/pkg/print" 9 | ) 10 | 11 | func TestOutputResult(t *testing.T) { 12 | type args struct { 13 | outputFormat string 14 | configData map[string]any 15 | activeProfile string 16 | } 17 | tests := []struct { 18 | name string 19 | args args 20 | wantErr bool 21 | }{ 22 | { 23 | name: "empty", 24 | args: args{}, 25 | wantErr: false, 26 | }, 27 | } 28 | p := print.NewPrinter() 29 | p.Cmd = NewCmd(&types.CmdParams{Printer: p}) 30 | for _, tt := range tests { 31 | t.Run(tt.name, func(t *testing.T) { 32 | if err := outputResult(p, tt.args.outputFormat, tt.args.configData, tt.args.activeProfile); (err != nil) != tt.wantErr { 33 | t.Errorf("outputResult() error = %v, wantErr %v", err, tt.wantErr) 34 | } 35 | }) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /internal/cmd/server/public-ip/public_ip.go: -------------------------------------------------------------------------------- 1 | package publicip 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/cmd/server/public-ip/attach" 5 | "github.com/stackitcloud/stackit-cli/internal/cmd/server/public-ip/detach" 6 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 7 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 8 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 9 | 10 | "github.com/spf13/cobra" 11 | ) 12 | 13 | func NewCmd(params *types.CmdParams) *cobra.Command { 14 | cmd := &cobra.Command{ 15 | Use: "public-ip", 16 | Short: "Allows attaching/detaching public IPs to servers", 17 | Long: "Allows attaching/detaching public IPs to servers.", 18 | Args: args.NoArgs, 19 | Run: utils.CmdHelp, 20 | } 21 | addSubcommands(cmd, params) 22 | return cmd 23 | } 24 | 25 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 26 | cmd.AddCommand(attach.NewCmd(params)) 27 | cmd.AddCommand(detach.NewCmd(params)) 28 | } 29 | -------------------------------------------------------------------------------- /internal/cmd/secrets-manager/secrets_manager.go: -------------------------------------------------------------------------------- 1 | package secretsmanager 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/cmd/secrets-manager/instance" 5 | "github.com/stackitcloud/stackit-cli/internal/cmd/secrets-manager/user" 6 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 7 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 8 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 9 | 10 | "github.com/spf13/cobra" 11 | ) 12 | 13 | func NewCmd(params *types.CmdParams) *cobra.Command { 14 | cmd := &cobra.Command{ 15 | Use: "secrets-manager", 16 | Short: "Provides functionality for Secrets Manager", 17 | Long: "Provides functionality for Secrets Manager.", 18 | Args: args.NoArgs, 19 | Run: utils.CmdHelp, 20 | } 21 | addSubcommands(cmd, params) 22 | return cmd 23 | } 24 | 25 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 26 | cmd.AddCommand(instance.NewCmd(params)) 27 | cmd.AddCommand(user.NewCmd(params)) 28 | } 29 | -------------------------------------------------------------------------------- /internal/cmd/ske/kubeconfig/kubeconfig.go: -------------------------------------------------------------------------------- 1 | package kubeconfig 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/cmd/ske/kubeconfig/create" 5 | "github.com/stackitcloud/stackit-cli/internal/cmd/ske/kubeconfig/login" 6 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 7 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 8 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 9 | 10 | "github.com/spf13/cobra" 11 | ) 12 | 13 | func NewCmd(params *types.CmdParams) *cobra.Command { 14 | cmd := &cobra.Command{ 15 | Use: "kubeconfig", 16 | Short: "Provides functionality for SKE kubeconfig", 17 | Long: "Provides functionality for STACKIT Kubernetes Engine (SKE) kubeconfig.", 18 | Args: args.NoArgs, 19 | Run: utils.CmdHelp, 20 | } 21 | addSubcommands(cmd, params) 22 | return cmd 23 | } 24 | 25 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 26 | cmd.AddCommand(create.NewCmd(params)) 27 | cmd.AddCommand(login.NewCmd(params)) 28 | } 29 | -------------------------------------------------------------------------------- /docs/stackit_quota.md: -------------------------------------------------------------------------------- 1 | ## stackit quota 2 | 3 | Manage server quotas 4 | 5 | ### Synopsis 6 | 7 | Manage the lifecycle of server quotas. 8 | 9 | ``` 10 | stackit quota [flags] 11 | ``` 12 | 13 | ### Options 14 | 15 | ``` 16 | -h, --help Help for "stackit quota" 17 | ``` 18 | 19 | ### Options inherited from parent commands 20 | 21 | ``` 22 | -y, --assume-yes If set, skips all confirmation prompts 23 | --async If set, runs the command asynchronously 24 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 25 | -p, --project-id string Project ID 26 | --region string Target region for region-specific requests 27 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 28 | ``` 29 | 30 | ### SEE ALSO 31 | 32 | * [stackit](./stackit.md) - Manage STACKIT resources using the command line 33 | * [stackit quota list](./stackit_quota_list.md) - Lists quotas 34 | 35 | -------------------------------------------------------------------------------- /internal/cmd/server/command/template/template.go: -------------------------------------------------------------------------------- 1 | package template 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/cmd/server/command/template/describe" 5 | "github.com/stackitcloud/stackit-cli/internal/cmd/server/command/template/list" 6 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 7 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 8 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 9 | 10 | "github.com/spf13/cobra" 11 | ) 12 | 13 | func NewCmd(params *types.CmdParams) *cobra.Command { 14 | cmd := &cobra.Command{ 15 | Use: "template", 16 | Short: "Provides functionality for Server Command Template", 17 | Long: "Provides functionality for Server Command Template.", 18 | Args: args.NoArgs, 19 | Run: utils.CmdHelp, 20 | } 21 | addSubcommands(cmd, params) 22 | return cmd 23 | } 24 | 25 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 26 | cmd.AddCommand(describe.NewCmd(params)) 27 | cmd.AddCommand(list.NewCmd(params)) 28 | } 29 | -------------------------------------------------------------------------------- /docs/stackit_quota_list.md: -------------------------------------------------------------------------------- 1 | ## stackit quota list 2 | 3 | Lists quotas 4 | 5 | ### Synopsis 6 | 7 | Lists project quotas. 8 | 9 | ``` 10 | stackit quota list [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | List available quotas 17 | $ stackit quota list 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit quota list" 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -y, --assume-yes If set, skips all confirmation prompts 30 | --async If set, runs the command asynchronously 31 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 32 | -p, --project-id string Project ID 33 | --region string Target region for region-specific requests 34 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [stackit quota](./stackit_quota.md) - Manage server quotas 40 | 41 | -------------------------------------------------------------------------------- /internal/pkg/flags/cidr.go: -------------------------------------------------------------------------------- 1 | package flags 2 | 3 | import ( 4 | "fmt" 5 | "net" 6 | 7 | "github.com/spf13/pflag" 8 | ) 9 | 10 | type cidrFlag struct { 11 | value string 12 | } 13 | 14 | // Ensure the implementation satisfies the expected interface 15 | var _ pflag.Value = &cidrFlag{} 16 | 17 | // CIDRFlag returns a flag which must be a valid CIDR. 18 | func CIDRFlag() *cidrFlag { 19 | return &cidrFlag{} 20 | } 21 | 22 | func (f *cidrFlag) String() string { 23 | return f.value 24 | } 25 | 26 | func (f *cidrFlag) Set(value string) error { 27 | if value == "" { 28 | return fmt.Errorf("value cannot be empty") 29 | } 30 | err := validateCIDR(value) 31 | if err != nil { 32 | return err 33 | } 34 | f.value = value 35 | return nil 36 | } 37 | 38 | func (f *cidrFlag) Type() string { 39 | return "string" 40 | } 41 | 42 | func validateCIDR(value string) error { 43 | _, _, err := net.ParseCIDR(value) 44 | if err != nil { 45 | return fmt.Errorf("parse %s as CIDR: %w", value, err) 46 | } 47 | return nil 48 | } 49 | -------------------------------------------------------------------------------- /internal/cmd/logme/logme.go: -------------------------------------------------------------------------------- 1 | package logme 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/cmd/logme/credentials" 5 | "github.com/stackitcloud/stackit-cli/internal/cmd/logme/instance" 6 | "github.com/stackitcloud/stackit-cli/internal/cmd/logme/plans" 7 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 8 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 9 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 10 | 11 | "github.com/spf13/cobra" 12 | ) 13 | 14 | func NewCmd(params *types.CmdParams) *cobra.Command { 15 | cmd := &cobra.Command{ 16 | Use: "logme", 17 | Short: "Provides functionality for LogMe", 18 | Long: "Provides functionality for LogMe.", 19 | Args: args.NoArgs, 20 | Run: utils.CmdHelp, 21 | } 22 | addSubcommands(cmd, params) 23 | return cmd 24 | } 25 | 26 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 27 | cmd.AddCommand(instance.NewCmd(params)) 28 | cmd.AddCommand(plans.NewCmd(params)) 29 | cmd.AddCommand(credentials.NewCmd(params)) 30 | } 31 | -------------------------------------------------------------------------------- /internal/cmd/project/member/member.go: -------------------------------------------------------------------------------- 1 | package member 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/cmd/project/member/add" 5 | "github.com/stackitcloud/stackit-cli/internal/cmd/project/member/list" 6 | "github.com/stackitcloud/stackit-cli/internal/cmd/project/member/remove" 7 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 8 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 9 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 10 | 11 | "github.com/spf13/cobra" 12 | ) 13 | 14 | func NewCmd(params *types.CmdParams) *cobra.Command { 15 | cmd := &cobra.Command{ 16 | Use: "member", 17 | Short: "Manages project members", 18 | Long: "Manages project members.", 19 | Args: args.NoArgs, 20 | Run: utils.CmdHelp, 21 | } 22 | addSubcommands(cmd, params) 23 | return cmd 24 | } 25 | 26 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 27 | cmd.AddCommand(add.NewCmd(params)) 28 | cmd.AddCommand(list.NewCmd(params)) 29 | cmd.AddCommand(remove.NewCmd(params)) 30 | } 31 | -------------------------------------------------------------------------------- /internal/cmd/redis/redis.go: -------------------------------------------------------------------------------- 1 | package redis 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/cmd/redis/credentials" 5 | "github.com/stackitcloud/stackit-cli/internal/cmd/redis/instance" 6 | "github.com/stackitcloud/stackit-cli/internal/cmd/redis/plans" 7 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 8 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 9 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 10 | 11 | "github.com/spf13/cobra" 12 | ) 13 | 14 | func NewCmd(params *types.CmdParams) *cobra.Command { 15 | cmd := &cobra.Command{ 16 | Use: "redis", 17 | Short: "Provides functionality for Redis", 18 | Long: "Provides functionality for Redis.", 19 | Args: args.NoArgs, 20 | Run: utils.CmdHelp, 21 | } 22 | addSubcommands(cmd, params) 23 | return cmd 24 | } 25 | 26 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 27 | cmd.AddCommand(instance.NewCmd(params)) 28 | cmd.AddCommand(plans.NewCmd(params)) 29 | cmd.AddCommand(credentials.NewCmd(params)) 30 | } 31 | -------------------------------------------------------------------------------- /docs/stackit_project_role.md: -------------------------------------------------------------------------------- 1 | ## stackit project role 2 | 3 | Manages project roles 4 | 5 | ### Synopsis 6 | 7 | Manages project roles. 8 | 9 | ``` 10 | stackit project role [flags] 11 | ``` 12 | 13 | ### Options 14 | 15 | ``` 16 | -h, --help Help for "stackit project role" 17 | ``` 18 | 19 | ### Options inherited from parent commands 20 | 21 | ``` 22 | -y, --assume-yes If set, skips all confirmation prompts 23 | --async If set, runs the command asynchronously 24 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 25 | -p, --project-id string Project ID 26 | --region string Target region for region-specific requests 27 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 28 | ``` 29 | 30 | ### SEE ALSO 31 | 32 | * [stackit project](./stackit_project.md) - Manages projects 33 | * [stackit project role list](./stackit_project_role_list.md) - Lists roles and permissions of a project 34 | 35 | -------------------------------------------------------------------------------- /internal/cmd/server/backup/volume-backup/volumebackup.go: -------------------------------------------------------------------------------- 1 | package volumebackup 2 | 3 | import ( 4 | del "github.com/stackitcloud/stackit-cli/internal/cmd/server/backup/volume-backup/delete" 5 | "github.com/stackitcloud/stackit-cli/internal/cmd/server/backup/volume-backup/restore" 6 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 7 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 8 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 9 | 10 | "github.com/spf13/cobra" 11 | ) 12 | 13 | func NewCmd(params *types.CmdParams) *cobra.Command { 14 | cmd := &cobra.Command{ 15 | Use: "volume-backup", 16 | Short: "Provides functionality for Server Backup Volume Backups", 17 | Long: "Provides functionality for Server Backup Volume Backups.", 18 | Args: args.NoArgs, 19 | Run: utils.CmdHelp, 20 | } 21 | addSubcommands(cmd, params) 22 | return cmd 23 | } 24 | 25 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 26 | cmd.AddCommand(del.NewCmd(params)) 27 | cmd.AddCommand(restore.NewCmd(params)) 28 | } 29 | -------------------------------------------------------------------------------- /internal/cmd/mariadb/mariadb.go: -------------------------------------------------------------------------------- 1 | package mariadb 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/cmd/mariadb/credentials" 5 | "github.com/stackitcloud/stackit-cli/internal/cmd/mariadb/instance" 6 | "github.com/stackitcloud/stackit-cli/internal/cmd/mariadb/plans" 7 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 8 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 9 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 10 | 11 | "github.com/spf13/cobra" 12 | ) 13 | 14 | func NewCmd(params *types.CmdParams) *cobra.Command { 15 | cmd := &cobra.Command{ 16 | Use: "mariadb", 17 | Short: "Provides functionality for MariaDB", 18 | Long: "Provides functionality for MariaDB.", 19 | Args: args.NoArgs, 20 | Run: utils.CmdHelp, 21 | } 22 | addSubcommands(cmd, params) 23 | return cmd 24 | } 25 | 26 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 27 | cmd.AddCommand(instance.NewCmd(params)) 28 | cmd.AddCommand(plans.NewCmd(params)) 29 | cmd.AddCommand(credentials.NewCmd(params)) 30 | } 31 | -------------------------------------------------------------------------------- /internal/cmd/server/machine-type/machine-type.go: -------------------------------------------------------------------------------- 1 | package machinetype 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/cmd/server/machine-type/describe" 5 | "github.com/stackitcloud/stackit-cli/internal/cmd/server/machine-type/list" 6 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 7 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 8 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 9 | 10 | "github.com/spf13/cobra" 11 | ) 12 | 13 | func NewCmd(params *types.CmdParams) *cobra.Command { 14 | cmd := &cobra.Command{ 15 | Use: "machine-type", 16 | Short: "Provides functionality for server machine types available inside a project", 17 | Long: "Provides functionality for server machine types available inside a project.", 18 | Args: args.NoArgs, 19 | Run: utils.CmdHelp, 20 | } 21 | addSubcommands(cmd, params) 22 | return cmd 23 | } 24 | 25 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 26 | cmd.AddCommand(describe.NewCmd(params)) 27 | cmd.AddCommand(list.NewCmd(params)) 28 | } 29 | -------------------------------------------------------------------------------- /docs/stackit_image_delete.md: -------------------------------------------------------------------------------- 1 | ## stackit image delete 2 | 3 | Deletes an image 4 | 5 | ### Synopsis 6 | 7 | Deletes an image by its internal ID. 8 | 9 | ``` 10 | stackit image delete IMAGE_ID [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Delete an image with ID "xxx" 17 | $ stackit image delete xxx 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit image delete" 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -y, --assume-yes If set, skips all confirmation prompts 30 | --async If set, runs the command asynchronously 31 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 32 | -p, --project-id string Project ID 33 | --region string Target region for region-specific requests 34 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [stackit image](./stackit_image.md) - Manage server images 40 | 41 | -------------------------------------------------------------------------------- /internal/cmd/organization/member/member.go: -------------------------------------------------------------------------------- 1 | package member 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/cmd/organization/member/add" 5 | "github.com/stackitcloud/stackit-cli/internal/cmd/organization/member/list" 6 | "github.com/stackitcloud/stackit-cli/internal/cmd/organization/member/remove" 7 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 8 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 9 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 10 | 11 | "github.com/spf13/cobra" 12 | ) 13 | 14 | func NewCmd(params *types.CmdParams) *cobra.Command { 15 | cmd := &cobra.Command{ 16 | Use: "member", 17 | Short: "Manages organization members", 18 | Long: "Manages organization members.", 19 | Args: args.NoArgs, 20 | Run: utils.CmdHelp, 21 | } 22 | addSubcommands(cmd, params) 23 | return cmd 24 | } 25 | 26 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 27 | cmd.AddCommand(add.NewCmd(params)) 28 | cmd.AddCommand(list.NewCmd(params)) 29 | cmd.AddCommand(remove.NewCmd(params)) 30 | } 31 | -------------------------------------------------------------------------------- /internal/cmd/rabbitmq/rabbitmq.go: -------------------------------------------------------------------------------- 1 | package rabbitmq 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/cmd/rabbitmq/credentials" 5 | "github.com/stackitcloud/stackit-cli/internal/cmd/rabbitmq/instance" 6 | "github.com/stackitcloud/stackit-cli/internal/cmd/rabbitmq/plans" 7 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 8 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 9 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 10 | 11 | "github.com/spf13/cobra" 12 | ) 13 | 14 | func NewCmd(params *types.CmdParams) *cobra.Command { 15 | cmd := &cobra.Command{ 16 | Use: "rabbitmq", 17 | Short: "Provides functionality for RabbitMQ", 18 | Long: "Provides functionality for RabbitMQ.", 19 | Args: args.NoArgs, 20 | Run: utils.CmdHelp, 21 | } 22 | addSubcommands(cmd, params) 23 | return cmd 24 | } 25 | 26 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 27 | cmd.AddCommand(instance.NewCmd(params)) 28 | cmd.AddCommand(plans.NewCmd(params)) 29 | cmd.AddCommand(credentials.NewCmd(params)) 30 | } 31 | -------------------------------------------------------------------------------- /docs/stackit_image_describe.md: -------------------------------------------------------------------------------- 1 | ## stackit image describe 2 | 3 | Describes image 4 | 5 | ### Synopsis 6 | 7 | Describes an image by its internal ID. 8 | 9 | ``` 10 | stackit image describe IMAGE_ID [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Describe image "xxx" 17 | $ stackit image describe xxx 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit image describe" 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -y, --assume-yes If set, skips all confirmation prompts 30 | --async If set, runs the command asynchronously 31 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 32 | -p, --project-id string Project ID 33 | --region string Target region for region-specific requests 34 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [stackit image](./stackit_image.md) - Manage server images 40 | 41 | -------------------------------------------------------------------------------- /docs/stackit_beta_intake.md: -------------------------------------------------------------------------------- 1 | ## stackit beta intake 2 | 3 | Provides functionality for intake 4 | 5 | ### Synopsis 6 | 7 | Provides functionality for intake. 8 | 9 | ``` 10 | stackit beta intake [flags] 11 | ``` 12 | 13 | ### Options 14 | 15 | ``` 16 | -h, --help Help for "stackit beta intake" 17 | ``` 18 | 19 | ### Options inherited from parent commands 20 | 21 | ``` 22 | -y, --assume-yes If set, skips all confirmation prompts 23 | --async If set, runs the command asynchronously 24 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 25 | -p, --project-id string Project ID 26 | --region string Target region for region-specific requests 27 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 28 | ``` 29 | 30 | ### SEE ALSO 31 | 32 | * [stackit beta](./stackit_beta.md) - Contains beta STACKIT CLI commands 33 | * [stackit beta intake runner](./stackit_beta_intake_runner.md) - Provides functionality for Intake Runners 34 | 35 | -------------------------------------------------------------------------------- /internal/cmd/ske/credentials/credentials.go: -------------------------------------------------------------------------------- 1 | package credentials 2 | 3 | import ( 4 | completerotation "github.com/stackitcloud/stackit-cli/internal/cmd/ske/credentials/complete-rotation" 5 | startrotation "github.com/stackitcloud/stackit-cli/internal/cmd/ske/credentials/start-rotation" 6 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 7 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 8 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 9 | 10 | "github.com/spf13/cobra" 11 | ) 12 | 13 | func NewCmd(params *types.CmdParams) *cobra.Command { 14 | cmd := &cobra.Command{ 15 | Use: "credentials", 16 | Short: "Provides functionality for SKE credentials", 17 | Long: "Provides functionality for STACKIT Kubernetes Engine (SKE) credentials.", 18 | Args: args.NoArgs, 19 | Run: utils.CmdHelp, 20 | } 21 | addSubcommands(cmd, params) 22 | return cmd 23 | } 24 | 25 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 26 | cmd.AddCommand(startrotation.NewCmd(params)) 27 | cmd.AddCommand(completerotation.NewCmd(params)) 28 | } 29 | -------------------------------------------------------------------------------- /internal/cmd/opensearch/opensearch.go: -------------------------------------------------------------------------------- 1 | package opensearch 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/cmd/opensearch/credentials" 5 | "github.com/stackitcloud/stackit-cli/internal/cmd/opensearch/instance" 6 | "github.com/stackitcloud/stackit-cli/internal/cmd/opensearch/plans" 7 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 8 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 9 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 10 | 11 | "github.com/spf13/cobra" 12 | ) 13 | 14 | func NewCmd(params *types.CmdParams) *cobra.Command { 15 | cmd := &cobra.Command{ 16 | Use: "opensearch", 17 | Short: "Provides functionality for OpenSearch", 18 | Long: "Provides functionality for OpenSearch.", 19 | Args: args.NoArgs, 20 | Run: utils.CmdHelp, 21 | } 22 | addSubcommands(cmd, params) 23 | return cmd 24 | } 25 | 26 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 27 | cmd.AddCommand(instance.NewCmd(params)) 28 | cmd.AddCommand(plans.NewCmd(params)) 29 | cmd.AddCommand(credentials.NewCmd(params)) 30 | } 31 | -------------------------------------------------------------------------------- /docs/stackit_server_stop.md: -------------------------------------------------------------------------------- 1 | ## stackit server stop 2 | 3 | Stops an existing server 4 | 5 | ### Synopsis 6 | 7 | Stops an existing server. 8 | 9 | ``` 10 | stackit server stop SERVER_ID [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Stop an existing server with ID "xxx" 17 | $ stackit server stop xxx 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit server stop" 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -y, --assume-yes If set, skips all confirmation prompts 30 | --async If set, runs the command asynchronously 31 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 32 | -p, --project-id string Project ID 33 | --region string Target region for region-specific requests 34 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [stackit server](./stackit_server.md) - Provides functionality for servers 40 | 41 | -------------------------------------------------------------------------------- /docs/stackit_auth_logout.md: -------------------------------------------------------------------------------- 1 | ## stackit auth logout 2 | 3 | Logs the user account out of the STACKIT CLI 4 | 5 | ### Synopsis 6 | 7 | Logs the user account out of the STACKIT CLI. 8 | 9 | ``` 10 | stackit auth logout [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Log out of the STACKIT CLI. 17 | $ stackit auth logout 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit auth logout" 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -y, --assume-yes If set, skips all confirmation prompts 30 | --async If set, runs the command asynchronously 31 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 32 | -p, --project-id string Project ID 33 | --region string Target region for region-specific requests 34 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [stackit auth](./stackit_auth.md) - Authenticates the STACKIT CLI 40 | 41 | -------------------------------------------------------------------------------- /docs/stackit_dns_zone_delete.md: -------------------------------------------------------------------------------- 1 | ## stackit dns zone delete 2 | 3 | Deletes a DNS zone 4 | 5 | ### Synopsis 6 | 7 | Deletes a DNS zone. 8 | 9 | ``` 10 | stackit dns zone delete ZONE_ID [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Delete a DNS zone with ID "xxx" 17 | $ stackit dns zone delete xxx 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit dns zone delete" 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -y, --assume-yes If set, skips all confirmation prompts 30 | --async If set, runs the command asynchronously 31 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 32 | -p, --project-id string Project ID 33 | --region string Target region for region-specific requests 34 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [stackit dns zone](./stackit_dns_zone.md) - Provides functionality for DNS zones 40 | 41 | -------------------------------------------------------------------------------- /docs/stackit_git_flavor.md: -------------------------------------------------------------------------------- 1 | ## stackit git flavor 2 | 3 | Provides functionality for STACKIT Git flavors 4 | 5 | ### Synopsis 6 | 7 | Provides functionality for STACKIT Git flavors. 8 | 9 | ``` 10 | stackit git flavor [flags] 11 | ``` 12 | 13 | ### Options 14 | 15 | ``` 16 | -h, --help Help for "stackit git flavor" 17 | ``` 18 | 19 | ### Options inherited from parent commands 20 | 21 | ``` 22 | -y, --assume-yes If set, skips all confirmation prompts 23 | --async If set, runs the command asynchronously 24 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 25 | -p, --project-id string Project ID 26 | --region string Target region for region-specific requests 27 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 28 | ``` 29 | 30 | ### SEE ALSO 31 | 32 | * [stackit git](./stackit_git.md) - Provides functionality for STACKIT Git 33 | * [stackit git flavor list](./stackit_git_flavor_list.md) - Lists instances flavors of STACKIT Git. 34 | 35 | -------------------------------------------------------------------------------- /docs/stackit_ske_enable.md: -------------------------------------------------------------------------------- 1 | ## stackit ske enable 2 | 3 | Enables SKE for a project 4 | 5 | ### Synopsis 6 | 7 | Enables STACKIT Kubernetes Engine (SKE) for a project. 8 | 9 | ``` 10 | stackit ske enable [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Enable SKE functionality for your project 17 | $ stackit ske enable 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit ske enable" 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -y, --assume-yes If set, skips all confirmation prompts 30 | --async If set, runs the command asynchronously 31 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 32 | -p, --project-id string Project ID 33 | --region string Target region for region-specific requests 34 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [stackit ske](./stackit_ske.md) - Provides functionality for SKE 40 | 41 | -------------------------------------------------------------------------------- /internal/cmd/auth/logout/logout.go: -------------------------------------------------------------------------------- 1 | package logout 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 7 | 8 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 9 | "github.com/stackitcloud/stackit-cli/internal/pkg/auth" 10 | "github.com/stackitcloud/stackit-cli/internal/pkg/examples" 11 | 12 | "github.com/spf13/cobra" 13 | ) 14 | 15 | func NewCmd(params *types.CmdParams) *cobra.Command { 16 | cmd := &cobra.Command{ 17 | Use: "logout", 18 | Short: "Logs the user account out of the STACKIT CLI", 19 | Long: "Logs the user account out of the STACKIT CLI.", 20 | Args: args.NoArgs, 21 | Example: examples.Build( 22 | examples.NewExample( 23 | `Log out of the STACKIT CLI.`, 24 | "$ stackit auth logout"), 25 | ), 26 | RunE: func(_ *cobra.Command, _ []string) error { 27 | err := auth.LogoutUser() 28 | if err != nil { 29 | return fmt.Errorf("log out failed: %w", err) 30 | } 31 | 32 | params.Printer.Info("Successfully logged out of the STACKIT CLI.\n") 33 | return nil 34 | }, 35 | } 36 | return cmd 37 | } 38 | -------------------------------------------------------------------------------- /docs/stackit_organization_role.md: -------------------------------------------------------------------------------- 1 | ## stackit organization role 2 | 3 | Manages organization roles 4 | 5 | ### Synopsis 6 | 7 | Manages organization roles. 8 | 9 | ``` 10 | stackit organization role [flags] 11 | ``` 12 | 13 | ### Options 14 | 15 | ``` 16 | -h, --help Help for "stackit organization role" 17 | ``` 18 | 19 | ### Options inherited from parent commands 20 | 21 | ``` 22 | -y, --assume-yes If set, skips all confirmation prompts 23 | --async If set, runs the command asynchronously 24 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 25 | -p, --project-id string Project ID 26 | --region string Target region for region-specific requests 27 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 28 | ``` 29 | 30 | ### SEE ALSO 31 | 32 | * [stackit organization](./stackit_organization.md) - Manages organizations 33 | * [stackit organization role list](./stackit_organization_role_list.md) - Lists roles and permissions of an organization 34 | 35 | -------------------------------------------------------------------------------- /internal/cmd/volume/performance-class/performance_class.go: -------------------------------------------------------------------------------- 1 | package performanceclass 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/cmd/volume/performance-class/describe" 5 | "github.com/stackitcloud/stackit-cli/internal/cmd/volume/performance-class/list" 6 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 7 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 8 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 9 | 10 | "github.com/spf13/cobra" 11 | ) 12 | 13 | func NewCmd(params *types.CmdParams) *cobra.Command { 14 | cmd := &cobra.Command{ 15 | Use: "performance-class", 16 | Short: "Provides functionality for volume performance classes available inside a project", 17 | Long: "Provides functionality for volume performance classes available inside a project.", 18 | Args: args.NoArgs, 19 | Run: utils.CmdHelp, 20 | } 21 | addSubcommands(cmd, params) 22 | return cmd 23 | } 24 | 25 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 26 | cmd.AddCommand(describe.NewCmd(params)) 27 | cmd.AddCommand(list.NewCmd(params)) 28 | } 29 | -------------------------------------------------------------------------------- /internal/cmd/server/service-account/service-account.go: -------------------------------------------------------------------------------- 1 | package serviceaccount 2 | 3 | import ( 4 | "github.com/spf13/cobra" 5 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 6 | 7 | "github.com/stackitcloud/stackit-cli/internal/cmd/server/service-account/attach" 8 | "github.com/stackitcloud/stackit-cli/internal/cmd/server/service-account/detach" 9 | "github.com/stackitcloud/stackit-cli/internal/cmd/server/service-account/list" 10 | 11 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 12 | ) 13 | 14 | func NewCmd(params *types.CmdParams) *cobra.Command { 15 | cmd := &cobra.Command{ 16 | Use: "service-account", 17 | Short: "Allows attaching/detaching service accounts to servers", 18 | Long: "Allows attaching/detaching service accounts to servers", 19 | Args: cobra.NoArgs, 20 | Run: utils.CmdHelp, 21 | } 22 | addSubcommands(cmd, params) 23 | return cmd 24 | } 25 | 26 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 27 | cmd.AddCommand(attach.NewCmd(params)) 28 | cmd.AddCommand(detach.NewCmd(params)) 29 | cmd.AddCommand(list.NewCmd(params)) 30 | } 31 | -------------------------------------------------------------------------------- /.aptly.conf: -------------------------------------------------------------------------------- 1 | { 2 | "downloadConcurrency": 4, 3 | "downloadSpeedLimit": 0, 4 | "downloadRetries": 0, 5 | "downloader": "default", 6 | "databaseOpenAttempts": -1, 7 | "architectures": [], 8 | "dependencyFollowSuggests": false, 9 | "dependencyFollowRecommends": false, 10 | "dependencyFollowAllVariants": false, 11 | "dependencyFollowSource": false, 12 | "dependencyVerboseResolve": false, 13 | "gpgDisableSign": false, 14 | "gpgDisableVerify": false, 15 | "gpgProvider": "gpg", 16 | "downloadSourcePackages": false, 17 | "skipLegacyPool": true, 18 | "ppaDistributorID": "ubuntu", 19 | "ppaCodename": "", 20 | "skipContentsPublishing": false, 21 | "skipBz2Publishing": false, 22 | "FileSystemPublishEndpoints": {}, 23 | "S3PublishEndpoints": { 24 | "distribution": { 25 | "region": "eu01", 26 | "bucket": "distribution", 27 | "acl":"public-read", 28 | "endpoint": "https://object.storage.eu01.onstackit.cloud" 29 | } 30 | }, 31 | "SwiftPublishEndpoints": {}, 32 | "AzurePublishEndpoints": {}, 33 | "AsyncAPI": false, 34 | "enableMetricsEndpoint": false 35 | } -------------------------------------------------------------------------------- /docs/stackit_server_unrescue.md: -------------------------------------------------------------------------------- 1 | ## stackit server unrescue 2 | 3 | Unrescues an existing server 4 | 5 | ### Synopsis 6 | 7 | Unrescues an existing server. 8 | 9 | ``` 10 | stackit server unrescue SERVER_ID [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Unrescue an existing server with ID "xxx" 17 | $ stackit server unrescue xxx 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit server unrescue" 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -y, --assume-yes If set, skips all confirmation prompts 30 | --async If set, runs the command asynchronously 31 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 32 | -p, --project-id string Project ID 33 | --region string Target region for region-specific requests 34 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [stackit server](./stackit_server.md) - Provides functionality for servers 40 | 41 | -------------------------------------------------------------------------------- /docs/stackit_dns.md: -------------------------------------------------------------------------------- 1 | ## stackit dns 2 | 3 | Provides functionality for DNS 4 | 5 | ### Synopsis 6 | 7 | Provides functionality for DNS. 8 | 9 | ``` 10 | stackit dns [flags] 11 | ``` 12 | 13 | ### Options 14 | 15 | ``` 16 | -h, --help Help for "stackit dns" 17 | ``` 18 | 19 | ### Options inherited from parent commands 20 | 21 | ``` 22 | -y, --assume-yes If set, skips all confirmation prompts 23 | --async If set, runs the command asynchronously 24 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 25 | -p, --project-id string Project ID 26 | --region string Target region for region-specific requests 27 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 28 | ``` 29 | 30 | ### SEE ALSO 31 | 32 | * [stackit](./stackit.md) - Manage STACKIT resources using the command line 33 | * [stackit dns record-set](./stackit_dns_record-set.md) - Provides functionality for DNS record set 34 | * [stackit dns zone](./stackit_dns_zone.md) - Provides functionality for DNS zones 35 | 36 | -------------------------------------------------------------------------------- /docs/stackit_key-pair_delete.md: -------------------------------------------------------------------------------- 1 | ## stackit key-pair delete 2 | 3 | Deletes a key pair 4 | 5 | ### Synopsis 6 | 7 | Deletes a key pair. 8 | 9 | ``` 10 | stackit key-pair delete KEY_PAIR_NAME [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Delete key pair with name "KEY_PAIR_NAME" 17 | $ stackit key-pair delete KEY_PAIR_NAME 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit key-pair delete" 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -y, --assume-yes If set, skips all confirmation prompts 30 | --async If set, runs the command asynchronously 31 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 32 | -p, --project-id string Project ID 33 | --region string Target region for region-specific requests 34 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [stackit key-pair](./stackit_key-pair.md) - Provides functionality for SSH key pairs 40 | 41 | -------------------------------------------------------------------------------- /internal/cmd/service-account/token/token.go: -------------------------------------------------------------------------------- 1 | package token 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/cmd/service-account/token/create" 5 | "github.com/stackitcloud/stackit-cli/internal/cmd/service-account/token/list" 6 | "github.com/stackitcloud/stackit-cli/internal/cmd/service-account/token/revoke" 7 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 8 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 9 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 10 | 11 | "github.com/spf13/cobra" 12 | ) 13 | 14 | func NewCmd(params *types.CmdParams) *cobra.Command { 15 | cmd := &cobra.Command{ 16 | Use: "token", 17 | Short: "Provides functionality for service account tokens", 18 | Long: "Provides functionality for service account tokens.", 19 | Args: args.NoArgs, 20 | Run: utils.CmdHelp, 21 | } 22 | addSubcommands(cmd, params) 23 | return cmd 24 | } 25 | 26 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 27 | cmd.AddCommand(create.NewCmd(params)) 28 | cmd.AddCommand(list.NewCmd(params)) 29 | cmd.AddCommand(revoke.NewCmd(params)) 30 | } 31 | -------------------------------------------------------------------------------- /docs/stackit_server_deallocate.md: -------------------------------------------------------------------------------- 1 | ## stackit server deallocate 2 | 3 | Deallocates an existing server 4 | 5 | ### Synopsis 6 | 7 | Deallocates an existing server. 8 | 9 | ``` 10 | stackit server deallocate SERVER_ID [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Deallocate an existing server with ID "xxx" 17 | $ stackit server deallocate xxx 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit server deallocate" 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -y, --assume-yes If set, skips all confirmation prompts 30 | --async If set, runs the command asynchronously 31 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 32 | -p, --project-id string Project ID 33 | --region string Target region for region-specific requests 34 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [stackit server](./stackit_server.md) - Provides functionality for servers 40 | 41 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | ROOT_DIR ?= $(shell git rev-parse --show-toplevel) 2 | SCRIPTS_BASE ?= $(ROOT_DIR)/scripts 3 | GOLANG_CI_YAML_PATH ?= ${ROOT_DIR}/golang-ci.yaml 4 | GOLANG_CI_ARGS ?= --allow-parallel-runners --config=${GOLANG_CI_YAML_PATH} 5 | 6 | # Build 7 | build: 8 | @go build -o ./bin/stackit 9 | 10 | fmt: 11 | @gofmt -s -w . 12 | @go tool goimports -w . 13 | 14 | # Lint 15 | lint-golangci-lint: 16 | @echo ">> Linting with golangci-lint" 17 | @go tool golangci-lint run ${GOLANG_CI_ARGS} 18 | 19 | lint-yamllint: 20 | @echo ">> Linting with yamllint" 21 | @yamllint -c .yamllint.yaml . 22 | 23 | lint: lint-golangci-lint lint-yamllint 24 | 25 | # Test 26 | test: 27 | @echo ">> Running tests for the CLI application" 28 | @go test ./... -count=1 -coverprofile=coverage.out 29 | 30 | # Test coverage 31 | coverage: 32 | @echo ">> Creating test coverage report for the CLI application" 33 | @go test ./... -coverprofile=coverage.out || true 34 | @go tool cover -html=coverage.out -o coverage.html 35 | 36 | # Generate docs 37 | generate-docs: 38 | @echo ">> Generating docs..." 39 | @go run $(SCRIPTS_BASE)/generate.go 40 | -------------------------------------------------------------------------------- /docs/stackit_beta_alb_plans.md: -------------------------------------------------------------------------------- 1 | ## stackit beta alb plans 2 | 3 | Lists the application load balancer plans 4 | 5 | ### Synopsis 6 | 7 | Lists the available application load balancer plans. 8 | 9 | ``` 10 | stackit beta alb plans [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | List all application load balancer plans 17 | $ stackit beta alb plans 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit beta alb plans" 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -y, --assume-yes If set, skips all confirmation prompts 30 | --async If set, runs the command asynchronously 31 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 32 | -p, --project-id string Project ID 33 | --region string Target region for region-specific requests 34 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [stackit beta alb](./stackit_beta_alb.md) - Manages application loadbalancers 40 | 41 | -------------------------------------------------------------------------------- /docs/stackit_server_delete.md: -------------------------------------------------------------------------------- 1 | ## stackit server delete 2 | 3 | Deletes a server 4 | 5 | ### Synopsis 6 | 7 | Deletes a server. 8 | If the server is still in use, the deletion will fail 9 | 10 | 11 | ``` 12 | stackit server delete SERVER_ID [flags] 13 | ``` 14 | 15 | ### Examples 16 | 17 | ``` 18 | Delete server with ID "xxx" 19 | $ stackit server delete xxx 20 | ``` 21 | 22 | ### Options 23 | 24 | ``` 25 | -h, --help Help for "stackit server delete" 26 | ``` 27 | 28 | ### Options inherited from parent commands 29 | 30 | ``` 31 | -y, --assume-yes If set, skips all confirmation prompts 32 | --async If set, runs the command asynchronously 33 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 34 | -p, --project-id string Project ID 35 | --region string Target region for region-specific requests 36 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 37 | ``` 38 | 39 | ### SEE ALSO 40 | 41 | * [stackit server](./stackit_server.md) - Provides functionality for servers 42 | 43 | -------------------------------------------------------------------------------- /docs/stackit_ske_describe.md: -------------------------------------------------------------------------------- 1 | ## stackit ske describe 2 | 3 | Shows overall details regarding SKE 4 | 5 | ### Synopsis 6 | 7 | Shows overall details regarding STACKIT Kubernetes Engine (SKE). 8 | 9 | ``` 10 | stackit ske describe [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Get details regarding SKE functionality on your project 17 | $ stackit ske describe 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit ske describe" 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -y, --assume-yes If set, skips all confirmation prompts 30 | --async If set, runs the command asynchronously 31 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 32 | -p, --project-id string Project ID 33 | --region string Target region for region-specific requests 34 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [stackit ske](./stackit_ske.md) - Provides functionality for SKE 40 | 41 | -------------------------------------------------------------------------------- /docs/stackit_volume_backup_delete.md: -------------------------------------------------------------------------------- 1 | ## stackit volume backup delete 2 | 3 | Deletes a backup 4 | 5 | ### Synopsis 6 | 7 | Deletes a backup by its ID. 8 | 9 | ``` 10 | stackit volume backup delete BACKUP_ID [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Delete a backup with ID "xxx" 17 | $ stackit volume backup delete xxx 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit volume backup delete" 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -y, --assume-yes If set, skips all confirmation prompts 30 | --async If set, runs the command asynchronously 31 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 32 | -p, --project-id string Project ID 33 | --region string Target region for region-specific requests 34 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [stackit volume backup](./stackit_volume_backup.md) - Provides functionality for volume backups 40 | 41 | -------------------------------------------------------------------------------- /docs/stackit_volume_delete.md: -------------------------------------------------------------------------------- 1 | ## stackit volume delete 2 | 3 | Deletes a volume 4 | 5 | ### Synopsis 6 | 7 | Deletes a volume. 8 | If the volume is still in use, the deletion will fail 9 | 10 | 11 | ``` 12 | stackit volume delete VOLUME_ID [flags] 13 | ``` 14 | 15 | ### Examples 16 | 17 | ``` 18 | Delete volume with ID "xxx" 19 | $ stackit volume delete xxx 20 | ``` 21 | 22 | ### Options 23 | 24 | ``` 25 | -h, --help Help for "stackit volume delete" 26 | ``` 27 | 28 | ### Options inherited from parent commands 29 | 30 | ``` 31 | -y, --assume-yes If set, skips all confirmation prompts 32 | --async If set, runs the command asynchronously 33 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 34 | -p, --project-id string Project ID 35 | --region string Target region for region-specific requests 36 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 37 | ``` 38 | 39 | ### SEE ALSO 40 | 41 | * [stackit volume](./stackit_volume.md) - Provides functionality for volumes 42 | 43 | -------------------------------------------------------------------------------- /docs/stackit_beta_alb_pool.md: -------------------------------------------------------------------------------- 1 | ## stackit beta alb pool 2 | 3 | Manages target pools for application loadbalancers 4 | 5 | ### Synopsis 6 | 7 | Manage the lifecycle of target pools for application loadbalancers. 8 | 9 | ``` 10 | stackit beta alb pool [flags] 11 | ``` 12 | 13 | ### Options 14 | 15 | ``` 16 | -h, --help Help for "stackit beta alb pool" 17 | ``` 18 | 19 | ### Options inherited from parent commands 20 | 21 | ``` 22 | -y, --assume-yes If set, skips all confirmation prompts 23 | --async If set, runs the command asynchronously 24 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 25 | -p, --project-id string Project ID 26 | --region string Target region for region-specific requests 27 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 28 | ``` 29 | 30 | ### SEE ALSO 31 | 32 | * [stackit beta alb](./stackit_beta_alb.md) - Manages application loadbalancers 33 | * [stackit beta alb pool update](./stackit_beta_alb_pool_update.md) - Updates an application target pool 34 | 35 | -------------------------------------------------------------------------------- /internal/cmd/organization/organization.go: -------------------------------------------------------------------------------- 1 | package organization 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 7 | 8 | "github.com/stackitcloud/stackit-cli/internal/cmd/organization/member" 9 | "github.com/stackitcloud/stackit-cli/internal/cmd/organization/role" 10 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 11 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 12 | 13 | "github.com/spf13/cobra" 14 | ) 15 | 16 | func NewCmd(params *types.CmdParams) *cobra.Command { 17 | cmd := &cobra.Command{ 18 | Use: "organization", 19 | Short: "Manages organizations", 20 | Long: fmt.Sprintf("%s\n%s", 21 | "Manages organizations.", 22 | "An active STACKIT organization is the root element of the resource hierarchy and a prerequisite to use any STACKIT Cloud Resource / Service.", 23 | ), 24 | Args: args.NoArgs, 25 | Run: utils.CmdHelp, 26 | } 27 | addSubcommands(cmd, params) 28 | return cmd 29 | } 30 | 31 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 32 | cmd.AddCommand(member.NewCmd(params)) 33 | cmd.AddCommand(role.NewCmd(params)) 34 | } 35 | -------------------------------------------------------------------------------- /docs/stackit_network_delete.md: -------------------------------------------------------------------------------- 1 | ## stackit network delete 2 | 3 | Deletes a network 4 | 5 | ### Synopsis 6 | 7 | Deletes a network. 8 | If the network is still in use, the deletion will fail 9 | 10 | 11 | ``` 12 | stackit network delete NETWORK_ID [flags] 13 | ``` 14 | 15 | ### Examples 16 | 17 | ``` 18 | Delete network with ID "xxx" 19 | $ stackit network delete xxx 20 | ``` 21 | 22 | ### Options 23 | 24 | ``` 25 | -h, --help Help for "stackit network delete" 26 | ``` 27 | 28 | ### Options inherited from parent commands 29 | 30 | ``` 31 | -y, --assume-yes If set, skips all confirmation prompts 32 | --async If set, runs the command asynchronously 33 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 34 | -p, --project-id string Project ID 35 | --region string Target region for region-specific requests 36 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 37 | ``` 38 | 39 | ### SEE ALSO 40 | 41 | * [stackit network](./stackit_network.md) - Provides functionality for networks 42 | 43 | -------------------------------------------------------------------------------- /docs/stackit_public-ip_ranges.md: -------------------------------------------------------------------------------- 1 | ## stackit public-ip ranges 2 | 3 | Provides functionality for STACKIT public-ip ranges 4 | 5 | ### Synopsis 6 | 7 | Provides functionality for STACKIT public-ip ranges 8 | 9 | ``` 10 | stackit public-ip ranges [flags] 11 | ``` 12 | 13 | ### Options 14 | 15 | ``` 16 | -h, --help Help for "stackit public-ip ranges" 17 | ``` 18 | 19 | ### Options inherited from parent commands 20 | 21 | ``` 22 | -y, --assume-yes If set, skips all confirmation prompts 23 | --async If set, runs the command asynchronously 24 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 25 | -p, --project-id string Project ID 26 | --region string Target region for region-specific requests 27 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 28 | ``` 29 | 30 | ### SEE ALSO 31 | 32 | * [stackit public-ip](./stackit_public-ip.md) - Provides functionality for public IPs 33 | * [stackit public-ip ranges list](./stackit_public-ip_ranges_list.md) - Lists all STACKIT public-ip ranges 34 | 35 | -------------------------------------------------------------------------------- /docs/stackit_volume_backup_restore.md: -------------------------------------------------------------------------------- 1 | ## stackit volume backup restore 2 | 3 | Restores a backup 4 | 5 | ### Synopsis 6 | 7 | Restores a backup by its ID. 8 | 9 | ``` 10 | stackit volume backup restore BACKUP_ID [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Restore a backup with ID "xxx" 17 | $ stackit volume backup restore xxx 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit volume backup restore" 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -y, --assume-yes If set, skips all confirmation prompts 30 | --async If set, runs the command asynchronously 31 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 32 | -p, --project-id string Project ID 33 | --region string Target region for region-specific requests 34 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [stackit volume backup](./stackit_volume_backup.md) - Provides functionality for volume backups 40 | 41 | -------------------------------------------------------------------------------- /docs/stackit_volume_resize.md: -------------------------------------------------------------------------------- 1 | ## stackit volume resize 2 | 3 | Resizes a volume 4 | 5 | ### Synopsis 6 | 7 | Resizes a volume. 8 | 9 | ``` 10 | stackit volume resize VOLUME_ID [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Resize volume with ID "xxx" with new size 10 GB 17 | $ stackit volume resize xxx --size 10 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit volume resize" 24 | --size int Volume size (GB) 25 | ``` 26 | 27 | ### Options inherited from parent commands 28 | 29 | ``` 30 | -y, --assume-yes If set, skips all confirmation prompts 31 | --async If set, runs the command asynchronously 32 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 33 | -p, --project-id string Project ID 34 | --region string Target region for region-specific requests 35 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 36 | ``` 37 | 38 | ### SEE ALSO 39 | 40 | * [stackit volume](./stackit_volume.md) - Provides functionality for volumes 41 | 42 | -------------------------------------------------------------------------------- /docs/stackit_security-group_describe.md: -------------------------------------------------------------------------------- 1 | ## stackit security-group describe 2 | 3 | Describes security groups 4 | 5 | ### Synopsis 6 | 7 | Describes security groups by its internal ID. 8 | 9 | ``` 10 | stackit security-group describe GROUP_ID [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Describe group "xxx" 17 | $ stackit security-group describe xxx 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit security-group describe" 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -y, --assume-yes If set, skips all confirmation prompts 30 | --async If set, runs the command asynchronously 31 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 32 | -p, --project-id string Project ID 33 | --region string Target region for region-specific requests 34 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [stackit security-group](./stackit_security-group.md) - Manage security groups 40 | 41 | -------------------------------------------------------------------------------- /internal/cmd/beta/kms/kms.go: -------------------------------------------------------------------------------- 1 | package kms 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/cmd/beta/kms/key" 5 | "github.com/stackitcloud/stackit-cli/internal/cmd/beta/kms/keyring" 6 | "github.com/stackitcloud/stackit-cli/internal/cmd/beta/kms/version" 7 | "github.com/stackitcloud/stackit-cli/internal/cmd/beta/kms/wrappingkey" 8 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 9 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 10 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 11 | 12 | "github.com/spf13/cobra" 13 | ) 14 | 15 | func NewCmd(params *types.CmdParams) *cobra.Command { 16 | cmd := &cobra.Command{ 17 | Use: "kms", 18 | Short: "Provides functionality for KMS", 19 | Long: "Provides functionality for KMS.", 20 | Args: args.NoArgs, 21 | Run: utils.CmdHelp, 22 | } 23 | addSubcommands(cmd, params) 24 | return cmd 25 | } 26 | 27 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 28 | cmd.AddCommand(keyring.NewCmd(params)) 29 | cmd.AddCommand(wrappingkey.NewCmd(params)) 30 | cmd.AddCommand(key.NewCmd(params)) 31 | cmd.AddCommand(version.NewCmd(params)) 32 | } 33 | -------------------------------------------------------------------------------- /internal/pkg/flags/uuidslice.go: -------------------------------------------------------------------------------- 1 | package flags 2 | 3 | import ( 4 | "fmt" 5 | "strings" 6 | 7 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 8 | 9 | "github.com/spf13/pflag" 10 | ) 11 | 12 | type uuidSliceFlag struct { 13 | value []string 14 | } 15 | 16 | // Ensure the implementation satisfies the expected interface 17 | var _ pflag.Value = &uuidFlag{} 18 | 19 | // UUIDSliceFlag returns a flag which must be a valid slice. 20 | func UUIDSliceFlag() *uuidSliceFlag { 21 | return &uuidSliceFlag{} 22 | } 23 | 24 | func (f *uuidSliceFlag) String() string { 25 | return "[" + strings.Join(f.value, ",") + "]" 26 | } 27 | 28 | func (f *uuidSliceFlag) Set(value string) error { 29 | if value == "" { 30 | return fmt.Errorf("value cannot be empty") 31 | } 32 | 33 | uuids := strings.Split(value, ",") 34 | 35 | for i, uuid := range uuids { 36 | uuids[i] = strings.TrimSpace(uuid) 37 | 38 | err := utils.ValidateUUID(uuids[i]) 39 | if err != nil { 40 | return err 41 | } 42 | } 43 | 44 | f.value = append(f.value, uuids...) 45 | return nil 46 | } 47 | 48 | func (f *uuidSliceFlag) Type() string { 49 | return "stringSlice" 50 | } 51 | -------------------------------------------------------------------------------- /docs/stackit_affinity-group_delete.md: -------------------------------------------------------------------------------- 1 | ## stackit affinity-group delete 2 | 3 | Deletes an affinity group 4 | 5 | ### Synopsis 6 | 7 | Deletes an affinity group. 8 | 9 | ``` 10 | stackit affinity-group delete AFFINITY_GROUP [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Delete an affinity group with ID "xxx" 17 | $ stackit affinity-group delete xxx 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit affinity-group delete" 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -y, --assume-yes If set, skips all confirmation prompts 30 | --async If set, runs the command asynchronously 31 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 32 | -p, --project-id string Project ID 33 | --region string Target region for region-specific requests 34 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [stackit affinity-group](./stackit_affinity-group.md) - Manage server affinity groups 40 | 41 | -------------------------------------------------------------------------------- /docs/stackit_beta_kms_keyring_describe.md: -------------------------------------------------------------------------------- 1 | ## stackit beta kms keyring describe 2 | 3 | Describe a KMS key ring 4 | 5 | ### Synopsis 6 | 7 | Describe a KMS key ring 8 | 9 | ``` 10 | stackit beta kms keyring describe KEYRING_ID [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Describe a KMS key ring with ID xxx 17 | $ stackit beta kms keyring describe xxx 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit beta kms keyring describe" 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -y, --assume-yes If set, skips all confirmation prompts 30 | --async If set, runs the command asynchronously 31 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 32 | -p, --project-id string Project ID 33 | --region string Target region for region-specific requests 34 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [stackit beta kms keyring](./stackit_beta_kms_keyring.md) - Manage KMS key rings 40 | 41 | -------------------------------------------------------------------------------- /docs/stackit_git.md: -------------------------------------------------------------------------------- 1 | ## stackit git 2 | 3 | Provides functionality for STACKIT Git 4 | 5 | ### Synopsis 6 | 7 | Provides functionality for STACKIT Git. 8 | 9 | ``` 10 | stackit git [flags] 11 | ``` 12 | 13 | ### Options 14 | 15 | ``` 16 | -h, --help Help for "stackit git" 17 | ``` 18 | 19 | ### Options inherited from parent commands 20 | 21 | ``` 22 | -y, --assume-yes If set, skips all confirmation prompts 23 | --async If set, runs the command asynchronously 24 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 25 | -p, --project-id string Project ID 26 | --region string Target region for region-specific requests 27 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 28 | ``` 29 | 30 | ### SEE ALSO 31 | 32 | * [stackit](./stackit.md) - Manage STACKIT resources using the command line 33 | * [stackit git flavor](./stackit_git_flavor.md) - Provides functionality for STACKIT Git flavors 34 | * [stackit git instance](./stackit_git_instance.md) - Provides functionality for STACKIT Git instances 35 | 36 | -------------------------------------------------------------------------------- /docs/stackit_security-group_delete.md: -------------------------------------------------------------------------------- 1 | ## stackit security-group delete 2 | 3 | Deletes a security group 4 | 5 | ### Synopsis 6 | 7 | Deletes a security group by its internal ID. 8 | 9 | ``` 10 | stackit security-group delete GROUP_ID [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Delete a named group with ID "xxx" 17 | $ stackit security-group delete xxx 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit security-group delete" 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -y, --assume-yes If set, skips all confirmation prompts 30 | --async If set, runs the command asynchronously 31 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 32 | -p, --project-id string Project ID 33 | --region string Target region for region-specific requests 34 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [stackit security-group](./stackit_security-group.md) - Manage security groups 40 | 41 | -------------------------------------------------------------------------------- /docs/stackit_volume_snapshot_delete.md: -------------------------------------------------------------------------------- 1 | ## stackit volume snapshot delete 2 | 3 | Deletes a snapshot 4 | 5 | ### Synopsis 6 | 7 | Deletes a snapshot by its ID. 8 | 9 | ``` 10 | stackit volume snapshot delete SNAPSHOT_ID [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Delete a snapshot with ID "xxx" 17 | $ stackit volume snapshot delete xxx 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit volume snapshot delete" 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -y, --assume-yes If set, skips all confirmation prompts 30 | --async If set, runs the command asynchronously 31 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 32 | -p, --project-id string Project ID 33 | --region string Target region for region-specific requests 34 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [stackit volume snapshot](./stackit_volume_snapshot.md) - Provides functionality for snapshots 40 | 41 | -------------------------------------------------------------------------------- /docs/stackit_auth_get-access-token.md: -------------------------------------------------------------------------------- 1 | ## stackit auth get-access-token 2 | 3 | Prints a short-lived access token. 4 | 5 | ### Synopsis 6 | 7 | Prints a short-lived access token which can be used e.g. for API calls. 8 | 9 | ``` 10 | stackit auth get-access-token [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Print a short-lived access token 17 | $ stackit auth get-access-token 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit auth get-access-token" 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -y, --assume-yes If set, skips all confirmation prompts 30 | --async If set, runs the command asynchronously 31 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 32 | -p, --project-id string Project ID 33 | --region string Target region for region-specific requests 34 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [stackit auth](./stackit_auth.md) - Authenticates the STACKIT CLI 40 | 41 | -------------------------------------------------------------------------------- /docs/stackit_logme_instance_delete.md: -------------------------------------------------------------------------------- 1 | ## stackit logme instance delete 2 | 3 | Deletes a LogMe instance 4 | 5 | ### Synopsis 6 | 7 | Deletes a LogMe instance. 8 | 9 | ``` 10 | stackit logme instance delete INSTANCE_ID [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Delete a LogMe instance with ID "xxx" 17 | $ stackit logme instance delete xxx 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit logme instance delete" 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -y, --assume-yes If set, skips all confirmation prompts 30 | --async If set, runs the command asynchronously 31 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 32 | -p, --project-id string Project ID 33 | --region string Target region for region-specific requests 34 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [stackit logme instance](./stackit_logme_instance.md) - Provides functionality for LogMe instances 40 | 41 | -------------------------------------------------------------------------------- /docs/stackit_redis_instance_delete.md: -------------------------------------------------------------------------------- 1 | ## stackit redis instance delete 2 | 3 | Deletes a Redis instance 4 | 5 | ### Synopsis 6 | 7 | Deletes a Redis instance. 8 | 9 | ``` 10 | stackit redis instance delete INSTANCE_ID [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Delete a Redis instance with ID "xxx" 17 | $ stackit redis instance delete xxx 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit redis instance delete" 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -y, --assume-yes If set, skips all confirmation prompts 30 | --async If set, runs the command asynchronously 31 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 32 | -p, --project-id string Project ID 33 | --region string Target region for region-specific requests 34 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [stackit redis instance](./stackit_redis_instance.md) - Provides functionality for Redis instances 40 | 41 | -------------------------------------------------------------------------------- /internal/cmd/observability/credentials/credentials.go: -------------------------------------------------------------------------------- 1 | package credentials 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/cmd/observability/credentials/create" 5 | "github.com/stackitcloud/stackit-cli/internal/cmd/observability/credentials/delete" 6 | "github.com/stackitcloud/stackit-cli/internal/cmd/observability/credentials/list" 7 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 8 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 9 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 10 | 11 | "github.com/spf13/cobra" 12 | ) 13 | 14 | func NewCmd(params *types.CmdParams) *cobra.Command { 15 | cmd := &cobra.Command{ 16 | Use: "credentials", 17 | Short: "Provides functionality for Observability credentials", 18 | Long: "Provides functionality for Observability credentials.", 19 | Args: args.NoArgs, 20 | Run: utils.CmdHelp, 21 | } 22 | addSubcommands(cmd, params) 23 | return cmd 24 | } 25 | 26 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 27 | cmd.AddCommand(create.NewCmd(params)) 28 | cmd.AddCommand(delete.NewCmd(params)) 29 | cmd.AddCommand(list.NewCmd(params)) 30 | } 31 | -------------------------------------------------------------------------------- /docs/stackit_beta_kms_keyring_delete.md: -------------------------------------------------------------------------------- 1 | ## stackit beta kms keyring delete 2 | 3 | Deletes a KMS key ring 4 | 5 | ### Synopsis 6 | 7 | Deletes a KMS key ring. 8 | 9 | ``` 10 | stackit beta kms keyring delete KEYRING-ID [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Delete a KMS key ring with ID "MY_KEYRING_ID" 17 | $ stackit beta kms keyring delete "MY_KEYRING_ID" 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit beta kms keyring delete" 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -y, --assume-yes If set, skips all confirmation prompts 30 | --async If set, runs the command asynchronously 31 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 32 | -p, --project-id string Project ID 33 | --region string Target region for region-specific requests 34 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [stackit beta kms keyring](./stackit_beta_kms_keyring.md) - Manage KMS key rings 40 | 41 | -------------------------------------------------------------------------------- /internal/cmd/object-storage/credentials/credentials.go: -------------------------------------------------------------------------------- 1 | package credentials 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/cmd/object-storage/credentials/create" 5 | "github.com/stackitcloud/stackit-cli/internal/cmd/object-storage/credentials/delete" 6 | "github.com/stackitcloud/stackit-cli/internal/cmd/object-storage/credentials/list" 7 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 8 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 9 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 10 | 11 | "github.com/spf13/cobra" 12 | ) 13 | 14 | func NewCmd(params *types.CmdParams) *cobra.Command { 15 | cmd := &cobra.Command{ 16 | Use: "credentials", 17 | Short: "Provides functionality for Object Storage credentials", 18 | Long: "Provides functionality for Object Storage credentials.", 19 | Args: args.NoArgs, 20 | Run: utils.CmdHelp, 21 | } 22 | addSubcommands(cmd, params) 23 | return cmd 24 | } 25 | 26 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 27 | cmd.AddCommand(create.NewCmd(params)) 28 | cmd.AddCommand(delete.NewCmd(params)) 29 | cmd.AddCommand(list.NewCmd(params)) 30 | } 31 | -------------------------------------------------------------------------------- /internal/pkg/services/resourcemanager/utils/utils.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | 7 | "github.com/stackitcloud/stackit-sdk-go/services/resourcemanager" 8 | ) 9 | 10 | type ResourceManagerClient interface { 11 | GetOrganizationExecute(ctx context.Context, organizationId string) (*resourcemanager.OrganizationResponse, error) 12 | GetProjectExecute(ctx context.Context, projectId string) (*resourcemanager.GetProjectResponse, error) 13 | } 14 | 15 | // GetOrganizationName returns the name of an organization by its ID. 16 | func GetOrganizationName(ctx context.Context, apiClient ResourceManagerClient, orgId string) (string, error) { 17 | resp, err := apiClient.GetOrganizationExecute(ctx, orgId) 18 | if err != nil { 19 | return "", fmt.Errorf("get organization details: %w", err) 20 | } 21 | 22 | return *resp.Name, nil 23 | } 24 | 25 | func GetProjectName(ctx context.Context, apiClient ResourceManagerClient, projectId string) (string, error) { 26 | resp, err := apiClient.GetProjectExecute(ctx, projectId) 27 | if err != nil { 28 | return "", fmt.Errorf("get project details: %w", err) 29 | } 30 | 31 | return *resp.Name, nil 32 | } 33 | -------------------------------------------------------------------------------- /docs/stackit_beta_alb_quotas.md: -------------------------------------------------------------------------------- 1 | ## stackit beta alb quotas 2 | 3 | Shows the application load balancer quotas 4 | 5 | ### Synopsis 6 | 7 | Shows the application load balancer quotas for the application load balancers. 8 | 9 | ``` 10 | stackit beta alb quotas [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | List all application load balancer quotas 17 | $ stackit beta alb quotas 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit beta alb quotas" 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -y, --assume-yes If set, skips all confirmation prompts 30 | --async If set, runs the command asynchronously 31 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 32 | -p, --project-id string Project ID 33 | --region string Target region for region-specific requests 34 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [stackit beta alb](./stackit_beta_alb.md) - Manages application loadbalancers 40 | 41 | -------------------------------------------------------------------------------- /docs/stackit_git_instance_describe.md: -------------------------------------------------------------------------------- 1 | ## stackit git instance describe 2 | 3 | Describes STACKIT Git instance 4 | 5 | ### Synopsis 6 | 7 | Describes a STACKIT Git instance by its internal ID. 8 | 9 | ``` 10 | stackit git instance describe INSTANCE_ID [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Describe instance "xxx" 17 | $ stackit git describe xxx 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit git instance describe" 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -y, --assume-yes If set, skips all confirmation prompts 30 | --async If set, runs the command asynchronously 31 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 32 | -p, --project-id string Project ID 33 | --region string Target region for region-specific requests 34 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [stackit git instance](./stackit_git_instance.md) - Provides functionality for STACKIT Git instances 40 | 41 | -------------------------------------------------------------------------------- /docs/stackit_public-ip_delete.md: -------------------------------------------------------------------------------- 1 | ## stackit public-ip delete 2 | 3 | Deletes a Public IP 4 | 5 | ### Synopsis 6 | 7 | Deletes a Public IP. 8 | If the public IP is still in use, the deletion will fail 9 | 10 | 11 | ``` 12 | stackit public-ip delete PUBLIC_IP_ID [flags] 13 | ``` 14 | 15 | ### Examples 16 | 17 | ``` 18 | Delete public IP with ID "xxx" 19 | $ stackit public-ip delete xxx 20 | ``` 21 | 22 | ### Options 23 | 24 | ``` 25 | -h, --help Help for "stackit public-ip delete" 26 | ``` 27 | 28 | ### Options inherited from parent commands 29 | 30 | ``` 31 | -y, --assume-yes If set, skips all confirmation prompts 32 | --async If set, runs the command asynchronously 33 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 34 | -p, --project-id string Project ID 35 | --region string Target region for region-specific requests 36 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 37 | ``` 38 | 39 | ### SEE ALSO 40 | 41 | * [stackit public-ip](./stackit_public-ip.md) - Provides functionality for public IPs 42 | 43 | -------------------------------------------------------------------------------- /docs/stackit_server_start.md: -------------------------------------------------------------------------------- 1 | ## stackit server start 2 | 3 | Starts an existing server or allocates the server if deallocated 4 | 5 | ### Synopsis 6 | 7 | Starts an existing server or allocates the server if deallocated. 8 | 9 | ``` 10 | stackit server start SERVER_ID [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Start an existing server with ID "xxx" 17 | $ stackit server start xxx 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit server start" 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -y, --assume-yes If set, skips all confirmation prompts 30 | --async If set, runs the command asynchronously 31 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 32 | -p, --project-id string Project ID 33 | --region string Target region for region-specific requests 34 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [stackit server](./stackit_server.md) - Provides functionality for servers 40 | 41 | -------------------------------------------------------------------------------- /docs/stackit_ske_cluster_delete.md: -------------------------------------------------------------------------------- 1 | ## stackit ske cluster delete 2 | 3 | Deletes a SKE cluster 4 | 5 | ### Synopsis 6 | 7 | Deletes a STACKIT Kubernetes Engine (SKE) cluster. 8 | 9 | ``` 10 | stackit ske cluster delete CLUSTER_NAME [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Delete a SKE cluster with name "my-cluster" 17 | $ stackit ske cluster delete my-cluster 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit ske cluster delete" 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -y, --assume-yes If set, skips all confirmation prompts 30 | --async If set, runs the command asynchronously 31 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 32 | -p, --project-id string Project ID 33 | --region string Target region for region-specific requests 34 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [stackit ske cluster](./stackit_ske_cluster.md) - Provides functionality for SKE cluster 40 | 41 | -------------------------------------------------------------------------------- /docs/stackit_ske_disable.md: -------------------------------------------------------------------------------- 1 | ## stackit ske disable 2 | 3 | Disables SKE for a project 4 | 5 | ### Synopsis 6 | 7 | Disables STACKIT Kubernetes Engine (SKE) for a project. It will delete all associated clusters. 8 | 9 | ``` 10 | stackit ske disable [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Disable SKE functionality for your project, deleting all associated clusters 17 | $ stackit ske disable 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit ske disable" 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -y, --assume-yes If set, skips all confirmation prompts 30 | --async If set, runs the command asynchronously 31 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 32 | -p, --project-id string Project ID 33 | --region string Target region for region-specific requests 34 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [stackit ske](./stackit_ske.md) - Provides functionality for SKE 40 | 41 | -------------------------------------------------------------------------------- /internal/cmd/postgresflex/backup/backup.go: -------------------------------------------------------------------------------- 1 | package backup 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/backup/describe" 5 | "github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/backup/list" 6 | updateschedule "github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/backup/update-schedule" 7 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 8 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 9 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 10 | 11 | "github.com/spf13/cobra" 12 | ) 13 | 14 | func NewCmd(params *types.CmdParams) *cobra.Command { 15 | cmd := &cobra.Command{ 16 | Use: "backup", 17 | Short: "Provides functionality for PostgreSQL Flex instance backups", 18 | Long: "Provides functionality for PostgreSQL Flex instance backups.", 19 | Args: args.NoArgs, 20 | Run: utils.CmdHelp, 21 | } 22 | addSubcommands(cmd, params) 23 | return cmd 24 | } 25 | 26 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 27 | cmd.AddCommand(list.NewCmd(params)) 28 | cmd.AddCommand(describe.NewCmd(params)) 29 | cmd.AddCommand(updateschedule.NewCmd(params)) 30 | } 31 | -------------------------------------------------------------------------------- /docs/stackit_git_instance_delete.md: -------------------------------------------------------------------------------- 1 | ## stackit git instance delete 2 | 3 | Deletes STACKIT Git instance 4 | 5 | ### Synopsis 6 | 7 | Deletes a STACKIT Git instance by its internal ID. 8 | 9 | ``` 10 | stackit git instance delete INSTANCE_ID [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Delete a instance with ID "xxx" 17 | $ stackit git instance delete xxx 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit git instance delete" 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -y, --assume-yes If set, skips all confirmation prompts 30 | --async If set, runs the command asynchronously 31 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 32 | -p, --project-id string Project ID 33 | --region string Target region for region-specific requests 34 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [stackit git instance](./stackit_git_instance.md) - Provides functionality for STACKIT Git instances 40 | 41 | -------------------------------------------------------------------------------- /docs/stackit_beta_alb_delete.md: -------------------------------------------------------------------------------- 1 | ## stackit beta alb delete 2 | 3 | Deletes an application loadbalancer 4 | 5 | ### Synopsis 6 | 7 | Deletes an application loadbalancer. 8 | 9 | ``` 10 | stackit beta alb delete LOADBALANCER_NAME_ARG [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Delete an application loadbalancer with name "my-load-balancer" 17 | $ stackit beta alb delete my-load-balancer 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit beta alb delete" 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -y, --assume-yes If set, skips all confirmation prompts 30 | --async If set, runs the command asynchronously 31 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 32 | -p, --project-id string Project ID 33 | --region string Target region for region-specific requests 34 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [stackit beta alb](./stackit_beta_alb.md) - Manages application loadbalancers 40 | 41 | -------------------------------------------------------------------------------- /docs/stackit_mariadb_instance_delete.md: -------------------------------------------------------------------------------- 1 | ## stackit mariadb instance delete 2 | 3 | Deletes a MariaDB instance 4 | 5 | ### Synopsis 6 | 7 | Deletes a MariaDB instance. 8 | 9 | ``` 10 | stackit mariadb instance delete INSTANCE_ID [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Delete a MariaDB instance with ID "xxx" 17 | $ stackit mariadb instance delete xxx 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit mariadb instance delete" 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -y, --assume-yes If set, skips all confirmation prompts 30 | --async If set, runs the command asynchronously 31 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 32 | -p, --project-id string Project ID 33 | --region string Target region for region-specific requests 34 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [stackit mariadb instance](./stackit_mariadb_instance.md) - Provides functionality for MariaDB instances 40 | 41 | -------------------------------------------------------------------------------- /docs/stackit_object-storage_enable.md: -------------------------------------------------------------------------------- 1 | ## stackit object-storage enable 2 | 3 | Enables Object Storage for a project 4 | 5 | ### Synopsis 6 | 7 | Enables Object Storage for a project. 8 | 9 | ``` 10 | stackit object-storage enable [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Enable Object Storage functionality for your project 17 | $ stackit object-storage enable 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit object-storage enable" 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -y, --assume-yes If set, skips all confirmation prompts 30 | --async If set, runs the command asynchronously 31 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 32 | -p, --project-id string Project ID 33 | --region string Target region for region-specific requests 34 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [stackit object-storage](./stackit_object-storage.md) - Provides functionality for Object Storage 40 | 41 | -------------------------------------------------------------------------------- /internal/cmd/server/network-interface/network-interface.go: -------------------------------------------------------------------------------- 1 | package networkinterface 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/cmd/server/network-interface/attach" 5 | "github.com/stackitcloud/stackit-cli/internal/cmd/server/network-interface/detach" 6 | "github.com/stackitcloud/stackit-cli/internal/cmd/server/network-interface/list" 7 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 8 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 9 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 10 | 11 | "github.com/spf13/cobra" 12 | ) 13 | 14 | func NewCmd(params *types.CmdParams) *cobra.Command { 15 | cmd := &cobra.Command{ 16 | Use: "network-interface", 17 | Short: "Allows attaching/detaching network interfaces to servers", 18 | Long: "Allows attaching/detaching network interfaces to servers.", 19 | Args: args.NoArgs, 20 | Run: utils.CmdHelp, 21 | } 22 | addSubcommands(cmd, params) 23 | return cmd 24 | } 25 | 26 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 27 | cmd.AddCommand(attach.NewCmd(params)) 28 | cmd.AddCommand(list.NewCmd(params)) 29 | cmd.AddCommand(detach.NewCmd(params)) 30 | } 31 | -------------------------------------------------------------------------------- /docs/stackit_beta_intake_runner_delete.md: -------------------------------------------------------------------------------- 1 | ## stackit beta intake runner delete 2 | 3 | Deletes an Intake Runner 4 | 5 | ### Synopsis 6 | 7 | Deletes an Intake Runner. 8 | 9 | ``` 10 | stackit beta intake runner delete RUNNER_ID [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Delete an Intake Runner with ID "xxx" 17 | $ stackit beta intake runner delete xxx 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit beta intake runner delete" 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -y, --assume-yes If set, skips all confirmation prompts 30 | --async If set, runs the command asynchronously 31 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 32 | -p, --project-id string Project ID 33 | --region string Target region for region-specific requests 34 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [stackit beta intake runner](./stackit_beta_intake_runner.md) - Provides functionality for Intake Runners 40 | 41 | -------------------------------------------------------------------------------- /docs/stackit_load-balancer_delete.md: -------------------------------------------------------------------------------- 1 | ## stackit load-balancer delete 2 | 3 | Deletes a Load Balancer 4 | 5 | ### Synopsis 6 | 7 | Deletes a Load Balancer. 8 | 9 | ``` 10 | stackit load-balancer delete LOAD_BALANCER_NAME [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Deletes a load balancer with name "my-load-balancer" 17 | $ stackit load-balancer delete my-load-balancer 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit load-balancer delete" 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -y, --assume-yes If set, skips all confirmation prompts 30 | --async If set, runs the command asynchronously 31 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 32 | -p, --project-id string Project ID 33 | --region string Target region for region-specific requests 34 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [stackit load-balancer](./stackit_load-balancer.md) - Provides functionality for Load Balancer 40 | 41 | -------------------------------------------------------------------------------- /internal/cmd/load-balancer/target-pool/target_pool.go: -------------------------------------------------------------------------------- 1 | package targetpool 2 | 3 | import ( 4 | addtarget "github.com/stackitcloud/stackit-cli/internal/cmd/load-balancer/target-pool/add-target" 5 | "github.com/stackitcloud/stackit-cli/internal/cmd/load-balancer/target-pool/describe" 6 | removetarget "github.com/stackitcloud/stackit-cli/internal/cmd/load-balancer/target-pool/remove-target" 7 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 8 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 9 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 10 | 11 | "github.com/spf13/cobra" 12 | ) 13 | 14 | func NewCmd(params *types.CmdParams) *cobra.Command { 15 | cmd := &cobra.Command{ 16 | Use: "target-pool", 17 | Short: "Provides functionality for target pools", 18 | Long: "Provides functionality for target pools.", 19 | Args: args.NoArgs, 20 | Run: utils.CmdHelp, 21 | } 22 | addSubcommands(cmd, params) 23 | return cmd 24 | } 25 | 26 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 27 | cmd.AddCommand(addtarget.NewCmd(params)) 28 | cmd.AddCommand(removetarget.NewCmd(params)) 29 | cmd.AddCommand(describe.NewCmd(params)) 30 | } 31 | -------------------------------------------------------------------------------- /internal/cmd/git/instance/instance.go: -------------------------------------------------------------------------------- 1 | package instance 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/cmd/git/instance/create" 5 | "github.com/stackitcloud/stackit-cli/internal/cmd/git/instance/delete" 6 | "github.com/stackitcloud/stackit-cli/internal/cmd/git/instance/describe" 7 | "github.com/stackitcloud/stackit-cli/internal/cmd/git/instance/list" 8 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 9 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 10 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 11 | 12 | "github.com/spf13/cobra" 13 | ) 14 | 15 | func NewCmd(params *types.CmdParams) *cobra.Command { 16 | cmd := &cobra.Command{ 17 | Use: "instance", 18 | Short: "Provides functionality for STACKIT Git instances", 19 | Long: "Provides functionality for STACKIT Git instances.", 20 | Args: args.NoArgs, 21 | Run: utils.CmdHelp, 22 | } 23 | addSubcommands(cmd, params) 24 | return cmd 25 | } 26 | 27 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 28 | cmd.AddCommand( 29 | list.NewCmd(params), 30 | describe.NewCmd(params), 31 | create.NewCmd(params), 32 | delete.NewCmd(params), 33 | ) 34 | } 35 | -------------------------------------------------------------------------------- /docs/stackit_affinity-group_describe.md: -------------------------------------------------------------------------------- 1 | ## stackit affinity-group describe 2 | 3 | Show details of an affinity group 4 | 5 | ### Synopsis 6 | 7 | Show details of an affinity group. 8 | 9 | ``` 10 | stackit affinity-group describe AFFINITY_GROUP_ID [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Get details about an affinity group with the ID "xxx" 17 | $ stackit affinity-group describe xxx 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit affinity-group describe" 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -y, --assume-yes If set, skips all confirmation prompts 30 | --async If set, runs the command asynchronously 31 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 32 | -p, --project-id string Project ID 33 | --region string Target region for region-specific requests 34 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [stackit affinity-group](./stackit_affinity-group.md) - Manage server affinity groups 40 | 41 | -------------------------------------------------------------------------------- /docs/stackit_beta_alb_describe.md: -------------------------------------------------------------------------------- 1 | ## stackit beta alb describe 2 | 3 | Describes an application loadbalancer 4 | 5 | ### Synopsis 6 | 7 | Describes an application alb. 8 | 9 | ``` 10 | stackit beta alb describe LOADBALANCER_NAME_ARG [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Get details about an application loadbalancer with name "my-load-balancer" 17 | $ stackit beta alb describe my-load-balancer 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit beta alb describe" 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -y, --assume-yes If set, skips all confirmation prompts 30 | --async If set, runs the command asynchronously 31 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 32 | -p, --project-id string Project ID 33 | --region string Target region for region-specific requests 34 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [stackit beta alb](./stackit_beta_alb.md) - Manages application loadbalancers 40 | 41 | -------------------------------------------------------------------------------- /docs/stackit_beta_kms_key_describe.md: -------------------------------------------------------------------------------- 1 | ## stackit beta kms key describe 2 | 3 | Describe a KMS key 4 | 5 | ### Synopsis 6 | 7 | Describe a KMS key 8 | 9 | ``` 10 | stackit beta kms key describe KEY_ID [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Describe a KMS key with ID xxx of keyring yyy 17 | $ stackit beta kms key describe xxx --keyring-id yyy 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit beta kms key describe" 24 | --keyring-id string Key Ring ID 25 | ``` 26 | 27 | ### Options inherited from parent commands 28 | 29 | ``` 30 | -y, --assume-yes If set, skips all confirmation prompts 31 | --async If set, runs the command asynchronously 32 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 33 | -p, --project-id string Project ID 34 | --region string Target region for region-specific requests 35 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 36 | ``` 37 | 38 | ### SEE ALSO 39 | 40 | * [stackit beta kms key](./stackit_beta_kms_key.md) - Manage KMS keys 41 | 42 | -------------------------------------------------------------------------------- /docs/stackit_project_delete.md: -------------------------------------------------------------------------------- 1 | ## stackit project delete 2 | 3 | Deletes a STACKIT project 4 | 5 | ### Synopsis 6 | 7 | Deletes a STACKIT project. 8 | 9 | ``` 10 | stackit project delete [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Delete the configured STACKIT project 17 | $ stackit project delete 18 | 19 | Delete a STACKIT project by explicitly providing the project ID 20 | $ stackit project delete --project-id xxx 21 | ``` 22 | 23 | ### Options 24 | 25 | ``` 26 | -h, --help Help for "stackit project delete" 27 | ``` 28 | 29 | ### Options inherited from parent commands 30 | 31 | ``` 32 | -y, --assume-yes If set, skips all confirmation prompts 33 | --async If set, runs the command asynchronously 34 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 35 | -p, --project-id string Project ID 36 | --region string Target region for region-specific requests 37 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 38 | ``` 39 | 40 | ### SEE ALSO 41 | 42 | * [stackit project](./stackit_project.md) - Manages projects 43 | 44 | -------------------------------------------------------------------------------- /docs/stackit_rabbitmq_instance_delete.md: -------------------------------------------------------------------------------- 1 | ## stackit rabbitmq instance delete 2 | 3 | Deletes a RabbitMQ instance 4 | 5 | ### Synopsis 6 | 7 | Deletes a RabbitMQ instance. 8 | 9 | ``` 10 | stackit rabbitmq instance delete INSTANCE_ID [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Delete a RabbitMQ instance with ID "xxx" 17 | $ stackit rabbitmq instance delete xxx 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit rabbitmq instance delete" 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -y, --assume-yes If set, skips all confirmation prompts 30 | --async If set, runs the command asynchronously 31 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 32 | -p, --project-id string Project ID 33 | --region string Target region for region-specific requests 34 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [stackit rabbitmq instance](./stackit_rabbitmq_instance.md) - Provides functionality for RabbitMQ instances 40 | 41 | -------------------------------------------------------------------------------- /internal/cmd/affinity-groups/affinity-groups.go: -------------------------------------------------------------------------------- 1 | package affinity_groups 2 | 3 | import ( 4 | "github.com/spf13/cobra" 5 | "github.com/stackitcloud/stackit-cli/internal/cmd/affinity-groups/create" 6 | "github.com/stackitcloud/stackit-cli/internal/cmd/affinity-groups/delete" 7 | "github.com/stackitcloud/stackit-cli/internal/cmd/affinity-groups/describe" 8 | "github.com/stackitcloud/stackit-cli/internal/cmd/affinity-groups/list" 9 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 10 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 11 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 12 | ) 13 | 14 | func NewCmd(params *types.CmdParams) *cobra.Command { 15 | cmd := &cobra.Command{ 16 | Use: "affinity-group", 17 | Short: "Manage server affinity groups", 18 | Long: "Manage the lifecycle of server affinity groups.", 19 | Args: args.NoArgs, 20 | Run: utils.CmdHelp, 21 | } 22 | addSubcommands(cmd, params) 23 | return cmd 24 | } 25 | 26 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 27 | cmd.AddCommand( 28 | create.NewCmd(params), 29 | delete.NewCmd(params), 30 | describe.NewCmd(params), 31 | list.NewCmd(params), 32 | ) 33 | } 34 | -------------------------------------------------------------------------------- /internal/pkg/services/service-enablement/utils/utils.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "context" 5 | "net/http" 6 | 7 | "github.com/stackitcloud/stackit-sdk-go/core/oapierror" 8 | "github.com/stackitcloud/stackit-sdk-go/services/serviceenablement" 9 | ) 10 | 11 | const ( 12 | SKEServiceId = "cloud.stackit.ske" 13 | ) 14 | 15 | type ServiceEnablementClient interface { 16 | GetServiceStatusRegionalExecute(ctx context.Context, region, projectId, serviceId string) (*serviceenablement.ServiceStatus, error) 17 | } 18 | 19 | func ProjectEnabled(ctx context.Context, apiClient ServiceEnablementClient, projectId, region string) (bool, error) { 20 | project, err := apiClient.GetServiceStatusRegionalExecute(ctx, region, projectId, SKEServiceId) 21 | if err != nil { 22 | oapiErr, ok := err.(*oapierror.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped 23 | if !ok { 24 | return false, err 25 | } 26 | if oapiErr.StatusCode == http.StatusNotFound { 27 | return false, nil 28 | } 29 | return false, err 30 | } 31 | return *project.State == serviceenablement.SERVICESTATUSSTATE_ENABLED, nil 32 | } 33 | -------------------------------------------------------------------------------- /docs/stackit_service-account_list.md: -------------------------------------------------------------------------------- 1 | ## stackit service-account list 2 | 3 | Lists all service accounts 4 | 5 | ### Synopsis 6 | 7 | Lists all service accounts. 8 | 9 | ``` 10 | stackit service-account list [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | List all service accounts 17 | $ stackit service-account list 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit service-account list" 24 | --limit int Maximum number of entries to list 25 | ``` 26 | 27 | ### Options inherited from parent commands 28 | 29 | ``` 30 | -y, --assume-yes If set, skips all confirmation prompts 31 | --async If set, runs the command asynchronously 32 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 33 | -p, --project-id string Project ID 34 | --region string Target region for region-specific requests 35 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 36 | ``` 37 | 38 | ### SEE ALSO 39 | 40 | * [stackit service-account](./stackit_service-account.md) - Provides functionality for service accounts 41 | 42 | -------------------------------------------------------------------------------- /internal/cmd/mongodbflex/mongodbflex.go: -------------------------------------------------------------------------------- 1 | package mongodbflex 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/cmd/mongodbflex/backup" 5 | "github.com/stackitcloud/stackit-cli/internal/cmd/mongodbflex/instance" 6 | "github.com/stackitcloud/stackit-cli/internal/cmd/mongodbflex/options" 7 | "github.com/stackitcloud/stackit-cli/internal/cmd/mongodbflex/user" 8 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 9 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 10 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 11 | 12 | "github.com/spf13/cobra" 13 | ) 14 | 15 | func NewCmd(params *types.CmdParams) *cobra.Command { 16 | cmd := &cobra.Command{ 17 | Use: "mongodbflex", 18 | Short: "Provides functionality for MongoDB Flex", 19 | Long: "Provides functionality for MongoDB Flex.", 20 | Args: args.NoArgs, 21 | Run: utils.CmdHelp, 22 | } 23 | addSubcommands(cmd, params) 24 | return cmd 25 | } 26 | 27 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 28 | cmd.AddCommand(instance.NewCmd(params)) 29 | cmd.AddCommand(user.NewCmd(params)) 30 | cmd.AddCommand(options.NewCmd(params)) 31 | cmd.AddCommand(backup.NewCmd(params)) 32 | } 33 | -------------------------------------------------------------------------------- /internal/cmd/image/image.go: -------------------------------------------------------------------------------- 1 | package image 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/cmd/image/create" 5 | "github.com/stackitcloud/stackit-cli/internal/cmd/image/delete" 6 | "github.com/stackitcloud/stackit-cli/internal/cmd/image/describe" 7 | "github.com/stackitcloud/stackit-cli/internal/cmd/image/list" 8 | "github.com/stackitcloud/stackit-cli/internal/cmd/image/update" 9 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 10 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 11 | 12 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 13 | 14 | "github.com/spf13/cobra" 15 | ) 16 | 17 | func NewCmd(params *types.CmdParams) *cobra.Command { 18 | cmd := &cobra.Command{ 19 | Use: "image", 20 | Short: "Manage server images", 21 | Long: "Manage the lifecycle of server images.", 22 | Args: args.NoArgs, 23 | Run: utils.CmdHelp, 24 | } 25 | addSubcommands(cmd, params) 26 | return cmd 27 | } 28 | 29 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 30 | cmd.AddCommand( 31 | create.NewCmd(params), 32 | list.NewCmd(params), 33 | delete.NewCmd(params), 34 | describe.NewCmd(params), 35 | update.NewCmd(params), 36 | ) 37 | } 38 | -------------------------------------------------------------------------------- /internal/cmd/server/command/command.go: -------------------------------------------------------------------------------- 1 | package command 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/cmd/server/command/create" 5 | "github.com/stackitcloud/stackit-cli/internal/cmd/server/command/describe" 6 | "github.com/stackitcloud/stackit-cli/internal/cmd/server/command/list" 7 | "github.com/stackitcloud/stackit-cli/internal/cmd/server/command/template" 8 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 9 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 10 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 11 | 12 | "github.com/spf13/cobra" 13 | ) 14 | 15 | func NewCmd(params *types.CmdParams) *cobra.Command { 16 | cmd := &cobra.Command{ 17 | Use: "command", 18 | Short: "Provides functionality for Server Command", 19 | Long: "Provides functionality for Server Command.", 20 | Args: args.NoArgs, 21 | Run: utils.CmdHelp, 22 | } 23 | addSubcommands(cmd, params) 24 | return cmd 25 | } 26 | 27 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 28 | cmd.AddCommand(create.NewCmd(params)) 29 | cmd.AddCommand(describe.NewCmd(params)) 30 | cmd.AddCommand(list.NewCmd(params)) 31 | cmd.AddCommand(template.NewCmd(params)) 32 | } 33 | -------------------------------------------------------------------------------- /internal/cmd/auth/auth.go: -------------------------------------------------------------------------------- 1 | package auth 2 | 3 | import ( 4 | activateserviceaccount "github.com/stackitcloud/stackit-cli/internal/cmd/auth/activate-service-account" 5 | getaccesstoken "github.com/stackitcloud/stackit-cli/internal/cmd/auth/get-access-token" 6 | "github.com/stackitcloud/stackit-cli/internal/cmd/auth/login" 7 | "github.com/stackitcloud/stackit-cli/internal/cmd/auth/logout" 8 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 9 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 10 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 11 | 12 | "github.com/spf13/cobra" 13 | ) 14 | 15 | func NewCmd(params *types.CmdParams) *cobra.Command { 16 | cmd := &cobra.Command{ 17 | Use: "auth", 18 | Short: "Authenticates the STACKIT CLI", 19 | Long: "Authenticates in the STACKIT CLI.", 20 | Args: args.NoArgs, 21 | Run: utils.CmdHelp, 22 | } 23 | addSubcommands(cmd, params) 24 | return cmd 25 | } 26 | 27 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 28 | cmd.AddCommand(login.NewCmd(params)) 29 | cmd.AddCommand(logout.NewCmd(params)) 30 | cmd.AddCommand(activateserviceaccount.NewCmd(params)) 31 | cmd.AddCommand(getaccesstoken.NewCmd(params)) 32 | } 33 | -------------------------------------------------------------------------------- /internal/cmd/beta/kms/keyring/keyring.go: -------------------------------------------------------------------------------- 1 | package keyring 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/cmd/beta/kms/keyring/create" 5 | "github.com/stackitcloud/stackit-cli/internal/cmd/beta/kms/keyring/delete" 6 | "github.com/stackitcloud/stackit-cli/internal/cmd/beta/kms/keyring/describe" 7 | "github.com/stackitcloud/stackit-cli/internal/cmd/beta/kms/keyring/list" 8 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 9 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 10 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 11 | 12 | "github.com/spf13/cobra" 13 | ) 14 | 15 | func NewCmd(params *types.CmdParams) *cobra.Command { 16 | cmd := &cobra.Command{ 17 | Use: "keyring", 18 | Short: "Manage KMS key rings", 19 | Long: "Provides functionality for key ring operations inside the KMS", 20 | Args: args.NoArgs, 21 | Run: utils.CmdHelp, 22 | } 23 | addSubcommands(cmd, params) 24 | return cmd 25 | } 26 | 27 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 28 | cmd.AddCommand(list.NewCmd(params)) 29 | cmd.AddCommand(delete.NewCmd(params)) 30 | cmd.AddCommand(create.NewCmd(params)) 31 | cmd.AddCommand(describe.NewCmd(params)) 32 | } 33 | -------------------------------------------------------------------------------- /docs/stackit_beta_kms_keyring_list.md: -------------------------------------------------------------------------------- 1 | ## stackit beta kms keyring list 2 | 3 | Lists all KMS key rings 4 | 5 | ### Synopsis 6 | 7 | Lists all KMS key rings. 8 | 9 | ``` 10 | stackit beta kms keyring list [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | List all KMS key rings 17 | $ stackit beta kms keyring list 18 | 19 | List all KMS key rings in JSON format 20 | $ stackit beta kms keyring list --output-format json 21 | ``` 22 | 23 | ### Options 24 | 25 | ``` 26 | -h, --help Help for "stackit beta kms keyring list" 27 | ``` 28 | 29 | ### Options inherited from parent commands 30 | 31 | ``` 32 | -y, --assume-yes If set, skips all confirmation prompts 33 | --async If set, runs the command asynchronously 34 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 35 | -p, --project-id string Project ID 36 | --region string Target region for region-specific requests 37 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 38 | ``` 39 | 40 | ### SEE ALSO 41 | 42 | * [stackit beta kms keyring](./stackit_beta_kms_keyring.md) - Manage KMS key rings 43 | 44 | -------------------------------------------------------------------------------- /docs/stackit_opensearch_instance_delete.md: -------------------------------------------------------------------------------- 1 | ## stackit opensearch instance delete 2 | 3 | Deletes an OpenSearch instance 4 | 5 | ### Synopsis 6 | 7 | Deletes an OpenSearch instance. 8 | 9 | ``` 10 | stackit opensearch instance delete INSTANCE_ID [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Delete an OpenSearch instance with ID "xxx" 17 | $ stackit opensearch instance delete xxx 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit opensearch instance delete" 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -y, --assume-yes If set, skips all confirmation prompts 30 | --async If set, runs the command asynchronously 31 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 32 | -p, --project-id string Project ID 33 | --region string Target region for region-specific requests 34 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [stackit opensearch instance](./stackit_opensearch_instance.md) - Provides functionality for OpenSearch instances 40 | 41 | -------------------------------------------------------------------------------- /internal/cmd/object-storage/credentials-group/credentials_group.go: -------------------------------------------------------------------------------- 1 | package credentialsgroup 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/cmd/object-storage/credentials-group/create" 5 | "github.com/stackitcloud/stackit-cli/internal/cmd/object-storage/credentials-group/delete" 6 | "github.com/stackitcloud/stackit-cli/internal/cmd/object-storage/credentials-group/list" 7 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 8 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 9 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 10 | 11 | "github.com/spf13/cobra" 12 | ) 13 | 14 | func NewCmd(params *types.CmdParams) *cobra.Command { 15 | cmd := &cobra.Command{ 16 | Use: "credentials-group", 17 | Short: "Provides functionality for Object Storage credentials group", 18 | Long: "Provides functionality for Object Storage credentials group.", 19 | Args: args.NoArgs, 20 | Run: utils.CmdHelp, 21 | } 22 | addSubcommands(cmd, params) 23 | return cmd 24 | } 25 | 26 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 27 | cmd.AddCommand(create.NewCmd(params)) 28 | cmd.AddCommand(delete.NewCmd(params)) 29 | cmd.AddCommand(list.NewCmd(params)) 30 | } 31 | -------------------------------------------------------------------------------- /internal/pkg/services/runcommand/utils/utils_test.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "testing" 5 | ) 6 | 7 | func TestParseScriptParams(t *testing.T) { 8 | tests := []struct { 9 | description string 10 | input map[string]string 11 | expectedOutput map[string]string 12 | isValid bool 13 | }{ 14 | { 15 | "base-ok", 16 | map[string]string{"script": "ls /"}, 17 | map[string]string{"script": "ls /"}, 18 | true, 19 | }, 20 | { 21 | "not-ok-nonexistant-file-specified-for-script", 22 | map[string]string{"script": "@{/some/file/which/does/not/exist/and/thus/fails}"}, 23 | nil, 24 | false, 25 | }, 26 | } 27 | 28 | for _, tt := range tests { 29 | t.Run(tt.description, func(t *testing.T) { 30 | output, err := ParseScriptParams(tt.input) 31 | 32 | if tt.isValid && err != nil { 33 | t.Errorf("failed on valid input") 34 | } 35 | if !tt.isValid && err == nil { 36 | t.Errorf("did not fail on invalid input") 37 | } 38 | if !tt.isValid { 39 | return 40 | } 41 | if output["script"] != tt.expectedOutput["script"] { 42 | t.Errorf("expected output to be %s, got %s", tt.expectedOutput["script"], output["script"]) 43 | } 44 | }) 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /docs/stackit_mongodbflex_instance_delete.md: -------------------------------------------------------------------------------- 1 | ## stackit mongodbflex instance delete 2 | 3 | Deletes a MongoDB Flex instance 4 | 5 | ### Synopsis 6 | 7 | Deletes a MongoDB Flex instance. 8 | 9 | ``` 10 | stackit mongodbflex instance delete INSTANCE_ID [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Delete a MongoDB Flex instance with ID "xxx" 17 | $ stackit mongodbflex instance delete xxx 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit mongodbflex instance delete" 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -y, --assume-yes If set, skips all confirmation prompts 30 | --async If set, runs the command asynchronously 31 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 32 | -p, --project-id string Project ID 33 | --region string Target region for region-specific requests 34 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [stackit mongodbflex instance](./stackit_mongodbflex_instance.md) - Provides functionality for MongoDB Flex instances 40 | 41 | -------------------------------------------------------------------------------- /docs/stackit_object-storage_disable.md: -------------------------------------------------------------------------------- 1 | ## stackit object-storage disable 2 | 3 | Disables Object Storage for a project 4 | 5 | ### Synopsis 6 | 7 | Disables Object Storage for a project. All buckets must be deleted beforehand. 8 | 9 | ``` 10 | stackit object-storage disable [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Disable Object Storage functionality for your project. 17 | $ stackit object-storage disable 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit object-storage disable" 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -y, --assume-yes If set, skips all confirmation prompts 30 | --async If set, runs the command asynchronously 31 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 32 | -p, --project-id string Project ID 33 | --region string Target region for region-specific requests 34 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [stackit object-storage](./stackit_object-storage.md) - Provides functionality for Object Storage 40 | 41 | -------------------------------------------------------------------------------- /docs/stackit_server_backup_enable.md: -------------------------------------------------------------------------------- 1 | ## stackit server backup enable 2 | 3 | Enables Server Backup service 4 | 5 | ### Synopsis 6 | 7 | Enables Server Backup service. 8 | 9 | ``` 10 | stackit server backup enable [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Enable Server Backup functionality for your server 17 | $ stackit server backup enable --server-id=zzz 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit server backup enable" 24 | -s, --server-id string Server ID 25 | ``` 26 | 27 | ### Options inherited from parent commands 28 | 29 | ``` 30 | -y, --assume-yes If set, skips all confirmation prompts 31 | --async If set, runs the command asynchronously 32 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 33 | -p, --project-id string Project ID 34 | --region string Target region for region-specific requests 35 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 36 | ``` 37 | 38 | ### SEE ALSO 39 | 40 | * [stackit server backup](./stackit_server_backup.md) - Provides functionality for server backups 41 | 42 | -------------------------------------------------------------------------------- /docs/stackit_server_describe.md: -------------------------------------------------------------------------------- 1 | ## stackit server describe 2 | 3 | Shows details of a server 4 | 5 | ### Synopsis 6 | 7 | Shows details of a server. 8 | 9 | ``` 10 | stackit server describe SERVER_ID [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Show details of a server with ID "xxx" 17 | $ stackit server describe xxx 18 | 19 | Show details of a server with ID "xxx" in JSON format 20 | $ stackit server describe xxx --output-format json 21 | ``` 22 | 23 | ### Options 24 | 25 | ``` 26 | -h, --help Help for "stackit server describe" 27 | ``` 28 | 29 | ### Options inherited from parent commands 30 | 31 | ``` 32 | -y, --assume-yes If set, skips all confirmation prompts 33 | --async If set, runs the command asynchronously 34 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 35 | -p, --project-id string Project ID 36 | --region string Target region for region-specific requests 37 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 38 | ``` 39 | 40 | ### SEE ALSO 41 | 42 | * [stackit server](./stackit_server.md) - Provides functionality for servers 43 | 44 | -------------------------------------------------------------------------------- /docs/stackit_ske_cluster_hibernate.md: -------------------------------------------------------------------------------- 1 | ## stackit ske cluster hibernate 2 | 3 | Trigger hibernate for a SKE cluster 4 | 5 | ### Synopsis 6 | 7 | Trigger hibernate for a STACKIT Kubernetes Engine (SKE) cluster. 8 | 9 | ``` 10 | stackit ske cluster hibernate CLUSTER_NAME [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Trigger hibernate for a SKE cluster with name "my-cluster" 17 | $ stackit ske cluster hibernate my-cluster 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit ske cluster hibernate" 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -y, --assume-yes If set, skips all confirmation prompts 30 | --async If set, runs the command asynchronously 31 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 32 | -p, --project-id string Project ID 33 | --region string Target region for region-specific requests 34 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [stackit ske cluster](./stackit_ske_cluster.md) - Provides functionality for SKE cluster 40 | 41 | -------------------------------------------------------------------------------- /docs/stackit_ske_cluster_reconcile.md: -------------------------------------------------------------------------------- 1 | ## stackit ske cluster reconcile 2 | 3 | Trigger reconcile for a SKE cluster 4 | 5 | ### Synopsis 6 | 7 | Trigger reconcile for a STACKIT Kubernetes Engine (SKE) cluster. 8 | 9 | ``` 10 | stackit ske cluster reconcile CLUSTER_NAME [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Trigger reconcile for a SKE cluster with name "my-cluster" 17 | $ stackit ske cluster reconcile my-cluster 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit ske cluster reconcile" 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -y, --assume-yes If set, skips all confirmation prompts 30 | --async If set, runs the command asynchronously 31 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 32 | -p, --project-id string Project ID 33 | --region string Target region for region-specific requests 34 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [stackit ske cluster](./stackit_ske_cluster.md) - Provides functionality for SKE cluster 40 | 41 | -------------------------------------------------------------------------------- /docs/stackit_volume_describe.md: -------------------------------------------------------------------------------- 1 | ## stackit volume describe 2 | 3 | Shows details of a volume 4 | 5 | ### Synopsis 6 | 7 | Shows details of a volume. 8 | 9 | ``` 10 | stackit volume describe VOLUME_ID [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Show details of a volume with ID "xxx" 17 | $ stackit volume describe xxx 18 | 19 | Show details of a volume with ID "xxx" in JSON format 20 | $ stackit volume describe xxx --output-format json 21 | ``` 22 | 23 | ### Options 24 | 25 | ``` 26 | -h, --help Help for "stackit volume describe" 27 | ``` 28 | 29 | ### Options inherited from parent commands 30 | 31 | ``` 32 | -y, --assume-yes If set, skips all confirmation prompts 33 | --async If set, runs the command asynchronously 34 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 35 | -p, --project-id string Project ID 36 | --region string Target region for region-specific requests 37 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 38 | ``` 39 | 40 | ### SEE ALSO 41 | 42 | * [stackit volume](./stackit_volume.md) - Provides functionality for volumes 43 | 44 | -------------------------------------------------------------------------------- /docs/stackit_beta_alb_list.md: -------------------------------------------------------------------------------- 1 | ## stackit beta alb list 2 | 3 | Lists albs 4 | 5 | ### Synopsis 6 | 7 | Lists application load balancers. 8 | 9 | ``` 10 | stackit beta alb list [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | List all load balancers 17 | $ stackit beta alb list 18 | 19 | List the first 10 application load balancers 20 | $ stackit beta alb list --limit=10 21 | ``` 22 | 23 | ### Options 24 | 25 | ``` 26 | -h, --help Help for "stackit beta alb list" 27 | --limit int Limit the output to the first n elements 28 | ``` 29 | 30 | ### Options inherited from parent commands 31 | 32 | ``` 33 | -y, --assume-yes If set, skips all confirmation prompts 34 | --async If set, runs the command asynchronously 35 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 36 | -p, --project-id string Project ID 37 | --region string Target region for region-specific requests 38 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 39 | ``` 40 | 41 | ### SEE ALSO 42 | 43 | * [stackit beta alb](./stackit_beta_alb.md) - Manages application loadbalancers 44 | 45 | -------------------------------------------------------------------------------- /internal/cmd/key-pair/key-pair.go: -------------------------------------------------------------------------------- 1 | package keypair 2 | 3 | import ( 4 | "github.com/spf13/cobra" 5 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 6 | 7 | "github.com/stackitcloud/stackit-cli/internal/cmd/key-pair/create" 8 | "github.com/stackitcloud/stackit-cli/internal/cmd/key-pair/delete" 9 | "github.com/stackitcloud/stackit-cli/internal/cmd/key-pair/describe" 10 | "github.com/stackitcloud/stackit-cli/internal/cmd/key-pair/list" 11 | "github.com/stackitcloud/stackit-cli/internal/cmd/key-pair/update" 12 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 13 | ) 14 | 15 | func NewCmd(params *types.CmdParams) *cobra.Command { 16 | cmd := &cobra.Command{ 17 | Use: "key-pair", 18 | Short: "Provides functionality for SSH key pairs", 19 | Long: "Provides functionality for SSH key pairs", 20 | Args: cobra.NoArgs, 21 | Run: utils.CmdHelp, 22 | } 23 | addSubcommands(cmd, params) 24 | return cmd 25 | } 26 | 27 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 28 | cmd.AddCommand(create.NewCmd(params)) 29 | cmd.AddCommand(delete.NewCmd(params)) 30 | cmd.AddCommand(describe.NewCmd(params)) 31 | cmd.AddCommand(list.NewCmd(params)) 32 | cmd.AddCommand(update.NewCmd(params)) 33 | } 34 | -------------------------------------------------------------------------------- /internal/pkg/spinner/spinner.go: -------------------------------------------------------------------------------- 1 | package spinner 2 | 3 | import ( 4 | "time" 5 | 6 | "github.com/stackitcloud/stackit-cli/internal/pkg/print" 7 | ) 8 | 9 | type Spinner struct { 10 | printer *print.Printer 11 | message string 12 | states []string 13 | startTime time.Time 14 | delay time.Duration 15 | done chan bool 16 | } 17 | 18 | func New(p *print.Printer) *Spinner { 19 | return &Spinner{ 20 | printer: p, 21 | states: []string{"|", "/", "-", "\\"}, 22 | startTime: time.Now(), 23 | delay: 100 * time.Millisecond, 24 | done: make(chan bool), 25 | } 26 | } 27 | 28 | func (s *Spinner) Start(message string) { 29 | s.message = message 30 | go s.animate() 31 | } 32 | 33 | func (s *Spinner) Stop() { 34 | s.done <- true 35 | close(s.done) 36 | s.printer.Info("\r%s ✓ \n", s.message) 37 | } 38 | 39 | func (s *Spinner) StopWithError() { 40 | s.done <- true 41 | close(s.done) 42 | s.printer.Info("\r%s ✗ \n", s.message) 43 | } 44 | 45 | func (s *Spinner) animate() { 46 | i := 0 47 | for { 48 | select { 49 | case <-s.done: 50 | return 51 | default: 52 | s.printer.Info("\r%s %s ", s.message, s.states[i%len(s.states)]) 53 | i++ 54 | time.Sleep(s.delay) 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /docs/stackit_server_backup_disable.md: -------------------------------------------------------------------------------- 1 | ## stackit server backup disable 2 | 3 | Disables Server Backup service 4 | 5 | ### Synopsis 6 | 7 | Disables Server Backup service. 8 | 9 | ``` 10 | stackit server backup disable [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Disable Server Backup functionality for your server. 17 | $ stackit server backup disable --server-id=zzz 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit server backup disable" 24 | -s, --server-id string Server ID 25 | ``` 26 | 27 | ### Options inherited from parent commands 28 | 29 | ``` 30 | -y, --assume-yes If set, skips all confirmation prompts 31 | --async If set, runs the command asynchronously 32 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 33 | -p, --project-id string Project ID 34 | --region string Target region for region-specific requests 35 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 36 | ``` 37 | 38 | ### SEE ALSO 39 | 40 | * [stackit server backup](./stackit_server_backup.md) - Provides functionality for server backups 41 | 42 | -------------------------------------------------------------------------------- /internal/cmd/logme/credentials/credentials.go: -------------------------------------------------------------------------------- 1 | package credentials 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/cmd/logme/credentials/create" 5 | "github.com/stackitcloud/stackit-cli/internal/cmd/logme/credentials/delete" 6 | "github.com/stackitcloud/stackit-cli/internal/cmd/logme/credentials/describe" 7 | "github.com/stackitcloud/stackit-cli/internal/cmd/logme/credentials/list" 8 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 9 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 10 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 11 | 12 | "github.com/spf13/cobra" 13 | ) 14 | 15 | func NewCmd(params *types.CmdParams) *cobra.Command { 16 | cmd := &cobra.Command{ 17 | Use: "credentials", 18 | Short: "Provides functionality for LogMe credentials", 19 | Long: "Provides functionality for LogMe credentials.", 20 | Args: args.NoArgs, 21 | Run: utils.CmdHelp, 22 | } 23 | addSubcommands(cmd, params) 24 | return cmd 25 | } 26 | 27 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 28 | cmd.AddCommand(create.NewCmd(params)) 29 | cmd.AddCommand(delete.NewCmd(params)) 30 | cmd.AddCommand(describe.NewCmd(params)) 31 | cmd.AddCommand(list.NewCmd(params)) 32 | } 33 | -------------------------------------------------------------------------------- /internal/cmd/redis/credentials/credentials.go: -------------------------------------------------------------------------------- 1 | package credentials 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/cmd/redis/credentials/create" 5 | "github.com/stackitcloud/stackit-cli/internal/cmd/redis/credentials/delete" 6 | "github.com/stackitcloud/stackit-cli/internal/cmd/redis/credentials/describe" 7 | "github.com/stackitcloud/stackit-cli/internal/cmd/redis/credentials/list" 8 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 9 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 10 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 11 | 12 | "github.com/spf13/cobra" 13 | ) 14 | 15 | func NewCmd(params *types.CmdParams) *cobra.Command { 16 | cmd := &cobra.Command{ 17 | Use: "credentials", 18 | Short: "Provides functionality for Redis credentials", 19 | Long: "Provides functionality for Redis credentials.", 20 | Args: args.NoArgs, 21 | Run: utils.CmdHelp, 22 | } 23 | addSubcommands(cmd, params) 24 | return cmd 25 | } 26 | 27 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 28 | cmd.AddCommand(create.NewCmd(params)) 29 | cmd.AddCommand(delete.NewCmd(params)) 30 | cmd.AddCommand(describe.NewCmd(params)) 31 | cmd.AddCommand(list.NewCmd(params)) 32 | } 33 | -------------------------------------------------------------------------------- /internal/pkg/flags/cidrslice.go: -------------------------------------------------------------------------------- 1 | package flags 2 | 3 | import ( 4 | "strings" 5 | 6 | "github.com/spf13/pflag" 7 | ) 8 | 9 | type cidrSliceFlag struct { 10 | value []string 11 | } 12 | 13 | // Ensure the implementation satisfies the expected interface 14 | var _ pflag.Value = &cidrFlag{} 15 | 16 | // CIDRSliceFlag returns a flag which must be a valid CIDR slice. 17 | func CIDRSliceFlag() *cidrSliceFlag { 18 | return &cidrSliceFlag{} 19 | } 20 | 21 | func (f *cidrSliceFlag) String() string { 22 | return "[" + strings.Join(f.value, ",") + "]" 23 | } 24 | 25 | func (f *cidrSliceFlag) Set(value string) error { 26 | if value == "" { 27 | // If it's the first value to be set to the flag, we set it to an empty list 28 | // Otherwise, we just ignore an empty value 29 | if len(f.value) == 0 { 30 | f.value = []string{} 31 | } 32 | return nil 33 | } 34 | 35 | cidrs := strings.Split(value, ",") 36 | 37 | for i, cidr := range cidrs { 38 | cidrs[i] = strings.TrimSpace(cidr) 39 | 40 | err := validateCIDR(cidrs[i]) 41 | if err != nil { 42 | return err 43 | } 44 | } 45 | 46 | f.value = append(f.value, cidrs...) 47 | return nil 48 | } 49 | 50 | func (f *cidrSliceFlag) Type() string { 51 | return "stringSlice" 52 | } 53 | -------------------------------------------------------------------------------- /docs/stackit_dns_record-set_delete.md: -------------------------------------------------------------------------------- 1 | ## stackit dns record-set delete 2 | 3 | Deletes a DNS record set 4 | 5 | ### Synopsis 6 | 7 | Deletes a DNS record set. 8 | 9 | ``` 10 | stackit dns record-set delete RECORD_SET_ID [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Delete DNS record set with ID "xxx" in zone with ID "yyy" 17 | $ stackit dns record-set delete xxx --zone-id yyy 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit dns record-set delete" 24 | --zone-id string Zone ID 25 | ``` 26 | 27 | ### Options inherited from parent commands 28 | 29 | ``` 30 | -y, --assume-yes If set, skips all confirmation prompts 31 | --async If set, runs the command asynchronously 32 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 33 | -p, --project-id string Project ID 34 | --region string Target region for region-specific requests 35 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 36 | ``` 37 | 38 | ### SEE ALSO 39 | 40 | * [stackit dns record-set](./stackit_dns_record-set.md) - Provides functionality for DNS record set 41 | 42 | -------------------------------------------------------------------------------- /docs/stackit_network_describe.md: -------------------------------------------------------------------------------- 1 | ## stackit network describe 2 | 3 | Shows details of a network 4 | 5 | ### Synopsis 6 | 7 | Shows details of a network. 8 | 9 | ``` 10 | stackit network describe NETWORK_ID [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Show details of a network with ID "xxx" 17 | $ stackit network describe xxx 18 | 19 | Show details of a network with ID "xxx" in JSON format 20 | $ stackit network describe xxx --output-format json 21 | ``` 22 | 23 | ### Options 24 | 25 | ``` 26 | -h, --help Help for "stackit network describe" 27 | ``` 28 | 29 | ### Options inherited from parent commands 30 | 31 | ``` 32 | -y, --assume-yes If set, skips all confirmation prompts 33 | --async If set, runs the command asynchronously 34 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 35 | -p, --project-id string Project ID 36 | --region string Target region for region-specific requests 37 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 38 | ``` 39 | 40 | ### SEE ALSO 41 | 42 | * [stackit network](./stackit_network.md) - Provides functionality for networks 43 | 44 | -------------------------------------------------------------------------------- /docs/stackit_ske_cluster_maintenance.md: -------------------------------------------------------------------------------- 1 | ## stackit ske cluster maintenance 2 | 3 | Trigger maintenance for a SKE cluster 4 | 5 | ### Synopsis 6 | 7 | Trigger maintenance for a STACKIT Kubernetes Engine (SKE) cluster. 8 | 9 | ``` 10 | stackit ske cluster maintenance CLUSTER_NAME [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Trigger maintenance for a SKE cluster with name "my-cluster" 17 | $ stackit ske cluster maintenance my-cluster 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit ske cluster maintenance" 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -y, --assume-yes If set, skips all confirmation prompts 30 | --async If set, runs the command asynchronously 31 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 32 | -p, --project-id string Project ID 33 | --region string Target region for region-specific requests 34 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [stackit ske cluster](./stackit_ske_cluster.md) - Provides functionality for SKE cluster 40 | 41 | -------------------------------------------------------------------------------- /internal/pkg/config/template/test_profile.json: -------------------------------------------------------------------------------- 1 | { 2 | "allowed_url_domain": "stackit.cloud", 3 | "async": false, 4 | "authorization_custom_endpoint": "", 5 | "dns_custom_endpoint": "", 6 | "iaas_custom_endpoint": "", 7 | "identity_provider_custom_client_id": "", 8 | "identity_provider_custom_well_known_configuration": "", 9 | "load_balancer_custom_endpoint": "", 10 | "logme_custom_endpoint": "", 11 | "mariadb_custom_endpoint": "", 12 | "mongodbflex_custom_endpoint": "", 13 | "object_storage_custom_endpoint": "", 14 | "observability_custom_endpoint": "", 15 | "opensearch_custom_endpoint": "", 16 | "output_format": "", 17 | "postgresflex_custom_endpoint": "", 18 | "project_id": "", 19 | "project_name": "", 20 | "rabbitmq_custom_endpoint": "", 21 | "redis_custom_endpoint": "", 22 | "resource_manager_custom_endpoint": "", 23 | "runcommand_custom_endpoint": "", 24 | "secrets_manager_custom_endpoint": "", 25 | "serverbackup_custom_endpoint": "", 26 | "service_account_custom_endpoint": "", 27 | "service_enablement_custom_endpoint": "", 28 | "session_time_limit": "2h", 29 | "ske_custom_endpoint": "", 30 | "sqlserverflex_custom_endpoint": "", 31 | "token_custom_endpoint": "", 32 | "verbosity": "info" 33 | } -------------------------------------------------------------------------------- /docs/stackit_logme.md: -------------------------------------------------------------------------------- 1 | ## stackit logme 2 | 3 | Provides functionality for LogMe 4 | 5 | ### Synopsis 6 | 7 | Provides functionality for LogMe. 8 | 9 | ``` 10 | stackit logme [flags] 11 | ``` 12 | 13 | ### Options 14 | 15 | ``` 16 | -h, --help Help for "stackit logme" 17 | ``` 18 | 19 | ### Options inherited from parent commands 20 | 21 | ``` 22 | -y, --assume-yes If set, skips all confirmation prompts 23 | --async If set, runs the command asynchronously 24 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 25 | -p, --project-id string Project ID 26 | --region string Target region for region-specific requests 27 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 28 | ``` 29 | 30 | ### SEE ALSO 31 | 32 | * [stackit](./stackit.md) - Manage STACKIT resources using the command line 33 | * [stackit logme credentials](./stackit_logme_credentials.md) - Provides functionality for LogMe credentials 34 | * [stackit logme instance](./stackit_logme_instance.md) - Provides functionality for LogMe instances 35 | * [stackit logme plans](./stackit_logme_plans.md) - Lists all LogMe service plans 36 | 37 | -------------------------------------------------------------------------------- /docs/stackit_observability_instance_delete.md: -------------------------------------------------------------------------------- 1 | ## stackit observability instance delete 2 | 3 | Deletes an Observability instance 4 | 5 | ### Synopsis 6 | 7 | Deletes an Observability instance. 8 | 9 | ``` 10 | stackit observability instance delete INSTANCE_ID [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Delete an Observability instance with ID "xxx" 17 | $ stackit Observability instance delete xxx 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit observability instance delete" 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -y, --assume-yes If set, skips all confirmation prompts 30 | --async If set, runs the command asynchronously 31 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 32 | -p, --project-id string Project ID 33 | --region string Target region for region-specific requests 34 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [stackit observability instance](./stackit_observability_instance.md) - Provides functionality for Observability instances 40 | 41 | -------------------------------------------------------------------------------- /docs/stackit_project_member.md: -------------------------------------------------------------------------------- 1 | ## stackit project member 2 | 3 | Manages project members 4 | 5 | ### Synopsis 6 | 7 | Manages project members. 8 | 9 | ``` 10 | stackit project member [flags] 11 | ``` 12 | 13 | ### Options 14 | 15 | ``` 16 | -h, --help Help for "stackit project member" 17 | ``` 18 | 19 | ### Options inherited from parent commands 20 | 21 | ``` 22 | -y, --assume-yes If set, skips all confirmation prompts 23 | --async If set, runs the command asynchronously 24 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 25 | -p, --project-id string Project ID 26 | --region string Target region for region-specific requests 27 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 28 | ``` 29 | 30 | ### SEE ALSO 31 | 32 | * [stackit project](./stackit_project.md) - Manages projects 33 | * [stackit project member add](./stackit_project_member_add.md) - Adds a member to a project 34 | * [stackit project member list](./stackit_project_member_list.md) - Lists members of a project 35 | * [stackit project member remove](./stackit_project_member_remove.md) - Removes a member from a project 36 | 37 | -------------------------------------------------------------------------------- /docs/stackit_redis.md: -------------------------------------------------------------------------------- 1 | ## stackit redis 2 | 3 | Provides functionality for Redis 4 | 5 | ### Synopsis 6 | 7 | Provides functionality for Redis. 8 | 9 | ``` 10 | stackit redis [flags] 11 | ``` 12 | 13 | ### Options 14 | 15 | ``` 16 | -h, --help Help for "stackit redis" 17 | ``` 18 | 19 | ### Options inherited from parent commands 20 | 21 | ``` 22 | -y, --assume-yes If set, skips all confirmation prompts 23 | --async If set, runs the command asynchronously 24 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 25 | -p, --project-id string Project ID 26 | --region string Target region for region-specific requests 27 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 28 | ``` 29 | 30 | ### SEE ALSO 31 | 32 | * [stackit](./stackit.md) - Manage STACKIT resources using the command line 33 | * [stackit redis credentials](./stackit_redis_credentials.md) - Provides functionality for Redis credentials 34 | * [stackit redis instance](./stackit_redis_instance.md) - Provides functionality for Redis instances 35 | * [stackit redis plans](./stackit_redis_plans.md) - Lists all Redis service plans 36 | 37 | -------------------------------------------------------------------------------- /docs/stackit_server_public-ip.md: -------------------------------------------------------------------------------- 1 | ## stackit server public-ip 2 | 3 | Allows attaching/detaching public IPs to servers 4 | 5 | ### Synopsis 6 | 7 | Allows attaching/detaching public IPs to servers. 8 | 9 | ``` 10 | stackit server public-ip [flags] 11 | ``` 12 | 13 | ### Options 14 | 15 | ``` 16 | -h, --help Help for "stackit server public-ip" 17 | ``` 18 | 19 | ### Options inherited from parent commands 20 | 21 | ``` 22 | -y, --assume-yes If set, skips all confirmation prompts 23 | --async If set, runs the command asynchronously 24 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 25 | -p, --project-id string Project ID 26 | --region string Target region for region-specific requests 27 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 28 | ``` 29 | 30 | ### SEE ALSO 31 | 32 | * [stackit server](./stackit_server.md) - Provides functionality for servers 33 | * [stackit server public-ip attach](./stackit_server_public-ip_attach.md) - Attaches a public IP to a server 34 | * [stackit server public-ip detach](./stackit_server_public-ip_detach.md) - Detaches a public IP from a server 35 | 36 | -------------------------------------------------------------------------------- /docs/stackit_server_reboot.md: -------------------------------------------------------------------------------- 1 | ## stackit server reboot 2 | 3 | Reboots a server 4 | 5 | ### Synopsis 6 | 7 | Reboots a server. 8 | 9 | ``` 10 | stackit server reboot SERVER_ID [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Perform a soft reboot of a server with ID "xxx" 17 | $ stackit server reboot xxx 18 | 19 | Perform a hard reboot of a server with ID "xxx" 20 | $ stackit server reboot xxx --hard 21 | ``` 22 | 23 | ### Options 24 | 25 | ``` 26 | -b, --hard Performs a hard reboot. (default false) 27 | -h, --help Help for "stackit server reboot" 28 | ``` 29 | 30 | ### Options inherited from parent commands 31 | 32 | ``` 33 | -y, --assume-yes If set, skips all confirmation prompts 34 | --async If set, runs the command asynchronously 35 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 36 | -p, --project-id string Project ID 37 | --region string Target region for region-specific requests 38 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 39 | ``` 40 | 41 | ### SEE ALSO 42 | 43 | * [stackit server](./stackit_server.md) - Provides functionality for servers 44 | 45 | -------------------------------------------------------------------------------- /docs/stackit_server_rescue.md: -------------------------------------------------------------------------------- 1 | ## stackit server rescue 2 | 3 | Rescues an existing server 4 | 5 | ### Synopsis 6 | 7 | Rescues an existing server. 8 | 9 | ``` 10 | stackit server rescue SERVER_ID [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Rescue an existing server with ID "xxx" using image with ID "yyy" as boot volume 17 | $ stackit server rescue xxx --image-id yyy 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit server rescue" 24 | --image-id string The image ID to be used for a temporary boot volume. 25 | ``` 26 | 27 | ### Options inherited from parent commands 28 | 29 | ``` 30 | -y, --assume-yes If set, skips all confirmation prompts 31 | --async If set, runs the command asynchronously 32 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 33 | -p, --project-id string Project ID 34 | --region string Target region for region-specific requests 35 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 36 | ``` 37 | 38 | ### SEE ALSO 39 | 40 | * [stackit server](./stackit_server.md) - Provides functionality for servers 41 | 42 | -------------------------------------------------------------------------------- /docs/stackit_service-account_delete.md: -------------------------------------------------------------------------------- 1 | ## stackit service-account delete 2 | 3 | Deletes a service account 4 | 5 | ### Synopsis 6 | 7 | Deletes a service account. 8 | 9 | ``` 10 | stackit service-account delete EMAIL [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Delete a service account with email "my-service-account-1234567@sa.stackit.cloud" 17 | $ stackit service-account delete my-service-account-1234567@sa.stackit.cloud 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit service-account delete" 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -y, --assume-yes If set, skips all confirmation prompts 30 | --async If set, runs the command asynchronously 31 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 32 | -p, --project-id string Project ID 33 | --region string Target region for region-specific requests 34 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [stackit service-account](./stackit_service-account.md) - Provides functionality for service accounts 40 | 41 | -------------------------------------------------------------------------------- /docs/stackit_ske_kubeconfig.md: -------------------------------------------------------------------------------- 1 | ## stackit ske kubeconfig 2 | 3 | Provides functionality for SKE kubeconfig 4 | 5 | ### Synopsis 6 | 7 | Provides functionality for STACKIT Kubernetes Engine (SKE) kubeconfig. 8 | 9 | ``` 10 | stackit ske kubeconfig [flags] 11 | ``` 12 | 13 | ### Options 14 | 15 | ``` 16 | -h, --help Help for "stackit ske kubeconfig" 17 | ``` 18 | 19 | ### Options inherited from parent commands 20 | 21 | ``` 22 | -y, --assume-yes If set, skips all confirmation prompts 23 | --async If set, runs the command asynchronously 24 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 25 | -p, --project-id string Project ID 26 | --region string Target region for region-specific requests 27 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 28 | ``` 29 | 30 | ### SEE ALSO 31 | 32 | * [stackit ske](./stackit_ske.md) - Provides functionality for SKE 33 | * [stackit ske kubeconfig create](./stackit_ske_kubeconfig_create.md) - Creates or update a kubeconfig for a SKE cluster 34 | * [stackit ske kubeconfig login](./stackit_ske_kubeconfig_login.md) - Login plugin for kubernetes clients 35 | 36 | -------------------------------------------------------------------------------- /internal/cmd/beta/sqlserverflex/sqlserverflex.go: -------------------------------------------------------------------------------- 1 | package sqlserverflex 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex/database" 5 | "github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex/instance" 6 | "github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex/options" 7 | "github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex/user" 8 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 9 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 10 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 11 | 12 | "github.com/spf13/cobra" 13 | ) 14 | 15 | func NewCmd(params *types.CmdParams) *cobra.Command { 16 | cmd := &cobra.Command{ 17 | Use: "sqlserverflex", 18 | Short: "Provides functionality for SQLServer Flex", 19 | Long: "Provides functionality for SQLServer Flex.", 20 | Args: args.NoArgs, 21 | Run: utils.CmdHelp, 22 | } 23 | addSubcommands(cmd, params) 24 | return cmd 25 | } 26 | 27 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 28 | cmd.AddCommand(database.NewCmd(params)) 29 | cmd.AddCommand(instance.NewCmd(params)) 30 | cmd.AddCommand(options.NewCmd(params)) 31 | cmd.AddCommand(user.NewCmd(params)) 32 | } 33 | -------------------------------------------------------------------------------- /internal/cmd/security-group/rule/security_group_rule.go: -------------------------------------------------------------------------------- 1 | package rule 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/cmd/security-group/rule/create" 5 | "github.com/stackitcloud/stackit-cli/internal/cmd/security-group/rule/delete" 6 | "github.com/stackitcloud/stackit-cli/internal/cmd/security-group/rule/describe" 7 | "github.com/stackitcloud/stackit-cli/internal/cmd/security-group/rule/list" 8 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 9 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 10 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 11 | 12 | "github.com/spf13/cobra" 13 | ) 14 | 15 | func NewCmd(params *types.CmdParams) *cobra.Command { 16 | cmd := &cobra.Command{ 17 | Use: "rule", 18 | Short: "Provides functionality for security group rules", 19 | Long: "Provides functionality for security group rules.", 20 | Args: args.NoArgs, 21 | Run: utils.CmdHelp, 22 | } 23 | addSubcommands(cmd, params) 24 | return cmd 25 | } 26 | 27 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 28 | cmd.AddCommand(create.NewCmd(params)) 29 | cmd.AddCommand(delete.NewCmd(params)) 30 | cmd.AddCommand(describe.NewCmd(params)) 31 | cmd.AddCommand(list.NewCmd(params)) 32 | } 33 | -------------------------------------------------------------------------------- /docs/stackit_dns_zone_describe.md: -------------------------------------------------------------------------------- 1 | ## stackit dns zone describe 2 | 3 | Shows details of a DNS zone 4 | 5 | ### Synopsis 6 | 7 | Shows details of a DNS zone. 8 | 9 | ``` 10 | stackit dns zone describe ZONE_ID [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Get details of a DNS zone with ID "xxx" 17 | $ stackit dns zone describe xxx 18 | 19 | Get details of a DNS zone with ID "xxx" in JSON format 20 | $ stackit dns zone describe xxx --output-format json 21 | ``` 22 | 23 | ### Options 24 | 25 | ``` 26 | -h, --help Help for "stackit dns zone describe" 27 | ``` 28 | 29 | ### Options inherited from parent commands 30 | 31 | ``` 32 | -y, --assume-yes If set, skips all confirmation prompts 33 | --async If set, runs the command asynchronously 34 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 35 | -p, --project-id string Project ID 36 | --region string Target region for region-specific requests 37 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 38 | ``` 39 | 40 | ### SEE ALSO 41 | 42 | * [stackit dns zone](./stackit_dns_zone.md) - Provides functionality for DNS zones 43 | 44 | -------------------------------------------------------------------------------- /docs/stackit_object-storage_bucket_create.md: -------------------------------------------------------------------------------- 1 | ## stackit object-storage bucket create 2 | 3 | Creates an Object Storage bucket 4 | 5 | ### Synopsis 6 | 7 | Creates an Object Storage bucket. 8 | 9 | ``` 10 | stackit object-storage bucket create BUCKET_NAME [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Create an Object Storage bucket with name "my-bucket" 17 | $ stackit object-storage bucket create my-bucket 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit object-storage bucket create" 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -y, --assume-yes If set, skips all confirmation prompts 30 | --async If set, runs the command asynchronously 31 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 32 | -p, --project-id string Project ID 33 | --region string Target region for region-specific requests 34 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [stackit object-storage bucket](./stackit_object-storage_bucket.md) - Provides functionality for Object Storage buckets 40 | 41 | -------------------------------------------------------------------------------- /docs/stackit_object-storage_bucket_delete.md: -------------------------------------------------------------------------------- 1 | ## stackit object-storage bucket delete 2 | 3 | Deletes an Object Storage bucket 4 | 5 | ### Synopsis 6 | 7 | Deletes an Object Storage bucket. 8 | 9 | ``` 10 | stackit object-storage bucket delete BUCKET_NAME [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Delete an Object Storage bucket with name "my-bucket" 17 | $ stackit object-storage bucket delete my-bucket 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit object-storage bucket delete" 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -y, --assume-yes If set, skips all confirmation prompts 30 | --async If set, runs the command asynchronously 31 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 32 | -p, --project-id string Project ID 33 | --region string Target region for region-specific requests 34 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [stackit object-storage bucket](./stackit_object-storage_bucket.md) - Provides functionality for Object Storage buckets 40 | 41 | -------------------------------------------------------------------------------- /docs/stackit_server_volume_detach.md: -------------------------------------------------------------------------------- 1 | ## stackit server volume detach 2 | 3 | Detaches a volume from a server 4 | 5 | ### Synopsis 6 | 7 | Detaches a volume from a server. 8 | 9 | ``` 10 | stackit server volume detach VOLUME_ID [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Detaches a volume with ID "xxx" from a server with ID "yyy" 17 | $ stackit server volume detach xxx --server-id yyy 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit server volume detach" 24 | --server-id string Server ID 25 | ``` 26 | 27 | ### Options inherited from parent commands 28 | 29 | ``` 30 | -y, --assume-yes If set, skips all confirmation prompts 31 | --async If set, runs the command asynchronously 32 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 33 | -p, --project-id string Project ID 34 | --region string Target region for region-specific requests 35 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 36 | ``` 37 | 38 | ### SEE ALSO 39 | 40 | * [stackit server volume](./stackit_server_volume.md) - Provides functionality for server volumes 41 | 42 | -------------------------------------------------------------------------------- /docs/stackit_ske_cluster_wakeup.md: -------------------------------------------------------------------------------- 1 | ## stackit ske cluster wakeup 2 | 3 | Trigger wakeup from hibernation for a SKE cluster 4 | 5 | ### Synopsis 6 | 7 | Trigger wakeup from hibernation for a STACKIT Kubernetes Engine (SKE) cluster. 8 | 9 | ``` 10 | stackit ske cluster wakeup CLUSTER_NAME [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Trigger wakeup from hibernation for a SKE cluster with name "my-cluster" 17 | $ stackit ske cluster wakeup my-cluster 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit ske cluster wakeup" 24 | ``` 25 | 26 | ### Options inherited from parent commands 27 | 28 | ``` 29 | -y, --assume-yes If set, skips all confirmation prompts 30 | --async If set, runs the command asynchronously 31 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 32 | -p, --project-id string Project ID 33 | --region string Target region for region-specific requests 34 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 35 | ``` 36 | 37 | ### SEE ALSO 38 | 39 | * [stackit ske cluster](./stackit_ske_cluster.md) - Provides functionality for SKE cluster 40 | 41 | -------------------------------------------------------------------------------- /internal/cmd/beta/kms/wrappingkey/wrappingkey.go: -------------------------------------------------------------------------------- 1 | package wrappingkey 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/cmd/beta/kms/wrappingkey/create" 5 | "github.com/stackitcloud/stackit-cli/internal/cmd/beta/kms/wrappingkey/delete" 6 | "github.com/stackitcloud/stackit-cli/internal/cmd/beta/kms/wrappingkey/describe" 7 | "github.com/stackitcloud/stackit-cli/internal/cmd/beta/kms/wrappingkey/list" 8 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 9 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 10 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 11 | 12 | "github.com/spf13/cobra" 13 | ) 14 | 15 | func NewCmd(params *types.CmdParams) *cobra.Command { 16 | cmd := &cobra.Command{ 17 | Use: "wrapping-key", 18 | Short: "Manage KMS wrapping keys", 19 | Long: "Provides functionality for wrapping key operations inside the KMS", 20 | Args: args.NoArgs, 21 | Run: utils.CmdHelp, 22 | } 23 | addSubcommands(cmd, params) 24 | return cmd 25 | } 26 | 27 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 28 | cmd.AddCommand(list.NewCmd(params)) 29 | cmd.AddCommand(delete.NewCmd(params)) 30 | cmd.AddCommand(create.NewCmd(params)) 31 | cmd.AddCommand(describe.NewCmd(params)) 32 | } 33 | -------------------------------------------------------------------------------- /internal/cmd/config/profile/import/template/profile.json: -------------------------------------------------------------------------------- 1 | { 2 | "allowed_url_domain": "stackit.cloud", 3 | "async": false, 4 | "authorization_custom_endpoint": "", 5 | "dns_custom_endpoint": "", 6 | "iaas_custom_endpoint": "", 7 | "identity_provider_custom_client_id": "", 8 | "identity_provider_custom_well_known_configuration": "", 9 | "load_balancer_custom_endpoint": "", 10 | "logme_custom_endpoint": "", 11 | "mariadb_custom_endpoint": "", 12 | "mongodbflex_custom_endpoint": "", 13 | "object_storage_custom_endpoint": "", 14 | "observability_custom_endpoint": "", 15 | "opensearch_custom_endpoint": "", 16 | "output_format": "", 17 | "postgresflex_custom_endpoint": "", 18 | "project_id": "", 19 | "project_name": "", 20 | "rabbitmq_custom_endpoint": "", 21 | "redis_custom_endpoint": "", 22 | "resource_manager_custom_endpoint": "", 23 | "runcommand_custom_endpoint": "", 24 | "secrets_manager_custom_endpoint": "", 25 | "serverbackup_custom_endpoint": "", 26 | "service_account_custom_endpoint": "", 27 | "service_enablement_custom_endpoint": "", 28 | "session_time_limit": "2h", 29 | "ske_custom_endpoint": "", 30 | "sqlserverflex_custom_endpoint": "", 31 | "token_custom_endpoint": "", 32 | "verbosity": "info" 33 | } -------------------------------------------------------------------------------- /internal/cmd/mariadb/credentials/credentials.go: -------------------------------------------------------------------------------- 1 | package credentials 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/cmd/mariadb/credentials/create" 5 | "github.com/stackitcloud/stackit-cli/internal/cmd/mariadb/credentials/delete" 6 | "github.com/stackitcloud/stackit-cli/internal/cmd/mariadb/credentials/describe" 7 | "github.com/stackitcloud/stackit-cli/internal/cmd/mariadb/credentials/list" 8 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 9 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 10 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 11 | 12 | "github.com/spf13/cobra" 13 | ) 14 | 15 | func NewCmd(params *types.CmdParams) *cobra.Command { 16 | cmd := &cobra.Command{ 17 | Use: "credentials", 18 | Short: "Provides functionality for MariaDB credentials", 19 | Long: "Provides functionality for MariaDB credentials.", 20 | Args: args.NoArgs, 21 | Run: utils.CmdHelp, 22 | } 23 | addSubcommands(cmd, params) 24 | return cmd 25 | } 26 | 27 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 28 | cmd.AddCommand(create.NewCmd(params)) 29 | cmd.AddCommand(delete.NewCmd(params)) 30 | cmd.AddCommand(describe.NewCmd(params)) 31 | cmd.AddCommand(list.NewCmd(params)) 32 | } 33 | -------------------------------------------------------------------------------- /internal/cmd/object-storage/bucket/bucket.go: -------------------------------------------------------------------------------- 1 | package bucket 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/cmd/object-storage/bucket/create" 5 | "github.com/stackitcloud/stackit-cli/internal/cmd/object-storage/bucket/delete" 6 | "github.com/stackitcloud/stackit-cli/internal/cmd/object-storage/bucket/describe" 7 | "github.com/stackitcloud/stackit-cli/internal/cmd/object-storage/bucket/list" 8 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 9 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 10 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 11 | 12 | "github.com/spf13/cobra" 13 | ) 14 | 15 | func NewCmd(params *types.CmdParams) *cobra.Command { 16 | cmd := &cobra.Command{ 17 | Use: "bucket", 18 | Short: "Provides functionality for Object Storage buckets", 19 | Long: "Provides functionality for Object Storage buckets.", 20 | Args: args.NoArgs, 21 | Run: utils.CmdHelp, 22 | } 23 | addSubcommands(cmd, params) 24 | return cmd 25 | } 26 | 27 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 28 | cmd.AddCommand(delete.NewCmd(params)) 29 | cmd.AddCommand(describe.NewCmd(params)) 30 | cmd.AddCommand(create.NewCmd(params)) 31 | cmd.AddCommand(list.NewCmd(params)) 32 | } 33 | -------------------------------------------------------------------------------- /docs/stackit_secrets-manager.md: -------------------------------------------------------------------------------- 1 | ## stackit secrets-manager 2 | 3 | Provides functionality for Secrets Manager 4 | 5 | ### Synopsis 6 | 7 | Provides functionality for Secrets Manager. 8 | 9 | ``` 10 | stackit secrets-manager [flags] 11 | ``` 12 | 13 | ### Options 14 | 15 | ``` 16 | -h, --help Help for "stackit secrets-manager" 17 | ``` 18 | 19 | ### Options inherited from parent commands 20 | 21 | ``` 22 | -y, --assume-yes If set, skips all confirmation prompts 23 | --async If set, runs the command asynchronously 24 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 25 | -p, --project-id string Project ID 26 | --region string Target region for region-specific requests 27 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 28 | ``` 29 | 30 | ### SEE ALSO 31 | 32 | * [stackit](./stackit.md) - Manage STACKIT resources using the command line 33 | * [stackit secrets-manager instance](./stackit_secrets-manager_instance.md) - Provides functionality for Secrets Manager instances 34 | * [stackit secrets-manager user](./stackit_secrets-manager_user.md) - Provides functionality for Secrets Manager users 35 | 36 | -------------------------------------------------------------------------------- /docs/stackit_server_backup_delete.md: -------------------------------------------------------------------------------- 1 | ## stackit server backup delete 2 | 3 | Deletes a Server Backup. 4 | 5 | ### Synopsis 6 | 7 | Deletes a Server Backup. Operation always is async. 8 | 9 | ``` 10 | stackit server backup delete BACKUP_ID [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Delete a Server Backup with ID "xxx" for server "zzz" 17 | $ stackit server backup delete xxx --server-id=zzz 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit server backup delete" 24 | -s, --server-id string Server ID 25 | ``` 26 | 27 | ### Options inherited from parent commands 28 | 29 | ``` 30 | -y, --assume-yes If set, skips all confirmation prompts 31 | --async If set, runs the command asynchronously 32 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 33 | -p, --project-id string Project ID 34 | --region string Target region for region-specific requests 35 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 36 | ``` 37 | 38 | ### SEE ALSO 39 | 40 | * [stackit server backup](./stackit_server_backup.md) - Provides functionality for server backups 41 | 42 | -------------------------------------------------------------------------------- /docs/stackit_server_os-update_enable.md: -------------------------------------------------------------------------------- 1 | ## stackit server os-update enable 2 | 3 | Enables Server os-update service 4 | 5 | ### Synopsis 6 | 7 | Enables Server os-update service. 8 | 9 | ``` 10 | stackit server os-update enable [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Enable os-update functionality for your server 17 | $ stackit server os-update enable --server-id=zzz 18 | ``` 19 | 20 | ### Options 21 | 22 | ``` 23 | -h, --help Help for "stackit server os-update enable" 24 | -s, --server-id string Server ID 25 | ``` 26 | 27 | ### Options inherited from parent commands 28 | 29 | ``` 30 | -y, --assume-yes If set, skips all confirmation prompts 31 | --async If set, runs the command asynchronously 32 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 33 | -p, --project-id string Project ID 34 | --region string Target region for region-specific requests 35 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 36 | ``` 37 | 38 | ### SEE ALSO 39 | 40 | * [stackit server os-update](./stackit_server_os-update.md) - Provides functionality for managed server updates 41 | 42 | -------------------------------------------------------------------------------- /internal/cmd/observability/grafana/grafana.go: -------------------------------------------------------------------------------- 1 | package grafana 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/cmd/observability/grafana/describe" 5 | publicreadaccess "github.com/stackitcloud/stackit-cli/internal/cmd/observability/grafana/public-read-access" 6 | singlesignon "github.com/stackitcloud/stackit-cli/internal/cmd/observability/grafana/single-sign-on" 7 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 8 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 9 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 10 | 11 | "github.com/spf13/cobra" 12 | ) 13 | 14 | func NewCmd(params *types.CmdParams) *cobra.Command { 15 | cmd := &cobra.Command{ 16 | Use: "grafana", 17 | Short: "Provides functionality for the Grafana configuration of Observability instances", 18 | Long: "Provides functionality for the Grafana configuration of Observability instances.", 19 | Args: args.NoArgs, 20 | Run: utils.CmdHelp, 21 | } 22 | addSubcommands(cmd, params) 23 | return cmd 24 | } 25 | 26 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 27 | cmd.AddCommand(describe.NewCmd(params)) 28 | cmd.AddCommand(publicreadaccess.NewCmd(params)) 29 | cmd.AddCommand(singlesignon.NewCmd(params)) 30 | } 31 | -------------------------------------------------------------------------------- /internal/cmd/rabbitmq/credentials/credentials.go: -------------------------------------------------------------------------------- 1 | package credentials 2 | 3 | import ( 4 | "github.com/stackitcloud/stackit-cli/internal/cmd/rabbitmq/credentials/create" 5 | "github.com/stackitcloud/stackit-cli/internal/cmd/rabbitmq/credentials/delete" 6 | "github.com/stackitcloud/stackit-cli/internal/cmd/rabbitmq/credentials/describe" 7 | "github.com/stackitcloud/stackit-cli/internal/cmd/rabbitmq/credentials/list" 8 | "github.com/stackitcloud/stackit-cli/internal/pkg/args" 9 | "github.com/stackitcloud/stackit-cli/internal/pkg/types" 10 | "github.com/stackitcloud/stackit-cli/internal/pkg/utils" 11 | 12 | "github.com/spf13/cobra" 13 | ) 14 | 15 | func NewCmd(params *types.CmdParams) *cobra.Command { 16 | cmd := &cobra.Command{ 17 | Use: "credentials", 18 | Short: "Provides functionality for RabbitMQ credentials", 19 | Long: "Provides functionality for RabbitMQ credentials.", 20 | Args: args.NoArgs, 21 | Run: utils.CmdHelp, 22 | } 23 | addSubcommands(cmd, params) 24 | return cmd 25 | } 26 | 27 | func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { 28 | cmd.AddCommand(create.NewCmd(params)) 29 | cmd.AddCommand(delete.NewCmd(params)) 30 | cmd.AddCommand(describe.NewCmd(params)) 31 | cmd.AddCommand(list.NewCmd(params)) 32 | } 33 | -------------------------------------------------------------------------------- /docs/stackit_affinity-group_list.md: -------------------------------------------------------------------------------- 1 | ## stackit affinity-group list 2 | 3 | Lists affinity groups 4 | 5 | ### Synopsis 6 | 7 | Lists affinity groups. 8 | 9 | ``` 10 | stackit affinity-group list [flags] 11 | ``` 12 | 13 | ### Examples 14 | 15 | ``` 16 | Lists all affinity groups 17 | $ stackit affinity-group list 18 | 19 | Lists up to 10 affinity groups 20 | $ stackit affinity-group list --limit=10 21 | ``` 22 | 23 | ### Options 24 | 25 | ``` 26 | -h, --help Help for "stackit affinity-group list" 27 | --limit int Limit the output to the first n elements 28 | ``` 29 | 30 | ### Options inherited from parent commands 31 | 32 | ``` 33 | -y, --assume-yes If set, skips all confirmation prompts 34 | --async If set, runs the command asynchronously 35 | -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] 36 | -p, --project-id string Project ID 37 | --region string Target region for region-specific requests 38 | --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") 39 | ``` 40 | 41 | ### SEE ALSO 42 | 43 | * [stackit affinity-group](./stackit_affinity-group.md) - Manage server affinity groups 44 | 45 | --------------------------------------------------------------------------------