diff --git a/Makefile b/Makefile index 09b8054..4b8673e 100644 --- a/Makefile +++ b/Makefile @@ -5,19 +5,27 @@ build: go build ./... +build-experimental: + go build -tags experimental ./... + install: go install ./... +install-experimental: + go install -tags experimental ./... + test: go test ./... +testacc: + go install -tags experimental ./cmd/... + env TF_ACC=1 go test -v ./test/... + +testacc-simulation: + go install -tags experimental,simulation ./cmd/... + env TF_ACC=1 go test -v -tags simulation ./test/... + lint: @golangci-lint --version # Will use .golangci.yml golangci-lint run - -build-experimental: - go build -tags experimental ./... - -install-experimental: - go install -tags experimental ./... diff --git a/go.mod b/go.mod index a812304..a56e07b 100644 --- a/go.mod +++ b/go.mod @@ -4,10 +4,12 @@ go 1.22.3 require ( github.com/google/uuid v1.6.0 + github.com/h2non/gock v1.2.0 github.com/hashicorp/terraform-plugin-framework v1.11.0 github.com/hashicorp/terraform-plugin-framework-validators v0.13.0 github.com/hashicorp/terraform-plugin-go v0.23.0 github.com/hashicorp/terraform-plugin-log v0.9.0 + github.com/hashicorp/terraform-plugin-testing v1.10.0 github.com/microsoft/kiota-abstractions-go v1.6.1 github.com/microsoft/kiota-http-go v1.4.4 github.com/microsoft/kiota-serialization-form-go v1.0.0 @@ -17,33 +19,63 @@ require ( ) require ( + github.com/ProtonMail/go-crypto v1.1.0-alpha.2 // indirect + github.com/agext/levenshtein v1.2.2 // indirect + github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect github.com/cjlapao/common-go v0.0.39 // indirect + github.com/cloudflare/circl v1.3.7 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/fatih/color v1.13.0 // indirect + github.com/fatih/color v1.16.0 // indirect github.com/go-logr/logr v1.4.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/golang/protobuf v1.5.4 // indirect - github.com/hashicorp/go-hclog v1.5.0 // indirect + github.com/google/go-cmp v0.6.0 // indirect + github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 // indirect + github.com/hashicorp/errwrap v1.0.0 // indirect + github.com/hashicorp/go-checkpoint v0.5.0 // indirect + github.com/hashicorp/go-cleanhttp v0.5.2 // indirect + github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 // indirect + github.com/hashicorp/go-hclog v1.6.3 // indirect + github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-plugin v1.6.0 // indirect + github.com/hashicorp/go-retryablehttp v0.7.7 // indirect github.com/hashicorp/go-uuid v1.0.3 // indirect + github.com/hashicorp/go-version v1.7.0 // indirect + github.com/hashicorp/hc-install v0.8.0 // indirect + github.com/hashicorp/hcl/v2 v2.21.0 // indirect + github.com/hashicorp/logutils v1.0.0 // indirect + github.com/hashicorp/terraform-exec v0.21.0 // indirect + github.com/hashicorp/terraform-json v0.22.1 // indirect + github.com/hashicorp/terraform-plugin-sdk/v2 v2.34.0 // indirect github.com/hashicorp/terraform-registry-address v0.2.3 // indirect github.com/hashicorp/terraform-svchost v0.1.1 // indirect github.com/hashicorp/yamux v0.1.1 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.16 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect + 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/oklog/run v1.0.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/std-uritemplate/std-uritemplate/go v0.0.57 // indirect github.com/stretchr/testify v1.9.0 // indirect + github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect + github.com/zclconf/go-cty v1.15.0 // indirect go.opentelemetry.io/otel v1.24.0 // indirect go.opentelemetry.io/otel/metric v1.24.0 // indirect go.opentelemetry.io/otel/trace v1.24.0 // indirect - golang.org/x/net v0.23.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/text v0.14.0 // indirect + golang.org/x/crypto v0.26.0 // indirect + golang.org/x/mod v0.19.0 // indirect + golang.org/x/net v0.25.0 // indirect + golang.org/x/sync v0.8.0 // indirect + golang.org/x/sys v0.23.0 // indirect + golang.org/x/text v0.17.0 // indirect + golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect + google.golang.org/appengine v1.6.8 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de // indirect google.golang.org/grpc v1.63.2 // indirect google.golang.org/protobuf v1.34.0 // indirect diff --git a/go.sum b/go.sum index 1a761fe..0d6ead9 100644 --- a/go.sum +++ b/go.sum @@ -1,29 +1,92 @@ +dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= +dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= +github.com/ProtonMail/go-crypto v1.1.0-alpha.2 h1:bkyFVUP+ROOARdgCiJzNQo2V2kiB97LyUpzH9P6Hrlg= +github.com/ProtonMail/go-crypto v1.1.0-alpha.2/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE= +github.com/agext/levenshtein v1.2.2 h1:0S/Yg6LYmFJ5stwQeRp6EeOcCbj7xiqQSdNelsXvaqE= +github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= +github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= +github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew1u1fNQOlOtuGxQY= +github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4= github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= github.com/cjlapao/common-go v0.0.39 h1:bAAUrj2B9v0kMzbAOhzjSmiyDy+rd56r2sy7oEiQLlA= github.com/cjlapao/common-go v0.0.39/go.mod h1:M3dzazLjTjEtZJbbxoA5ZDiGCiHmpwqW9l4UWaddwOA= +github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= +github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= +github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= +github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= 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/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= +github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= +github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= +github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= +github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= +github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= +github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU= +github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow= +github.com/go-git/go-git/v5 v5.12.0 h1:7Md+ndsjrzZxbddRDZjF14qK+NN56sy6wkqaVrjZtys= +github.com/go-git/go-git/v5 v5.12.0/go.mod h1:FTM9VKtnI2m65hNI/TenDDDnUf2Q9FHnXYjuz9i5OEY= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +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= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= -github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/h2non/gock v1.2.0 h1:K6ol8rfrRkUOefooBC8elXoaNGYkpp7y2qcxGG6BzUE= +github.com/h2non/gock v1.2.0/go.mod h1:tNhoxHYW2W42cYkYb1WqzdbYIieALC99kpYr7rH/BQk= +github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 h1:2VTzZjLZBgl62/EtslCrtky5vbi9dd7HrQPQIx6wqiw= +github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI= +github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-checkpoint v0.5.0 h1:MFYpPZCnQqQTE18jFwSII6eUQrD/oxMFp3mlgcqk5mU= +github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuDrwkBuEQsVcpCOgg= +github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= +github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= +github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 h1:1/D3zfFHttUKaCaGKZ/dR2roBXv0vKbSCnssIldfQdI= +github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320/go.mod h1:EiZBMaudVLy8fmjf9Npq1dq9RalhveqZG5w/yz3mHWs= +github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k= +github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= +github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-plugin v1.6.0 h1:wgd4KxHJTVGGqWBq4QPB1i5BZNEx9BR8+OFmHDmTk8A= github.com/hashicorp/go-plugin v1.6.0/go.mod h1:lBS5MtSSBZk0SHc66KACcjjlU6WzEVP/8pwz68aMkCI= +github.com/hashicorp/go-retryablehttp v0.7.7 h1:C8hUCYzor8PIfXHa4UrZkU4VvK8o9ISHxT2Q8+VepXU= +github.com/hashicorp/go-retryablehttp v0.7.7/go.mod h1:pkQpWZeYWskR+D1tR2O5OcBFOxfA7DoAO6xtkuQnHTk= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= +github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/hc-install v0.8.0 h1:LdpZeXkZYMQhoKPCecJHlKvUkQFixN/nvyR1CdfOLjI= +github.com/hashicorp/hc-install v0.8.0/go.mod h1:+MwJYjDfCruSD/udvBmRB22Nlkwwkwf5sAB6uTIhSaU= +github.com/hashicorp/hcl/v2 v2.21.0 h1:lve4q/o/2rqwYOgUg3y3V2YPyD1/zkCLGjIV74Jit14= +github.com/hashicorp/hcl/v2 v2.21.0/go.mod h1:62ZYHrXgPoX8xBnzl8QzbWq4dyDsDtfCRgIq1rbJEvA= +github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/terraform-exec v0.21.0 h1:uNkLAe95ey5Uux6KJdua6+cv8asgILFVWkd/RG0D2XQ= +github.com/hashicorp/terraform-exec v0.21.0/go.mod h1:1PPeMYou+KDUSSeRE9szMZ/oHf4fYUmB923Wzbq1ICg= +github.com/hashicorp/terraform-json v0.22.1 h1:xft84GZR0QzjPVWs4lRUwvTcPnegqlyS7orfb5Ltvec= +github.com/hashicorp/terraform-json v0.22.1/go.mod h1:JbWSQCLFSXFFhg42T7l9iJwdGXBYV8fmmD6o/ML4p3A= github.com/hashicorp/terraform-plugin-framework v1.11.0 h1:M7+9zBArexHFXDx/pKTxjE6n/2UCXY6b8FIq9ZYhwfE= github.com/hashicorp/terraform-plugin-framework v1.11.0/go.mod h1:qBXLDn69kM97NNVi/MQ9qgd1uWWsVftGSnygYG1tImM= github.com/hashicorp/terraform-plugin-framework-validators v0.13.0 h1:bxZfGo9DIUoLLtHMElsu+zwqI4IsMZQBRRy4iLzZJ8E= @@ -32,16 +95,26 @@ github.com/hashicorp/terraform-plugin-go v0.23.0 h1:AALVuU1gD1kPb48aPQUjug9Ir/12 github.com/hashicorp/terraform-plugin-go v0.23.0/go.mod h1:1E3Cr9h2vMlahWMbsSEcNrOCxovCZhOOIXjFHbjc/lQ= github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9TFvymaRGZED3FCV0= github.com/hashicorp/terraform-plugin-log v0.9.0/go.mod h1:rKL8egZQ/eXSyDqzLUuwUYLVdlYeamldAHSxjUFADow= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.34.0 h1:kJiWGx2kiQVo97Y5IOGR4EMcZ8DtMswHhUuFibsCQQE= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.34.0/go.mod h1:sl/UoabMc37HA6ICVMmGO+/0wofkVIRxf+BMb/dnoIg= +github.com/hashicorp/terraform-plugin-testing v1.10.0 h1:2+tmRNhvnfE4Bs8rB6v58S/VpqzGC6RCh9Y8ujdn+aw= +github.com/hashicorp/terraform-plugin-testing v1.10.0/go.mod h1:iWRW3+loP33WMch2P/TEyCxxct/ZEcCGMquSLSCVsrc= github.com/hashicorp/terraform-registry-address v0.2.3 h1:2TAiKJ1A3MAkZlH1YI/aTVcLZRu7JseiXNRHbOAyoTI= github.com/hashicorp/terraform-registry-address v0.2.3/go.mod h1:lFHA76T8jfQteVfT7caREqguFrW3c4MFSPhZB7HHgUM= github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S52uzrw4x0jKQ= github.com/hashicorp/terraform-svchost v0.1.1/go.mod h1:mNsjQfZyf/Jhz35v6/0LWcv26+X7JPS+buii2c9/ctc= github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= +github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= +github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= +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 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= @@ -50,8 +123,9 @@ github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxec github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/microsoft/kiota-abstractions-go v1.6.1 h1:NXK50S3BwJn9Wj6bO0YFuAig7y2WVgdQ/ie1ktMl2J4= github.com/microsoft/kiota-abstractions-go v1.6.1/go.mod h1:FI1I2OHg0E7bK5t8DPnw+9C/CHVyLP6XeqDBT+95pTE= github.com/microsoft/kiota-http-go v1.4.4 h1:HM0KT/Q7o+JsGatFkkbTIqJL24Jzo5eMI5NNe9N4TQ4= @@ -64,48 +138,117 @@ github.com/microsoft/kiota-serialization-multipart-go v1.0.0 h1:3O5sb5Zj+moLBiJy github.com/microsoft/kiota-serialization-multipart-go v1.0.0/go.mod h1:yauLeBTpANk4L03XD985akNysG24SnRJGaveZf+p4so= github.com/microsoft/kiota-serialization-text-go v1.0.0 h1:XOaRhAXy+g8ZVpcq7x7a0jlETWnWrEum0RhmbYrTFnA= github.com/microsoft/kiota-serialization-text-go v1.0.0/go.mod h1:sM1/C6ecnQ7IquQOGUrUldaO5wj+9+v7G2W3sQ3fy6M= +github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= +github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= +github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4= +github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= +github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32 h1:W6apQkHrMkS0Muv8G/TipAy/FJl/rCYT0+EuS8+Z0z4= +github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms= github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= +github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= +github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8= +github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4= +github.com/skeema/knownhosts v1.2.2 h1:Iug2P4fLmDw9f41PB6thxUkNUkJzB5i+1/exaj40L3A= +github.com/skeema/knownhosts v1.2.2/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo= github.com/std-uritemplate/std-uritemplate/go v0.0.57 h1:GHGjptrsmazP4IVDlUprssiEf9ESVkbjx15xQXXzvq4= github.com/std-uritemplate/std-uritemplate/go v0.0.57/go.mod h1:rG/bqh/ThY4xE5de7Rap3vaDkYUT76B0GPJ0loYeTTc= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +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= github.com/vmihailenco/msgpack/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IUPn0Bjt8= github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok= github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= +github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= +github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/zclconf/go-cty v1.15.0 h1:tTCRWxsexYUmtt/wVxgDClUe+uQusuI443uL6e+5sXQ= +github.com/zclconf/go-cty v1.15.0/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= +github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940 h1:4r45xpDWB6ZMSMNJFMOjqrGHynW3DIBuR2H9j0ug+Mo= +github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940/go.mod h1:CmBdvvj3nqzfzJ6nTCIwDTPZ56aVGvDrmztiO5g3qrM= go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI= go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco= go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI= go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= -golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= -golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +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/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= +golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +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-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.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= +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.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= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +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-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +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.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +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/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/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.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= +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/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/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.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= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= +google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de h1:cZGRis4/ot9uVm639a+rHCUaG0JJHEsdyzSQTMX+suY= google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.34.0 h1:Qo/qEd2RZPCf2nKuorzksSknv0d3ERwp1vFG38gSmH4= google.golang.org/protobuf v1.34.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= +gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/internal/resources/datastore/simulation.go b/internal/resources/datastore/simulation.go new file mode 100644 index 0000000..ea39946 --- /dev/null +++ b/internal/resources/datastore/simulation.go @@ -0,0 +1,12 @@ +// (C) Copyright 2024 Hewlett Packard Enterprise Development LP +//go:build simulation + +package datastore + +import ( + "github.com/HewlettPackard/hpegl-pcbe-terraform-resources/internal/simulator" +) + +func init() { + simulator.Datastore() +} diff --git a/internal/simulator/datastore.go b/internal/simulator/datastore.go new file mode 100644 index 0000000..18384cc --- /dev/null +++ b/internal/simulator/datastore.go @@ -0,0 +1,8 @@ +// (C) Copyright 2024 Hewlett Packard Enterprise Development LP + +package simulator + +func Datastore() { + datastoreCreate() + datastoreDelete() +} diff --git a/internal/simulator/datastore_create.go b/internal/simulator/datastore_create.go new file mode 100644 index 0000000..0832ba7 --- /dev/null +++ b/internal/simulator/datastore_create.go @@ -0,0 +1,89 @@ +// (C) Copyright 2024 Hewlett Packard Enterprise Development LP + +package simulator + +import ( + _ "embed" + + "github.com/h2non/gock" +) + +// Note: Using embed means that fixtures are included +// in the test binary. This means they are available +// when running acceptance tests in "simulator" mode. + +//go:embed fixtures/datastores/create/async1.json +var dsAsync1 string + +//go:embed fixtures/datastores/create/async2.json +var dsAsync2 string + +//go:embed fixtures/datastores/create/async3.json +var dsAsync3 string + +//go:embed fixtures/datastores/create/async4.json +var dsAsync4 string + +//go:embed fixtures/datastores/create/async5.json +var dsAsync5 string + +//go:embed fixtures/datastores/create/filter.json +var dsFilter string + +//go:embed fixtures/datastores/create/get.json +var dsDet string + +func datastoreCreate() { + taskID := "be55685c-f84f-4ad5-a3d1-2d7692ed47b1" + datastoreID := "698de955-87b5-5fe6-b683-78c3948beede" + datastoreName := "mclaren-ds19" + + gock.New("http://localhost"). + Post("/virtualization/v1beta1/datastore"). + Reply(202). + SetHeader("Location", "/data-services/v1beta1/async-operations/"+taskID) + + gock.New("http://localhost"). + Get("/data-services/v1beta1/async-operations/"+taskID). + Reply(200). + SetHeader("Content-Type", "application/json"). + BodyString(dsAsync1) + + gock.New("http://localhost"). + Get("/data-services/v1beta1/async-operations/"+taskID). + Reply(200). + SetHeader("Content-Type", "application/json"). + BodyString(dsAsync2) + + gock.New("http://localhost"). + Get("/data-services/v1beta1/async-operations/"+taskID). + Reply(200). + SetHeader("Content-Type", "application/json"). + BodyString(dsAsync3) + + gock.New("http://localhost"). + Get("/data-services/v1beta1/async-operations/"+taskID). + Reply(200). + SetHeader("Content-Type", "application/json"). + BodyString(dsAsync4) + + gock.New("http://localhost"). + Get("/data-services/v1beta1/async-operations/"+taskID). + Reply(200). + SetHeader("Content-Type", "application/json"). + BodyString(dsAsync5) + + gock.New("http://localhost"). + Get("/virtualization/v1beta1/datastores"). + // MatchParam("filter", "name eq "+datastoreName). + MatchParam("filter", "name eq "+datastoreName). + Reply(200). + SetHeader("Content-Type", "application/json"). + BodyString(dsFilter) + + gock.New("http://localhost"). + Get("/virtualization/v1beta1/datastores/"+datastoreID). + Reply(200). + SetHeader("Content-Type", "application/json"). + BodyString(dsDet) +} diff --git a/internal/simulator/datastore_delete.go b/internal/simulator/datastore_delete.go new file mode 100644 index 0000000..1cf73f2 --- /dev/null +++ b/internal/simulator/datastore_delete.go @@ -0,0 +1,64 @@ +// (C) Copyright 2024 Hewlett Packard Enterprise Development LP + +package simulator + +import ( + _ "embed" + + "github.com/h2non/gock" +) + +// Note: Using embed means that fixtures are included +// in the test binary. This means they are available +// when running acceptance tests in "simulator" mode. + +//go:embed fixtures/datastores/delete/delete.json +var dsDelete string + +//go:embed fixtures/datastores/delete/async1.json +var dsDeleteAsync1 string + +//go:embed fixtures/datastores/delete/async2.json +var dsDeleteAsync2 string + +//go:embed fixtures/datastores/delete/async3.json +var dsDeleteAsync3 string + +//go:embed fixtures/datastores/delete/async4.json +var dsDeleteAsync4 string + +func datastoreDelete() { + taskID := "5a7b6b4d-8327-48ec-a5ca-98215a24bd51" + datastoreID := "698de955-87b5-5fe6-b683-78c3948beede" + + gock.New("http://localhost"). + Delete("/virtualization/v1beta1/datastores/"+datastoreID). + Reply(202). + SetHeader("Location", "/data-services/v1beta1/async-operations/"+taskID). + SetHeader("Content-Type", "application/json"). + BodyString(dsDelete) + + gock.New("http://localhost"). + Get("/data-services/v1beta1/async-operations/"+taskID). + Reply(200). + SetHeader("Content-Type", "application/json"). + BodyString(dsDeleteAsync1) + + gock.New("http://localhost"). + Get("/data-services/v1beta1/async-operations/"+taskID). + Reply(200). + SetHeader("Content-Type", "application/json"). + BodyString(dsDeleteAsync2) + + gock.New("http://localhost"). + Get("/data-services/v1beta1/async-operations/"+taskID). + Reply(200). + SetHeader("Content-Type", "application/json"). + BodyString(dsDeleteAsync3) + + gock.New("http://localhost"). + Get("/data-services/v1beta1/async-operations/"+taskID). + Reply(200). + SetHeader("Content-Type", "application/json"). + BodyString(dsDeleteAsync4) +} diff --git a/internal/simulator/fixtures/datastores/create/async1.json b/internal/simulator/fixtures/datastores/create/async1.json new file mode 100644 index 0000000..dce85aa --- /dev/null +++ b/internal/simulator/fixtures/datastores/create/async1.json @@ -0,0 +1 @@ +{"associatedResources":[],"createdAt":"2024-07-29T12:42:46.443256231Z","customerId":"bb20052ac81011ed895f7a6e2fba2c57","displayName":"Create Datastore: 'mclaren-ds19'","endedAt":null,"error":null,"estimatedRunningDurationMinutes":300,"generation":1,"groups":[{"id":"bb20052ac81011ed895f7a6e2fba2c57","name":"Default Group"}],"hasChildOperations":false,"healthStatus":"OK","id":"be55685c-f84f-4ad5-a3d1-2d7692ed47b1","logMessages":[{"message":"Create Datastore task is created","timestamp":"2024-07-29T12:42:46.44326043Z"},{"message":"Create Datastore task is running","timestamp":"2024-07-29T12:42:46.443261567Z"}],"name":"Create-Datastore: '%!s(MISSING)'mclaren-ds19","parent":null,"progressPercent":0,"recommendations":[],"resourceUri":"/data-services/v1beta1/async-operations/be55685c-f84f-4ad5-a3d1-2d7692ed47b1","rootOperation":{"id":"be55685c-f84f-4ad5-a3d1-2d7692ed47b1","name":"","resourceUri":"/data-services/v1beta1/async-operations/be55685c-f84f-4ad5-a3d1-2d7692ed47b1","type":"task"},"services":["private-cloud-business-edition"],"sourceResourceUri":null,"startedAt":"2024-07-29T12:42:46.443256695Z","state":"RUNNING","subtreeOperationCount":0,"suggestedPollingIntervalSeconds":30,"type":"task","updatedAt":"2024-07-29T12:42:46.465872829Z","userId":"stuart.mclaren@hpe.com"} diff --git a/internal/simulator/fixtures/datastores/create/async2.json b/internal/simulator/fixtures/datastores/create/async2.json new file mode 100644 index 0000000..81aa790 --- /dev/null +++ b/internal/simulator/fixtures/datastores/create/async2.json @@ -0,0 +1 @@ +{"associatedResources":[],"createdAt":"2024-07-29T12:42:46.443256231Z","customerId":"bb20052ac81011ed895f7a6e2fba2c57","displayName":"Create Datastore: 'mclaren-ds19'","endedAt":null,"error":null,"estimatedRunningDurationMinutes":300,"generation":5,"groups":[{"id":"bb20052ac81011ed895f7a6e2fba2c57","name":"Default Group"}],"hasChildOperations":true,"healthStatus":"OK","id":"be55685c-f84f-4ad5-a3d1-2d7692ed47b1","logMessages":[{"message":"Create Datastore task is created","timestamp":"2024-07-29T12:42:46.44326043Z"},{"message":"Create Datastore task is running","timestamp":"2024-07-29T12:42:46.443261567Z"},{"message":"Preparing the parameters","timestamp":"2024-07-29T12:42:47.176131397Z"},{"message":"Attempting to create the datastore","timestamp":"2024-07-29T12:42:50.15339285Z"}],"name":"Create-Datastore: '%!s(MISSING)'mclaren-ds19","parent":null,"progressPercent":70,"recommendations":[],"resourceUri":"/data-services/v1beta1/async-operations/be55685c-f84f-4ad5-a3d1-2d7692ed47b1","rootOperation":{"id":"be55685c-f84f-4ad5-a3d1-2d7692ed47b1","name":"","resourceUri":"/data-services/v1beta1/async-operations/be55685c-f84f-4ad5-a3d1-2d7692ed47b1","type":"task"},"services":["private-cloud-business-edition"],"sourceResourceUri":null,"startedAt":"2024-07-29T12:42:46.443256695Z","state":"RUNNING","subtreeOperationCount":2,"suggestedPollingIntervalSeconds":30,"type":"task","updatedAt":"2024-07-29T12:42:54.104707315Z","userId":"stuart.mclaren@hpe.com"} diff --git a/internal/simulator/fixtures/datastores/create/async3.json b/internal/simulator/fixtures/datastores/create/async3.json new file mode 100644 index 0000000..81aa790 --- /dev/null +++ b/internal/simulator/fixtures/datastores/create/async3.json @@ -0,0 +1 @@ +{"associatedResources":[],"createdAt":"2024-07-29T12:42:46.443256231Z","customerId":"bb20052ac81011ed895f7a6e2fba2c57","displayName":"Create Datastore: 'mclaren-ds19'","endedAt":null,"error":null,"estimatedRunningDurationMinutes":300,"generation":5,"groups":[{"id":"bb20052ac81011ed895f7a6e2fba2c57","name":"Default Group"}],"hasChildOperations":true,"healthStatus":"OK","id":"be55685c-f84f-4ad5-a3d1-2d7692ed47b1","logMessages":[{"message":"Create Datastore task is created","timestamp":"2024-07-29T12:42:46.44326043Z"},{"message":"Create Datastore task is running","timestamp":"2024-07-29T12:42:46.443261567Z"},{"message":"Preparing the parameters","timestamp":"2024-07-29T12:42:47.176131397Z"},{"message":"Attempting to create the datastore","timestamp":"2024-07-29T12:42:50.15339285Z"}],"name":"Create-Datastore: '%!s(MISSING)'mclaren-ds19","parent":null,"progressPercent":70,"recommendations":[],"resourceUri":"/data-services/v1beta1/async-operations/be55685c-f84f-4ad5-a3d1-2d7692ed47b1","rootOperation":{"id":"be55685c-f84f-4ad5-a3d1-2d7692ed47b1","name":"","resourceUri":"/data-services/v1beta1/async-operations/be55685c-f84f-4ad5-a3d1-2d7692ed47b1","type":"task"},"services":["private-cloud-business-edition"],"sourceResourceUri":null,"startedAt":"2024-07-29T12:42:46.443256695Z","state":"RUNNING","subtreeOperationCount":2,"suggestedPollingIntervalSeconds":30,"type":"task","updatedAt":"2024-07-29T12:42:54.104707315Z","userId":"stuart.mclaren@hpe.com"} diff --git a/internal/simulator/fixtures/datastores/create/async4.json b/internal/simulator/fixtures/datastores/create/async4.json new file mode 100644 index 0000000..81aa790 --- /dev/null +++ b/internal/simulator/fixtures/datastores/create/async4.json @@ -0,0 +1 @@ +{"associatedResources":[],"createdAt":"2024-07-29T12:42:46.443256231Z","customerId":"bb20052ac81011ed895f7a6e2fba2c57","displayName":"Create Datastore: 'mclaren-ds19'","endedAt":null,"error":null,"estimatedRunningDurationMinutes":300,"generation":5,"groups":[{"id":"bb20052ac81011ed895f7a6e2fba2c57","name":"Default Group"}],"hasChildOperations":true,"healthStatus":"OK","id":"be55685c-f84f-4ad5-a3d1-2d7692ed47b1","logMessages":[{"message":"Create Datastore task is created","timestamp":"2024-07-29T12:42:46.44326043Z"},{"message":"Create Datastore task is running","timestamp":"2024-07-29T12:42:46.443261567Z"},{"message":"Preparing the parameters","timestamp":"2024-07-29T12:42:47.176131397Z"},{"message":"Attempting to create the datastore","timestamp":"2024-07-29T12:42:50.15339285Z"}],"name":"Create-Datastore: '%!s(MISSING)'mclaren-ds19","parent":null,"progressPercent":70,"recommendations":[],"resourceUri":"/data-services/v1beta1/async-operations/be55685c-f84f-4ad5-a3d1-2d7692ed47b1","rootOperation":{"id":"be55685c-f84f-4ad5-a3d1-2d7692ed47b1","name":"","resourceUri":"/data-services/v1beta1/async-operations/be55685c-f84f-4ad5-a3d1-2d7692ed47b1","type":"task"},"services":["private-cloud-business-edition"],"sourceResourceUri":null,"startedAt":"2024-07-29T12:42:46.443256695Z","state":"RUNNING","subtreeOperationCount":2,"suggestedPollingIntervalSeconds":30,"type":"task","updatedAt":"2024-07-29T12:42:54.104707315Z","userId":"stuart.mclaren@hpe.com"} diff --git a/internal/simulator/fixtures/datastores/create/async5.json b/internal/simulator/fixtures/datastores/create/async5.json new file mode 100644 index 0000000..78da97a --- /dev/null +++ b/internal/simulator/fixtures/datastores/create/async5.json @@ -0,0 +1 @@ +{"associatedResources":[],"createdAt":"2024-07-29T12:42:46.443256231Z","customerId":"bb20052ac81011ed895f7a6e2fba2c57","displayName":"Create Datastore: 'mclaren-ds19'","endedAt":"2024-07-29T12:43:31.699429406Z","error":null,"estimatedRunningDurationMinutes":300,"generation":6,"groups":[{"id":"bb20052ac81011ed895f7a6e2fba2c57","name":"Default Group"}],"hasChildOperations":true,"healthStatus":"OK","id":"be55685c-f84f-4ad5-a3d1-2d7692ed47b1","logMessages":[{"message":"Create Datastore task is created","timestamp":"2024-07-29T12:42:46.44326043Z"},{"message":"Create Datastore task is running","timestamp":"2024-07-29T12:42:46.443261567Z"},{"message":"Preparing the parameters","timestamp":"2024-07-29T12:42:47.176131397Z"},{"message":"Attempting to create the datastore","timestamp":"2024-07-29T12:42:50.15339285Z"},{"message":"Create Datastore task completed","timestamp":"2024-07-29T12:43:31.699430993Z"}],"name":"Create-Datastore: '%!s(MISSING)'mclaren-ds19","parent":null,"progressPercent":100,"recommendations":[],"resourceUri":"/data-services/v1beta1/async-operations/be55685c-f84f-4ad5-a3d1-2d7692ed47b1","rootOperation":{"id":"be55685c-f84f-4ad5-a3d1-2d7692ed47b1","name":"","resourceUri":"/data-services/v1beta1/async-operations/be55685c-f84f-4ad5-a3d1-2d7692ed47b1","type":"task"},"services":["private-cloud-business-edition"],"sourceResourceUri":null,"startedAt":"2024-07-29T12:42:46.443256695Z","state":"SUCCEEDED","subtreeOperationCount":2,"suggestedPollingIntervalSeconds":30,"type":"task","updatedAt":"2024-07-29T12:43:31.854681196Z","userId":"stuart.mclaren@hpe.com"} diff --git a/internal/simulator/fixtures/datastores/create/filter.json b/internal/simulator/fixtures/datastores/create/filter.json new file mode 100644 index 0000000..7f386c7 --- /dev/null +++ b/internal/simulator/fixtures/datastores/create/filter.json @@ -0,0 +1 @@ +{"items":[{"allowedOperations":["DATASTORE_CREATE","DATASTORE_DELETE"],"appType":"VMWARE","capacityFree":15670968320,"capacityInBytes":17179869184,"capacityUncommitted":0,"clusterInfo":{"displayName":"5305-CL","id":"acd4daea-e5e3-5f35-8be3-ce4a4b6d946c","name":"5305-CL","resourceUri":"/virtualization/v1beta1/hypervisor-clusters/acd4daea-e5e3-5f35-8be3-ce4a4b6d946c","type":"virtualization/hypervisor-cluster"},"createdAt":"2024-07-29T12:43:02Z","customerId":"bb20052ac81011ed895f7a6e2fba2c57","datacentersInfo":[{"displayName":"","id":"7d8051ab-4224-5075-93be-c1c0fa645e7d","moref":"datacenter-3","name":"5305-DC"}],"datastoreClassification":"","datastoreType":"VMFS","displayName":"mclaren-ds19","folderInfo":{"displayName":"datastore","id":"980201dd-c93a-5861-b0d1-d2d632696003","name":"datastore","resourceUri":"/virtualization/v1beta1/hypervisor-managers/c47b89e9-3a66-4fb9-9a22-cdec3c51604d/folders/980201dd-c93a-5861-b0d1-d2d632696003","type":"virtualization/hypervisor-folder"},"generation":1,"hciClusterUuid":"126fd201-9e6e-5e31-9ffb-a766265b1fd3","hostsInfo":[{"displayName":"16.182.105.217","id":"530b1894-9bd0-5627-9362-565aff1e5cbd","name":"16.182.105.217","resourceUri":"/virtualization/v1beta1/hypervisor-hosts/530b1894-9bd0-5627-9362-565aff1e5cbd","type":"virtualization/hypervisor-host"}],"hypervisorManagerInfo":{"displayName":"16.182.107.157","id":"c47b89e9-3a66-4fb9-9a22-cdec3c51604d","name":"16.182.107.157","resourceUri":"/virtualization/v1beta1/hypervisor-managers/c47b89e9-3a66-4fb9-9a22-cdec3c51604d","type":"virtualization/hypervisor-manager"},"id":"698de955-87b5-5fe6-b683-78c3948beede","moref":"datastore-43","name":"mclaren-ds19","protected":false,"protectionJobInfo":{"id":"","protectionPolicyInfo":{"id":"","name":"","resourceUri":"","type":""},"resourceUri":"","type":""},"protectionPolicyAppliedAtInfo":{"id":"","name":"","resourceUri":"","type":""},"provisioningPolicyInfo":{"id":"","name":"","resourceUri":"","type":""},"replicationInfo":{"id":"","name":"","partnerDetails":null,"resourceUri":""},"resourceUri":"/virtualization/v1beta1/datastores/698de955-87b5-5fe6-b683-78c3948beede","services":["hci-manager"],"state":"OK","stateReason":"OK","status":"OK","type":"virtualization/datastore","uid":"66a78e56-bc8d57b4-f50e-bc97e1e94000","updatedAt":"2024-07-29T12:43:02Z","vmCount":0,"vmProtectionGroupsInfo":null,"volumesInfo":[{"displayName":"mclaren-ds19","id":"0672c65541fc2058ba00000000000000000000000a","name":"mclaren-ds19","resourceUri":"/api/v1/storage-systems//0072c65541fc2058ba000000000000000000000001/volumes/0672c65541fc2058ba00000000000000000000000a","scsiIdentifier":"956387610ec1aae56c9ce900fb0de68e","sizeInBytes":17448304640,"storageFolderInfo":{"displayName":"","id":"","name":"","resourceUri":"","type":"storage-fleet/folder"},"storagePoolInfo":{"displayName":"default","id":"0a72c65541fc2058ba000000000000000000000001","name":"default","resourceUri":"/api/v1/storage-systems//0072c65541fc2058ba000000000000000000000001/storage-pools/0a72c65541fc2058ba000000000000000000000001","type":"storage-fleet/storage-pool"},"storageSystemInfo":{"displayName":"array-5305-grp","id":"fb0de68e","managed":true,"name":"array-5305-grp","resourceUri":"/api/v1/storage-systems/0072c65541fc2058ba000000000000000000000001","serialNumber":"AF-836032","storageSystemType":"HPE Alletra 6000","type":"storage-fleet/storage-system","vendorName":"hpe"},"type":"storage-fleet/volume","volumeSetInfo":{"displayName":"","id":"","name":"","resourceUri":"","type":""}}]}],"count":1,"offset":0,"total":1} diff --git a/internal/simulator/fixtures/datastores/create/get.json b/internal/simulator/fixtures/datastores/create/get.json new file mode 100644 index 0000000..6ea3db6 --- /dev/null +++ b/internal/simulator/fixtures/datastores/create/get.json @@ -0,0 +1 @@ +{"allowedOperations":["DATASTORE_CREATE","DATASTORE_DELETE"],"appType":"VMWARE","capacityFree":15670968320,"capacityInBytes":17179869184,"capacityUncommitted":0,"clusterInfo":{"displayName":"5305-CL","id":"acd4daea-e5e3-5f35-8be3-ce4a4b6d946c","name":"5305-CL","resourceUri":"/virtualization/v1beta1/hypervisor-clusters/acd4daea-e5e3-5f35-8be3-ce4a4b6d946c","type":"virtualization/hypervisor-cluster"},"createdAt":"2024-07-29T12:43:02Z","customerId":"bb20052ac81011ed895f7a6e2fba2c57","datacentersInfo":[{"displayName":"","id":"7d8051ab-4224-5075-93be-c1c0fa645e7d","moref":"datacenter-3","name":"5305-DC"}],"datastoreClassification":"","datastoreType":"VMFS","displayName":"mclaren-ds19","folderInfo":{"displayName":"datastore","id":"980201dd-c93a-5861-b0d1-d2d632696003","name":"datastore","resourceUri":"/virtualization/v1beta1/hypervisor-managers/c47b89e9-3a66-4fb9-9a22-cdec3c51604d/folders/980201dd-c93a-5861-b0d1-d2d632696003","type":"virtualization/hypervisor-folder"},"generation":1,"hciClusterUuid":"126fd201-9e6e-5e31-9ffb-a766265b1fd3","hostsInfo":[{"displayName":"16.182.105.217","id":"530b1894-9bd0-5627-9362-565aff1e5cbd","name":"16.182.105.217","resourceUri":"/virtualization/v1beta1/hypervisor-hosts/530b1894-9bd0-5627-9362-565aff1e5cbd","type":"virtualization/hypervisor-host"}],"hypervisorManagerInfo":{"displayName":"16.182.107.157","id":"c47b89e9-3a66-4fb9-9a22-cdec3c51604d","name":"16.182.107.157","resourceUri":"/virtualization/v1beta1/hypervisor-managers/c47b89e9-3a66-4fb9-9a22-cdec3c51604d","type":"virtualization/hypervisor-manager"},"id":"698de955-87b5-5fe6-b683-78c3948beede","moref":"datastore-43","name":"mclaren-ds19","protected":false,"protectionJobInfo":{"id":"","protectionPolicyInfo":{"id":"","name":"","resourceUri":"","type":""},"resourceUri":"","type":""},"protectionPolicyAppliedAtInfo":{"id":"","name":"","resourceUri":"","type":""},"provisioningPolicyInfo":{"id":"","name":"","resourceUri":"","type":""},"replicationInfo":{"id":"","name":"","partnerDetails":null,"resourceUri":""},"resourceUri":"/virtualization/v1beta1/datastores/698de955-87b5-5fe6-b683-78c3948beede","services":["hci-manager"],"state":"OK","stateReason":"OK","status":"OK","type":"virtualization/datastore","uid":"66a78e56-bc8d57b4-f50e-bc97e1e94000","updatedAt":"2024-07-29T12:43:02Z","vmCount":0,"vmProtectionGroupsInfo":null,"volumesInfo":[{"displayName":"mclaren-ds19","id":"0672c65541fc2058ba00000000000000000000000a","name":"mclaren-ds19","resourceUri":"/api/v1/storage-systems//0072c65541fc2058ba000000000000000000000001/volumes/0672c65541fc2058ba00000000000000000000000a","scsiIdentifier":"956387610ec1aae56c9ce900fb0de68e","sizeInBytes":17448304640,"storageFolderInfo":{"displayName":"","id":"","name":"","resourceUri":"","type":"storage-fleet/folder"},"storagePoolInfo":{"displayName":"default","id":"0a72c65541fc2058ba000000000000000000000001","name":"default","resourceUri":"/api/v1/storage-systems//0072c65541fc2058ba000000000000000000000001/storage-pools/0a72c65541fc2058ba000000000000000000000001","type":"storage-fleet/storage-pool"},"storageSystemInfo":{"displayName":"array-5305-grp","id":"fb0de68e","managed":true,"name":"array-5305-grp","resourceUri":"/api/v1/storage-systems/0072c65541fc2058ba000000000000000000000001","serialNumber":"AF-836032","storageSystemType":"HPE Alletra 6000","type":"storage-fleet/storage-system","vendorName":"hpe"},"type":"storage-fleet/volume","volumeSetInfo":{"displayName":"","id":"","name":"","resourceUri":"","type":""}}]} diff --git a/internal/simulator/fixtures/datastores/create/post-request.json b/internal/simulator/fixtures/datastores/create/post-request.json new file mode 100644 index 0000000..b41d5c2 --- /dev/null +++ b/internal/simulator/fixtures/datastores/create/post-request.json @@ -0,0 +1 @@ +{"name":"mclaren-ds19","sizeInBytes":17179869184,"storageSystemId":"126fd201-9e6e-5e31-9ffb-a766265b1fd3","targetHypervisorClusterId":"acd4daea-e5e3-5f35-8be3-ce4a4b6d946c","volumeInfo":{"deduplication":false,"encryption":{"cipher":"None"},"qos":{"iopsLimit":1000000,"mbpsLimit":1000000}},"datastoreType":"VMFS"} diff --git a/internal/simulator/fixtures/datastores/create/post-response.json b/internal/simulator/fixtures/datastores/create/post-response.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/internal/simulator/fixtures/datastores/create/post-response.json @@ -0,0 +1 @@ +{} diff --git a/internal/simulator/fixtures/datastores/delete/async1.json b/internal/simulator/fixtures/datastores/delete/async1.json new file mode 100644 index 0000000..b1c2ff5 --- /dev/null +++ b/internal/simulator/fixtures/datastores/delete/async1.json @@ -0,0 +1 @@ +{"associatedResources":[],"createdAt":"2024-07-29T12:43:55.427422049Z","customerId":"bb20052ac81011ed895f7a6e2fba2c57","displayName":"Delete-Datastore: 'mclaren-ds19'","endedAt":null,"error":null,"estimatedRunningDurationMinutes":300,"generation":2,"groups":[{"id":"bb20052ac81011ed895f7a6e2fba2c57","name":"Default Group"}],"hasChildOperations":false,"healthStatus":"OK","id":"5a7b6b4d-8327-48ec-a5ca-98215a24bd51","logMessages":[{"message":"Delete Datastore task is created","timestamp":"2024-07-29T12:43:55.427426255Z"},{"message":"Delete Datastore task is running","timestamp":"2024-07-29T12:43:55.427427897Z"},{"message":"Preparing the parameters","timestamp":"2024-07-29T12:43:55.583957811Z"}],"name":"Delete-Datastore: 'mclaren-ds19'","parent":null,"progressPercent":25,"recommendations":[],"resourceUri":"/data-services/v1beta1/async-operations/5a7b6b4d-8327-48ec-a5ca-98215a24bd51","rootOperation":{"id":"5a7b6b4d-8327-48ec-a5ca-98215a24bd51","name":"","resourceUri":"/data-services/v1beta1/async-operations/5a7b6b4d-8327-48ec-a5ca-98215a24bd51","type":"task"},"services":["private-cloud-business-edition"],"sourceResourceUri":null,"startedAt":"2024-07-29T12:43:55.427422517Z","state":"RUNNING","subtreeOperationCount":0,"suggestedPollingIntervalSeconds":30,"type":"task","updatedAt":"2024-07-29T12:43:55.827276904Z","userId":"stuart.mclaren@hpe.com"} diff --git a/internal/simulator/fixtures/datastores/delete/async2.json b/internal/simulator/fixtures/datastores/delete/async2.json new file mode 100644 index 0000000..b1c2ff5 --- /dev/null +++ b/internal/simulator/fixtures/datastores/delete/async2.json @@ -0,0 +1 @@ +{"associatedResources":[],"createdAt":"2024-07-29T12:43:55.427422049Z","customerId":"bb20052ac81011ed895f7a6e2fba2c57","displayName":"Delete-Datastore: 'mclaren-ds19'","endedAt":null,"error":null,"estimatedRunningDurationMinutes":300,"generation":2,"groups":[{"id":"bb20052ac81011ed895f7a6e2fba2c57","name":"Default Group"}],"hasChildOperations":false,"healthStatus":"OK","id":"5a7b6b4d-8327-48ec-a5ca-98215a24bd51","logMessages":[{"message":"Delete Datastore task is created","timestamp":"2024-07-29T12:43:55.427426255Z"},{"message":"Delete Datastore task is running","timestamp":"2024-07-29T12:43:55.427427897Z"},{"message":"Preparing the parameters","timestamp":"2024-07-29T12:43:55.583957811Z"}],"name":"Delete-Datastore: 'mclaren-ds19'","parent":null,"progressPercent":25,"recommendations":[],"resourceUri":"/data-services/v1beta1/async-operations/5a7b6b4d-8327-48ec-a5ca-98215a24bd51","rootOperation":{"id":"5a7b6b4d-8327-48ec-a5ca-98215a24bd51","name":"","resourceUri":"/data-services/v1beta1/async-operations/5a7b6b4d-8327-48ec-a5ca-98215a24bd51","type":"task"},"services":["private-cloud-business-edition"],"sourceResourceUri":null,"startedAt":"2024-07-29T12:43:55.427422517Z","state":"RUNNING","subtreeOperationCount":0,"suggestedPollingIntervalSeconds":30,"type":"task","updatedAt":"2024-07-29T12:43:55.827276904Z","userId":"stuart.mclaren@hpe.com"} diff --git a/internal/simulator/fixtures/datastores/delete/async3.json b/internal/simulator/fixtures/datastores/delete/async3.json new file mode 100644 index 0000000..b1c2ff5 --- /dev/null +++ b/internal/simulator/fixtures/datastores/delete/async3.json @@ -0,0 +1 @@ +{"associatedResources":[],"createdAt":"2024-07-29T12:43:55.427422049Z","customerId":"bb20052ac81011ed895f7a6e2fba2c57","displayName":"Delete-Datastore: 'mclaren-ds19'","endedAt":null,"error":null,"estimatedRunningDurationMinutes":300,"generation":2,"groups":[{"id":"bb20052ac81011ed895f7a6e2fba2c57","name":"Default Group"}],"hasChildOperations":false,"healthStatus":"OK","id":"5a7b6b4d-8327-48ec-a5ca-98215a24bd51","logMessages":[{"message":"Delete Datastore task is created","timestamp":"2024-07-29T12:43:55.427426255Z"},{"message":"Delete Datastore task is running","timestamp":"2024-07-29T12:43:55.427427897Z"},{"message":"Preparing the parameters","timestamp":"2024-07-29T12:43:55.583957811Z"}],"name":"Delete-Datastore: 'mclaren-ds19'","parent":null,"progressPercent":25,"recommendations":[],"resourceUri":"/data-services/v1beta1/async-operations/5a7b6b4d-8327-48ec-a5ca-98215a24bd51","rootOperation":{"id":"5a7b6b4d-8327-48ec-a5ca-98215a24bd51","name":"","resourceUri":"/data-services/v1beta1/async-operations/5a7b6b4d-8327-48ec-a5ca-98215a24bd51","type":"task"},"services":["private-cloud-business-edition"],"sourceResourceUri":null,"startedAt":"2024-07-29T12:43:55.427422517Z","state":"RUNNING","subtreeOperationCount":0,"suggestedPollingIntervalSeconds":30,"type":"task","updatedAt":"2024-07-29T12:43:55.827276904Z","userId":"stuart.mclaren@hpe.com"} diff --git a/internal/simulator/fixtures/datastores/delete/async4.json b/internal/simulator/fixtures/datastores/delete/async4.json new file mode 100644 index 0000000..9d19eb9 --- /dev/null +++ b/internal/simulator/fixtures/datastores/delete/async4.json @@ -0,0 +1 @@ +{"associatedResources":[],"createdAt":"2024-07-29T12:43:55.427422049Z","customerId":"bb20052ac81011ed895f7a6e2fba2c57","displayName":"Delete-Datastore: 'mclaren-ds19'","endedAt":"2024-07-29T12:44:38.754372737Z","error":null,"estimatedRunningDurationMinutes":300,"generation":3,"groups":[{"id":"bb20052ac81011ed895f7a6e2fba2c57","name":"Default Group"}],"hasChildOperations":false,"healthStatus":"OK","id":"5a7b6b4d-8327-48ec-a5ca-98215a24bd51","logMessages":[{"message":"Delete Datastore task is created","timestamp":"2024-07-29T12:43:55.427426255Z"},{"message":"Delete Datastore task is running","timestamp":"2024-07-29T12:43:55.427427897Z"},{"message":"Preparing the parameters","timestamp":"2024-07-29T12:43:55.583957811Z"},{"message":"Delete Datastore task completed","timestamp":"2024-07-29T12:44:38.754373811Z"}],"name":"Delete-Datastore: 'mclaren-ds19'","parent":null,"progressPercent":100,"recommendations":[],"resourceUri":"/data-services/v1beta1/async-operations/5a7b6b4d-8327-48ec-a5ca-98215a24bd51","rootOperation":{"id":"5a7b6b4d-8327-48ec-a5ca-98215a24bd51","name":"","resourceUri":"/data-services/v1beta1/async-operations/5a7b6b4d-8327-48ec-a5ca-98215a24bd51","type":"task"},"services":["private-cloud-business-edition"],"sourceResourceUri":null,"startedAt":"2024-07-29T12:43:55.427422517Z","state":"SUCCEEDED","subtreeOperationCount":0,"suggestedPollingIntervalSeconds":30,"type":"task","updatedAt":"2024-07-29T12:44:38.797837387Z","userId":"stuart.mclaren@hpe.com"} diff --git a/internal/simulator/fixtures/datastores/delete/delete.json b/internal/simulator/fixtures/datastores/delete/delete.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/internal/simulator/fixtures/datastores/delete/delete.json @@ -0,0 +1 @@ +{} diff --git a/test/datastore/datastore_test.go b/test/datastore/datastore_test.go new file mode 100644 index 0000000..c86db01 --- /dev/null +++ b/test/datastore/datastore_test.go @@ -0,0 +1,280 @@ +// (C) Copyright 2024 Hewlett Packard Enterprise Development LP + +package acceptance + +import ( + "fmt" + "regexp" + "testing" + + "github.com/HewlettPackard/hpegl-pcbe-terraform-resources/internal/provider" + "github.com/google/uuid" + "github.com/hashicorp/terraform-plugin-framework/providerserver" + "github.com/hashicorp/terraform-plugin-go/tfprotov6" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" +) + +const ( + providerConfig = ` +terraform { + required_providers { + hpegl = { + source = "github.com/HewlettPackard/hpegl-pcbe-terraform-resources" + } + } +} + +provider "hpegl" { + pc { + host = "http://localhost:8080" + token = "abcdefghijklmnopqrstuvwxyz-0123456789" + + http_dump = true + poll_interval = 0.001 + max_polls = 10 + } +} +` +) + +var simulation = false + +var testAccProtoV6ProviderFactories = map[string]func() (tfprotov6.ProviderServer, error){ + "scaffolding": providerserver.NewProtocol6WithError(provider.New("test")()), +} + +func checkUUIDAttr(resource string, attr string) func(*terraform.State) error { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[resource] + if !ok { + return fmt.Errorf("resource not found: %s", resource) + } + + attrValue := rs.Primary.Attributes[attr] + _, err := uuid.Parse(attrValue) + + return err + } +} + +func TestAccDatastoreResourceOk(t *testing.T) { + config := providerConfig + ` + resource "hpegl_pc_datastore" "test" { + name = "mclaren-ds19" + datastore_type = "VMFS" + capacity_in_bytes = 17179869184 + hci_cluster_uuid = "126fd201-9e6e-5e31-9ffb-a766265b1fd3" + cluster_info = { + "name": "5305-CL" + } + } + ` + + checks := []resource.TestCheckFunc{ + resource.TestCheckResourceAttr( + "hpegl_pc_datastore.test", + "name", + "mclaren-ds19", + ), + resource.TestCheckResourceAttr( + "hpegl_pc_datastore.test", + "datastore_type", + "VMFS", + ), + resource.TestCheckResourceAttr( + "hpegl_pc_datastore.test", + "capacity_in_bytes", + "17179869184", + ), + } + + if simulation { + // In simulation mode the ID value is known in advance + checks = append(checks, + resource.TestCheckResourceAttr( + "hpegl_pc_datastore.test", + "id", + "698de955-87b5-5fe6-b683-78c3948beede", + ), + ) + } else { + // In non-simulation mode check that the ID is a valid UUID + checks = append( + checks, checkUUIDAttr("hpegl_pc_datastore.test", "id"), + ) + } + + checkFn := resource.ComposeAggregateTestCheckFunc(checks...) + + resource.Test(t, resource.TestCase{ + ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, + Steps: []resource.TestStep{ + { + Config: config, + Check: checkFn, + PlanOnly: true, + ExpectNonEmptyPlan: true, + }, + { + Config: config, + Check: checkFn, + }, + { + Config: config, + Check: checkFn, + PlanOnly: true, + ExpectNonEmptyPlan: false, + }, + }, + }) +} + +func TestAccDatastoreResourceBadDatastoreType(t *testing.T) { + config := providerConfig + ` + resource "hpegl_pc_datastore" "test" { + name = "mclaren-ds19" + datastore_type = "XXX" + capacity_in_bytes = 17179869184 + hci_cluster_uuid = "126fd201-9e6e-5e31-9ffb-a766265b1fd3" + cluster_info = { + "name": "5305-CL" + } + } + ` + + expected := `Attribute datastore_type value must be one of: \["VMFS" "VVOL"\], got: "XXX"` + resource.Test(t, resource.TestCase{ + ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, + Steps: []resource.TestStep{ + { + Config: config, + ExpectError: regexp.MustCompile(expected), + PlanOnly: true, + }, + }, + }) +} + +func TestAccDatastoreResourceMissingClusterInfo(t *testing.T) { + config := providerConfig + ` + resource "hpegl_pc_datastore" "test" { + name = "mclaren-ds19" + datastore_type = "XXX" + capacity_in_bytes = 17179869184 + hci_cluster_uuid = "126fd201-9e6e-5e31-9ffb-a766265b1fd3" + } + ` + + expected := `The argument \"cluster_info\" is required, but no definition was found.` + resource.Test(t, resource.TestCase{ + ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, + Steps: []resource.TestStep{ + { + Config: config, + ExpectError: regexp.MustCompile(expected), + PlanOnly: true, + }, + }, + }) +} + +func TestAccDatastoreResourceMissingClusterId(t *testing.T) { + config := providerConfig + ` + resource "hpegl_pc_datastore" "test" { + name = "mclaren-ds19" + datastore_type = "VVOL" + capacity_in_bytes = 17179869184 + cluster_info = { + "name": "5305-CL" + } + } + ` + + expected := `The argument \"hci_cluster_uuid\" is required, but no definition was found.` + resource.Test(t, resource.TestCase{ + ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, + Steps: []resource.TestStep{ + { + Config: config, + ExpectError: regexp.MustCompile(expected), + PlanOnly: true, + }, + }, + }) +} + +func TestAccDatastoreResourceMissingName(t *testing.T) { + config := providerConfig + ` + resource "hpegl_pc_datastore" "test" { + datastore_type = "VVOL" + capacity_in_bytes = 17179869184 + hci_cluster_uuid = "126fd201-9e6e-5e31-9ffb-a766265b1fd3" + cluster_info = { + "name": "5305-CL" + } + } + ` + + expected := `The argument \"name\" is required, but no definition was found.` + resource.Test(t, resource.TestCase{ + ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, + Steps: []resource.TestStep{ + { + Config: config, + ExpectError: regexp.MustCompile(expected), + PlanOnly: true, + }, + }, + }) +} + +func TestAccDatastoreResourceMissingCapacity(t *testing.T) { + config := providerConfig + ` + resource "hpegl_pc_datastore" "test" { + name = "mclaren-ds19" + datastore_type = "VVOL" + hci_cluster_uuid = "126fd201-9e6e-5e31-9ffb-a766265b1fd3" + cluster_info = { + "name": "5305-CL" + } + } + ` + + expected := `The argument \"capacity_in_bytes\" is required, but no definition was found.` + resource.Test(t, resource.TestCase{ + ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, + Steps: []resource.TestStep{ + { + Config: config, + ExpectError: regexp.MustCompile(expected), + PlanOnly: true, + }, + }, + }) +} + +func TestAccDatastoreResourceMissingClusterInfoName(t *testing.T) { + config := providerConfig + ` + resource "hpegl_pc_datastore" "test" { + name = "mclaren-ds19" + capacity_in_bytes = 17179869184 + datastore_type = "VVOL" + hci_cluster_uuid = "126fd201-9e6e-5e31-9ffb-a766265b1fd3" + cluster_info = { + } + } + ` + + expected := `Inappropriate value for attribute \"cluster_info\": attribute \"name\"` + resource.Test(t, resource.TestCase{ + ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, + Steps: []resource.TestStep{ + { + Config: config, + ExpectError: regexp.MustCompile(expected), + PlanOnly: true, + }, + }, + }) +} diff --git a/test/datastore/simulation.go b/test/datastore/simulation.go new file mode 100644 index 0000000..f8bc213 --- /dev/null +++ b/test/datastore/simulation.go @@ -0,0 +1,9 @@ +// (C) Copyright 2024 Hewlett Packard Enterprise Development LP +//go:build simulation +// +build simulation + +package acceptance + +func init() { + simulation = true +}