diff --git a/go.mod b/go.mod index c30b640a..1044aa08 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,8 @@ module github.com/orange-cloudavenue/terraform-provider-cloudavenue -go 1.22 +go 1.22.0 -toolchain go1.22.5 +toolchain go1.23.1 require ( github.com/FrangipaneTeam/terraform-analytic-tool v0.0.12 @@ -24,7 +24,7 @@ require ( github.com/hashicorp/terraform-plugin-sdk/v2 v2.34.0 github.com/iancoleman/strcase v0.3.0 github.com/kr/pretty v0.3.1 - github.com/orange-cloudavenue/cloudavenue-sdk-go v0.11.1 + github.com/orange-cloudavenue/cloudavenue-sdk-go v0.12.0 github.com/orange-cloudavenue/common-go/utils v0.0.0-20240119163616-66b473d92339 github.com/orange-cloudavenue/infrapi-sdk-go v0.1.4-0.20231005074857-89878ea119fb github.com/rs/zerolog v1.33.0 @@ -59,7 +59,7 @@ require ( github.com/go-chi/chi v4.1.2+incompatible // indirect github.com/go-chi/render v1.0.3 // indirect github.com/go-redis/redis/v8 v8.11.5 // indirect - github.com/go-resty/resty/v2 v2.14.0 // indirect + github.com/go-resty/resty/v2 v2.15.0 // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/hashicorp/cli v1.1.6 // indirect @@ -85,7 +85,6 @@ require ( github.com/influxdata/influxdb-client-go/v2 v2.12.3 // indirect github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect - github.com/k0kubun/pp v3.0.1+incompatible // indirect github.com/kr/text v0.2.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect @@ -112,7 +111,7 @@ require ( github.com/zclconf/go-cty v1.14.4 // indirect go.abhg.dev/goldmark/frontmatter v0.2.0 // indirect golang.org/x/crypto v0.26.0 // indirect - golang.org/x/mod v0.20.0 // indirect + golang.org/x/mod v0.21.0 // indirect golang.org/x/oauth2 v0.17.0 // indirect golang.org/x/sync v0.8.0 // indirect golang.org/x/sys v0.23.0 // indirect @@ -126,5 +125,3 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect sigs.k8s.io/yaml v1.4.0 // indirect ) - -replace github.com/orange-cloudavenue/cloudavenue-sdk-go => /Users/micheneaudavid/go/src/github.com/orange-cloudavenue/cloudavenue-sdk-go diff --git a/go.sum b/go.sum index b512843d..6958b21d 100644 --- a/go.sum +++ b/go.sum @@ -95,8 +95,8 @@ github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34 github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= -github.com/go-resty/resty/v2 v2.14.0 h1:/rhkzsAqGQkozwfKS5aFAbb6TyKd3zyFRWcdRXLPCAU= -github.com/go-resty/resty/v2 v2.14.0/go.mod h1:IW6mekUOsElt9C7oWr0XRt9BNSD6D5rr9mhk6NjmNHg= +github.com/go-resty/resty/v2 v2.15.0 h1:clPQLZ2x9h4yGY81IzpMPnty+xoGyFaDg0XMkCsHf90= +github.com/go-resty/resty/v2 v2.15.0/go.mod h1:0fHAoK7JoBy/Ch36N8VFeMsK7xQOHhvWaC3iOktwmIU= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= @@ -197,10 +197,6 @@ github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9Y github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= -github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88 h1:uC1QfSlInpQF+M0ao65imhwqKnz3Q2z/d8PWZRMQvDM= -github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= -github.com/k0kubun/pp v3.0.1+incompatible h1:3tqvf7QgUnZ5tXO6pNAZlrvHgl6DvifjDrd9g2S9Z40= -github.com/k0kubun/pp v3.0.1+incompatible/go.mod h1:GWse8YhT0p8pT4ir3ZgBbfZild3tgzSScAn6HmfYukg= github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= @@ -254,6 +250,8 @@ github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= +github.com/orange-cloudavenue/cloudavenue-sdk-go v0.12.0 h1:7Sr4vhlbxU3uu3aKDCa+m9ebXzCq73wNjE3KBx9sSd0= +github.com/orange-cloudavenue/cloudavenue-sdk-go v0.12.0/go.mod h1:6ybGMCq1vVjPNgxXFK0lD1vCrvAUyXMP66VKGNOLXs0= github.com/orange-cloudavenue/common-go/utils v0.0.0-20240119163616-66b473d92339 h1:DEKcWLGbEhu/I6kn9NAXhVCFrbPhR+Ef7oLmpLVnnPM= github.com/orange-cloudavenue/common-go/utils v0.0.0-20240119163616-66b473d92339/go.mod h1:11JAFfGWVmhoT4AAORKsIC5M6nI+uDGSEOScMzavgPA= github.com/orange-cloudavenue/infrapi-sdk-go v0.1.4-0.20231005074857-89878ea119fb h1:1/Wc21Tp9RnDOUTjKBm9x3wi+UgUkDc2bv0fHJc5f2o= @@ -333,21 +331,13 @@ golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= -golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= -golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= -golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= golang.org/x/exp v0.0.0-20240119083558-1b970713d09a h1:Q8/wZp0KX97QFTc2ywcOE0YRjZPVIx+MXInMzdvQqcA= golang.org/x/exp v0.0.0-20240119083558-1b970713d09a/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= -golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= +golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -356,12 +346,6 @@ golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= -golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= -golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/oauth2 v0.17.0 h1:6m3ZPmLEFdVxKKWnKq4VqZ60gutO35zm+zrAHVmHyDQ= @@ -369,10 +353,6 @@ golang.org/x/oauth2 v0.17.0/go.mod h1:OzPDGQiuQMguemayvdylqddI7qcD9lnSDb+1FiwQ5H golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -394,26 +374,14 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/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.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM= golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= -golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= -golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= -golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4= 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= @@ -421,12 +389,6 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -437,8 +399,6 @@ golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/internal/provider/bms/bms_datasource.go b/internal/provider/bms/bms_datasource.go index 2ebacee3..390bbcdd 100644 --- a/internal/provider/bms/bms_datasource.go +++ b/internal/provider/bms/bms_datasource.go @@ -22,12 +22,12 @@ func NewBMSDataSource() datasource.DataSource { return &BMSDataSource{} } -type BMSDataSource struct { +type BMSDataSource struct { //nolint: revive client *client.CloudAvenue } // Init Initializes the data source. -func (d *BMSDataSource) Init(ctx context.Context, dm *BMSModelDatasource) (diags diag.Diagnostics) { +func (d *BMSDataSource) Init(ctx context.Context, dm *bmsModelDatasource) (diags diag.Diagnostics) { return } @@ -59,7 +59,7 @@ func (d *BMSDataSource) Configure(ctx context.Context, req datasource.ConfigureR func (d *BMSDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { defer metrics.New("data.cloudavenue_bms", d.client.GetOrgName(), metrics.Read)() - config := &BMSModelDatasource{} + config := &bmsModelDatasource{} // Read Terraform configuration data into the model resp.Diagnostics.Append(req.Config.Get(ctx, config)...) @@ -124,8 +124,6 @@ func (d *BMSDataSource) Read(ctx context.Context, req datasource.ReadRequest, re // Set ID config.ID.Set(d.client.GetOrgName()) - // // Append data - // data = append(data, config) // Save data into Terraform state resp.Diagnostics.Append(resp.State.Set(ctx, &config)...) diff --git a/internal/provider/bms/bms_schema.go b/internal/provider/bms/bms_schema.go index e2ca55ab..d6200d9f 100644 --- a/internal/provider/bms/bms_schema.go +++ b/internal/provider/bms/bms_schema.go @@ -100,8 +100,8 @@ func bmsSchema(_ context.Context) superschema.Schema { MarkdownDescription: "The storage of the BMS.", }, Attributes: superschema.Attributes{ - "local": superschema.SuperSingleNestedAttributeOf[bmsModelDatasourceBMSStorageGen]{ - DataSource: &schemaD.SingleNestedAttribute{ + "local": superschema.SuperListNestedAttributeOf[bmsModelDatasourceBMSStorageGen]{ + DataSource: &schemaD.ListNestedAttribute{ Computed: true, MarkdownDescription: "The local storage of the BMS.", }, @@ -120,8 +120,8 @@ func bmsSchema(_ context.Context) superschema.Schema { }, }, }, - "system": superschema.SuperSingleNestedAttributeOf[bmsModelDatasourceBMSStorageGen]{ - DataSource: &schemaD.SingleNestedAttribute{ + "system": superschema.SuperListNestedAttributeOf[bmsModelDatasourceBMSStorageGen]{ + DataSource: &schemaD.ListNestedAttribute{ Computed: true, MarkdownDescription: "The system storage of the BMS.", }, @@ -140,8 +140,8 @@ func bmsSchema(_ context.Context) superschema.Schema { }, }, }, - "data": superschema.SuperSingleNestedAttributeOf[bmsModelDatasourceBMSStorageGen]{ - DataSource: &schemaD.SingleNestedAttribute{ + "data": superschema.SuperListNestedAttributeOf[bmsModelDatasourceBMSStorageGen]{ + DataSource: &schemaD.ListNestedAttribute{ Computed: true, MarkdownDescription: "The data storage of the BMS.", }, @@ -160,8 +160,8 @@ func bmsSchema(_ context.Context) superschema.Schema { }, }, }, - "shared": superschema.SuperSingleNestedAttributeOf[bmsModelDatasourceBMSStorageGen]{ - DataSource: &schemaD.SingleNestedAttribute{ + "shared": superschema.SuperListNestedAttributeOf[bmsModelDatasourceBMSStorageGen]{ + DataSource: &schemaD.ListNestedAttribute{ Computed: true, MarkdownDescription: "The shared storage of the BMS.", }, diff --git a/internal/provider/bms/bms_types.go b/internal/provider/bms/bms_types.go index 6e3273ac..4b2d186b 100644 --- a/internal/provider/bms/bms_types.go +++ b/internal/provider/bms/bms_types.go @@ -12,7 +12,7 @@ import ( ) type ( - BMSModelDatasource struct { + bmsModelDatasource struct { ID supertypes.StringValue `tfsdk:"id"` Timeouts timeoutsD.Value `tfsdk:"timeouts"` Env supertypes.SetNestedObjectValueOf[bmsModelDatasourceEnv] `tfsdk:"env"` @@ -38,10 +38,10 @@ type ( } bmsModelDatasourceBMSStorage struct { - Local supertypes.SingleNestedObjectValueOf[bmsModelDatasourceBMSStorageGen] `tfsdk:"local"` - System supertypes.SingleNestedObjectValueOf[bmsModelDatasourceBMSStorageGen] `tfsdk:"system"` - Data supertypes.SingleNestedObjectValueOf[bmsModelDatasourceBMSStorageGen] `tfsdk:"data"` - Shared supertypes.SingleNestedObjectValueOf[bmsModelDatasourceBMSStorageGen] `tfsdk:"shared"` + Local supertypes.ListNestedObjectValueOf[bmsModelDatasourceBMSStorageGen] `tfsdk:"local"` + System supertypes.ListNestedObjectValueOf[bmsModelDatasourceBMSStorageGen] `tfsdk:"system"` + Data supertypes.ListNestedObjectValueOf[bmsModelDatasourceBMSStorageGen] `tfsdk:"data"` + Shared supertypes.ListNestedObjectValueOf[bmsModelDatasourceBMSStorageGen] `tfsdk:"shared"` } bmsModelDatasourceBMSStorageGen struct { @@ -51,17 +51,21 @@ type ( ) // NewbmsModelDatasource returns a new bmsModelDatasource. -func NewbmsModelDatasource() *BMSModelDatasource { - return &BMSModelDatasource{} +func NewBMSModelDatasource(ctx context.Context) *bmsModelDatasource { + return &bmsModelDatasource{ + ID: supertypes.NewStringNull(), + Timeouts: timeoutsD.Value{}, + Env: supertypes.NewSetNestedObjectValueOfNull[bmsModelDatasourceEnv](ctx), + } } // SetID sets the ID. -func (m *BMSModelDatasource) SetID(id *string) { +func (m *bmsModelDatasource) SetID(id *string) { m.ID.Set(*id) } // SetNetwork sets the Network of BMS listed. -func (m *BMSModelDatasource) SetNetwork(ctx context.Context, bms *v1.BMS) (net []*bmsModelDatasourceNetwork, err error) { +func (m *bmsModelDatasource) SetNetwork(ctx context.Context, bms *v1.BMS) (net []*bmsModelDatasourceNetwork, err error) { networks := bms.GetNetworks() if len(networks) == 0 { return make([]*bmsModelDatasourceNetwork, 0), nil @@ -78,8 +82,8 @@ func (m *BMSModelDatasource) SetNetwork(ctx context.Context, bms *v1.BMS) (net [ } // SetBMS sets the BMS information. -func (m *BMSModelDatasource) SetBMS(ctx context.Context, bms *v1.BMS) (bmsList []*bmsModelDatasourceBMS, err error) { - bmsDetails := bms.GetBMSDetails() +func (m *bmsModelDatasource) SetBMS(ctx context.Context, bms *v1.BMS) (bmsList []*bmsModelDatasourceBMS, err error) { + bmsDetails := bms.GetBMS() if len(bmsDetails) == 0 { return make([]*bmsModelDatasourceBMS, 0), nil } @@ -89,7 +93,7 @@ func (m *BMSModelDatasource) SetBMS(ctx context.Context, bms *v1.BMS) (bmsList [ x.BMSType.Set(bms.BMSType) x.OS.Set(bms.OS) x.BiosConfiguration.Set(bms.BiosConfiguration) - x.Storage.Set(ctx, setStorage(ctx, bms.GetBMSStorage())) + x.Storage.Set(ctx, setStorage(ctx, bms.GetStorages())) bmsList = append(bmsList, x) } return bmsList, nil @@ -105,16 +109,23 @@ func setStorage(ctx context.Context, storages v1.BMSStorage) (storage *bmsModelD return } -func setStorageDetail(storage v1.BMSStorageDetail) (storageDetail *bmsModelDatasourceBMSStorageGen) { - storageDetail = &bmsModelDatasourceBMSStorageGen{} - storageDetail.Size.Set(storage.Size) - storageDetail.StorageClass.Set(storage.StorageClass) +func setStorageDetail(storage []v1.BMSStorageDetail) (storageDetail []*bmsModelDatasourceBMSStorageGen) { + if len(storage) == 0 { + return + } + // for each storage detail, set the size and storage class + for _, stor := range storage { + x := &bmsModelDatasourceBMSStorageGen{} + x.Size.Set(stor.GetSize()) + x.StorageClass.Set(stor.GetStorageClass()) + storageDetail = append(storageDetail, x) + } return } // Copy returns a new bmsModelDatasource. -func (m *BMSModelDatasource) Copy() any { - x := &BMSModelDatasource{} +func (m *bmsModelDatasource) Copy() any { + x := &bmsModelDatasource{} utils.ModelCopy(m, x) return x } @@ -126,33 +137,3 @@ func newBMSModelDatasourceEnv(ctx context.Context) *bmsModelDatasourceEnv { BMS: supertypes.NewSetNestedObjectValueOfNull[bmsModelDatasourceBMS](ctx), } } - -// New bmsModelDatasourceNetwork returns a new bmsModelDatasourceNetwork. -func newBMSModelDatasourceNetwork() *bmsModelDatasourceNetwork { - return &bmsModelDatasourceNetwork{ - VLANID: supertypes.NewStringNull(), - Subnet: supertypes.NewStringNull(), - Prefix: supertypes.NewStringNull(), - } -} - -// New bmsModelDatasourceBMS returns a new bmsModelDatasourceBMS. -func newBMSModelDatasourceBMS(ctx context.Context) *bmsModelDatasourceBMS { - return &bmsModelDatasourceBMS{ - Hostname: supertypes.NewStringNull(), - BMSType: supertypes.NewStringNull(), - OS: supertypes.NewStringNull(), - BiosConfiguration: supertypes.NewStringNull(), - Storage: supertypes.NewSingleNestedObjectValueOfNull[bmsModelDatasourceBMSStorage](ctx), - } -} - -// New bmsModelDatasourceBMSStorage returns a new bmsModelDatasourceBMSStorage. -func newBMSModelDatasourceBMSStorage(ctx context.Context) *bmsModelDatasourceBMSStorage { - return &bmsModelDatasourceBMSStorage{ - Local: supertypes.NewSingleNestedObjectValueOfNull[bmsModelDatasourceBMSStorageGen](ctx), - System: supertypes.NewSingleNestedObjectValueOfNull[bmsModelDatasourceBMSStorageGen](ctx), - Data: supertypes.NewSingleNestedObjectValueOfNull[bmsModelDatasourceBMSStorageGen](ctx), - Shared: supertypes.NewSingleNestedObjectValueOfNull[bmsModelDatasourceBMSStorageGen](ctx), - } -}