From 36b07f047691b8d33dbbe63443a612eaa4e03aa4 Mon Sep 17 00:00:00 2001 From: Theophilus Okwugwuni Date: Tue, 12 Sep 2023 19:47:50 +0100 Subject: [PATCH] Feature/ssd volumes (#24) * update genesiscloud-go package * add support for specifying volume storage type --- docs/data-sources/images.md | 2 +- docs/index.md | 2 +- docs/resources/instance.md | 6 +- docs/resources/security_group.md | 2 +- docs/resources/volume.md | 6 +- .../resources/genesiscloud_volume/resource.tf | 1 + go.mod | 38 ++------ go.sum | 96 ++++--------------- internal/provider/common.go | 2 +- internal/provider/images_data_source.go | 10 +- internal/provider/images_types.go | 2 +- internal/provider/instance_resource.go | 28 +++--- internal/provider/instance_types.go | 21 ++-- internal/provider/security_group_resource.go | 26 ++--- internal/provider/security_group_types.go | 2 +- internal/provider/snapshot_resource.go | 2 +- internal/provider/snapshot_types.go | 2 +- internal/provider/ssh_key_resource.go | 2 +- internal/provider/ssh_key_types.go | 2 +- internal/provider/volume_resource.go | 21 +++- internal/provider/volume_types.go | 6 +- 21 files changed, 110 insertions(+), 169 deletions(-) diff --git a/docs/data-sources/images.md b/docs/data-sources/images.md index 3ae7c57..5dbe5e7 100644 --- a/docs/data-sources/images.md +++ b/docs/data-sources/images.md @@ -60,7 +60,7 @@ Required: Optional: - `region` (String) Filter by the region identifier. - - The value must be one of: [`ARC-IS-HAF-1` `NORD-NO-KRS-1`]. + - The value must be one of: [`ARC-IS-HAF-1` `EUC-DE-MUC-1` `NORD-NO-KRS-1`]. diff --git a/docs/index.md b/docs/index.md index 87c310d..4a84385 100644 --- a/docs/index.md +++ b/docs/index.md @@ -138,7 +138,7 @@ output "connect" { ### Optional -- `endpoint` (String) Genesis Cloud API endpoint. May also be provided via `GENESISCLOUD_ENDPOINT` environment variable. If neither is provided, defaults to `https://api.genesiscloud.com`. +- `endpoint` (String) Genesis Cloud API endpoint. May also be provided via `GENESISCLOUD_ENDPOINT` environment variable. If neither is provided, defaults to `https://api.genesiscloud.com/compute/v1`. - `polling_interval` (String) The polling interval. - The string must be a positive [time duration](https://pkg.go.dev/time#ParseDuration), for example "10s". - `token` (String, Sensitive) Genesis Cloud API token. May also be provided via `GENESISCLOUD_TOKEN` environment variable. diff --git a/docs/resources/instance.md b/docs/resources/instance.md index 0ffe1d3..834d2d6 100644 --- a/docs/resources/instance.md +++ b/docs/resources/instance.md @@ -36,10 +36,9 @@ resource "genesiscloud_instance" "example" { - `name` (String) The human-readable name for the instance. - `region` (String) The region identifier. - If the value of this attribute changes, Terraform will destroy and recreate the resource. - - The value must be one of: [`ARC-IS-HAF-1` `NORD-NO-KRS-1`]. -- `type` (String) The instance type identifier. + - The value must be one of: [`ARC-IS-HAF-1` `EUC-DE-MUC-1` `NORD-NO-KRS-1`]. +- `type` (String) The instance type identifier. Learn more about instance types [here](https://developers.genesiscloud.com/instances#instance-types). - If the value of this attribute changes, Terraform will destroy and recreate the resource. - - The value must be one of: [`vcpu-12_memory-24g_disk-80g` `vcpu-12_memory-36g_disk-80g_nvidia1080ti-3` `vcpu-12_memory-36g_disk-80g_nvidia3060ti-3` `vcpu-12_memory-36g_disk-80g_nvidia3080-3` `vcpu-12_memory-72g_disk-80g_nvidia3090-3` `vcpu-16_memory-32g_disk-80g` `vcpu-16_memory-48g_disk-80g_nvidia1080ti-4` `vcpu-16_memory-48g_disk-80g_nvidia3060ti-4` `vcpu-16_memory-48g_disk-80g_nvidia3080-4` `vcpu-16_memory-64g_disk-80g_nvidia3080-2` `vcpu-16_memory-96g_disk-80g_nvidia3090-2` `vcpu-16_memory-96g_disk-80g_nvidia3090-4` `vcpu-20_memory-120g_disk-80g_nvidia3090-5` `vcpu-20_memory-40g_disk-80g` `vcpu-20_memory-60g_disk-80g_nvidia1080ti-5` `vcpu-20_memory-60g_disk-80g_nvidia3060ti-5` `vcpu-20_memory-60g_disk-80g_nvidia3080-5` `vcpu-24_memory-144g_disk-80g_nvidia3090-3` `vcpu-24_memory-144g_disk-80g_nvidia3090-6` `vcpu-24_memory-48g_disk-80g` `vcpu-24_memory-72g_disk-80g_nvidia1080ti-6` `vcpu-24_memory-72g_disk-80g_nvidia3060ti-6` `vcpu-24_memory-72g_disk-80g_nvidia3080-6` `vcpu-24_memory-96g_disk-80g_nvidia3080-3` `vcpu-28_memory-168g_disk-80g_nvidia3090-7` `vcpu-28_memory-84g_disk-80g_nvidia1080ti-7` `vcpu-28_memory-84g_disk-80g_nvidia3060ti-7` `vcpu-28_memory-84g_disk-80g_nvidia3080-7` `vcpu-2_memory-4g_disk-80g` `vcpu-2_memory-8g_disk-80g_amdrx470-4` `vcpu-2_memory-8g_disk-80g_amdrx470-5` `vcpu-2_memory-8g_disk-80g_amdrx470-6` `vcpu-2_memory-8g_disk-80g_amdrx470-7` `vcpu-2_memory-8g_disk-80g_amdrx470-8` `vcpu-32_memory-128g_disk-80g_nvidia3080-4` `vcpu-32_memory-192g_disk-80g_nvidia3090-4` `vcpu-32_memory-192g_disk-80g_nvidia3090-8` `vcpu-32_memory-96g_disk-80g_nvidia1080ti-8` `vcpu-32_memory-96g_disk-80g_nvidia3060ti-8` `vcpu-32_memory-96g_disk-80g_nvidia3080-8` `vcpu-4_memory-12g_disk-80g_nvidia1080ti-1` `vcpu-4_memory-12g_disk-80g_nvidia3060ti-1` `vcpu-4_memory-12g_disk-80g_nvidia3080-1` `vcpu-4_memory-24g_disk-80g_nvidia3090-1` `vcpu-4_memory-8g_disk-80g` `vcpu-8_memory-16g_disk-80g` `vcpu-8_memory-24g_disk-80g_nvidia1080ti-2` `vcpu-8_memory-24g_disk-80g_nvidia3060ti-2` `vcpu-8_memory-24g_disk-80g_nvidia3080-2` `vcpu-8_memory-32g_disk-80g_nvidia3080-1` `vcpu-8_memory-48g_disk-80g_nvidia3090-1` `vcpu-8_memory-48g_disk-80g_nvidia3090-2`]. ### Optional @@ -52,7 +51,6 @@ resource "genesiscloud_instance" "example" { - `placement_option` (String) The placement option identifier in which instances are physically located relative to each other within a zone. - If the value of this attribute changes, Terraform will destroy and recreate the resource. - Sets the default value `AUTO` if the attribute is not set. - - The value must be one of: [`A` `AUTO` `B`]. - `public_ip_type` (String) When set to `static`, the instance's public IP will not change between start and stop actions. - If the value of this attribute changes, Terraform will destroy and recreate the resource. - Sets the default value `dynamic` if the attribute is not set. diff --git a/docs/resources/security_group.md b/docs/resources/security_group.md index 7929d9b..8316012 100644 --- a/docs/resources/security_group.md +++ b/docs/resources/security_group.md @@ -35,7 +35,7 @@ resource "genesiscloud_security_group" "allow-https" { - `name` (String) The human-readable name for the security group. - `region` (String) The region identifier. - If the value of this attribute changes, Terraform will destroy and recreate the resource. - - The value must be one of: [`ARC-IS-HAF-1` `NORD-NO-KRS-1`]. + - The value must be one of: [`ARC-IS-HAF-1` `EUC-DE-MUC-1` `NORD-NO-KRS-1`]. - `rules` (Attributes List) (see [below for nested schema](#nestedatt--rules)) ### Optional diff --git a/docs/resources/volume.md b/docs/resources/volume.md index ab1a79b..44912fb 100644 --- a/docs/resources/volume.md +++ b/docs/resources/volume.md @@ -17,6 +17,7 @@ resource "genesiscloud_volume" "example" { name = "example" region = "ARC-IS-HAF-1" size = 50 + type = "hdd" } ``` @@ -28,10 +29,13 @@ resource "genesiscloud_volume" "example" { - `name` (String) The human-readable name for the volume. - `region` (String) The region identifier. - If the value of this attribute changes, Terraform will destroy and recreate the resource. - - The value must be one of: [`ARC-IS-HAF-1` `NORD-NO-KRS-1`]. + - The value must be one of: [`ARC-IS-HAF-1` `EUC-DE-MUC-1` `NORD-NO-KRS-1`]. - `size` (Number) The storage size of this volume given in GiB. - If the value of this attribute changes, Terraform will destroy and recreate the resource. - The value must be at least 1. +- `type` (String) The storage type of the volume. + - If the value of this attribute changes, Terraform will destroy and recreate the resource. + - The value must be one of: [`hdd` `ssd`]. ### Optional diff --git a/examples/resources/genesiscloud_volume/resource.tf b/examples/resources/genesiscloud_volume/resource.tf index a5d2cb2..dd1e0ae 100644 --- a/examples/resources/genesiscloud_volume/resource.tf +++ b/examples/resources/genesiscloud_volume/resource.tf @@ -2,4 +2,5 @@ resource "genesiscloud_volume" "example" { name = "example" region = "ARC-IS-HAF-1" size = 50 + type = "hdd" } diff --git a/go.mod b/go.mod index 4f986bf..177e733 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/genesiscloud/terraform-provider-genesiscloud go 1.18 require ( - github.com/genesiscloud/genesiscloud-go v1.0.0-rc.1 + github.com/genesiscloud/genesiscloud-go v1.0.1 github.com/hashicorp/go-retryablehttp v0.7.4 github.com/hashicorp/terraform-plugin-docs v0.13.0 github.com/hashicorp/terraform-plugin-framework v1.1.1 @@ -23,21 +23,12 @@ require ( github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect github.com/armon/go-radix v1.0.0 // indirect github.com/bgentry/speakeasy v0.1.0 // indirect - github.com/bytedance/sonic v1.9.2 // indirect - github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/deepmap/oapi-codegen v1.13.0 // indirect + github.com/deepmap/oapi-codegen v1.15.0 // indirect github.com/fatih/color v1.13.0 // indirect - github.com/gabriel-vasile/mimetype v1.4.2 // indirect - github.com/gin-contrib/sse v0.1.0 // indirect - github.com/gin-gonic/gin v1.9.1 // indirect - github.com/go-playground/locales v0.14.1 // indirect - github.com/go-playground/universal-translator v0.18.1 // indirect - github.com/go-playground/validator/v10 v10.14.1 // indirect - github.com/goccy/go-json v0.10.2 // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/google/go-cmp v0.5.9 // indirect - github.com/google/uuid v1.3.0 // indirect + github.com/google/uuid v1.3.1 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-checkpoint v0.5.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect @@ -57,11 +48,6 @@ require ( github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect github.com/huandu/xstrings v1.3.2 // indirect github.com/imdario/mergo v0.3.13 // indirect - github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/cpuid/v2 v2.2.5 // indirect - github.com/labstack/echo/v4 v4.10.2 // indirect - github.com/labstack/gommon v0.4.0 // indirect - github.com/leodido/go-urn v1.2.4 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.19 // indirect github.com/mitchellh/cli v1.1.4 // indirect @@ -70,32 +56,24 @@ require ( github.com/mitchellh/go-wordwrap v1.0.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/oapi-codegen/runtime v1.0.0 // indirect github.com/oklog/run v1.0.0 // indirect - github.com/pelletier/go-toml/v2 v2.0.8 // indirect github.com/posener/complete v1.2.3 // indirect github.com/russross/blackfriday v1.6.0 // indirect github.com/shopspring/decimal v1.3.1 // indirect github.com/spf13/cast v1.5.0 // indirect - github.com/twitchyliquid64/golang-asm v0.15.1 // indirect - github.com/ugorji/go/codec v1.2.11 // indirect - github.com/valyala/bytebufferpool v1.0.0 // indirect - github.com/valyala/fasttemplate v1.2.2 // indirect github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect github.com/vmihailenco/msgpack/v4 v4.3.12 // indirect github.com/vmihailenco/tagparser v0.1.2 // indirect github.com/zclconf/go-cty v1.12.1 // indirect - golang.org/x/arch v0.4.0 // indirect - golang.org/x/crypto v0.11.0 // indirect - golang.org/x/net v0.12.0 // indirect - golang.org/x/sys v0.10.0 // indirect - golang.org/x/text v0.11.0 // indirect + golang.org/x/crypto v0.13.0 // indirect + golang.org/x/net v0.15.0 // indirect + golang.org/x/sys v0.12.0 // indirect + golang.org/x/text v0.13.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20200711021454-869866162049 // indirect google.golang.org/grpc v1.51.0 // indirect google.golang.org/protobuf v1.31.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect ) replace github.com/hashicorp/terraform-plugin-framework => github.com/genesiscloud/terraform-plugin-framework v0.0.0-20230209224658-8e5bdfcff8eb diff --git a/go.sum b/go.sum index 8f326c1..cece6b7 100644 --- a/go.sum +++ b/go.sum @@ -34,20 +34,14 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkY github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w= -github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= -github.com/bytedance/sonic v1.9.2 h1:GDaNjuWSGu09guE9Oql0MSTNhNCLlWwO8y/xM5BzcbM= -github.com/bytedance/sonic v1.9.2/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= -github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams= -github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/deepmap/oapi-codegen v1.13.0 h1:cnFHelhsRQbYvanCUAbRSn/ZpkUb1HPRlQcu8YqSORQ= -github.com/deepmap/oapi-codegen v1.13.0/go.mod h1:Amy7tbubKY9qkZOXqymI3Z6xSbndmu+atMJheLdyg44= +github.com/deepmap/oapi-codegen v1.15.0 h1:SQqViaeb4k2vMul8gx12oDOIadEtoRqTdLkxjzqtQ90= +github.com/deepmap/oapi-codegen v1.15.0/go.mod h1:a6KoHV7lMRwsPoEg2C6NDHiXYV3EQfiFocOlJ8dgJQE= github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg= github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -57,16 +51,10 @@ github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= -github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= -github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= -github.com/genesiscloud/genesiscloud-go v1.0.0-rc.1 h1:BUuldvlr5idIZTtYSbgl/bfzcRXPv8zUChMrZ6UqpIc= -github.com/genesiscloud/genesiscloud-go v1.0.0-rc.1/go.mod h1:NI5cu/MH/vQc/sVUzrP2JVEqH3n3LACHJqsf/qZc+Fs= +github.com/genesiscloud/genesiscloud-go v1.0.1 h1:/1EThl96u/O9Sh0yMX2uZu37TaeEzv9n8+e03I2Wu48= +github.com/genesiscloud/genesiscloud-go v1.0.1/go.mod h1:OAMjSCejQTC4BBLWXleegT/fg+X46SZ6t/vW9RPtXWg= github.com/genesiscloud/terraform-plugin-framework v0.0.0-20230209224658-8e5bdfcff8eb h1:GiM6GYVU6p8cjsMFcuGuvpBYkF/Ra0b8h7GVMnsFsaw= github.com/genesiscloud/terraform-plugin-framework v0.0.0-20230209224658-8e5bdfcff8eb/go.mod h1:JMR+Y8KdD9kWMLILo1gn1MzF3C3j607Pvv4PtxQj/8w= -github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= -github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= -github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= @@ -76,16 +64,7 @@ github.com/go-git/go-billy/v5 v5.3.1/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI github.com/go-git/go-git-fixtures/v4 v4.2.1/go.mod h1:K8zd3kDUAykwTdDCr+I0per6Y6vMiRR/nnVTBtavnB0= github.com/go-git/go-git/v5 v5.4.2 h1:BXyZu9t0VkbiHtqrsvdq39UDhGJTl1h55VW6CSC4aY4= github.com/go-git/go-git/v5 v5.4.2/go.mod h1:gQ1kArt6d+n+BGd+/B/I74HwRTLhth2+zti4ihgckDc= -github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= -github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= -github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= -github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= -github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.14.1 h1:9c50NUPC30zyuKprjL3vNZ0m5oG+jU0zvx4AqHGnv4k= -github.com/go-playground/validator/v10 v10.14.1/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= -github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= -github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -110,11 +89,10 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= +github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -182,14 +160,9 @@ github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOl github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE= -github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= -github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE= github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 h1:DowS9hvgyYSX4TO5NpyC606/Z4SxnNYbT+WX27or6Ck= github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= -github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg= -github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -200,16 +173,9 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/labstack/echo/v4 v4.10.2 h1:n1jAhnq/elIFTHr1EYpiYtyKgx4RW9ccVgkqByZaN2M= -github.com/labstack/echo/v4 v4.10.2/go.mod h1:OEyqf2//K1DFdE57vw2DRgWY0M7s65IVQO2FzvI4J5k= -github.com/labstack/gommon v0.4.0 h1:y7cvthEAEbU0yHOf4axH8ZG2NH8knB9iNSoTO8dyIk8= -github.com/labstack/gommon v0.4.0/go.mod h1:uW6kP17uPlLJsD3ijUYn3/M5bAxtlZhMI6m3MFxTMTM= -github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= -github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= @@ -235,16 +201,11 @@ github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RR github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= -github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/oapi-codegen/runtime v1.0.0 h1:P4rqFX5fMFWqRzY9M/3YF9+aPSPPB06IzP2P7oOxrWo= +github.com/oapi-codegen/runtime v1.0.0/go.mod h1:LmCUMQuPB4M/nLXilQXhHw+BLZdDb18B34OO356yJ/A= github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= -github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= -github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -269,30 +230,14 @@ github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155 github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad/go.mod h1:qLr4V1qq6nMqFKkMo8ZTx3f+BZEkzsRUY10Xsm2mwU0= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= -github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= -github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= -github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= -github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= -github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo= -github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI= github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= @@ -309,9 +254,6 @@ github.com/zclconf/go-cty v1.10.0/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uU github.com/zclconf/go-cty v1.12.1 h1:PcupnljUm9EIvbgSHQnHhUr3fO6oFmkOrvs2BAFNXXY= github.com/zclconf/go-cty v1.12.1/go.mod h1:s9IfD1LK5ccNMSWCVFCE2rJfHiZgi7JijgeWIMfhLvA= github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8= -golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= -golang.org/x/arch v0.4.0 h1:A8WCeEWhLwPBKNbFi5Wv5UTCBx5zzubnXDlMOFAzFMc= -golang.org/x/arch v0.4.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -319,8 +261,8 @@ golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA= -golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= +golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck= +golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= @@ -338,8 +280,8 @@ golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k= -golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50= -golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= +golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8= +golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -362,20 +304,18 @@ golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211103235746-7861aae1554b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= -golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4= -golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -421,10 +361,8 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= diff --git a/internal/provider/common.go b/internal/provider/common.go index 67afd06..0c5224f 100644 --- a/internal/provider/common.go +++ b/internal/provider/common.go @@ -11,7 +11,7 @@ import ( type ErrorResponse struct { Body []byte HTTPResponse *http.Response - Error *genesiscloud.ComputeV1Error + Error *genesiscloud.Error } var ErrResourceInErrorState = errors.New("the resource is in error state") diff --git a/internal/provider/images_data_source.go b/internal/provider/images_data_source.go index c6e8354..f950e1d 100644 --- a/internal/provider/images_data_source.go +++ b/internal/provider/images_data_source.go @@ -66,14 +66,14 @@ func (d *ImagesDataSource) Schema(ctx context.Context, req datasource.SchemaRequ MarkdownDescription: "Filter by the kind of image.", Required: true, Validators: []validator.String{ - stringvalidator.OneOf(sliceStringify(genesiscloud.AllComputeV1ImageTypes)...), + stringvalidator.OneOf(sliceStringify(genesiscloud.AllImageTypes)...), }, }), "region": datasourceenhancer.Attribute(ctx, schema.StringAttribute{ MarkdownDescription: "Filter by the region identifier.", Optional: true, Validators: []validator.String{ - stringvalidator.OneOf(sliceStringify(genesiscloud.AllComputeV1Regions)...), + stringvalidator.OneOf(sliceStringify(genesiscloud.AllRegions)...), }, }), }, @@ -133,12 +133,12 @@ func (d *ImagesDataSource) Read(ctx context.Context, req datasource.ReadRequest, } defer cancel() - filterType := pointer(genesiscloud.ComputeV1ImageType(data.Filter.Type.ValueString())) + filterType := pointer(genesiscloud.ImageType(data.Filter.Type.ValueString())) - var filterRegion *genesiscloud.ComputeV1Region + var filterRegion *genesiscloud.Region if !data.Filter.Region.IsNull() && !data.Filter.Region.IsUnknown() { - filterRegion = pointer(genesiscloud.ComputeV1Region(data.Filter.Region.ValueString())) + filterRegion = pointer(genesiscloud.Region(data.Filter.Region.ValueString())) } for page := 1; ; page++ { diff --git a/internal/provider/images_types.go b/internal/provider/images_types.go index bb80eb6..5bf6035 100644 --- a/internal/provider/images_types.go +++ b/internal/provider/images_types.go @@ -23,7 +23,7 @@ type ImageModel struct { Type types.String `tfsdk:"type"` } -func (data *ImageModel) PopulateFromClientResponse(image *genesiscloud.ComputeV1Image) { +func (data *ImageModel) PopulateFromClientResponse(image *genesiscloud.Image) { data.CreatedAt = types.StringValue(image.CreatedAt.Format(time.RFC3339)) data.Id = types.StringValue(image.Id) data.Name = types.StringValue(image.Name) diff --git a/internal/provider/instance_resource.go b/internal/provider/instance_resource.go index 77c0cd9..8717e8c 100644 --- a/internal/provider/instance_resource.go +++ b/internal/provider/instance_resource.go @@ -127,11 +127,9 @@ func (r *InstanceResource) Schema(ctx context.Context, req resource.SchemaReques Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.RequiresReplace(), - defaultplanmodifier.String(string(genesiscloud.ComputeV1PlacementOptionAUTO)), - }, - Validators: []validator.String{ - stringvalidator.OneOf(sliceStringify(genesiscloud.AllComputeV1PlacementOptions)...), + defaultplanmodifier.String("AUTO"), }, + Validators: []validator.String{}, }), "private_ip": resourceenhancer.Attribute(ctx, schema.StringAttribute{ MarkdownDescription: "The private IPv4 IP-Address (IPv4 address).", @@ -155,10 +153,10 @@ func (r *InstanceResource) Schema(ctx context.Context, req resource.SchemaReques Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.RequiresReplace(), - defaultplanmodifier.String(string(genesiscloud.ComputeV1InstancePublicIPTypeDynamic)), + defaultplanmodifier.String(string(genesiscloud.InstancePublicIPTypeDynamic)), }, Validators: []validator.String{ - stringvalidator.OneOf(sliceStringify(genesiscloud.AllComputeV1InstancePublicIPTypes)...), + stringvalidator.OneOf(sliceStringify(genesiscloud.AllInstancePublicIPTypes)...), }, }), "region": resourceenhancer.Attribute(ctx, schema.StringAttribute{ @@ -168,7 +166,7 @@ func (r *InstanceResource) Schema(ctx context.Context, req resource.SchemaReques stringplanmodifier.RequiresReplace(), }, Validators: []validator.String{ - stringvalidator.OneOf(sliceStringify(genesiscloud.AllComputeV1Regions)...), + stringvalidator.OneOf(sliceStringify(genesiscloud.AllRegions)...), }, }), "security_group_ids": resourceenhancer.Attribute(ctx, schema.SetAttribute{ @@ -199,14 +197,11 @@ func (r *InstanceResource) Schema(ctx context.Context, req resource.SchemaReques }, }), "type": resourceenhancer.Attribute(ctx, schema.StringAttribute{ - MarkdownDescription: "The instance type identifier.", + MarkdownDescription: "The instance type identifier. Learn more about instance types [here](https://developers.genesiscloud.com/instances#instance-types).", Required: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.RequiresReplace(), }, - Validators: []validator.String{ - stringvalidator.OneOf(sliceStringify(genesiscloud.AllComputeV1InstanceTypes)...), - }, }), "updated_at": resourceenhancer.Attribute(ctx, schema.StringAttribute{ MarkdownDescription: "The timestamp when this image was last updated in RFC 3339.", @@ -266,12 +261,13 @@ func (r *InstanceResource) Create(ctx context.Context, req resource.CreateReques body.Hostname = data.Name.ValueString() } - body.Type = genesiscloud.ComputeV1InstanceType(data.Type.ValueString()) + body.Type = genesiscloud.InstanceType(data.Type.ValueString()) body.Image = data.ImageId.ValueString() if data.Metadata != nil { body.Metadata = &struct { - StartupScript *string `json:"startup_script,omitempty"` + StartupScript *string `json:"startup_script,omitempty"` + UserData *genesiscloud.InstanceUserData `json:"user_data,omitempty"` }{ StartupScript: pointer(data.Metadata.StartupScript.ValueString()), } @@ -299,9 +295,9 @@ func (r *InstanceResource) Create(ctx context.Context, req resource.CreateReques body.Volumes = &volumeIds } - body.PublicIpType = pointer(genesiscloud.ComputeV1InstancePublicIPType(data.PublicIpType.ValueString())) - body.Region = pointer(genesiscloud.ComputeV1Region(data.Region.ValueString())) - body.PlacementOption = pointer(genesiscloud.ComputeV1PlacementOption(data.PlacementOption.ValueString())) + body.PublicIpType = pointer(genesiscloud.InstancePublicIPType(data.PublicIpType.ValueString())) + body.Region = genesiscloud.Region(data.Region.ValueString()) + body.PlacementOption = pointer(data.PlacementOption.ValueString()) response, err := r.client.CreateInstanceWithResponse(ctx, body) if err != nil { diff --git a/internal/provider/instance_types.go b/internal/provider/instance_types.go index 11cd5a0..1ee5ded 100644 --- a/internal/provider/instance_types.go +++ b/internal/provider/instance_types.go @@ -73,16 +73,16 @@ type InstanceModel struct { VolumeIds types.Set `tfsdk:"volume_ids"` } -func (data *InstanceModel) PopulateFromClientResponse(ctx context.Context, instance *genesiscloud.ComputeV1Instance) (diag diag.Diagnostics) { +func (data *InstanceModel) PopulateFromClientResponse(ctx context.Context, instance *genesiscloud.Instance) (diag diag.Diagnostics) { data.Id = types.StringValue(instance.Id) data.Name = types.StringValue(instance.Name) data.Hostname = types.StringValue(instance.Hostname) data.Type = types.StringValue(string(instance.Type)) - data.ImageId = types.StringValue(*instance.Image.Id) + data.ImageId = types.StringValue(instance.Image.Id) volumeIds := make([]string, 0) // volumes do NOT support NULL for _, volume := range instance.Volumes { - volumeIds = append(volumeIds, *volume.Id) + volumeIds = append(volumeIds, volume.Id) } data.VolumeIds, diag = types.SetValueFrom(ctx, types.StringType, volumeIds) if diag.HasError() { @@ -91,7 +91,7 @@ func (data *InstanceModel) PopulateFromClientResponse(ctx context.Context, insta securityGroupIds := make([]string, 0) // security groups do NOT support NULL for _, securityGroup := range instance.SecurityGroups { - securityGroupIds = append(securityGroupIds, *securityGroup.Id) + securityGroupIds = append(securityGroupIds, securityGroup.Id) } data.SecurityGroupIds, diag = types.SetValueFrom(ctx, types.StringType, securityGroupIds) if diag.HasError() { @@ -100,7 +100,7 @@ func (data *InstanceModel) PopulateFromClientResponse(ctx context.Context, insta var sshKeyIds []string // ssh-keys do support NULL for _, sshKey := range instance.SshKeys { - sshKeyIds = append(sshKeyIds, *sshKey.Id) + sshKeyIds = append(sshKeyIds, sshKey.Id) } data.SshKeyIds, diag = types.SetValueFrom(ctx, types.StringType, sshKeyIds) if diag.HasError() { @@ -108,8 +108,15 @@ func (data *InstanceModel) PopulateFromClientResponse(ctx context.Context, insta } data.PlacementOption = types.StringValue(string(instance.PlacementOption)) - data.PrivateIp = types.StringValue(instance.PrivateIp) - data.PublicIp = types.StringValue(instance.PublicIp) + + if instance.PrivateIp != nil { + data.PrivateIp = types.StringValue(*instance.PrivateIp) + } + + if instance.PublicIp != nil { + data.PublicIp = types.StringValue(*instance.PublicIp) + } + data.PublicIpType = types.StringValue(string(instance.PublicIpType)) data.Region = types.StringValue(string(instance.Region)) data.Status = types.StringValue(string(instance.Status)) diff --git a/internal/provider/security_group_resource.go b/internal/provider/security_group_resource.go index 420c54c..05fc91b 100644 --- a/internal/provider/security_group_resource.go +++ b/internal/provider/security_group_resource.go @@ -89,7 +89,7 @@ func (r *SecurityGroupResource) Schema(ctx context.Context, req resource.SchemaR stringplanmodifier.RequiresReplace(), }, Validators: []validator.String{ - stringvalidator.OneOf(sliceStringify(genesiscloud.AllComputeV1Regions)...), + stringvalidator.OneOf(sliceStringify(genesiscloud.AllRegions)...), }, }), "rules": schema.ListNestedAttribute{ @@ -100,7 +100,7 @@ func (r *SecurityGroupResource) Schema(ctx context.Context, req resource.SchemaR MarkdownDescription: "The direction of the rule.", Required: true, Validators: []validator.String{ - stringvalidator.OneOf(sliceStringify(genesiscloud.AllComputeV1SecurityGroupRuleDirections)...), + stringvalidator.OneOf(sliceStringify(genesiscloud.AllSecurityGroupRuleDirections)...), }, }), "port_range_max": resourceenhancer.Attribute(ctx, schema.Int64Attribute{ @@ -121,7 +121,7 @@ func (r *SecurityGroupResource) Schema(ctx context.Context, req resource.SchemaR MarkdownDescription: "The protocol of the rule.", Required: true, Validators: []validator.String{ - stringvalidator.OneOf(sliceStringify(genesiscloud.AllComputeV1SecurityGroupRuleProtocols)...), + stringvalidator.OneOf(sliceStringify(genesiscloud.AllSecurityGroupRuleProtocols)...), }, }), }, @@ -170,7 +170,7 @@ func (r *SecurityGroupResource) Create(ctx context.Context, req resource.CreateR body.Description = pointer(data.Description.ValueString()) body.Name = data.Name.ValueString() - body.Region = pointer(genesiscloud.ComputeV1Region(data.Region.ValueString())) + body.Region = genesiscloud.Region(data.Region.ValueString()) for _, rule := range data.Rules { var portRangeMax, portRangeMin *int @@ -183,11 +183,11 @@ func (r *SecurityGroupResource) Create(ctx context.Context, req resource.CreateR portRangeMin = pointer(int(rule.PortRangeMin.ValueInt64())) } - body.Rules = append(body.Rules, genesiscloud.ComputeV1SecurityGroupRule{ - Direction: genesiscloud.ComputeV1SecurityGroupRuleDirection(rule.Direction.ValueString()), + body.Rules = append(body.Rules, genesiscloud.SecurityGroupRule{ + Direction: genesiscloud.SecurityGroupRuleDirection(rule.Direction.ValueString()), PortRangeMax: portRangeMax, PortRangeMin: portRangeMin, - Protocol: genesiscloud.ComputeV1SecurityGroupRuleProtocol(rule.Protocol.ValueString()), + Protocol: genesiscloud.SecurityGroupRuleProtocol(rule.Protocol.ValueString()), }) } @@ -332,7 +332,9 @@ func (r *SecurityGroupResource) Update(ctx context.Context, req resource.UpdateR body := genesiscloud.UpdateSecurityGroupJSONRequestBody{} body.Description = pointer(data.Description.ValueString()) - body.Name = data.Name.ValueString() + body.Name = pointer(data.Name.ValueString()) + rules := make([]genesiscloud.SecurityGroupRule, 0) + for _, rule := range data.Rules { var portRangeMax, portRangeMin *int @@ -344,14 +346,16 @@ func (r *SecurityGroupResource) Update(ctx context.Context, req resource.UpdateR portRangeMin = pointer(int(rule.PortRangeMin.ValueInt64())) } - body.Rules = append(body.Rules, genesiscloud.ComputeV1SecurityGroupRule{ - Direction: genesiscloud.ComputeV1SecurityGroupRuleDirection(rule.Direction.ValueString()), + rules = append(rules, genesiscloud.SecurityGroupRule{ + Direction: genesiscloud.SecurityGroupRuleDirection(rule.Direction.ValueString()), PortRangeMax: portRangeMax, PortRangeMin: portRangeMin, - Protocol: genesiscloud.ComputeV1SecurityGroupRuleProtocol(rule.Protocol.ValueString()), + Protocol: genesiscloud.SecurityGroupRuleProtocol(rule.Protocol.ValueString()), }) } + body.Rules = pointer(rules) + securityGroupId := data.Id.ValueString() response, err := r.client.UpdateSecurityGroupWithResponse(ctx, securityGroupId, body) diff --git a/internal/provider/security_group_types.go b/internal/provider/security_group_types.go index 6e1a0ac..5e0bd57 100644 --- a/internal/provider/security_group_types.go +++ b/internal/provider/security_group_types.go @@ -45,7 +45,7 @@ type SecurityGroupModel struct { Status types.String `tfsdk:"status"` } -func (data *SecurityGroupModel) PopulateFromClientResponse(ctx context.Context, securityGroup *genesiscloud.ComputeV1SecurityGroup) (diag diag.Diagnostics) { +func (data *SecurityGroupModel) PopulateFromClientResponse(ctx context.Context, securityGroup *genesiscloud.SecurityGroup) (diag diag.Diagnostics) { data.CreatedAt = types.StringValue(securityGroup.CreatedAt.Format(time.RFC3339)) data.Description = types.StringValue(securityGroup.Description) data.Id = types.StringValue(securityGroup.Id) diff --git a/internal/provider/snapshot_resource.go b/internal/provider/snapshot_resource.go index d1b7692..f4bb194 100644 --- a/internal/provider/snapshot_resource.go +++ b/internal/provider/snapshot_resource.go @@ -280,7 +280,7 @@ func (r *SnapshotResource) Update(ctx context.Context, req resource.UpdateReques body := genesiscloud.UpdateSnapshotJSONRequestBody{} - body.Name = data.Name.ValueString() + body.Name = pointer(data.Name.ValueString()) snapshotId := data.Id.ValueString() diff --git a/internal/provider/snapshot_types.go b/internal/provider/snapshot_types.go index e6f9d07..6f3b5f2 100644 --- a/internal/provider/snapshot_types.go +++ b/internal/provider/snapshot_types.go @@ -34,7 +34,7 @@ type SnapshotModel struct { Status types.String `tfsdk:"status"` } -func (data *SnapshotModel) PopulateFromClientResponse(ctx context.Context, snapshot *genesiscloud.ComputeV1Snapshot) (diag diag.Diagnostics) { +func (data *SnapshotModel) PopulateFromClientResponse(ctx context.Context, snapshot *genesiscloud.Snapshot) (diag diag.Diagnostics) { data.CreatedAt = types.StringValue(snapshot.CreatedAt.Format(time.RFC3339)) data.Id = types.StringValue(snapshot.Id) data.Name = types.StringValue(snapshot.Name) diff --git a/internal/provider/ssh_key_resource.go b/internal/provider/ssh_key_resource.go index 878b916..f2ca37b 100644 --- a/internal/provider/ssh_key_resource.go +++ b/internal/provider/ssh_key_resource.go @@ -200,7 +200,7 @@ func (r *SSHKeyResource) Update(ctx context.Context, req resource.UpdateRequest, body := genesiscloud.UpdateSSHKeyJSONRequestBody{} - body.Name = data.Name.ValueString() + body.Name = pointer(data.Name.ValueString()) sshKeyId := data.Id.ValueString() diff --git a/internal/provider/ssh_key_types.go b/internal/provider/ssh_key_types.go index 58a2fc1..c991a00 100644 --- a/internal/provider/ssh_key_types.go +++ b/internal/provider/ssh_key_types.go @@ -25,7 +25,7 @@ type SSHKeyModel struct { PublicKey types.String `tfsdk:"public_key"` } -func (data *SSHKeyModel) PopulateFromClientResponse(ctx context.Context, sshKey *genesiscloud.ComputeV1SSHKey) (diag diag.Diagnostics) { +func (data *SSHKeyModel) PopulateFromClientResponse(ctx context.Context, sshKey *genesiscloud.SSHKey) (diag diag.Diagnostics) { data.CreatedAt = types.StringValue(sshKey.CreatedAt.Format(time.RFC3339)) data.Fingerprint = types.StringValue(sshKey.Fingerprint) data.Id = types.StringValue(sshKey.Id) diff --git a/internal/provider/volume_resource.go b/internal/provider/volume_resource.go index 567cccb..63a1fdb 100644 --- a/internal/provider/volume_resource.go +++ b/internal/provider/volume_resource.go @@ -93,7 +93,7 @@ func (r *VolumeResource) Schema(ctx context.Context, req resource.SchemaRequest, stringplanmodifier.RequiresReplace(), }, Validators: []validator.String{ - stringvalidator.OneOf(sliceStringify(genesiscloud.AllComputeV1Regions)...), + stringvalidator.OneOf(sliceStringify(genesiscloud.AllRegions)...), }, }), "size": resourceenhancer.Attribute(ctx, schema.Int64Attribute{ @@ -113,6 +113,16 @@ func (r *VolumeResource) Schema(ctx context.Context, req resource.SchemaRequest, stringplanmodifier.UseStateForUnknown(), // immutable }, }), + "type": resourceenhancer.Attribute(ctx, schema.StringAttribute{ + MarkdownDescription: "The storage type of the volume.", + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.RequiresReplace(), + }, + Validators: []validator.String{ + stringvalidator.OneOf(sliceStringify(genesiscloud.AllVolumeTypes)...), + }, + }), // Internal "retain_on_delete": resourceenhancer.Attribute(ctx, schema.BoolAttribute{ @@ -147,10 +157,11 @@ func (r *VolumeResource) Create(ctx context.Context, req resource.CreateRequest, body := genesiscloud.CreateVolumeJSONRequestBody{} - body.Description = data.Description.ValueString() + body.Description = pointer(data.Description.ValueString()) body.Name = data.Name.ValueString() - body.Region = pointer(genesiscloud.ComputeV1Region(data.Region.ValueString())) + body.Region = genesiscloud.Region(data.Region.ValueString()) body.Size = int(data.Size.ValueInt64()) + body.Type = pointer(genesiscloud.VolumeType(data.Type.ValueString())) response, err := r.client.CreateVolumeWithResponse(ctx, body) if err != nil { @@ -292,8 +303,8 @@ func (r *VolumeResource) Update(ctx context.Context, req resource.UpdateRequest, body := genesiscloud.UpdateVolumeJSONRequestBody{} - body.Name = data.Name.ValueString() - body.Description = data.Description.ValueString() + body.Name = pointer(data.Name.ValueString()) + body.Description = pointer(data.Description.ValueString()) volumeId := data.Id.ValueString() diff --git a/internal/provider/volume_types.go b/internal/provider/volume_types.go index 5091ac2..94348fc 100644 --- a/internal/provider/volume_types.go +++ b/internal/provider/volume_types.go @@ -29,9 +29,12 @@ type VolumeModel struct { // Status The volume status. Status types.String `tfsdk:"status"` + + // Type The storage type of the volume. + Type types.String `tfsdk:"type"` } -func (data *VolumeModel) PopulateFromClientResponse(ctx context.Context, volume *genesiscloud.ComputeV1Volume) (diag diag.Diagnostics) { +func (data *VolumeModel) PopulateFromClientResponse(ctx context.Context, volume *genesiscloud.Volume) (diag diag.Diagnostics) { data.CreatedAt = types.StringValue(volume.CreatedAt.Format(time.RFC3339)) data.Description = types.StringValue(volume.Description) data.Id = types.StringValue(volume.Id) @@ -39,6 +42,7 @@ func (data *VolumeModel) PopulateFromClientResponse(ctx context.Context, volume data.Region = types.StringValue(string(volume.Region)) data.Size = types.Int64Value(int64(volume.Size)) data.Status = types.StringValue(string(volume.Status)) + data.Type = types.StringValue(string(volume.Type)) return }