mirror of
https://github.com/apricote/hcloud-upload-image.git
synced 2026-01-13 13:21:01 +00:00
feat: add --location flag to specify datacenter region (#141)
Allow users to specify which Hetzner datacenter location to use for the temporary server during image upload. Defaults to fsn1 for backward compatibility. Available locations: fsn1, nbg1, hel1, ash, hil, sin Implements: #142
This commit is contained in:
parent
a9b16cf07c
commit
fcbc14aab6
5 changed files with 28 additions and 3 deletions
|
|
@ -73,7 +73,8 @@ export HCLOUD_TOKEN="<your token>"
|
|||
hcloud-upload-image upload \
|
||||
--image-url "https://example.com/disk-image-x86.raw.bz2" \
|
||||
--architecture x86 \
|
||||
--compression bz2
|
||||
--compression bz2 \
|
||||
--location nbg1 # Optional: defaults to fsn1
|
||||
```
|
||||
|
||||
To learn more, you can use the embedded help output or check out the [CLI help pages in this repository](docs/reference/cli/hcloud-upload-image.md).:
|
||||
|
|
@ -123,6 +124,7 @@ func main() {
|
|||
ImageURL: imageURL,
|
||||
ImageCompression: hcloudimages.CompressionBZ2,
|
||||
Architecture: hcloud.ArchitectureX86,
|
||||
Location: &hcloud.Location{Name: "nbg1"}, // Optional: defaults to fsn1
|
||||
})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue