StackIT cli client¶
Install¶
Arch¶
GitHub binary¶
Config¶
~/.config/stackit/cli-config.json
Authentication¶
Browser-based login¶
Service account login¶
export STACKIT_SERVICE_ACCOUNT_KEY=<content-of-service-account-key>
export STACKIT_PRIVATE_KEY=<content-of-private-key> # only required if the private key is not part of the service account key
stackit auth activate-service-account
Create a VM¶
Create network
with default prefix 10.0.0.0/25 and public IP assigned:
Create ssh security rule and security group:
stackit security-group create --name ssh
stackit security-group list
stackit security-group rule create --security-group-id 6a2c981c-fc71-4b40-9ca4-97474a938115 \
--protocol-name tcp --port-range-min 22 --port-range-max 22 --direction ingress
stackit security-group rule list --security-group-id 6a2c981c-fc71-4b40-9ca4-97474a938115
stackit image list | grep -i debian
stackit server create --name test1 \
--machine-type t1.1 \
--boot-volume-delete-on-termination --boot-volume-source-id c3bbb293-d962-4163-999a-f539127f2492 \
--boot-volume-source-type image --boot-volume-size 64 \
--network-id a668b010-2858-474e-9bed-fb246600bb22 \
--security-groups 6a2c981c-fc71-4b40-9ca4-97474a938115 \
--keypair-name stackit1
stackit server list
Create and attach public IP:
stackit public-ip create
stackit public-ip list
stackit server public-ip attach --server-id cdd015c0-fe52-4d85-8ed9-2bc9db5cec20 8c245ef7-2717-4820-b194-317d4494c806
Finally, ssh into the server:
stackit curl https://iaas.api.eu01.stackit.cloud/v1/projects/<PROJECT_ID>/servers/<SERVER_ID>
stackit curl https://iaas.api.eu01.stackit.cloud/v1/projects/29fbbc0b-e1cc-486a-a771-bca2df4e9fe0/servers/cdd015c0-fe52-4d85-8ed9-2bc9db5cec20
Delete VM: